/* ==============================================================================
 * Master Stylesheet - Tetris Classic Interactive Web Application
 * Design System: Modern Glassmorphism & Cyber Neon Arcade Aesthetics
 * Author: Praful Kumar
 * Website: https://prafulkr.xyz/
 * GitLab: https://gitlab.com/prafulkr/tetris-game
 * ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Fira+Code:wght@400;500;700&display=swap');

:root {
    /* Color Palette */
    --bg-primary: #080b14;
    --bg-card: rgba(15, 23, 42, 0.75);
    --border-card: rgba(255, 255, 255, 0.1);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #00f0f0;
    --accent-glow: rgba(0, 240, 240, 0.4);

    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: 'Fira Code', monospace;

    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background: var(--bg-primary);
    background-image: 
        radial-gradient(at 15% 15%, rgba(0, 240, 240, 0.08) 0px, transparent 50%),
        radial-gradient(at 85% 85%, rgba(176, 0, 255, 0.08) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px 15px;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.brand-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-title i {
    font-size: 1.8rem;
    color: var(--accent);
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.brand-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Main Layout Grid */
.main-layout {
    display: grid;
    grid-template-columns: 200px 340px 1fr;
    gap: 24px;
    align-items: start;
    justify-content: center;
}

@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar Boxes */
.box-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.box-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mini Canvas Slots */
.mini-canvas-wrapper {
    background: rgba(10, 15, 26, 0.85);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
}

#holdCanvas {
    width: 120px;
    height: 120px;
}

#nextCanvas {
    width: 120px;
    height: 260px;
}

/* Main Canvas Arena */
.arena-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.canvas-wrapper {
    background: rgba(10, 15, 26, 0.95);
    border: 2px solid rgba(0, 240, 240, 0.3);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 0 25px rgba(0, 240, 240, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.8);
}

#tetrisCanvas {
    width: 300px;
    height: 600px;
    display: block;
}

/* Stats Sidebar */
.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-box {
    width: 100%;
    background: rgba(10, 15, 26, 0.85);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

.stat-val {
    font-family: var(--font-code);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

/* Action Buttons */
.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    color: var(--text-main);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(0, 240, 240, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

.action-btn.primary {
    background: var(--accent);
    color: #080b14;
    border: none;
    font-weight: 700;
}

.action-btn.primary:hover {
    box-shadow: 0 0 15px var(--accent-glow);
    background: #00d5d5;
    color: #fff;
}

.action-btn.active {
    background: var(--accent);
    color: #080b14;
}

/* On-Screen Touch Controls */
.touch-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 16px;
    width: 100%;
    max-width: 320px;
}

.touch-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-card);
    color: var(--text-main);
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.touch-btn:active {
    background: rgba(0, 240, 240, 0.3);
    transform: scale(0.95);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #0f172a;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-card h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--accent);
}

.modal-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* ==============================================================================
 * Author & Developer Footer Component (Exact Match with Required UI)
 * ============================================================================== */
.app-footer {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
}

.footer-credit {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

.footer-link-highlight {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link-highlight:hover {
    text-decoration: underline;
    color: #00d5d5;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.footer-link:hover {
    color: #fff;
    transform: translateY(-1px);
}

.footer-sep {
    color: var(--text-muted);
    opacity: 0.5;
}

.tech-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.badge {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 240, 240, 0.3);
    color: var(--accent);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.footer-bottom {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 2px;
}
