/* ==========================================================================
   Lead Catcher Challenge - Game Styles
   ========================================================================== */

:root {
    --neon-blue: #00f2fe;
    --neon-purple: #9d4edd;
    --neon-green: #39ff14;
    --neon-red: #ff3838;
    --neon-gold: #ffd700;
    --neon-orange: #ff9f1c;
    --arcade-dark: #090d16;
    --glass-panel: rgba(15, 23, 42, 0.75);
    --glass-border-glow: rgba(0, 242, 254, 0.2);
}

/* Game Page Specific Base */
.game-page-body {
    background-color: var(--arcade-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(157, 78, 221, 0.15) 0px, transparent 50%),
        radial-gradient(at 50% 0%, rgba(0, 242, 254, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(15, 23, 42, 0.9) 0px, transparent 50%);
    color: #f8fafc;
    position: relative;
    overflow-x: hidden;
}

/* Grid Background Effect */
.game-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 1;
}

/* Floating Background Icons */
.game-floating-icons {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-bg-icon {
    position: absolute;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.04);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
    animation: floatSlow 12s infinite ease-in-out;
}

.floating-bg-icon.fb { top: 15%; left: 10%; animation-delay: 0s; color: rgba(24, 119, 242, 0.08); }
.floating-bg-icon.ig { top: 35%; right: 12%; animation-delay: 2s; color: rgba(225, 48, 108, 0.08); }
.floating-bg-icon.yt { top: 60%; left: 8%; animation-delay: 4s; color: rgba(255, 0, 0, 0.08); }
.floating-bg-icon.li { top: 75%; right: 15%; animation-delay: 1s; color: rgba(0, 119, 181, 0.08); }
.floating-bg-icon.wa { top: 45%; left: 85%; animation-delay: 3s; color: rgba(37, 211, 102, 0.08); }
.floating-bg-icon.go { top: 80%; left: 40%; animation-delay: 5s; color: rgba(219, 68, 85, 0.08); }

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    50% {
        transform: translateY(-30px) rotate(15deg) scale(1.1);
    }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.game-hero {
    padding-top: 150px;
    padding-bottom: 60px;
    position: relative;
    z-index: 2;
    text-align: center;
}

.game-hero-badge {
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.3);
    color: var(--neon-blue);
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: inline-block;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
    margin-bottom: 20px;
}

.game-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 30%, var(--neon-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 242, 254, 0.1);
}

.game-hero p {
    font-size: 1.25rem;
    max-width: 650px;
    margin: 0 auto 35px auto;
    color: #94a3b8;
}

.game-hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-game-primary {
    background: linear-gradient(135deg, var(--neon-blue), #0284c7);
    color: #000;
    font-weight: 700;
    border: none;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.btn-game-primary:hover {
    background: linear-gradient(135deg, #38bdf8, #0369a1);
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.6);
}

.btn-game-secondary {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    backdrop-filter: blur(10px);
}

.btn-game-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-3px);
}

/* ==========================================================================
   Game Main Console
   ========================================================================== */

.game-section {
    padding-bottom: 100px;
    position: relative;
    z-index: 2;
}

.game-console-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--glass-panel);
    border: 1px solid var(--glass-border-glow);
    border-radius: 24px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 242, 254, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    position: relative;
}

/* Glowing side stripes representing arcade cabinet */
.game-console-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--neon-blue), var(--neon-purple));
    box-shadow: 0 0 15px var(--neon-blue);
}

.game-console-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--neon-blue), var(--neon-purple));
    box-shadow: 0 0 15px var(--neon-blue);
}

/* HUD Header */
.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(9, 13, 22, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'Poppins', sans-serif;
}

.hud-item {
    display: flex;
    flex-direction: column;
}

.hud-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #64748b;
    margin-bottom: 2px;
}

.hud-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.hud-value.score {
    color: var(--neon-green);
    text-shadow: 0 0 12px rgba(57, 255, 20, 0.3);
}

.hud-value.timer {
    color: var(--neon-blue);
    text-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
    min-width: 60px;
}

.hud-value.timer.warning {
    color: var(--neon-red);
    text-shadow: 0 0 15px rgba(255, 56, 56, 0.6);
    animation: pulseRed 1s infinite;
}

.hud-value.combo {
    color: var(--neon-gold);
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

@keyframes pulseRed {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Arena / Canvas Area */
.game-arena {
    position: relative;
    width: 100%;
    height: 500px;
    background: #06090f;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: transparent;
    cursor: none; /* Hide cursor inside game */
}

/* ==========================================================================
   Overlay Menus (Start, Game Over)
   ========================================================================== */

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 10, 17, 0.95);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
    backdrop-filter: blur(8px);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.game-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Screen Overlays Scrollable Container */
.start-screen-content,
.game-over-content {
    max-width: 650px;
    width: 100%;
    overflow-y: auto;
    max-height: 100%;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Custom Scrollbar for overlays */
.start-screen-content::-webkit-scrollbar,
.game-over-content::-webkit-scrollbar {
    width: 6px;
}
.start-screen-content::-webkit-scrollbar-track,
.game-over-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
.start-screen-content::-webkit-scrollbar-thumb,
.game-over-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.start-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 25px;
    text-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
}

.game-legend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
    text-align: left;
}

.legend-column h5 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.legend-column.assets h5 { color: var(--neon-green); }
.legend-column.obstacles h5 { color: var(--neon-red); }

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.legend-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-right: 12px;
    box-shadow: 0 0 10px currentColor;
    flex-shrink: 0;
}

.legend-text {
    flex-grow: 1;
}

.legend-pts {
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    margin-left: 10px;
}

.legend-pts.plus { color: var(--neon-green); }
.legend-pts.minus { color: var(--neon-red); }

.game-instructions-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 30px;
    text-align: center;
}

.game-instructions-box p {
    margin-bottom: 5px;
}

.game-instructions-box strong {
    color: #fff;
}

/* Winner / Game Over Screen */
.win-title {
    font-size: 3rem;
    color: var(--neon-gold);
    text-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
    margin-bottom: 10px;
    font-weight: 800;
    animation: floatSmall 3s infinite ease-in-out;
}

@keyframes floatSmall {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.win-subtitle {
    font-size: 1.25rem;
    color: #cbd5e1;
    margin-bottom: 30px;
    max-width: 550px;
}

.score-summary-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 25px 40px;
    margin-bottom: 35px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.summary-score-val {
    font-size: 4rem;
    font-weight: 800;
    color: var(--neon-green);
    text-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
    line-height: 1;
    margin-bottom: 5px;
}

.summary-score-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #64748b;
    margin-bottom: 15px;
}

.badge-award {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    color: var(--neon-gold);
    font-size: 1rem;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.badge-award.rookie {
    background: rgba(205, 127, 50, 0.1);
    border-color: rgba(205, 127, 50, 0.3);
    color: #cd7f32;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.15);
}

.badge-award.expert {
    background: rgba(192, 192, 192, 0.1);
    border-color: rgba(192, 192, 192, 0.3);
    color: #c0c0c0;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.15);
}

.badge-award.champion {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    color: var(--neon-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    animation: goldGlow 2s infinite ease-in-out;
}

@keyframes goldGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.5); }
}

/* High Score Board (In overlays) */
.leaderboard-overlay-section {
    width: 100%;
    max-width: 400px;
    margin: 20px 0 35px 0;
}

.leaderboard-overlay-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #64748b;
    margin-bottom: 15px;
}

.leaderboard-list {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.leaderboard-row.highlight {
    background: rgba(0, 242, 254, 0.05);
}

.rank-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #334155;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.rank-badge.first { background: var(--neon-gold); color: #000; }
.rank-badge.second { background: #c0c0c0; color: #000; }
.rank-badge.third { background: #cd7f32; color: #000; }

.leaderboard-player {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.leaderboard-score {
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: var(--neon-blue);
}

/* Score Submission Form */
.score-submit-form {
    width: 100%;
    max-width: 400px;
    margin-bottom: 30px;
}

.form-input-glow {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    padding: 12px 20px;
    text-align: center;
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.form-input-glow:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
    outline: none;
}

/* Action buttons on overlays */
.overlay-buttons-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-game-action {
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s;
}

/* Confetti Layer */
#confettiCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 11;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 768px) {
    .game-hero {
        padding-top: 120px;
        padding-bottom: 40px;
    }
    .game-hero h1 {
        font-size: 2.3rem;
    }
    .game-hero p {
        font-size: 1rem;
    }
    .game-hud {
        padding: 15px 20px;
    }
    .hud-value {
        font-size: 1.3rem;
    }
    .game-arena {
        height: 400px;
    }
    .game-legend-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .win-title {
        font-size: 2.2rem;
    }
    .summary-score-val {
        font-size: 3rem;
    }
    .overlay-buttons-row {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
    }
    .btn-game-action {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .game-arena {
        height: 350px;
    }
    .game-overlay {
        padding: 20px 15px;
    }
    .hud-label {
        font-size: 0.65rem;
    }
    .hud-value {
        font-size: 1.1rem;
    }
}
