:root {
    --color-gold: #FFD700;
    --color-black: #000000;
    --color-red: #DC2626;
    --color-blue: #2563EB;
    --color-green: #22C55E;
    --color-gray: #4B5563;
    --font-retro: 'Press Start 2P', cursive;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: #111;
    color: var(--color-gold);
    font-family: var(--font-retro);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* CRT EFFECTS */
#hub-container, #game-container {
    width: 800px;
    height: 600px;
    position: relative;
    background-color: var(--color-black);
    border: 20px solid #333;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    overflow: hidden;
}

#game-container::after, #hub-container::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 0, 0.06));
    z-index: 100;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* UI CLASSES */
.hidden {
    display: none !important;
}

.retro-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.game-title {
    font-size: 2.5rem;
    color: var(--color-gold);
    text-shadow: 4px 4px var(--color-red);
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

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

#score-display {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    color: #FFF;
}

/* LEVEL SELECTION */
.level-select {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
}

.level-card {
    border: 4px solid var(--color-gray);
    padding: 2rem;
    cursor: pointer;
    width: 250px;
    transition: transform 0.2s;
}

.level-card:hover {
    transform: translateY(-5px);
}

.level-card.unlocked {
    border-color: var(--color-green);
    background: rgba(34, 197, 94, 0.1);
}

.level-card.locked {
    border-color: var(--color-red);
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(220, 38, 38, 0.1);
}

.teaser-stripes {
    background: repeating-linear-gradient(
        135deg,
        rgba(255, 204, 0, 0.2) 0px,
        rgba(255, 204, 0, 0.2) 14px,
        rgba(0, 0, 0, 0.25) 14px,
        rgba(0, 0, 0, 0.25) 28px
    );
}
.animate-fist-pulse {
    animation: fist-pulse 1.4s ease-in-out infinite;
    display: inline-block;
}
@keyframes fist-pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255,215,0,0.0));}
    50% { transform: scale(1.08); filter: drop-shadow(0 0 10px rgba(255,215,0,0.35));}
}
.glow-text {
    text-shadow: 0 0 6px rgba(255, 221, 0, 0.7), 0 0 16px rgba(255, 221, 0, 0.35);
}
.shake {
    animation: hub-shake 450ms cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes hub-shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

.mode-tip {
    position: fixed;
    background: #fbbf24;
    color: #000;
    border: 4px solid #fff;
    padding: 10px 12px;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    line-height: 1.4;
    z-index: 2000;
    box-shadow: 4px 4px 0 #92400e;
    max-width: 240px;
    text-align: center;
    animation: tip-pop .2s ease-out both;
}
.mode-tip.right::after {
    content: "";
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 12px 8px 0;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
}
.mode-tip.top::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -12px;
    transform: translateX(-50%);
    border-width: 0 8px 12px 8px;
    border-style: solid;
    border-color: transparent transparent #fff transparent;
}
@media (min-width: 768px) {
    .mode-tip { font-size: 12px; }
}
@keyframes tip-pop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.level-card h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #FFF;
}

.level-card p {
    font-size: 0.8rem;
    line-height: 1.5;
}

.instructions {
    font-size: 0.7rem;
    color: #888;
    line-height: 2;
}

/* NEWS TICKER */
#news-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: var(--color-red);
    color: #FFF;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-top: 4px solid #FFF;
    z-index: 1000;
}

.ticker-content {
    white-space: nowrap;
    animation: ticker 20s linear infinite;
    font-size: 0.8rem;
    padding-left: 100%;
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* RESPONSIVE */
@media (max-width: 800px) {
    #hub-container, #game-container {
        width: 100%;
        height: 100%;
        border: none;
        border-radius: 0;
    }
    
    .game-title { font-size: 1.5rem; }
    .level-select { flex-direction: column; gap: 1rem; }
    .level-card { width: 100%; }
}

/* === GLOBAL CRT EFFECTS === */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.10) 0px,
        rgba(0, 0, 0, 0.10) 1px,
        rgba(0, 0, 0, 0.00) 2px,
        rgba(0, 0, 0, 0.00) 4px
    );
    animation: crt-flicker 0.01s infinite alternate;
    will-change: opacity;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(ellipse at center,
        rgba(0,0,0,0) 40%,
        rgba(0,0,0,0.25) 70%,
        rgba(0,0,0,0.45) 100%);
}

@keyframes crt-flicker {
    0% { opacity: 0.96; }
    100% { opacity: 1; }
}

/* Overflow Glow (Tasma) */
#hub, #game-container {
    box-shadow:
        0 0 24px 2px rgba(255,255,255,0.04),
        0 0 120px 24px rgba(59,130,246,0.06),
        0 0 240px 48px rgba(241, 196, 15, 0.05);
}

.victory-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.victory-modal {
    width: min(92vw, 700px);
    background: rgba(0,0,0,0.85);
    border: 6px solid #FFD700;
    border-radius: 8px;
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.victory-header {
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 20px;
    color: #FFD700;
    margin-bottom: 12px;
}
.victory-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 0;
}
.sunburst {
    position: absolute;
    width: 220px;
    height: 220px;
    background: conic-gradient(#FFD700, #ff8c00, #FFD700);
    border-radius: 50%;
    filter: blur(6px);
    animation: spin 6s linear infinite;
    opacity: 0.6;
}
.victory-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 10px 0 18px;
    text-align: center;
    font-size: 14px;
}
.victory-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.btn-pixel {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    padding: 10px 14px;
    background: #333;
    color: #fff;
    border: 3px solid #FFD700;
    cursor: pointer;
}
.btn-pixel:hover {
    transform: translateY(-2px);
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
