.emoji-rush-section {
    width: 100%;
    margin-bottom: 30px;
}

.emoji-rush-card {
    padding: 24px 24px 20px;
}

.emoji-rush-title {
    font-size: 26px;
    font-weight: 900;
    color: var(--text-primary);
    text-align: center;
    margin: 0 0 6px 0;
}

.emoji-rush-subtitle {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

.emoji-rush-hud {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.emoji-rush-hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 12px;
    background: var(--chip-bg);
    border: 2px solid var(--chip-border);
    border-radius: 14px;
}

.emoji-rush-hud-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.emoji-rush-hud-value {
    font-size: 18px;
    font-weight: 900;
    color: var(--accent-1);
}

.emoji-rush-game-wrapper {
    margin: 0 auto 14px;
    max-width: 420px;
}

.emoji-rush-game {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    min-height: 360px;
    max-height: 520px;
    margin: 0 auto;
    border-radius: 22px;
    overflow: hidden;
    /* Use theme colors so road matches current theme */
    background:
        radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--accent-1) 20%, transparent) 0%, transparent 55%),
        radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--accent-2) 22%, transparent) 0%, transparent 60%),
        linear-gradient(180deg,
            color-mix(in srgb, var(--card-bg) 80%, #000 20%) 0%,
            color-mix(in srgb, var(--panel-bg) 85%, #000 15%) 100%
        );
    border: 3px solid color-mix(in srgb, var(--card-border-color) 80%, rgba(255,255,255,0.18) 20%);
    box-shadow: var(--card-shadow);
}

/* Make road brighter in Neon theme so lanes/emojis are clearly visible */
html[data-theme="neon"] .emoji-rush-game {
    background:
        radial-gradient(circle at 15% 0%, rgba(34, 211, 238, 0.28) 0%, transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(255, 61, 127, 0.22) 0%, transparent 60%),
        linear-gradient(180deg, #030712 0%, #020617 100%);
    border-color: rgba(34, 211, 238, 0.45);
}

/* road animation overlay removed for cleaner top edge */
.emoji-rush-game.is-running::before {
    content: none;
}

.emoji-rush-lane {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 33.3333%;
    border-left: 1px dashed rgba(255,255,255,0.18);
    border-right: 1px dashed rgba(255,255,255,0.18);
    pointer-events: none;
}

.emoji-rush-lane:nth-child(1) { left: 0; }
.emoji-rush-lane:nth-child(2) { left: 33.3333%; }
.emoji-rush-lane:nth-child(3) { left: 66.6666%; }

.emoji-rush-player {
    position: absolute;
    bottom: 10px;
    width: 32px;
    height: 32px;
    margin-left: -16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #ffffff;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
    transform: translateZ(0);
}

.emoji-rush-emoji {
    position: absolute;
    width: 30px;
    height: 30px;
    margin-left: -15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #ffffff;
    /* keep emoji itself clean, aura handles highlight */
    text-shadow: none;
    background: transparent;
    border-radius: 999px;
    will-change: transform;
    overflow: visible;
}

.emoji-rush-emoji::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid transparent;
    opacity: 0;
    pointer-events: none;
}

.emoji-rush-emoji.is-good::after {
    border-color: rgba(34, 197, 94, 0.7);
    animation: emojiAuraGood 2.2s ease-out infinite;
}

.emoji-rush-emoji.is-bad {
    /* keep emoji clean; aura handles danger highlight */
    background: transparent;
    box-shadow: none;
    border: none;
    transform: scale(1);
}

/* (emojiRushWaves kept only in case we re-enable road animation later) */

@keyframes emojiAuraBad {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.9);
        opacity: 0;
    }
    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

@keyframes emojiAuraGood {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    70% {
        transform: scale(1.6);
        opacity: 0;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.emoji-rush-emoji.is-bad::after {
    border-color: rgba(248, 113, 113, 0.95);
    animation: emojiAuraBad 1.6s ease-out infinite;
}

.emoji-rush-hit-explosion {
    position: absolute;
    width: 42px;
    height: 42px;
    margin-left: -21px;
    margin-top: -21px;
    border-radius: 999px;
    border: 2px solid rgba(248, 113, 113, 0.9);
    box-shadow:
        0 0 14px rgba(248, 113, 113, 0.9),
        0 0 24px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    animation: emojiRushHitExplode 350ms ease-out forwards;
}

@keyframes emojiRushHitExplode {
    0% {
        transform: scale(0.5);
        opacity: 0.9;
    }
    60% {
        transform: scale(1.5);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.emoji-rush-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.emoji-rush-start-btn {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid var(--modal-btn-border);
    background: linear-gradient(135deg, var(--accent-3), var(--accent-1));
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.emoji-rush-start-icon {
    font-size: 20px;
    line-height: 1;
}

.emoji-rush-start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.28);
}

.emoji-rush-start-btn:active {
    transform: translateY(1px) scale(0.97);
}

.emoji-rush-controls-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    width: 100%;
}

.emoji-rush-controls-hint .mobile-only {
    display: none;
}

.emoji-rush-controls-hint .desktop-only {
    display: inline;
}

/* Emoji Rush stats popup tweaks */
.emoji-rush-stats-popup .stats-popup {
    max-width: 480px;
}

/* Emoji Rush result modal */
.emoji-rush-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.emoji-rush-modal {
    background: var(--modal-bg);
    border-radius: 18px;
    border: 2px solid var(--modal-border-color);
    padding: 28px 22px 20px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--modal-shadow);
}

.emoji-rush-modal-emoji {
    font-size: 3rem;
    margin-bottom: 14px;
}

.emoji-rush-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.emoji-rush-modal-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.emoji-rush-modal-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    padding: 10px 12px;
    background: var(--chip-bg);
    border-radius: 10px;
}

.emoji-rush-modal-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.emoji-rush-modal-stat-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.emoji-rush-modal-stat-value {
    font-weight: 700;
    color: var(--accent-1);
}

.emoji-rush-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.emoji-rush-modal-btn {
    padding: 10px 18px;
    border-radius: 16px;
    border: 2px solid var(--modal-btn-border);
    background: linear-gradient(135deg, var(--accent-3), var(--accent-1));
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: var(--modal-btn-shadow);
    text-decoration: none;
}

.emoji-rush-controls-wrapper {
    position: relative;
    display: flex;
    justify-content: center;   /* default: keep play/toggle centered when controls hidden */
    align-items: center;
    margin-top: 6px;
    width: 100%;
    box-sizing: border-box;
}

.emoji-rush-mobile-controls {
    display: none; /* JS toggles this like other games */
    margin: 0;
    justify-content: center;
    gap: 16px;
}

.emoji-rush-mobile-btn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 2px solid var(--modal-btn-border);
    background: var(--chip-bg);
    color: var(--text-primary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.emoji-rush-mobile-btn:active {
    transform: translateY(1px) scale(0.96);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.emoji-rush-controls-toggle-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.emoji-rush-controls-toggle-btn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 2px solid var(--modal-btn-border);
    background: var(--chip-bg);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.emoji-rush-controls-toggle-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    border-color: var(--accent-1);
}

.emoji-rush-controls-toggle-btn:active {
    transform: scale(0.95);
}

.emoji-rush-controls-toggle-btn.active {
    background: var(--card-bg);
    border-color: var(--accent-1);
}

.emoji-rush-controls-toggle-icon {
    font-size: 18px;
    line-height: 1;
}

/* Speed button uses same style as mobile left/right (emoji-rush-mobile-btn); icon only */
.emoji-rush-speed-btn {
    font-size: 20px;
}

.emoji-rush-controls-wrapper.controls-visible {
    justify-content: space-between;  /* when visible: arrows (with ⚡) left, play/toggle right */
    align-items: flex-start;
}

.emoji-rush-controls-wrapper.controls-visible .emoji-rush-mobile-controls {
    display: flex;
    flex: 1;
    justify-content: flex-start;
}

@media (max-width: 768px) {
    .emoji-rush-card {
        padding: 18px 16px 16px;
    }

    .emoji-rush-title {
        font-size: 22px;
    }

    .emoji-rush-game-wrapper {
        max-width: 100%;
    }

    .emoji-rush-controls-hint .mobile-only {
        display: inline;
    }

    .emoji-rush-controls-hint .desktop-only {
        display: none;
    }
}

