/* Modern Tetris - Main Styles */

:root {
    --primary-bg: #0a0a0a;
    --secondary-bg: #1a1a2e;
    --accent-bg: #16213e;
    --glass-bg: rgba(255, 255, 255, 0.1);
    
    --neon-blue: #00d4ff;
    --neon-purple: #9d4edd;
    --neon-pink: #ff006e;
    --neon-green: #39ff14;
    --neon-yellow: #ffff00;
    --neon-orange: #ff8500;
    --neon-red: #ff0040;
    
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-accent: var(--neon-blue);
    
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);
    --shadow-strong: 0 0 30px rgba(0, 212, 255, 0.5);
    --border-radius: 12px;
    
    --font-primary: 'Orbitron', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 50%, var(--accent-bg) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}


.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px 20px; /* Add top padding for progression header */
}

/* Home Screen Styles */
.home-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.home-container {
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

.home-header {
    margin-bottom: 50px;
}

.home-logo {
    width: 200px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(57, 255, 20, 0.6));
    animation: pulse-glow 2s ease-in-out infinite;
    margin-bottom: 20px;
}

.home-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    letter-spacing: 0.3em;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple), var(--neon-pink));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease-in-out infinite;
    margin: 20px 0;
}

.home-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.home-modes {
    margin-bottom: 40px;
}

.home-mode-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.home-mode-card:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: var(--neon-blue);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.home-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Game controls now in progression header - see progression.css */

/* Legacy Header Styles - for reference */
.header {
    margin-bottom: 30px;
    z-index: 10;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.header-controls {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-icon.muted {
    color: var(--neon-red);
    border-color: var(--neon-red);
}

/* Button Styles */
.btn-primary, .btn-secondary {
    padding: 12px 30px;
    border: 2px solid var(--neon-blue);
    border-radius: 25px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 30px rgba(0, 212, 255, 0.5);
}

.btn-secondary {
    background: var(--glass-bg);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

/* Game Screen Styles */
.game-screen {
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height */
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 10px;
    padding-top: 70px; /* Space for progression header (60px + 10px margin) */
    padding-bottom: env(safe-area-inset-bottom); /* Safe area for iOS */
    overflow: hidden;
    box-sizing: border-box;
}

/* Logo Styles */
.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(57, 255, 20, 0.5));
    transition: all 0.3s ease;
}

.logo:hover {
    filter: drop-shadow(0 0 15px rgba(57, 255, 20, 0.8));
    transform: scale(1.05);
}

.title {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    letter-spacing: 0.2em;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple), var(--neon-pink));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: var(--shadow-glow);
    animation: gradient-shift 3s ease-in-out infinite;
    margin: 0;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.controls-hint {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.controls-hint span {
    padding: 8px 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.controls-hint span:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-glow);
}

/* Game Container */
.game-container {
    display: grid;
    grid-template-columns: minmax(10em, 1fr) minmax(18em, 22em) minmax(10em, 1fr);
    gap: 1.2em;
    align-items: start;
    max-width: 70em;
    margin-top: 10px; /* Additional spacing from progression bar */
    width: 100%;
    max-height: calc(100vh - 70px);
    margin: 0 auto;
    padding: 0 0.8em;
}

/* Sidebars */
.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: calc(100vh - 80px);
}

.hold-area, .next-area, .stats,
.hold-stats-card, .next-pieces-card, .info-panel, .next-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}


/* Show desktop sidebars by default */
.game-sidebar {
    display: block;
}

/* Hide mobile panels by default */
.info-panel, .next-panel {
    display: none;
}

.hold-area::before, .next-area::before, .stats::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
    border-radius: var(--border-radius);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hold-area:hover::before, .next-area:hover::before, .stats:hover::before {
    opacity: 0.3;
}

.hold-area h3, .next-area h3 {
    color: var(--text-accent);
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hold-piece, .next-piece {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.next-pieces {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.next-piece:first-child {
    transform: scale(1.1);
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

/* Stats */
.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stat-value {
    color: var(--neon-blue);
    font-weight: 700;
    font-size: 1.2rem;
    text-shadow: 0 0 10px currentColor;
}

/* Game Board */
.game-board {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-width: 20em;
    min-height: 40em;
    max-height: calc(100vh - 10em);
}

#game-canvas {
    background: linear-gradient(180deg, 
        rgba(10, 10, 10, 0.95) 0%, 
        rgba(26, 26, 46, 0.95) 50%, 
        rgba(22, 33, 62, 0.95) 100%);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--border-radius);
    box-shadow: 
        var(--shadow-strong),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    width: 18em;
    height: 36em;
    max-width: 100%;
    max-height: calc(100vh - 80px);
    display: block;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* Game Overlay */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    z-index: 100;
}

.overlay-content {
    text-align: center;
    padding: 40px;
}

#overlay-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-accent);
    margin-bottom: 20px;
    text-shadow: var(--shadow-glow);
}

#overlay-message {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 15px 30px;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
    color: white;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--text-secondary);
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Particles Container */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Hidden by default */
.game-overlay.hidden {
    display: none;
}

/* Player Name Input Modal */
.name-input-overlay, .leaderboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fade-in 0.3s ease-out;
}

.name-input-content, .leaderboard-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-strong);
    position: relative;
}

.name-input-content h2, .leaderboard-content h2 {
    color: var(--neon-blue);
    font-size: 2rem;
    margin-bottom: 15px;
    text-shadow: var(--shadow-glow);
}

.name-input-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.input-group {
    margin-bottom: 25px;
}

#player-name-input {
    width: 100%;
    padding: 15px 20px;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

#player-name-input:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

#player-name-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.input-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.score-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.score-item span:first-child {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.score-item span:last-child {
    color: var(--neon-blue);
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 0 10px currentColor;
}

/* Leaderboard Mode Selector */
.mode-selector-container {
    margin: 0 25px 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.3),
        0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

.mode-selector-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple), var(--neon-blue));
    border-radius: 12px;
    opacity: 0.15;
    z-index: -1;
    animation: gradient-shift 3s ease infinite;
}

.mode-selector {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-select-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.08));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.mode-select-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.3), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.mode-select-btn:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(157, 78, 221, 0.1));
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 20px rgba(0, 212, 255, 0.25),
        inset 0 0 15px rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 212, 255, 0.4);
}

.mode-select-btn:hover::before {
    width: 200%;
    height: 200%;
}

.mode-select-btn.active {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    color: white;
    border-color: transparent;
    box-shadow: 
        0 0 25px rgba(0, 212, 255, 0.6),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    font-weight: 600;
    transform: scale(1.05);
    animation: active-pulse 2s ease infinite;
}

@keyframes active-pulse {
    0%, 100% {
        box-shadow: 
            0 0 25px rgba(0, 212, 255, 0.6),
            inset 0 0 10px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 
            0 0 35px rgba(0, 212, 255, 0.8),
            inset 0 0 15px rgba(255, 255, 255, 0.3);
    }
}

@keyframes gradient-shift {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
}

.mode-icon {
    font-size: 1.1rem;
}

/* Mode-specific leaderboard entries */
.entry-time,
.entry-puzzle,
.entry-checkpoint,
.entry-duration,
.entry-wins {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 3px;
}

.entry-puzzle {
    color: #ff8800;
}

.entry-time {
    color: #ff00ff;
    font-weight: bold;
}

/* Leaderboard Styles */
.leaderboard-content {
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(18, 18, 24, 0.98), rgba(29, 29, 41, 0.98));
    border-radius: 15px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 20px 25px 15px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(157, 78, 221, 0.1) 100%);
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, var(--neon-blue), var(--neon-purple)) 1;
    border-radius: 15px 15px 0 0;
    position: relative;
}

.leaderboard-header h2 {
    font-size: 1.8rem;
    color: var(--neon-gold);
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.3);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.btn-close, .modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-close:hover, .modal-close:hover {
    color: var(--neon-red);
    background: rgba(255, 89, 94, 0.1);
    border-color: var(--neon-red);
    transform: rotate(90deg);
    box-shadow: 0 0 15px rgba(255, 89, 94, 0.3);
}

.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    padding: 5px;
}

.tab-button {
    flex: 1;
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: var(--neon-blue);
    color: white;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.tab-button:not(.active):hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-blue) rgba(255, 255, 255, 0.1);
}

.leaderboard-list::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: var(--neon-blue);
    border-radius: 4px;
    opacity: 0.5;
}

.leaderboard-list::-webkit-scrollbar-thumb:hover {
    background: var(--neon-purple);
    opacity: 0.8;
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 50px 1fr 100px 60px 60px;
    gap: 15px;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.leaderboard-entry:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-blue);
    transform: translateX(5px);
}

/* Special styling for top 3 */
.leaderboard-entry:nth-child(1) .entry-rank {
    color: #ffd700;
    text-shadow: 0 0 15px #ffd700;
}

.leaderboard-entry:nth-child(2) .entry-rank {
    color: #c0c0c0;
    text-shadow: 0 0 15px #c0c0c0;
}

.leaderboard-entry:nth-child(3) .entry-rank {
    color: #cd7f32;
    text-shadow: 0 0 15px #cd7f32;
}

.leaderboard-entry:nth-child(1) {
    border-color: rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, transparent 100%);
}

.leaderboard-entry:nth-child(2) {
    border-color: rgba(192, 192, 192, 0.3);
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.05) 0%, transparent 100%);
}

.leaderboard-entry:nth-child(3) {
    border-color: rgba(205, 127, 50, 0.3);
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.05) 0%, transparent 100%);
}

.entry-rank {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--neon-blue);
    text-align: center;
}

.entry-rank.gold { color: var(--neon-yellow); }
.entry-rank.silver { color: #c0c0c0; }
.entry-rank.bronze { color: #cd7f32; }

.entry-name {
    font-weight: 600;
    color: var(--text-primary);
}

.entry-score {
    font-weight: 700;
    color: var(--neon-green);
    text-align: right;
}

.entry-lines, .entry-level {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    font-size: 1.1rem;
}

.error-message {
    text-align: center;
    color: var(--neon-red);
    padding: 20px;
    background: rgba(255, 0, 64, 0.1);
    border: 1px solid rgba(255, 0, 64, 0.3);
    border-radius: var(--border-radius);
    margin: 10px 0;
}

/* Settings Modal Styles */
.settings-overlay, .help-overlay, .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fade-in 0.3s ease-out;
}

.settings-content, .help-content, .modal-content, .achievements-content, .profile-content, .customization-content, .account-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-strong);
    position: relative;
}

.settings-header, .help-header, .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.settings-header h2, .help-header h2 {
    color: var(--neon-blue);
    font-size: 1.8rem;
    margin: 0;
    text-shadow: var(--shadow-glow);
}

.settings-tabs, .help-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    padding: 5px;
}

.settings-tab-button, .help-tab {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-tab-button.active, .help-tab.active {
    background: var(--neon-blue);
    color: white;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.settings-tab-button:not(.active):hover, .help-tab:not(.active):hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Help Modal Specific Styles */
.help-tab-content {
    animation: fade-in 0.3s ease-out;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.control-item kbd {
    background: var(--secondary-bg);
    color: var(--neon-blue);
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid rgba(0, 212, 255, 0.3);
    min-width: 40px;
    text-align: center;
}

.touch-controls-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.touch-control {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.gesture-icon {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.gesture-info strong {
    display: block;
    color: var(--neon-blue);
    margin-bottom: 5px;
}

.scoring-table {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.score-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-row:last-child {
    border-bottom: none;
}

.score-value {
    color: var(--neon-green);
    font-weight: bold;
}

.special-moves-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.special-move {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.special-move strong {
    color: var(--neon-purple);
    margin-bottom: 5px;
    display: block;
}

.special-move p {
    color: var(--text-secondary);
    margin: 0;
}

.settings-panel {
    animation: fade-in 0.3s ease-out;
}

.setting-group {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-group > label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.volume-control input[type="range"] {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--neon-blue);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--neon-blue);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.volume-control span {
    color: var(--neon-blue);
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

.setting-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 13px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-label {
    color: var(--text-primary);
    font-weight: 600;
}

/* Controls Display */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-key {
    background: var(--neon-blue);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: center;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.control-action {
    color: var(--text-primary);
    font-weight: 500;
}

.controls-info h3 {
    color: var(--neon-blue);
    margin-bottom: 15px;
    margin-top: 25px;
    font-size: 1.2rem;
    text-shadow: 0 0 8px currentColor;
}

.controls-info h3:first-child {
    margin-top: 0;
}

/* Touch Controls */
.touch-controls-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.touch-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.touch-gesture {
    font-size: 1rem;
    min-width: 100px;
    background: var(--neon-purple);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 0 8px rgba(157, 78, 221, 0.3);
}

/* Help Modal Specific Styles */
.help-sections {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.help-section h3 {
    color: var(--neon-blue);
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-shadow: 0 0 8px currentColor;
}

.help-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.special-moves, .scoring-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.special-item, .score-item {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.special-item {
    color: var(--text-secondary);
    line-height: 1.5;
}

.special-item strong {
    color: var(--text-accent);
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-item span:first-child {
    color: var(--text-secondary);
}

.score-item span:last-child {
    color: var(--neon-green);
    font-weight: 700;
}

.quick-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

/* Offline Mode Indicators */
.offline-indicator {
    position: fixed;
    top: 70px;
    right: 20px;
    background: var(--bg-dark);
    border: 2px solid var(--neon-orange);
    border-radius: 10px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 159, 64, 0.3);
}

.offline-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.offline-indicator.offline {
    border-color: var(--neon-red);
    box-shadow: 0 0 20px rgba(255, 89, 94, 0.3);
}

.offline-indicator.syncing {
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.offline-indicator .offline-icon,
.offline-indicator .sync-icon {
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

.offline-indicator .pending-count {
    background: var(--neon-orange);
    color: var(--bg-dark);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.8rem;
}

/* Offline Notifications */
.offline-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-dark);
    border: 2px solid var(--neon-blue);
    border-radius: 10px;
    padding: 15px 20px;
    max-width: 300px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.offline-notification.visible {
    opacity: 1;
    transform: translateX(0);
}

.offline-notification.success {
    border-color: var(--neon-green);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.offline-notification.warning {
    border-color: var(--neon-orange);
    box-shadow: 0 0 20px rgba(255, 159, 64, 0.3);
}

.offline-notification.error {
    border-color: var(--neon-red);
    box-shadow: 0 0 20px rgba(255, 89, 94, 0.3);
}

.offline-notification.info {
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

/* Update Notification */
.update-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-dark);
    border: 2px solid var(--neon-green);
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10001;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.4);
    animation: slideDown 0.5s ease;
}

.update-notification button {
    background: var(--neon-green);
    color: var(--bg-dark);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.update-notification button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

/* PWA Install Button */
.pwa-install {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
    border: 2px solid transparent;
    animation: gradient-border 3s ease infinite;
}

.pwa-install:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(187, 134, 252, 0.5);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes gradient-border {
    0%, 100% {
        border-color: var(--neon-purple);
    }
    50% {
        border-color: var(--neon-blue);
    }
}

/* Hint System Styles */
.hint-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--neon-yellow), var(--neon-orange));
    border: 2px solid rgba(255, 255, 0, 0.5);
    border-radius: 10px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 50;
    font-weight: bold;
}

.hint-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.5);
}

.hint-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hint-icon {
    font-size: 1.5rem;
}

.hint-count {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.hint-column-highlight {
    pointer-events: none;
    animation: pulse 1s infinite;
}

.hint-rotation-indicator {
    animation: rotateHint 2s ease-out;
}

.hint-movement-arrow {
    animation: slideHint 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.3; }
}

@keyframes rotateHint {
    from { transform: translate(-50%, -50%) rotate(0deg) scale(0); }
    to { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}

@keyframes slideHint {
    0%, 100% { transform: translateX(-50%) translateX(0); }
    50% { transform: translateX(-50%) translateX(10px); }
}

/* Power-Up Mode Styles */
.powerup-slots {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 50;
}

.powerup-slot {
    width: 100px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.powerup-slot.filled {
    animation: pulse 2s infinite;
}

.powerup-slot:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.powerup-key {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--neon-blue);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}

.powerup-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.powerup-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    text-align: center;
}

.powerup-empty {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Active Power-Ups Display */
.active-powerups {
    position: absolute;
    top: 100px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
}

.active-powerup {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid;
    border-radius: 50%;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.active-powerup-icon {
    font-size: 1.5rem;
}

.active-powerup-timer {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    transition: width 0.1s linear;
    border-radius: 2px;
}

/* Power-Up Notification */
.powerup-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid;
    border-radius: 15px;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10000;
    animation: slideIn 0.5s ease;
}

.powerup-notification.fade-out {
    animation: fadeOut 0.5s ease;
}

.notification-icon {
    font-size: 2rem;
}

.notification-text {
    font-size: 1.2rem;
    font-weight: bold;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}