/* Modern Glassmorphism & Neon Theme for Blocker */

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

:root {
    --bg-color: #0b0f19;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.3);
    
    /* Neon Colors */
    --neon-pink: #ff2a5f;
    --neon-blue: #00f0ff;
    --neon-green: #00ff66;
    --neon-yellow: #ffee00;
    --neon-red: #ff3333;
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Lock scroll for game */
}

.game-container {
    width: 100%;
    max-width: 450px; /* Standard mobile width */
    height: 100dvh;
    display: grid;
    grid-template-rows: 80px 1fr 140px;
    background: radial-gradient(circle at top right, #1a1b3a, #0b0f19);
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-select: none;
}

/* Glassmorphism UI Panels */
.glass-ui {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
}

/* Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--glass-border);
    z-index: 10;
    position: relative; /* Context for absolute meter */
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(45deg, var(--neon-pink), var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 0 10px var(--neon-blue);
    -webkit-text-fill-color: initial; /* Reset fill for images if inherited */
}

.stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mute-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.2s ease, background 0.2s ease;
}

.mute-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

.mute-btn:active {
    transform: scale(0.9);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-item .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-item .value {
    font-size: 1.25rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Middle Game Area where PixiJS will render */
#canvas-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Footer / Queue UI */
.game-footer {
    height: 140px; /* Taller for vertical lanes selection */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 16px;
    border-top: 1px solid var(--glass-border);
    z-index: 10;
    position: relative; /* Context for children overlays */
}

.lanes-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    max-width: 400px;
    height: 100%;
    position: relative; /* Context for blocked overlay */
}

.lane {
    display: flex;
    flex-direction: column-reverse; /* Bottom to top reading */
    justify-content: flex-end; /* Stack securely and push to the top */
    align-items: center;
    gap: 6px; /* Predictable safe spacing between balls */
    height: 120px;
    width: 50px;
    padding: 6px 0;
    background: var(--glass-bg);
    border-radius: 25px;
    border: 1px solid var(--glass-border);
}

.lane-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 0 10px currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.lane-item.clickable {
    cursor: pointer;
}

.lane-item.clickable:hover {
    transform: scale(1.15);
}

.lane-item.clickable:active {
    transform: scale(0.9);
}

.lane-item.red { color: var(--neon-pink); background-color: rgba(255, 42, 95, 0.3); border: 1px solid var(--neon-pink); }
.lane-item.blue { color: var(--neon-blue); background-color: rgba(0, 240, 255, 0.3); border: 1px solid var(--neon-blue); }
.lane-item.green { color: var(--neon-green); background-color: rgba(0, 255, 102, 0.3); border: 1px solid var(--neon-green); }

.lane-item.passive {
    opacity: 0.5;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 5px currentColor; }
    50% { box-shadow: 0 0 15px currentColor; }
    100% { box-shadow: 0 0 5px currentColor; }
}

.lane-item.clickable {
    animation: pulseGlow 2s infinite ease-in-out;
}

.meter-track {
    width: 100%;
    height: 4px; /* Thinner */
    background: rgba(255, 255, 255, 0.1);
    position: absolute;
    bottom: 0;
    left: 0;
    overflow: hidden;
    z-index: 11;
}

.meter-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-pink));
    box-shadow: 0 0 10px var(--neon-blue);
    transition: width 0.1s linear;
}

.blocked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.82);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    backdrop-filter: blur(5px);
    pointer-events: all;
    border-radius: 20px;
}

.overlay-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--neon-pink);
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--neon-pink);
    margin-bottom: 6px;
}

.overlay-timer {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    margin: 8px 0;
    transition: all 0.2s ease;
}

.overlay-timer.warning {
    color: #ffaa00;
    text-shadow: 0 0 15px #ffaa00;
    transform: scale(1.1);
}

.overlay-timer.critical {
    color: #ff2a5f;
    text-shadow: 0 0 20px #ff2a5f;
    animation: errorPulse 0.5s infinite alternate ease-in-out;
}

@keyframes errorPulse {
    0% { transform: scale(1.1); }
    100% { transform: scale(1.25); }
}

.overlay-stat {
    font-size: 1rem;
    font-weight: bold;
    color: var(--neon-blue);
    text-shadow: 0 0 5px var(--neon-blue);
}

.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Slightly darker than block overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50; /* Above everything */
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
}

.game-over-modal {
    width: 85%;
    max-width: 350px;
    padding: 32px 24px;
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--glass-border);
}

.game-over-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--neon-pink);
    letter-spacing: 4px;
    text-shadow: 0 0 15px var(--neon-pink);
    margin-bottom: 24px;
}

.game-over-stats {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

.restart-btn {
    width: 100%;
    padding: 16px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(135deg, var(--neon-pink), #8a2be2);
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 42, 95, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.restart-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(255, 42, 95, 0.2);
}

.fast-forward-btn {
    position: absolute;
    bottom: 130px; /* Above the launchers panel */
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 32px;
    border-radius: 30px;
    border: 1px solid var(--neon-blue);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 240, 255, 0.3);
    z-index: 40; /* Above normal UI elements, below dialog overlays */
    backdrop-filter: blur(10px);
    animation: glowPulse 2s infinite ease-in-out;
    transition: transform 0.2s ease, opacity 0.3s ease;
}

.fast-forward-btn:active {
    transform: translateX(-50%) scale(0.95);
}

@keyframes glowPulse {
    0% { box-shadow: 0 5px 15px rgba(0, 217, 255, 0.3); }
    50% { box-shadow: 0 5px 25px rgba(0, 217, 255, 0.6); }
    100% { box-shadow: 0 5px 15px rgba(0, 217, 255, 0.3); }
}

/* About Screen Modal Overlay */
.about-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 60; /* Above game over */
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
}

.about-modal {
    width: 90%;
    max-width: 400px;
    max-height: 80dvh;
    padding: 32px 24px;
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--glass-border);
    overflow-y: auto;
}

.about-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--neon-pink);
    letter-spacing: 2px;
    text-shadow: 0 0 15px var(--neon-pink);
    margin-bottom: 24px;
}

.about-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.about-section h3 {
    font-size: 1.1rem;
    color: var(--neon-blue);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 6px;
}

.about-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.about-section li {
    font-size: 0.95rem;
    color: #fff;
    line-height: 1.4;
}

.install-guide {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.install-guide em {
    color: var(--neon-yellow);
    font-style: normal;
}
