/* ===========================
   BLOCKSTORM CYBERPUNK EDITION
   Neon style inspired by game.h3me.xyz
   =========================== */

/* ===========================
   1. CSS VARIABLES
   =========================== */

:root {
    /* Dark Theme - Premium Cyberpunk */
    --color-bg-dark: #0a0e27;
    --color-bg-gradient: linear-gradient(135deg, #0a0e27 0%, #1a1e3a 50%, #0f1729 100%);
    --color-panel-bg: rgba(20, 25, 40, 0.85);
    --color-canvas-bg: #000000;
    --color-canvas-bg-with-ad: rgba(0, 0, 0, 0.85);
    --color-next-piece-bg: rgba(0, 0, 0, 0.5);
    --color-overlay-bg: rgba(10, 14, 39, 0.95);

    /* Neon Colors - Enhanced */
    --color-cyan: #00ffff;
    --color-cyan-glow: rgba(0, 255, 255, 0.4);
    --color-cyan-bright: #00ff88;
    --color-magenta: #ff00ff;
    --color-magenta-dark: #8b1a5c;
    --color-gold: #ffcc00;
    --color-yellow: #ffff00;

    /* Premium Shadows & Glows */
    --glow-cyan: 0 0 30px var(--color-cyan-glow), 0 0 60px rgba(0, 255, 255, 0.2);
    --glow-cyan-strong: 0 0 50px rgba(0, 255, 255, 0.6), 0 0 80px rgba(0, 255, 255, 0.3);
    --glow-text: 0 0 12px rgba(0, 255, 136, 0.5), 0 0 24px rgba(0, 255, 136, 0.2);
    --shadow-deep: 0 10px 40px rgba(0, 0, 0, 0.7), 0 5px 20px rgba(0, 0, 0, 0.5);

    /* Text colors */
    --color-text-primary: #ffffff;
    --color-text-secondary: #e0e0e0;

    /* Button colors - Enhanced depth */
    --color-btn-secondary-bg: rgba(0, 0, 0, 0.6);
    --color-btn-secondary-hover: rgba(0, 0, 0, 0.8);

    /* Box/Panel backgrounds - Glassmorphism */
    --color-box-bg: rgba(0, 0, 0, 0.5);
    --color-box-bg-alt: rgba(0, 0, 0, 0.3);

    /* Typography */
    --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Roboto', sans-serif;

    /* Spacing */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50%;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;

    /* Layout */
    --header-height: 50px;
    --controls-height: 100px;
}

/* Light Theme - Premium Design */
[data-theme="light"] {
    /* Light Color Palette - Sophisticated & Modern */
    --color-bg-dark: #f8f9fd;
    --color-bg-gradient: linear-gradient(135deg, #ffffff 0%, #f0f4ff 50%, #e8f0fe 100%);
    --color-panel-bg: rgba(255, 255, 255, 0.9);
    --color-canvas-bg: linear-gradient(135deg, #fafbff 0%, #f5f7ff 100%);
    --color-next-piece-bg: linear-gradient(135deg, #fafbff 0%, #f0f4ff 100%);
    --color-overlay-bg: rgba(255, 255, 255, 0.98);

    /* Vibrant & Accessible Colors for Light Mode - Enhanced Contrast */
    --color-cyan: #0066cc;
    --color-cyan-glow: rgba(0, 102, 204, 0.3);
    --color-cyan-bright: #0088ff;
    --color-magenta: #c026d3;
    --color-magenta-dark: #9333ea;
    --color-gold: #ea580c;
    --color-yellow: #f59e0b;

    /* Premium Shadows & Effects */
    --glow-cyan: 0 4px 12px rgba(0, 102, 204, 0.2), 0 2px 4px rgba(0, 102, 204, 0.15);
    --glow-cyan-strong: 0 8px 24px rgba(0, 102, 204, 0.3), 0 4px 8px rgba(0, 102, 204, 0.2);
    --glow-text: 0 2px 4px rgba(0, 102, 204, 0.15);
    --shadow-deep: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);

    /* Text colors - Maximum readability */
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;

    /* Button colors - High contrast */
    --color-btn-secondary-bg: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    --color-btn-secondary-hover: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);

    /* Box/Panel backgrounds - Enhanced visibility */
    --color-box-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
    --color-box-bg-alt: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(241, 245, 249, 0.7) 100%);
}

/* ===========================
   2. BASE STYLES
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevent text selection which can trigger scroll */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Prevent tap highlight */
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    overflow: hidden;
    /* Prevent all scrolling and touch gestures */
    touch-action: none;
    -ms-touch-action: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}

body {
    font-family: var(--font-system);
    background: var(--color-bg-gradient);
    color: var(--color-text-primary);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Prevent all scrolling and touch gestures */
    touch-action: none;
    -ms-touch-action: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
    transition: background 0.3s ease, color 0.3s ease;
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg-gradient);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(0, 255, 136, 0.03) 0%, transparent 60%);
    z-index: -1;
    animation: floatingOrbs 20s ease-in-out infinite;
}

@keyframes floatingOrbs {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
        opacity: 0.8;
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
        opacity: 0.9;
    }
}

[data-theme="light"] body::before {
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0, 119, 204, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(0, 184, 148, 0.04) 0%, transparent 60%);
}

/* ===========================
   3. TOP HEADER BAR
   =========================== */

.top-bar {
    min-height: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--color-panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 2px solid var(--color-cyan);
    box-shadow: var(--glow-cyan), 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: all 0.3s ease;
    position: relative;
}

/* Subtle animated gradient line */
.top-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--color-cyan) 20%,
        var(--color-cyan-bright) 50%,
        var(--color-cyan) 80%,
        transparent 100%);
    opacity: 0.6;
    animation: gradientSlide 8s linear infinite;
}

@keyframes gradientSlide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

[data-theme="light"] .top-bar::after {
    opacity: 0.4;
}

.header-stats {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    justify-content: flex-start;
}

.score-display {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: auto;
    flex: 0 0 auto;
    align-items: flex-start;
}

/* Hide level/lines on desktop by default */
.level-display,
.lines-display {
    display: none;
}

.score-label {
    font-size: 0.5rem;
    font-weight: 600;
    color: var(--color-cyan);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.score-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-cyan-bright);
    font-variant-numeric: tabular-nums;
    text-shadow: var(--glow-text);
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.score-value.score-update {
    animation: scorePopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.score-value.score-combo {
    animation: scoreCombo 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scorePopIn {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: var(--color-gold);
        text-shadow: 0 0 20px currentColor;
    }
    100% {
        transform: scale(1);
    }
}

@keyframes scoreCombo {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.3) rotate(-5deg);
        color: var(--color-magenta);
        text-shadow: 0 0 30px currentColor, 0 0 60px currentColor;
    }
    50% {
        transform: scale(1.4) rotate(5deg);
        color: var(--color-gold);
        text-shadow: 0 0 40px currentColor, 0 0 80px currentColor;
    }
    75% {
        transform: scale(1.3) rotate(-3deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.header-controls {
    display: flex;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg,
        rgba(0, 255, 255, 0.15) 0%,
        rgba(0, 200, 255, 0.2) 100%);
    color: var(--color-text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 15px var(--color-cyan-glow),
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 2px rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

.icon-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 255, 255, 0.3), transparent 70%);
    opacity: 0;
    border-radius: var(--radius-full);
    transition: opacity var(--transition-fast);
}

.icon-btn:hover {
    transform: scale(1.15) translateY(-2px);
    box-shadow:
        0 0 25px rgba(0, 255, 255, 0.6),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 0 0 3px rgba(0, 255, 255, 0.5);
    background: linear-gradient(135deg,
        rgba(0, 255, 255, 0.25) 0%,
        rgba(0, 200, 255, 0.3) 100%);
}

.icon-btn:hover::before {
    opacity: 0.5;
}

.icon-btn:active {
    transform: scale(1) translateY(0);
    box-shadow:
        inset 0 0 15px rgba(0, 255, 255, 0.4),
        0 0 10px rgba(0, 255, 255, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.2);
}

.icon-btn:active::before {
    opacity: 1;
}

/* Remove focus outline and prevent focus state from staying active */
.icon-btn:focus {
    outline: none;
}

.icon-btn:focus-visible {
    outline: none;
}

/* Reset to default state when focused but not being interacted with */
.icon-btn:focus:not(:hover):not(:active) {
    transform: scale(1);
    background: linear-gradient(135deg,
        rgba(0, 255, 255, 0.15) 0%,
        rgba(0, 200, 255, 0.2) 100%);
    box-shadow:
        0 0 15px var(--color-cyan-glow),
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 2px rgba(0, 255, 255, 0.3);
}

.icon-btn:focus:not(:hover):not(:active)::before {
    opacity: 0;
}

/* Sound icon SVG styling */
.sound-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    transition: all 0.3s ease;
}

.icon-btn:hover .sound-icon {
    transform: scale(1.1);
}

.sound-waves {
    transition: opacity 0.3s ease;
}

.sound-mute {
    transition: opacity 0.3s ease;
}

/* ===========================
   4. MAIN GAME LAYOUT
   =========================== */

.game-wrapper {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 8px 0;
    padding-bottom: 160px;
    overflow: hidden;
    touch-action: none;
    -ms-touch-action: none;
    overscroll-behavior: none;
    position: relative;
}

/* Beautiful margin visualization with animated dots pattern */
.game-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 255, 255, 0.08) 0%, transparent 2%),
        radial-gradient(circle at 80% 80%, rgba(255, 0, 255, 0.08) 0%, transparent 2%),
        radial-gradient(circle at 40% 60%, rgba(0, 255, 136, 0.08) 0%, transparent 2%),
        radial-gradient(circle at 90% 10%, rgba(255, 204, 0, 0.08) 0%, transparent 2%);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px, 10px 30px, 40px 10px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
    animation: floatingDots 20s linear infinite;
}

@keyframes floatingDots {
    0% {
        background-position: 0 0, 25px 25px, 10px 30px, 40px 10px;
    }
    100% {
        background-position: 50px 50px, 75px 75px, 60px 80px, 90px 60px;
    }
}

[data-theme="light"] .game-wrapper::before {
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 102, 204, 0.06) 0%, transparent 2%),
        radial-gradient(circle at 80% 80%, rgba(147, 51, 234, 0.06) 0%, transparent 2%),
        radial-gradient(circle at 40% 60%, rgba(234, 88, 12, 0.06) 0%, transparent 2%),
        radial-gradient(circle at 90% 10%, rgba(168, 85, 247, 0.06) 0%, transparent 2%);
    opacity: 0.4;
}

.game-main {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: stretch;
    justify-content: center;
    max-width: 100vw;
    width: 100%;
    padding: 0 8px;
    height: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Mobile size adjustment */
@media (max-width: 768px) {
    .game-main {
        gap: 4px;
        padding: 0 4px;
        max-width: 100vw;
    }

    .game-wrapper {
        padding: 4px 0;
    }
}

/* ===========================
   5. GAME BOARD
   =========================== */

.game-board-container {
    position: relative;
    z-index: 1;
    border: 2px solid var(--color-cyan);
    border-radius: var(--radius-md);
    padding: 8px;
    background: linear-gradient(135deg,
        rgba(0, 255, 255, 0.03) 0%,
        rgba(0, 200, 255, 0.05) 50%,
        rgba(0, 255, 255, 0.03) 100%);
    box-shadow: var(--glow-cyan), var(--shadow-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    max-width: none;
    flex: 1;
    transition: all 0.3s ease;
    position: relative;
    /* Inner dotted border effect */
    background-image:
        linear-gradient(135deg,
            rgba(0, 255, 255, 0.03) 0%,
            rgba(0, 200, 255, 0.05) 50%,
            rgba(0, 255, 255, 0.03) 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 255, 0.1) 2px,
            rgba(0, 255, 255, 0.1) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 255, 0.1) 2px,
            rgba(0, 255, 255, 0.1) 3px
        );
    background-size: 100% 100%, 100% 100%, 100% 100%;
    background-position: center;
}

[data-theme="light"] .game-board-container {
    background: linear-gradient(135deg,
        rgba(0, 102, 204, 0.02) 0%,
        rgba(0, 136, 255, 0.03) 50%,
        rgba(0, 102, 204, 0.02) 100%);
    background-image:
        linear-gradient(135deg,
            rgba(0, 102, 204, 0.02) 0%,
            rgba(0, 136, 255, 0.03) 50%,
            rgba(0, 102, 204, 0.02) 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 102, 204, 0.08) 2px,
            rgba(0, 102, 204, 0.08) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 102, 204, 0.08) 2px,
            rgba(0, 102, 204, 0.08) 3px
        );
}

/* Inner glow effect for depth */
.game-board-container::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 255, 255, 0.05) 100%);
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    /* z-index removed - was covering brand ad and canvas */
}

[data-theme="light"] .game-board-container::after {
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 102, 204, 0.03) 100%);
}

.game-board-container:hover {
    box-shadow: var(--glow-cyan-strong), var(--shadow-deep);
    transform: translateY(-1px);
}

.game-board-container:hover::after {
    opacity: 0.8;
}

/* Mobile size restriction */
@media (max-width: 768px) {
    .game-board-container {
        max-width: none;
        padding: 6px;
        border-width: 2px;
        background-size: 100% 100%, 100% 100%, 100% 100%;
    }
}

/* ===========================
   BRAND ADVERTISEMENT
   =========================== */

.brand-ad-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;  /* Above canvas (canvas is z-index: 2) */
    overflow: hidden;
    border-radius: var(--radius-sm);
    pointer-events: none;  /* Container ignores events */
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.brand-ad-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    text-align: center;
    padding: 12px 24px;
    z-index: 1;
    background: rgba(128, 128, 128, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(128, 128, 128, 0.15);
    box-shadow: 0 2px 6px rgba(128, 128, 128, 0.06);
    transition: all 0.3s ease;
    cursor: default;
    pointer-events: none;  /* Default: no interaction */
}

.brand-ad-content.clickable {
    cursor: pointer;
    pointer-events: auto;  /* Enable interaction for clickable ads */
    background: rgba(128, 128, 128, 0.12);  /* Slightly more visible */
    border: 1px solid rgba(128, 128, 128, 0.25);  /* Stronger border */
    box-shadow: 0 2px 8px rgba(128, 128, 128, 0.1);  /* More prominent shadow */
    animation: pulseGlow 3s ease-in-out infinite;  /* Subtle pulsing animation */
}

/* Subtle pulsing glow animation for clickable ads */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(128, 128, 128, 0.1);
        border-color: rgba(128, 128, 128, 0.25);
    }
    50% {
        box-shadow: 0 2px 12px rgba(128, 128, 128, 0.15);
        border-color: rgba(128, 128, 128, 0.35);
    }
}

.brand-ad-content.clickable:hover {
    background: rgba(128, 128, 128, 0.18);  /* Brighter on hover */
    border-color: rgba(128, 128, 128, 0.4);
    box-shadow: 0 4px 16px rgba(128, 128, 128, 0.2);
    transform: translate(-50%, -50%) scale(0.65);
    animation: none;  /* Stop pulsing on hover */
}

.brand-ad-content.clickable:active {
    transform: translate(-50%, -50%) scale(0.58);
    background: rgba(128, 128, 128, 0.15);
}

.brand-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: rgba(96, 96, 96, 0.80);
    margin-bottom: 4px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.brand-tagline {
    font-size: 0.7rem;
    color: rgba(112, 112, 112, 0.70);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

[data-theme="light"] .brand-ad-content {
    background: rgba(128, 128, 128, 0.08);
    border: 1px solid rgba(128, 128, 128, 0.15);
}

[data-theme="light"] .brand-logo {
    color: rgba(96, 96, 96, 0.80);
}

[data-theme="light"] .brand-tagline {
    color: rgba(112, 112, 112, 0.70);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .brand-logo {
        font-size: 2.5rem;
    }

    .brand-tagline {
        font-size: 0.7rem;
    }
}

#blockstorm {
    display: block;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.01) 100%
    );
    flex-shrink: 0;
    /* Prevent double-tap zoom on canvas */
    touch-action: none;
    -ms-touch-action: none;
    position: relative;
    z-index: 2;
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 255, 255, 0.2),
        inset 0 0 0 1px rgba(0, 255, 255, 0.1);
}

[data-theme="light"] #blockstorm {
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 102, 204, 0.3),
        inset 0 0 0 1px rgba(0, 102, 204, 0.15);
    background-image:
        linear-gradient(45deg, rgba(0, 102, 204, 0.08) 0%, transparent 10px),
        linear-gradient(-45deg, rgba(0, 102, 204, 0.08) 0%, transparent 10px),
        linear-gradient(135deg, rgba(0, 102, 204, 0.08) 0%, transparent 10px),
        linear-gradient(-135deg, rgba(0, 102, 204, 0.08) 0%, transparent 10px);
}

/* Canvas grid pattern overlay - removed to prevent conflict with corner accents */

/* ===========================
   6. INFO PANEL
   =========================== */

.info-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    flex-shrink: 0;
}

/* Mobile size adjustment */
@media (max-width: 768px) {
    .info-panel {
        gap: 4px;
        width: 72px;
        min-width: 72px;
        max-width: 72px;
    }
}

.info-box {
    background: var(--color-panel-bg);
    border: 2px solid var(--color-cyan);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    box-shadow: var(--glow-cyan);
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Subtle shimmer effect */
.info-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.1), transparent);
    transition: left 0.8s ease;
}

[data-theme="light"] .info-box::before {
    background: linear-gradient(90deg, transparent, rgba(0, 102, 204, 0.08), transparent);
}

.info-box:hover {
    transform: translateY(-1px);
    box-shadow: var(--glow-cyan-strong);
}

.info-box:hover::before {
    left: 100%;
}

.info-label {
    font-size: 0.5rem;
    font-weight: 600;
    color: var(--color-cyan);
    letter-spacing: 0.2px;
    text-transform: uppercase;
    margin-bottom: 1px;
}

.info-value {
    font-size: 1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.info-value.value-update {
    animation: valuePopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes valuePopIn {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* Mobile size adjustment */
@media (max-width: 768px) {
    .info-box {
        padding: 4px 6px;
    }

    .info-label {
        font-size: 0.4rem;
        margin-bottom: 0;
    }

    .info-value {
        font-size: 0.8rem;
    }
}

.best-value {
    color: var(--color-gold);
    text-shadow: 0 0 12px rgba(255, 204, 0, 0.5);
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-yellow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: bestShine 3s ease-in-out infinite;
}

@keyframes bestShine {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 8px rgba(255, 204, 0, 0.5));
    }
    50% {
        filter: brightness(1.3) drop-shadow(0 0 16px rgba(255, 204, 0, 0.8));
    }
}

.level-value {
    color: var(--color-cyan-bright);
    text-shadow: var(--glow-text);
    background: linear-gradient(135deg, var(--color-cyan-bright) 0%, var(--color-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lines-value {
    color: var(--color-cyan);
    text-shadow: var(--glow-text);
    background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-cyan-bright) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.next-box {
    padding: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
}

#next-piece {
    display: block;
    background: var(--color-next-piece-bg);
    border-radius: var(--radius-sm);
    width: 100%;
    max-width: 70px;
    height: 70px;
    border: 2px solid var(--color-cyan);
    box-shadow:
        inset 0 0 20px rgba(0, 255, 255, 0.15),
        0 0 10px rgba(0, 255, 255, 0.3);
    transition: all 0.3s ease;
}

#next-piece:hover {
    box-shadow:
        inset 0 0 30px rgba(0, 255, 255, 0.25),
        0 0 15px rgba(0, 255, 255, 0.5);
    transform: scale(1.02);
}

[data-theme="light"] #next-piece {
    border-color: var(--color-cyan);
    box-shadow:
        inset 0 0 20px rgba(0, 119, 204, 0.1),
        0 0 8px rgba(0, 119, 204, 0.2);
}

[data-theme="light"] #next-piece:hover {
    box-shadow:
        inset 0 0 30px rgba(0, 119, 204, 0.15),
        0 0 12px rgba(0, 119, 204, 0.3);
}

/* Mobile size adjustment */
@media (max-width: 768px) {
    #next-piece {
        max-width: 65px;
        height: 65px;
    }
}

/* ===========================
   7. BOTTOM CONTROLS
   =========================== */

.controls-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    z-index: 100;
    transition: all 0.3s ease;
}

[data-theme="dark"] .controls-bar {
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
}

.controls-left {
    flex: 0 0 auto;
}

.controls-right {
    flex: 0 0 auto;
}

/* D-Pad Wrapper */
.dpad-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 64px);
    grid-template-rows: repeat(2, 64px);
    gap: 8px;
    position: relative;
}

.dpad-btn {
    border: none;
    background: #3b82f6;
    color: #ffffff;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .dpad-btn {
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.dpad-btn:focus {
    outline: none;
}

.dpad-btn:focus-visible {
    outline: none;
}

.dpad-btn:hover {
    background: #60a5fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .dpad-btn:hover {
    background: #3b82f6;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
}

.dpad-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.3);
}

.dpad-btn:focus:not(:hover):not(:active) {
    background: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .dpad-btn:focus:not(:hover):not(:active) {
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.btn-icon {
    font-size: 1.8rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* D-Pad positioning */
.dpad-up {
    grid-column: 2;
    grid-row: 1;
    border-radius: 12px 12px 6px 6px;
    background: #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .dpad-up {
    background: #d97706;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
}

.dpad-up:hover {
    background: #fbbf24;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .dpad-up:hover {
    background: #f59e0b;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.5);
}

.dpad-up:active {
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.3);
}

.dpad-left {
    grid-column: 1;
    grid-row: 2;
    border-radius: 12px 6px 6px 12px;
}

.dpad-down {
    grid-column: 2;
    grid-row: 2;
    border-radius: 8px;
}

.dpad-right {
    grid-column: 3;
    grid-row: 2;
    border-radius: 6px 12px 12px 6px;
}

/* Action Button - Premium Drop Button */
.action-btn {
    width: 100px;
    height: 100px;
    border: none;
    border-radius: 50%;
    background: #a855f7;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

[data-theme="dark"] .action-btn {
    background: #9333ea;
    box-shadow: 0 4px 16px rgba(147, 51, 234, 0.5);
}

.action-btn:focus {
    outline: none;
}

.action-btn:focus-visible {
    outline: none;
}

.action-btn:hover {
    background: #c084fc;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

[data-theme="dark"] .action-btn:hover {
    background: #a855f7;
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.6);
}

.action-btn:active {
    transform: scale(0.98) translateY(0);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}

.action-btn:focus:not(:hover):not(:active) {
    background: #a855f7;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

[data-theme="dark"] .action-btn:focus:not(:hover):not(:active) {
    background: #9333ea;
    box-shadow: 0 4px 16px rgba(147, 51, 234, 0.5);
}

.action-btn .btn-icon {
    font-size: 2.2rem;
    font-weight: 700;
}

.btn-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    position: relative;
}

/* ===========================
   8. OVERLAYS
   =========================== */

.overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-overlay-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999 !important;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.overlay.show {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto;
}

.overlay-content {
    background: var(--color-panel-bg);
    border: 2px solid var(--color-cyan);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--glow-cyan-strong), var(--shadow-deep);
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    pointer-events: auto;
    width: 90%;
    text-align: center;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

@keyframes slideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Level up celebration effect */
@keyframes levelUpFlash {
    0%, 100% {
        background: var(--color-panel-bg);
    }
    10%, 30%, 50% {
        background: linear-gradient(135deg,
            rgba(0, 255, 255, 0.3) 0%,
            rgba(0, 255, 136, 0.3) 100%);
        box-shadow:
            var(--glow-cyan-strong),
            inset 0 0 50px rgba(0, 255, 255, 0.3),
            0 0 100px rgba(0, 255, 255, 0.5);
    }
}

@keyframes levelUpScale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.level-up-celebration {
    animation:
        levelUpFlash 1s ease-out,
        levelUpScale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cyber-title {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--color-cyan);
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-bottom: var(--space-lg);
    text-shadow: var(--glow-text);
    background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-cyan-bright) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

.cyber-glow {
    display: block;
    font-size: 1.2rem;
    color: var(--color-cyan-bright);
    letter-spacing: 8px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 20px var(--color-cyan-glow);
    }
    50% {
        opacity: 0.8;
        text-shadow: 0 0 40px var(--color-cyan-glow);
    }
}

/* Tutorial Steps */
.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.tutorial-step {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-box-bg);
    border: 2px solid var(--color-cyan);
    border-radius: var(--radius-md);
    text-align: left;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: slideInStep 0.4s ease-out backwards;
}

.tutorial-step:nth-child(1) {
    animation-delay: 0.1s;
}

.tutorial-step:nth-child(2) {
    animation-delay: 0.2s;
}

.tutorial-step:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes slideInStep {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tutorial-step:hover {
    transform: translateX(5px);
    box-shadow: var(--glow-cyan-strong);
    border-color: var(--color-cyan-bright);
}

.step-icon {
    font-size: 1.8rem;
    color: var(--color-cyan);
    min-width: 50px;
    text-align: center;
}

.step-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Buttons - Premium Modern Design */
.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 18px 32px;
    border: none;
    border-radius: 16px;
    font-family: var(--font-system);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    outline: none;
}

/* Shimmer effect */
.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
    left: 100%;
}

/* Glow pulse animation */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px var(--color-cyan-glow), 0 0 40px var(--color-cyan-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 255, 0.6), 0 0 60px rgba(0, 255, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
}

.btn-primary {
    background: linear-gradient(135deg,
        rgba(0, 255, 255, 0.25) 0%,
        rgba(0, 255, 136, 0.35) 50%,
        rgba(0, 200, 255, 0.25) 100%);
    color: #ffffff;
    box-shadow:
        0 0 20px var(--color-cyan-glow),
        0 0 40px var(--color-cyan-glow),
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(0, 255, 255, 0.5);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.btn-primary:hover {
    background: linear-gradient(135deg,
        rgba(0, 255, 255, 0.4) 0%,
        rgba(0, 255, 136, 0.5) 50%,
        rgba(0, 200, 255, 0.4) 100%);
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.6),
        0 0 60px rgba(0, 255, 255, 0.4),
        0 12px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-4px) scale(1.03);
    border-color: var(--color-cyan-bright);
    animation: glowPulse 2s ease-in-out infinite;
}

.btn-primary:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow:
        0 0 15px var(--color-cyan-glow),
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(20, 25, 40, 0.6) 50%,
        rgba(0, 0, 0, 0.5) 100%);
    color: var(--color-text-primary);
    margin-top: var(--space-sm);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(0, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(30, 35, 50, 0.8) 50%,
        rgba(0, 0, 0, 0.7) 100%);
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.3),
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 2px rgba(0, 255, 255, 0.3);
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(0, 255, 255, 0.3);
}

.btn-secondary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Light Mode Button Overrides - Enhanced Readability */
[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg,
        rgba(0, 102, 204, 0.9) 0%,
        rgba(0, 136, 255, 0.95) 50%,
        rgba(0, 102, 204, 0.9) 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 102, 204, 1);
}

[data-theme="light"] .btn-primary:hover {
    background: linear-gradient(135deg,
        rgba(0, 102, 204, 1) 0%,
        rgba(0, 136, 255, 1) 50%,
        rgba(0, 102, 204, 1) 100%);
}

[data-theme="light"] .btn-secondary {
    background: linear-gradient(135deg,
        rgba(226, 232, 240, 1) 0%,
        rgba(203, 213, 225, 1) 100%);
    color: #0f172a;
    text-shadow: none;
    border: 2px solid rgba(148, 163, 184, 0.5);
}

[data-theme="light"] .btn-secondary:hover {
    background: linear-gradient(135deg,
        rgba(203, 213, 225, 1) 0%,
        rgba(148, 163, 184, 1) 100%);
    color: #0f172a;
}

/* Light Mode D-Pad Buttons */
[data-theme="light"] .dpad-btn {
    background: linear-gradient(135deg,
        rgba(0, 102, 204, 0.85) 0%,
        rgba(0, 136, 255, 0.9) 50%,
        rgba(0, 102, 204, 0.85) 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow:
        0 0 20px rgba(0, 102, 204, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 2px rgba(0, 102, 204, 0.6);
}

[data-theme="light"] .dpad-btn:hover {
    background: linear-gradient(135deg,
        rgba(0, 102, 204, 1) 0%,
        rgba(0, 136, 255, 1) 50%,
        rgba(0, 102, 204, 1) 100%);
}

[data-theme="light"] .dpad-up {
    background: linear-gradient(135deg,
        rgba(234, 88, 12, 0.9) 0%,
        rgba(249, 115, 22, 0.95) 50%,
        rgba(234, 88, 12, 0.9) 100%);
    color: #ffffff;
    box-shadow:
        0 0 20px rgba(234, 88, 12, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 2px rgba(234, 88, 12, 0.7);
}

[data-theme="light"] .dpad-up:hover {
    background: linear-gradient(135deg,
        rgba(234, 88, 12, 1) 0%,
        rgba(249, 115, 22, 1) 50%,
        rgba(234, 88, 12, 1) 100%);
}

/* Light Mode Action Button */
[data-theme="light"] .action-btn {
    background: linear-gradient(135deg,
        rgba(192, 38, 211, 0.9) 0%,
        rgba(147, 51, 234, 0.95) 50%,
        rgba(168, 85, 247, 0.9) 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow:
        0 0 30px rgba(192, 38, 211, 0.5),
        0 0 60px rgba(192, 38, 211, 0.25),
        0 6px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 3px rgba(192, 38, 211, 0.6);
}

[data-theme="light"] .action-btn:hover {
    background: linear-gradient(135deg,
        rgba(192, 38, 211, 1) 0%,
        rgba(147, 51, 234, 1) 50%,
        rgba(168, 85, 247, 1) 100%);
}

/* Light Mode Icon Buttons */
[data-theme="light"] .icon-btn {
    background: linear-gradient(135deg,
        rgba(0, 102, 204, 0.85) 0%,
        rgba(0, 136, 255, 0.9) 100%);
    color: #ffffff;
}

[data-theme="light"] .icon-btn:hover {
    background: linear-gradient(135deg,
        rgba(0, 102, 204, 1) 0%,
        rgba(0, 136, 255, 1) 100%);
}

/* Light Mode Score and Label Text */
[data-theme="light"] .score-label,
[data-theme="light"] .stat-label,
[data-theme="light"] .overlay-title {
    color: #0f172a;
    text-shadow: none;
}

[data-theme="light"] .score-value,
[data-theme="light"] .stat-value {
    color: #0066cc;
    text-shadow: 0 1px 2px rgba(0, 102, 204, 0.2);
}

[data-theme="light"] .tutorial-title,
[data-theme="light"] .game-over-title {
    color: #0f172a;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .tutorial-text,
[data-theme="light"] .tutorial-content p {
    color: #475569;
}

[data-theme="light"] .btn-label {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.overlay-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

/* Final Score Display */
.final-score-display {
    margin: var(--space-lg) 0;
    padding: var(--space-lg);
    background: var(--color-box-bg);
    border: 2px solid var(--color-cyan);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: scoreDisplayReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scoreDisplayReveal {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.final-score-label {
    font-size: 0.8rem;
    color: var(--color-cyan);
    letter-spacing: 2px;
    margin-bottom: var(--space-xs);
}

.final-score-value {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--color-cyan-bright);
    font-variant-numeric: tabular-nums;
    text-shadow: var(--glow-text);
    background: linear-gradient(135deg, var(--color-cyan-bright) 0%, var(--color-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: finalScorePulse 2s ease-in-out infinite;
    line-height: 1.2;
    letter-spacing: 2px;
}

@keyframes finalScorePulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05);
        filter: brightness(1.3);
    }
}

.final-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.final-stat {
    padding: var(--space-sm);
    background: var(--color-box-bg);
    border: 2px solid var(--color-cyan);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: statFadeIn 0.4s ease-out backwards;
}

.final-stat:nth-child(1) {
    animation-delay: 0.1s;
}

.final-stat:nth-child(2) {
    animation-delay: 0.2s;
}

.final-stat:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes statFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.final-stat:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: var(--glow-cyan-strong);
    border-color: var(--color-cyan-bright);
}

.final-stat-label {
    font-size: 0.7rem;
    color: var(--color-cyan);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.final-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text-primary);
    font-variant-numeric: tabular-nums;
}

/* ===========================
   9. ANIMATIONS
   =========================== */

.score-pulse {
    animation: scorePulse 0.3s ease-out;
}

@keyframes scorePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: var(--color-yellow);
        text-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
    }
    100% {
        transform: scale(1);
    }
}

/* ===========================
   10. RESPONSIVE DESIGN
   =========================== */

@media (max-width: 768px) {
    /* Mobile-specific overrides - most styles are now default */
}

@media (max-width: 480px) {
    /* Very small screens - compact controls */
    .game-wrapper {
        /* Adjust padding for smaller controls bar */
        /* Controls bar: padding(12*2) + dpad-height(113) + bottom-margin(16) = ~153px */
        padding-bottom: 153px;
    }

    .controls-bar {
        padding: var(--space-sm);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .dpad-wrapper {
        grid-template-columns: repeat(3, 58px);
        grid-template-rows: repeat(2, 58px);
        gap: 4px;
    }

    .dpad-btn {
        border-width: 2px;
    }

    .btn-icon {
        font-size: 1.6rem;
    }

    .action-btn {
        width: 88px;
        height: 88px;
        border-width: 3px;
    }

    .action-btn .btn-icon {
        font-size: 2.2rem;
    }

    .btn-label {
        font-size: 0.7rem;
        letter-spacing: 1.5px;
    }

    .game-main {
        padding: 8px;
        gap: 10px;
    }

    .game-board-container {
        max-width: none;
        padding: 3px;
        flex: 1;
    }

    .info-panel {
        width: 88px;
        min-width: 88px;
        max-width: 88px;
    }

    .info-box {
        padding: 6px 7px;
    }

    .info-label {
        font-size: 0.45rem;
    }

    .info-value {
        font-size: 0.85rem;
    }

    #next-piece {
        width: 75px;
        height: 75px;
    }

    .top-bar {
        padding: 8px 10px;
    }

    .header-stats {
        gap: 12px;
    }

    .score-label {
        font-size: 0.48rem;
    }

    .score-value {
        font-size: 0.95rem;
    }

    .icon-btn {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    .cyber-title {
        font-size: 2rem;
        letter-spacing: 3px;
    }

    .final-score-value {
        font-size: 2.8rem;
    }

    .overlay-content {
        padding: 20px 12px;
        max-height: 95vh;
    }

    .leaderboard-content-area {
        max-height: min(350px, 40vh);
    }

    .leaderboard-table-container {
        max-height: min(350px, 40vh);
    }

    /* Game Over Screen Adjustments */
    .final-score-display {
        margin: 10px 0;
        padding: 10px;
    }

    .final-score-label {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }

    .final-score-value {
        font-size: 2rem;
    }

    .final-stats {
        gap: 4px;
        margin-bottom: 10px;
    }

    .final-stat {
        padding: 6px 3px;
    }

    .final-stat-label {
        font-size: 0.6rem;
    }

    .final-stat-value {
        font-size: 1rem;
    }

    .share-section {
        margin: 10px 0;
        padding: 10px;
    }

    .share-label {
        font-size: 0.7rem;
        margin-bottom: 8px;
    }

    .share-buttons {
        gap: 8px;
        padding: 6px 0;
    }

    .share-btn {
        width: 55px;
        height: 55px;
    }

    .share-btn svg {
        width: 24px;
        height: 24px;
    }

    .overlay-buttons {
        gap: 6px;
        margin-top: 10px;
    }

    .btn-primary, .btn-secondary {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    /* Landscape mode - compact layout */
    .game-wrapper {
        /* Adjust padding for landscape controls bar */
        /* Controls bar: padding(12*2) + dpad-height(100) + bottom-margin(16) = ~140px */
        padding-bottom: 140px;
    }

    .controls-bar {
        padding: var(--space-sm);
    }

    .dpad-wrapper {
        grid-template-columns: repeat(3, 50px);
        grid-template-rows: repeat(2, 50px);
    }

    .action-btn {
        width: 75px;
        height: 75px;
    }

    .overlay-content {
        padding: 20px;
        max-height: 90vh;
    }

    .leaderboard-content-area {
        max-height: min(300px, 35vh);
    }

    .leaderboard-table-container {
        max-height: min(300px, 35vh);
    }

    /* Game Over Screen Adjustments for Landscape */
    .final-score-display {
        margin: 8px 0;
        padding: 8px;
    }

    .final-score-label {
        font-size: 0.65rem;
        margin-bottom: 3px;
    }

    .final-score-value {
        font-size: 1.8rem;
    }

    .final-stats {
        gap: 4px;
        margin-bottom: 8px;
    }

    .final-stat {
        padding: 5px 3px;
    }

    .final-stat-label {
        font-size: 0.55rem;
    }

    .final-stat-value {
        font-size: 0.9rem;
    }

    .share-section {
        margin: 8px 0;
        padding: 8px;
    }

    .share-label {
        font-size: 0.65rem;
        margin-bottom: 6px;
    }

    .share-buttons {
        gap: 6px;
        padding: 4px 0;
    }

    .share-btn {
        width: 50px;
        height: 50px;
    }

    .share-btn svg {
        width: 22px;
        height: 22px;
    }

    .overlay-buttons {
        gap: 6px;
        margin-top: 8px;
    }

    .btn-primary, .btn-secondary {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .cyber-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
}

/* ===========================
   11. ACCESSIBILITY
   =========================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Enhanced focus styles for accessibility */
button:focus-visible,
.icon-btn:focus-visible,
.dpad-btn:focus-visible,
.action-btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
    outline: 3px solid var(--color-cyan-bright);
    outline-offset: 4px;
    animation: focusPulse 1.5s ease-in-out infinite;
}

@keyframes focusPulse {
    0%, 100% {
        outline-color: var(--color-cyan-bright);
        box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.2);
    }
    50% {
        outline-color: var(--color-cyan);
        box-shadow: 0 0 0 6px rgba(0, 255, 136, 0.4);
    }
}

/* Remove default focus for mouse users, keep for keyboard */
button:focus:not(:focus-visible) {
    outline: none;
}

/* SNS Share Section */
.share-section {
    margin: var(--space-lg) 0;
    padding: var(--space-md);
    background: var(--color-box-bg-alt);
    border: 2px solid var(--color-cyan);
    border-radius: var(--radius-md);
}

.share-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333333;
    letter-spacing: 0.5px;
    text-transform: none;
    margin-bottom: var(--space-md);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.share-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    align-items: center;
    padding: var(--space-sm) 0;
}

.share-btn {
    width: 80px;
    height: 80px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}


.share-btn svg {
    width: 36px;
    height: 36px;
    position: relative;
    z-index: 1;
}

/* Kakao - Official Yellow Brand */
.share-kakao {
    background: #FEE500;
    border-color: #FEE500;
    color: #3C1E1E;
    box-shadow: 0 4px 12px rgba(254, 229, 0, 0.4);
}

.share-kakao::before {
    display: none;
}

.share-kakao:hover {
    background: #FFD700;
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(254, 229, 0, 0.6);
}

.share-kakao:active {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(254, 229, 0, 0.4);
}

/* X (Twitter) - Official Black Brand */
.share-x {
    background: #000000;
    border-color: #000000;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.share-x::before {
    display: none;
}

.share-x:hover {
    background: #14171A;
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

.share-x:active {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Threads - Official Black Brand */
.share-threads {
    background: #000000;
    border-color: #000000;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.share-threads::before {
    display: none;
}

.share-threads:hover {
    background: #1A1A1A;
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

.share-threads:active {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ===========================
   UTILITY CLASSES
   =========================== */

.hidden {
    display: none !important;
}

/* ===========================
   12. PERFORMANCE
   =========================== */

/* Removed .game-board-container from transform to avoid stacking context issues with overlay */
#blockstorm,
.controls-bar,
.top-bar {
    transform: translateZ(0);
    will-change: transform;
}

button {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    /* Prevent double-tap zoom on buttons */
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

/* Loading state */
body {
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

body.loaded {
    opacity: 1;
    animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   DESKTOP OPTIMIZATION (1024px+)
   =========================== */
@media (min-width: 1024px) {
    .game-wrapper {
        padding: 16px 0;
        padding-bottom: 80px;
        max-width: 1400px;
        margin: 0 auto;
    }

    .game-main {
        gap: 20px;
        max-width: 100%;
        justify-content: center;
    }

    .info-panel {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
        gap: 12px;
    }

    .info-box {
        padding: 16px 12px;
        border-width: 3px;
    }

    .info-label {
        font-size: 0.65rem;
        font-weight: 600;
        letter-spacing: 0.05em;
    }

    .info-value {
        font-size: 1.5rem;
        font-weight: 700;
    }

    #next-piece {
        max-width: 120px;
        height: 120px;
    }

    .next-box {
        padding: 12px;
    }

    .game-board-container {
        padding: 8px;
        border-width: 3px;
        max-width: 600px;
    }

    .top-bar {
        padding: 12px 24px;
    }

    .header-stats {
        gap: 24px;
    }

    .score-display {
        padding: 10px 16px;
        min-width: 100px;
    }

    .score-label {
        font-size: 0.6rem;
        font-weight: 600;
    }

    .score-value {
        font-size: 1.3rem;
        font-weight: 700;
    }

    .icon-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .header-controls {
        gap: 12px;
    }

    /* Hide mobile controls on desktop */
    .controls-bar {
        display: none;
    }

    /* Add keyboard hint for desktop */
    body::after {
        content: '⌨️ Arrow Keys = Move | Space = Drop | Up = Rotate';
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--color-panel-bg);
        border: 2px solid var(--color-cyan);
        border-radius: var(--radius-md);
        padding: 12px 24px;
        font-size: 0.85rem;
        color: var(--color-text-primary);
        box-shadow: var(--glow-cyan), var(--shadow-deep);
        backdrop-filter: blur(16px);
        z-index: 1000;
        opacity: 0.9;
    }

    [data-theme="light"] body::after {
        background: rgba(255, 255, 255, 0.95);
        color: #0f172a;
    }
}

/* ===========================
   LEADERBOARD
   =========================== */

.leaderboard-content {
    max-width: 600px;
    width: 90%;
}

/* Leaderboard Tabs */
.leaderboard-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    justify-content: center;
}

.leaderboard-tab {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--color-cyan);
    border-radius: var(--radius-sm);
    color: var(--color-cyan);
    cursor: pointer;
    transition: all 0.3s ease;
}

.leaderboard-tab:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: translateY(-2px);
}

.leaderboard-tab.active {
    background: var(--color-cyan);
    color: var(--color-bg);
    box-shadow: var(--glow-cyan);
}

[data-theme="light"] .leaderboard-tab {
    background: rgba(0, 102, 204, 0.1);
    border-color: var(--color-cyan);
    color: var(--color-cyan);
}

[data-theme="light"] .leaderboard-tab.active {
    background: var(--color-cyan);
    color: white;
}

/* Leaderboard Content Area - Responsive Height Container */
.leaderboard-content-area {
    height: auto;
    max-height: min(500px, 50vh);
    margin-bottom: 16px;
    position: relative;
}

/* Loading Spinner */
.leaderboard-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 255, 255, 0.2);
    z-index: 10;
    pointer-events: none;
}

[data-theme="light"] .leaderboard-loading {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 102, 204, 0.2);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    border: 3px solid rgba(0, 255, 255, 0.1);
    border-top: 3px solid var(--color-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--color-cyan);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Leaderboard Table */
.leaderboard-table-container {
    width: 100%;
    height: 100%;
    max-height: min(500px, 50vh);
    overflow: auto;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 255, 255, 0.2);
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar for Chrome, Safari and Opera */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.leaderboard-table-container::-webkit-scrollbar {
    display: none;
}

[data-theme="light"] .leaderboard-table-container {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 102, 204, 0.2);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    min-height: 100%;
}

.leaderboard-table thead {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background: var(--color-panel-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
}

.leaderboard-table thead::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-cyan);
}

[data-theme="light"] .leaderboard-table thead::after {
    background: var(--color-cyan);
}

.leaderboard-table th {
    padding: 12px 8px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--color-cyan);
    border-bottom: none;
    position: relative;
}

.leaderboard-table td {
    padding: 8px 8px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
}

[data-theme="light"] .leaderboard-table td {
    border-bottom-color: rgba(0, 102, 204, 0.1);
}

.leaderboard-table tbody tr {
    transition: all 0.2s ease;
    height: 50px;
    min-height: 50px;
}

.leaderboard-table tbody tr:hover {
    background: rgba(0, 255, 255, 0.05);
}

[data-theme="light"] .leaderboard-table tbody tr:hover {
    background: rgba(0, 102, 204, 0.05);
}

/* Rank Cell */
.rank-cell {
    font-weight: 700;
    text-align: center;
    width: 60px;
}

.rank-1 {
    color: #FFD700;
    font-size: 1rem;
}

.rank-2 {
    color: #C0C0C0;
    font-size: 0.95rem;
}

.rank-3 {
    color: #CD7F32;
    font-size: 0.9rem;
}

/* Player Cell */
.player-cell {
    font-weight: 500;
}

.player-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    font-size: 0.6rem;
    font-weight: 700;
    background: var(--color-cyan);
    color: var(--color-bg);
    border-radius: 3px;
}

/* Score Cell */
.score-cell {
    font-weight: 600;
    color: var(--color-cyan);
    text-align: right;
}

/* Level Cell */
.level-cell {
    text-align: center;
    font-weight: 500;
    opacity: 0.8;
}

/* Highlight Current Player */
.leaderboard-row-highlight {
    background: rgba(0, 255, 255, 0.1) !important;
    border-left: 3px solid var(--color-cyan);
}

[data-theme="light"] .leaderboard-row-highlight {
    background: rgba(0, 102, 204, 0.1) !important;
}

/* Empty State */
.leaderboard-empty {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    z-index: 5;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-cyan);
    margin-bottom: 8px;
}

.empty-subtext {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .overlay-content {
        padding: 24px 16px;
        max-height: 95vh;
    }

    .leaderboard-content {
        width: 95%;
    }

    .leaderboard-content-area {
        max-height: min(400px, 45vh);
    }

    .leaderboard-table-container {
        max-height: min(400px, 45vh);
    }

    .leaderboard-tabs {
        gap: 4px;
        margin-bottom: 12px;
    }

    .leaderboard-tab {
        padding: 6px 8px;
        font-size: 0.6rem;
    }

    .leaderboard-table th {
        padding: 8px 4px;
        font-size: 0.6rem;
    }

    .leaderboard-table td {
        padding: 8px 4px;
        font-size: 0.75rem;
    }

    .rank-cell {
        width: 40px;
    }

    .player-badge {
        font-size: 0.5rem;
        padding: 1px 4px;
    }

    /* Game Over Screen Adjustments */
    .final-score-display {
        margin: 12px 0;
        padding: 12px;
    }

    .final-score-value {
        font-size: 2.5rem;
    }

    .final-stats {
        gap: 6px;
        margin-bottom: 12px;
    }

    .final-stat {
        padding: 8px 4px;
    }

    .final-stat-value {
        font-size: 1.1rem;
    }

    .share-section {
        margin: 12px 0;
        padding: 12px;
    }

    .share-buttons {
        gap: 12px;
        padding: 8px 0;
    }

    .share-btn {
        width: 65px;
        height: 65px;
    }

    .share-btn svg {
        width: 28px;
        height: 28px;
    }

    .overlay-buttons {
        gap: 8px;
        margin-top: 12px;
    }

    .cyber-title {
        font-size: 2.2rem;
        letter-spacing: 3px;
        margin-bottom: 12px;
    }
}

/* ===========================
   SETTINGS OVERLAY
   =========================== */

.settings-section {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px 0;
}

.settings-item {
    text-align: center;
    padding: 15px;
    background: var(--color-box-bg);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.settings-item:hover {
    border-color: rgba(0, 255, 255, 0.4);
    background: var(--color-box-bg-alt);
}

.settings-label {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.settings-value {
    font-size: 1.2rem;
    color: var(--color-cyan-bright);
    font-weight: 600;
    text-shadow: var(--glow-text);
    word-break: break-all;
}

#change-name-btn {
    width: 100%;
    max-width: 200px;
}

@media (max-width: 768px) {
    .settings-section {
        padding: 15px 10px;
    }

    .settings-item {
        padding: 12px;
    }

    .settings-value {
        font-size: 1rem;
    }
}
