/* HEIST CLUB: Parts Match - Cyberpunk Styling */

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

:root {
    --neon-pink: #ff006e;
    --neon-cyan: #00f5ff;
    --neon-yellow: #ffdd00;
    --neon-green: #39ff14;
    --neon-orange: #ff6b35;
    --neon-purple: #bf00ff;
    --dark-bg: #0a0a0f;
    --darker-bg: #050508;
    --panel-bg: rgba(10, 10, 20, 0.9);
    --grid-line: rgba(0, 245, 255, 0.1);
}

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

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--dark-bg);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scanline effect overlay */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    z-index: 1000;
}

#game-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    position: relative;
    background:
        radial-gradient(ellipse at center, rgba(0, 245, 255, 0.03) 0%, transparent 70%),
        linear-gradient(180deg, var(--darker-bg) 0%, var(--dark-bg) 50%, var(--darker-bg) 100%);
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ===== TITLE SCREEN ===== */
#title-screen {
    background:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v60H0z' fill='none'/%3E%3Cpath d='M0 30h60M30 0v60' stroke='rgba(0,245,255,0.05)' stroke-width='1'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 30% 20%, rgba(255, 0, 110, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(0, 245, 255, 0.1) 0%, transparent 50%),
        var(--dark-bg);
}

.title-content {
    text-align: center;
    z-index: 10;
}

h1.glitch {
    font-family: 'Orbitron', sans-serif;
    font-size: 5rem;
    font-weight: 900;
    color: var(--neon-cyan);
    text-shadow:
        0 0 10px var(--neon-cyan),
        0 0 20px var(--neon-cyan),
        0 0 40px var(--neon-cyan),
        0 0 80px var(--neon-cyan);
    letter-spacing: 0.2em;
    animation: flicker 3s infinite;
    position: relative;
}

h1.glitch::before,
h1.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

h1.glitch::before {
    color: var(--neon-pink);
    animation: glitch-1 0.3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    transform: translateX(-2px);
}

h1.glitch::after {
    color: var(--neon-yellow);
    animation: glitch-2 0.3s infinite;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    transform: translateX(2px);
}

@keyframes glitch-1 {
    0%, 100% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
}

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

@keyframes flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.8; }
    94% { opacity: 1; }
    96% { opacity: 0.9; }
    97% { opacity: 1; }
}

.subtitle {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink);
    letter-spacing: 0.5em;
    margin-top: 0.5rem;
}

.tagline {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1rem;
    letter-spacing: 0.3em;
}

.neon-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    padding: 1rem 3rem;
    margin-top: 3rem;
    background: transparent;
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.neon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.neon-btn:hover {
    background: rgba(0, 245, 255, 0.1);
    box-shadow:
        0 0 20px var(--neon-cyan),
        inset 0 0 20px rgba(0, 245, 255, 0.1);
    text-shadow: 0 0 10px var(--neon-cyan);
}

.neon-btn:hover::before {
    left: 100%;
}

.credits {
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

/* ===== TEAM SELECT SCREEN ===== */
#team-screen h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 20px var(--neon-cyan);
    margin-bottom: 3rem;
    letter-spacing: 0.2em;
}

.team-grid {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 2rem;
}

.team-card {
    width: 300px;
    background: var(--panel-bg);
    border: 1px solid rgba(0, 245, 255, 0.3);
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan));
}

.team-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-cyan);
    box-shadow:
        0 10px 40px rgba(0, 245, 255, 0.2),
        inset 0 0 30px rgba(0, 245, 255, 0.05);
}

.team-emblem {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jaguario-emblem {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid var(--neon-orange);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
}

.jaguario-emblem::after {
    content: '☠';
    font-size: 2.5rem;
}

.loscreeps-emblem {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid var(--neon-purple);
    box-shadow: 0 0 20px rgba(191, 0, 255, 0.5);
}

.loscreeps-emblem::after {
    content: '◈';
    font-size: 2.5rem;
    color: var(--neon-purple);
}

.raze-emblem {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid var(--neon-green);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.5);
}

.raze-emblem::after {
    content: '⚡';
    font-size: 2.5rem;
}

.team-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: var(--neon-cyan);
    margin-bottom: 0.5rem;
}

.team-location {
    color: var(--neon-pink);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.team-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.team-jockey {
    color: var(--neon-yellow);
    font-size: 0.9rem;
}

/* ===== BRIEFING SCREEN ===== */
.briefing-content {
    text-align: center;
    max-width: 600px;
    padding: 2rem;
}

#briefing-screen h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--neon-pink);
    text-shadow: 0 0 20px var(--neon-pink);
    margin-bottom: 2rem;
    letter-spacing: 0.2em;
}

#briefing-details {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 0, 110, 0.3);
    padding: 2rem;
    margin-bottom: 2rem;
}

.briefing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.race-number {
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-cyan);
    font-size: 1rem;
}

.race-name {
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-yellow);
    font-size: 1.2rem;
}

.briefing-body p {
    text-align: left;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
}

.upgrade-goal {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.goal-parts {
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-green);
    font-size: 1.3rem;
    margin-top: 0.5rem;
}

.time-limit {
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-yellow);
    font-size: 1.1rem;
    margin-top: 0.3rem;
}

/* Target Bonus Display on Briefing */
.target-bonus {
    background: linear-gradient(135deg, rgba(255, 0, 110, 0.2) 0%, rgba(255, 107, 53, 0.2) 100%);
    border: 2px solid var(--neon-pink);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    position: relative;
    animation: target-pulse 2s ease-in-out infinite;
}

.target-bonus::before {
    content: '★ STRATEGY BONUS ★';
    position: absolute;
    top: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-bg);
    padding: 0 0.8rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    color: var(--neon-pink);
    letter-spacing: 0.1em;
}

.target-bonus-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
    text-align: center;
}

@keyframes target-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 0, 110, 0.3); }
    50% { box-shadow: 0 0 25px rgba(255, 0, 110, 0.6); }
}

/* ===== GAME SCREEN ===== */
#game-screen {
    padding: 1rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    padding: 1rem 2rem;
    background: var(--panel-bg);
    border-bottom: 2px solid var(--neon-cyan);
    margin-bottom: 1rem;
}

.team-info {
    display: flex;
    flex-direction: column;
}

#current-team-name {
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-cyan);
    font-size: 1.2rem;
}

#current-jockey {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

#current-race {
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-pink);
}

.game-main {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
}

.stats-panel {
    width: 200px;
    background: var(--panel-bg);
    border: 1px solid rgba(0, 245, 255, 0.2);
    padding: 1.5rem;
}

.stats-panel h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: var(--neon-cyan);
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: 0.1em;
}

.stat-bar {
    margin-bottom: 1rem;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-bottom: 0.3rem;
}

.bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.2rem;
}

.bar-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

.engine-bar { background: linear-gradient(90deg, var(--neon-orange), #ff8c42); }
.armor-bar { background: linear-gradient(90deg, #4a90d9, var(--neon-cyan)); }
.tech-bar { background: linear-gradient(90deg, var(--neon-purple), #d742f5); }
.nitro-bar { background: linear-gradient(90deg, var(--neon-green), #7fff00); }
.handling-bar { background: linear-gradient(90deg, var(--neon-yellow), #ffd700); }

/* Stat bar damage flash - when race events hit */
.bar-fill.stat-damage {
    animation: stat-damage-flash 0.3s ease-out;
}

@keyframes stat-damage-flash {
    0% { filter: brightness(1); }
    50% { filter: brightness(0.3) saturate(0.5); box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.8); }
    100% { filter: brightness(1); }
}

/* Stat bar boost flash - when matches repair/upgrade */
.bar-fill.stat-boost {
    animation: stat-boost-flash 0.4s ease-out;
}

@keyframes stat-boost-flash {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.8) saturate(1.5); box-shadow: 0 0 15px currentColor; }
    100% { filter: brightness(1); }
}

/* Smooth transitions for stat changes */
.bar-fill {
    transition: width 0.3s ease-out;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    color: var(--neon-cyan);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.legend-item.special {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.engine-icon { background: linear-gradient(135deg, #ff6b35, #ff8c42); }
.engine-icon::after { content: '⚙'; }

.armor-icon { background: linear-gradient(135deg, #4a90d9, #00f5ff); }
.armor-icon::after { content: '🛡'; }

.tech-icon { background: linear-gradient(135deg, #bf00ff, #d742f5); }
.tech-icon::after { content: '💾'; }

.nitro-icon { background: linear-gradient(135deg, #39ff14, #7fff00); }
.nitro-icon::after { content: '⚡'; }

.handling-icon { background: linear-gradient(135deg, #ffdd00, #ffd700); }
.handling-icon::after { content: '◎'; }

.wild-icon {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
    animation: wild-pulse 1s infinite;
}
.wild-icon::after { content: '₿'; }

@keyframes wild-pulse {
    0%, 100% { box-shadow: 0 0 10px var(--neon-cyan); }
    50% { box-shadow: 0 0 20px var(--neon-pink); }
}

/* Game Board Container */
.game-board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-display {
    display: flex;
    gap: 3rem;
    margin-bottom: 1rem;
    padding: 1rem 2rem;
    background: var(--panel-bg);
    border: 1px solid rgba(0, 245, 255, 0.3);
}

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

.score-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1em;
}

.score-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

#goal {
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}

#moves {
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
}

/* Timer display */
.timer-item #timer {
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink);
}

.timer-item #timer.warning {
    color: var(--neon-orange);
    text-shadow: 0 0 15px var(--neon-orange);
    animation: timer-warning 0.5s ease-in-out infinite;
}

.timer-item #timer.critical {
    color: #ff0000;
    text-shadow: 0 0 20px #ff0000;
    animation: timer-critical 0.25s ease-in-out infinite;
}

@keyframes timer-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes timer-critical {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Target Indicator during game */
.target-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, rgba(255, 0, 110, 0.15) 0%, rgba(255, 107, 53, 0.15) 100%);
    border: 1px solid var(--neon-pink);
    border-radius: 4px;
}

.target-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    color: var(--neon-pink);
    letter-spacing: 0.1em;
}

.target-type {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
    text-transform: uppercase;
    animation: bonus-glow 1.5s ease-in-out infinite;
}

@keyframes bonus-glow {
    0%, 100% { text-shadow: 0 0 10px var(--neon-yellow); }
    50% { text-shadow: 0 0 20px var(--neon-yellow), 0 0 30px var(--neon-orange); }
}

/* Target bonus flash animation */
.target-indicator.bonus-flash {
    animation: target-bonus-flash 0.3s ease-in-out 3;
    background: linear-gradient(135deg, rgba(255, 221, 0, 0.4) 0%, rgba(255, 107, 53, 0.4) 100%);
}

@keyframes target-bonus-flash {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px var(--neon-yellow);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 25px var(--neon-yellow), 0 0 40px var(--neon-orange);
    }
}

/* Bonus match indicator */
.tile.bonus-match {
    animation: bonus-explode 0.5s forwards;
}

@keyframes bonus-explode {
    0% { transform: scale(1); }
    30% { transform: scale(1.4); box-shadow: 0 0 30px var(--neon-yellow); }
    100% { transform: scale(0); opacity: 0; }
}

/* Game Board */
#game-board {
    display: grid;
    grid-template-columns: repeat(8, 55px);
    grid-template-rows: repeat(8, 55px);
    gap: 4px;
    padding: 15px;
    background:
        linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9)),
        repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(0, 245, 255, 0.03) 10px, rgba(0, 245, 255, 0.03) 11px),
        repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(0, 245, 255, 0.03) 10px, rgba(0, 245, 255, 0.03) 11px);
    border: 2px solid var(--neon-cyan);
    box-shadow:
        0 0 30px rgba(0, 245, 255, 0.3),
        inset 0 0 50px rgba(0, 245, 255, 0.1);
    position: relative;
}

#game-board::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--neon-pink), var(--neon-cyan), var(--neon-pink));
    z-index: -1;
    filter: blur(10px);
    opacity: 0.5;
}

.tile {
    width: 55px;
    height: 55px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    user-select: none;
}

.tile::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 6px;
    background: inherit;
    filter: brightness(1.2);
    z-index: -1;
}

.tile:hover {
    transform: scale(1.05);
    z-index: 10;
}

.tile.selected {
    transform: scale(1.1);
    box-shadow: 0 0 25px currentColor;
    animation: selected-pulse 0.5s infinite;
}

@keyframes selected-pulse {
    0%, 100% { box-shadow: 0 0 20px currentColor; }
    50% { box-shadow: 0 0 35px currentColor; }
}

.tile.matched {
    animation: match-explode 0.4s forwards;
}

@keyframes match-explode {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

.tile.falling {
    animation: tile-fall 0.3s ease-out;
}

@keyframes tile-fall {
    0% { transform: translateY(-60px); opacity: 0; }
    60% { transform: translateY(5px); }
    100% { transform: translateY(0); opacity: 1; }
}

/* Tile types */
.tile.engine {
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.5);
}
.tile.engine::after { content: '⚙'; }

.tile.armor {
    background: linear-gradient(135deg, #4a90d9, #00f5ff);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.5);
}
.tile.armor::after { content: '🛡'; }

.tile.tech {
    background: linear-gradient(135deg, #bf00ff, #d742f5);
    color: #fff;
    box-shadow: 0 0 15px rgba(191, 0, 255, 0.5);
}
.tile.tech::after { content: '💾'; }

.tile.nitro {
    background: linear-gradient(135deg, #39ff14, #7fff00);
    color: #000;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.5);
}
.tile.nitro::after { content: '⚡'; }

.tile.handling {
    background: linear-gradient(135deg, #ffdd00, #ffd700);
    color: #000;
    box-shadow: 0 0 15px rgba(255, 221, 0, 0.5);
}
.tile.handling::after { content: '◎'; }

.tile.wild {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink), var(--neon-yellow));
    background-size: 200% 200%;
    animation: wild-gradient 2s ease infinite;
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.7);
}
.tile.wild::after { content: '₿'; }

@keyframes wild-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.combo-display {
    height: 40px;
    margin-top: 1rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--neon-pink);
    text-shadow: 0 0 20px var(--neon-pink);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.combo-display.show {
    opacity: 1;
    animation: combo-pop 0.5s ease;
}

@keyframes combo-pop {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ===== RESULT SCREEN ===== */
.result-content, .season-content {
    text-align: center;
    max-width: 600px;
    padding: 2rem;
}

#result-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
}

#result-title.victory {
    color: var(--neon-green);
    text-shadow: 0 0 30px var(--neon-green);
}

#result-title.defeat {
    color: var(--neon-pink);
    text-shadow: 0 0 30px var(--neon-pink);
}

#result-story, #season-story {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: left;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8);
}

#result-story p, #season-story p {
    margin-bottom: 1rem;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.result-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-name {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

.stat-val {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--neon-cyan);
}

#season-screen h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 30px var(--neon-yellow);
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 1100px) {
    .game-main {
        flex-direction: column;
        align-items: center;
    }

    .stats-panel {
        width: 100%;
        max-width: 500px;
    }

    .left-panel {
        order: 2;
    }

    .right-panel {
        display: none;
    }
}

@media (max-width: 600px) {
    h1.glitch {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    #game-board {
        grid-template-columns: repeat(8, 40px);
        grid-template-rows: repeat(8, 40px);
        gap: 2px;
        padding: 10px;
    }

    .tile {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .team-grid {
        flex-direction: column;
    }

    .score-display {
        gap: 1.5rem;
        padding: 0.8rem 1rem;
    }

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

/* ===== LORE SCREEN ===== */
#lore-screen {
    background:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v60H0z' fill='none'/%3E%3Cpath d='M0 30h60M30 0v60' stroke='rgba(255,0,110,0.05)' stroke-width='1'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 20% 30%, rgba(255, 0, 110, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(0, 245, 255, 0.08) 0%, transparent 50%),
        var(--dark-bg);
    padding: 2rem;
    overflow-y: auto;
}

.lore-content {
    max-width: 800px;
    width: 100%;
    z-index: 10;
}

.lore-section {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 0, 110, 0.3);
    padding: 2rem;
    margin-bottom: 0;
    position: relative;
}

.lore-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--neon-pink), var(--neon-cyan));
}

.lore-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px var(--neon-cyan);
    margin-bottom: 1.5rem;
    letter-spacing: 0.15em;
}

.lore-text {
    line-height: 2;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
}

.lore-text p {
    margin-bottom: 1.2rem;
}

.lore-text p:last-child {
    margin-bottom: 0;
}

.lore-text .highlight {
    color: var(--neon-cyan);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

.lore-text .highlight-danger {
    color: var(--neon-pink);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 0, 110, 0.5);
}

.lore-text .highlight-stat {
    color: var(--neon-yellow);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
}

.lore-divider {
    height: 30px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(0, 245, 255, 0.1) 50%,
        transparent 100%);
    position: relative;
}

.lore-divider::before {
    content: '◆';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--neon-cyan);
    font-size: 0.8rem;
    text-shadow: 0 0 10px var(--neon-cyan);
}

.lore-stakes {
    border-color: rgba(255, 221, 0, 0.3);
}

.lore-stakes::before {
    background: linear-gradient(180deg, var(--neon-yellow), var(--neon-orange));
}

.lore-stakes .lore-title {
    color: var(--neon-yellow);
    text-shadow: 0 0 15px var(--neon-yellow);
}

.lore-tagline {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 15px var(--neon-yellow);
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 221, 0, 0.2);
}

#lore-continue-btn {
    display: block;
    margin: 2rem auto 0;
}

.team-screen-subtitle {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2rem;
    margin-top: -2rem;
    letter-spacing: 0.2em;
}

/* ===== JOCKEY PROFILE SCREEN ===== */
#jockey-screen {
    background:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v60H0z' fill='none'/%3E%3Cpath d='M0 30h60M30 0v60' stroke='rgba(0,245,255,0.05)' stroke-width='1'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 70% 20%, rgba(0, 245, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 80%, rgba(255, 0, 110, 0.08) 0%, transparent 50%),
        var(--dark-bg);
    padding: 2rem;
}

.jockey-content {
    max-width: 700px;
    width: 100%;
    z-index: 10;
}

.jockey-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(0, 245, 255, 0.3);
}

.jockey-team-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.jockey-team-badge.jaguario {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 3px solid var(--neon-orange);
    box-shadow: 0 0 25px rgba(255, 107, 53, 0.5);
}
.jockey-team-badge.jaguario::after { content: '☠'; }

.jockey-team-badge.loscreeps {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 3px solid var(--neon-purple);
    box-shadow: 0 0 25px rgba(191, 0, 255, 0.5);
}
.jockey-team-badge.loscreeps::after { content: '◈'; color: var(--neon-purple); }

.jockey-team-badge.raze {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 3px solid var(--neon-green);
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.5);
}
.jockey-team-badge.raze::after { content: '⚡'; }

.jockey-title-area {
    flex-grow: 1;
}

#jockey-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 20px var(--neon-cyan);
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.jockey-role {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink);
    letter-spacing: 0.3em;
    margin-bottom: 0.2rem;
}

.jockey-team-name {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.jockey-profile {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.jockey-portrait {
    width: 200px;
    height: 250px;
    background: var(--panel-bg);
    border: 2px solid rgba(0, 245, 255, 0.3);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.jockey-portrait::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.8) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 245, 255, 0.03) 2px, rgba(0, 245, 255, 0.03) 4px);
}

.jockey-portrait::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan));
}

/* Portrait character helmets - full-face racing helmet style */

/* Base helmet shape - shared structure */
.jockey-portrait.dexx,
.jockey-portrait.javier,
.jockey-portrait.jaila {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dexx - Matte black with orange Death Skull */
.jockey-portrait.dexx {
    background:
        linear-gradient(180deg, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        var(--panel-bg);
}
.jockey-portrait.dexx::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 130px;
    background: #1a1a1a;
    border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
    box-shadow:
        0 0 30px rgba(255, 107, 53, 0.4),
        inset -15px 0 25px rgba(0, 0, 0, 0.6),
        inset 5px 10px 15px rgba(50, 50, 50, 0.3);
}
/* Visor */
.jockey-portrait.dexx::after {
    content: '';
    position: absolute;
    top: 46%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75px;
    height: 45px;
    background: linear-gradient(180deg, rgba(255, 107, 53, 0.6) 0%, rgba(255, 107, 53, 0.3) 100%);
    border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
    border: 2px solid rgba(255, 107, 53, 0.8);
    box-shadow:
        0 0 15px rgba(255, 107, 53, 0.5),
        inset 0 -5px 15px rgba(0, 0, 0, 0.4);
}
/* Emblem on helmet - using additional element */
.jockey-portrait.dexx .helmet-emblem,
.jockey-portrait.dexx::before {
    position: absolute;
}

/* Javier - Glossy white with purple Monsoon diamond */
.jockey-portrait.javier {
    background:
        linear-gradient(180deg, rgba(191, 0, 255, 0.1) 0%, transparent 50%),
        var(--panel-bg);
}
.jockey-portrait.javier::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 130px;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 30%, #c0c0c0 70%, #a0a0a0 100%);
    border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
    box-shadow:
        0 0 35px rgba(191, 0, 255, 0.5),
        inset -15px 0 25px rgba(150, 150, 150, 0.4),
        inset 10px 15px 20px rgba(255, 255, 255, 0.6);
}
/* Visor */
.jockey-portrait.javier::after {
    content: '';
    position: absolute;
    top: 46%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75px;
    height: 45px;
    background: linear-gradient(180deg, rgba(191, 0, 255, 0.7) 0%, rgba(100, 0, 180, 0.4) 100%);
    border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
    border: 2px solid rgba(191, 0, 255, 0.9);
    box-shadow:
        0 0 20px rgba(191, 0, 255, 0.6),
        inset 0 -5px 15px rgba(50, 0, 100, 0.3);
}

/* Jaila - Weathered dark with green lightning */
.jockey-portrait.jaila {
    background:
        linear-gradient(180deg, rgba(57, 255, 20, 0.1) 0%, transparent 50%),
        var(--panel-bg);
}
.jockey-portrait.jaila::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 130px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #0d0d0d 100%);
    border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
    box-shadow:
        0 0 30px rgba(57, 255, 20, 0.4),
        inset -15px 0 25px rgba(0, 0, 0, 0.7),
        inset 5px 10px 15px rgba(57, 255, 20, 0.1);
}
/* Visor - slightly cracked look */
.jockey-portrait.jaila::after {
    content: '';
    position: absolute;
    top: 46%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75px;
    height: 45px;
    background:
        linear-gradient(135deg, transparent 45%, rgba(57, 255, 20, 0.2) 46%, transparent 47%),
        linear-gradient(180deg, rgba(57, 255, 20, 0.6) 0%, rgba(30, 150, 10, 0.3) 100%);
    border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
    border: 2px solid rgba(57, 255, 20, 0.8);
    box-shadow:
        0 0 15px rgba(57, 255, 20, 0.5),
        inset 0 -5px 15px rgba(0, 0, 0, 0.4);
}

/* Helmet visor glow animation */
.jockey-portrait.dexx::after,
.jockey-portrait.javier::after,
.jockey-portrait.jaila::after {
    animation: visor-glow 3s ease-in-out infinite;
}

@keyframes visor-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Helmet emblems - positioned on forehead of helmet */
.jockey-portrait.dexx .helmet-emblem {
    position: absolute;
    top: 28%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    color: var(--neon-orange);
    text-shadow: 0 0 10px var(--neon-orange);
    z-index: 5;
}
.jockey-portrait.javier .helmet-emblem {
    position: absolute;
    top: 26%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: var(--neon-purple);
    text-shadow: 0 0 12px var(--neon-purple);
    z-index: 5;
}
.jockey-portrait.jaila .helmet-emblem {
    position: absolute;
    top: 26%;
    left: 50%;
    transform: translateX(-50%) rotate(-10deg);
    font-size: 1.6rem;
    color: var(--neon-green);
    text-shadow: 0 0 12px var(--neon-green), 0 0 25px var(--neon-green);
    z-index: 5;
}

.jockey-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

.jockey-origin, .jockey-style {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
}

.detail-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.2em;
    margin-bottom: 0.3rem;
}

.detail-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--neon-cyan);
}

.jockey-story {
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.95) 0%, rgba(30, 25, 40, 0.95) 100%);
    border: 1px solid rgba(255, 0, 110, 0.3);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    line-height: 2;
    color: #d4d4d8;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.jockey-story::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--neon-pink), var(--neon-cyan));
}

.jockey-story p {
    margin-bottom: 1rem;
}

.jockey-story p:last-child {
    margin-bottom: 0;
}

.jockey-story .story-highlight {
    color: var(--neon-pink);
    font-weight: 700;
}

.jockey-story .story-location {
    color: var(--neon-cyan);
    font-weight: 600;
}

.jockey-quote {
    background: linear-gradient(135deg, rgba(40, 35, 20, 0.9) 0%, rgba(30, 28, 15, 0.9) 100%);
    border-left: 3px solid var(--neon-yellow);
    border-right: 3px solid var(--neon-yellow);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    font-style: italic;
    color: #e8e8e0;
    font-size: 1.15rem;
    line-height: 1.7;
    text-align: center;
}

.jockey-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.neon-btn.secondary {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
}

.neon-btn.secondary:hover {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    background: rgba(255, 0, 110, 0.1);
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.3);
}

/* Responsive for lore and jockey screens */
@media (max-width: 700px) {
    .lore-section {
        padding: 1.5rem;
    }

    .lore-title {
        font-size: 1.2rem;
    }

    .jockey-header {
        flex-direction: column;
        text-align: center;
    }

    .jockey-profile {
        flex-direction: column;
        align-items: center;
    }

    .jockey-portrait {
        width: 150px;
        height: 180px;
    }

    .jockey-details {
        width: 100%;
    }

    #jockey-name {
        font-size: 1.5rem;
    }

    .jockey-buttons {
        flex-direction: column;
    }

    .neon-btn {
        width: 100%;
    }
}
