:root {
    --bg-color: #050510;
    --track-color: #1a1a3a;
    --neon-pink: #ff007f;
    --neon-cyan: #00f2ff;
    --neon-purple: #bc13fe;
    --neon-yellow: #fefe33;
    --text: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    user-select: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    background: linear-gradient(to bottom, #050510, #101025);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

/* HUD */
#hud {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 100;
}

.hud-item {
    background: rgba(0,0,0,0.6);
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#level-container { border-color: var(--neon-cyan); }
#score-container { border-color: var(--neon-yellow); }

#word-display {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
    min-width: 150px;
}

#word-emoji {
    font-size: 2.8rem;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
    margin-bottom: 5px;
    animation: emojiHover 3s ease-in-out infinite;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.emoji-pop {
    animation: emojiPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes emojiHover {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes emojiPop {
    0% { transform: scale(0.5) rotate(-20deg); opacity: 0; }
    50% { transform: scale(1.3) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

#word-target {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 2px;
}

.label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #8fa3c2;
    margin-bottom: 2px;
}

#score, #combo, #level {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--neon-yellow);
}

#level { color: var(--neon-cyan); }

/* LEVEL UP MESSAGE */
.level-up-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 900;
    color: var(--neon-yellow);
    text-shadow: 0 0 30px var(--neon-yellow);
    z-index: 2000;
    animation: levelPop 1.5s ease-out forwards;
    pointer-events: none;
}

@keyframes levelPop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -80%) scale(0.8); opacity: 0; }
}

/* TRACK */
#track {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    perspective: 1200px;
    display: flex;
    justify-content: center;
}

.lane {
    flex: 1;
    height: 100%;
    border-right: 1px solid rgba(0, 242, 255, 0.05);
    position: relative;
}

.lane:last-child { border-right: none; }

#track::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(0, 242, 255, 0.1) 2px, transparent 2px);
    background-size: 100% 50px;
    animation: roadFlow 2s linear infinite;
    pointer-events: none;
}

@keyframes roadFlow {
    from { background-position-y: 0; }
    to { background-position-y: 50px; }
}

/* PLAYER */
#player {
    position: absolute;
    bottom: 20px;
    width: 60px;
    height: 60px;
    z-index: 50;
    transition: left 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.player-model {
    font-size: 40px;
    filter: drop-shadow(0 0 10px var(--neon-cyan));
    animation: hover 2s ease-in-out infinite;
}

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

.thruster {
    position: absolute;
    bottom: -10px;
    width: 20px;
    height: 30px;
    background: linear-gradient(to top, transparent, var(--neon-cyan));
    filter: blur(5px);
    opacity: 0.6;
    animation: flame 0.1s infinite alternate;
}

@keyframes flame {
    from { height: 25px; opacity: 0.4; }
    to { height: 35px; opacity: 0.8; }
}

/* PORTALS */
.portal {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 100px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    border: 3px solid var(--neon-purple);
    box-shadow: 0 0 20px var(--neon-purple);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 10px white;
}

/* REACTION TEXT */
@keyframes floatUp {
    0% { opacity: 0; transform: translate(-50%, 0); }
    10% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -60px); }
}

/* OVERLAYS */
.overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 5, 16, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
}

.hidden { display: none !important; }

h1 {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(to right, var(--neon-cyan), var(--neon-pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 20px;
}

.victory-text {
    background: linear-gradient(to right, var(--neon-cyan), var(--neon-yellow)) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
}

#feedback-word-container {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid var(--neon-cyan);
}

#correct-word-reveal {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin-top: 10px;
}

.syllable-highlight {
    color: var(--neon-cyan);
    text-shadow: 0 0 15px var(--neon-cyan);
    text-decoration: underline;
}

.main-btn {
    margin-top: 40px;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 900;
    border: none;
    border-radius: 30px;
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 20px var(--neon-cyan);
    cursor: pointer;
    transition: transform 0.2s;
}

.main-btn:hover { transform: scale(1.1); }

.fail-text { color: var(--neon-pink); }
