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

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    background: #0a1628;
    color: #fff;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* === SPLASH === */
#splashScreen {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 40% 30%, rgba(0,60,120,.2) 0%, transparent 50%),
                linear-gradient(135deg, #060e1a, #0a1628, #0d2847, #061224);
}
.splash-content { text-align: center; animation: popIn .5s cubic-bezier(.17,.67,.3,1.33); }
.splash-emoji { font-size: 80px; margin-bottom: 8px; animation: bounce 1s ease infinite; }
.splash-title {
    font-family: 'Bungee', sans-serif; font-size: 2.6rem;
    background: linear-gradient(90deg, #FF6BF5, #FFD700, #00F0FF, #39FF14);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.splash-loader {
    width: 180px; height: 6px; background: rgba(255,255,255,.15);
    border-radius: 3px; margin: 20px auto 0; overflow: hidden;
}
.splash-loader-bar {
    width: 0%; height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, #FF6BF5, #FFD700, #00F0FF, #39FF14);
    animation: loadBar 1.8s ease-in-out forwards;
}
@keyframes loadBar { to { width: 100%; } }
@keyframes popIn { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@keyframes bounce {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* === SCREENS === */
#mainMenu, #settingsMenu, #howToPlay, #badgeRoom, #hallOfFame, #gameOverScreen, #pauseOverlay {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 30% 20%, rgba(0,60,120,.25) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(100,0,120,.15) 0%, transparent 50%),
                linear-gradient(135deg, #060e1a 0%, #0a1628 30%, #0d2847 60%, #061224 100%);
    padding: 12px;
}

.menu-card, .gameover-card, .pause-card {
    width: 100%; max-width: 400px;
    background: linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,255,255,.04));
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1.5px solid rgba(0,200,255,.2);
    border-top-color: rgba(255,255,255,.15);
    border-radius: 20px;
    padding: 22px 20px;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    animation: popIn .35s cubic-bezier(.17,.67,.3,1.33);
    box-shadow: 0 8px 32px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06);
}

.menu-emoji { font-size: 50px; animation: bounce 1.2s ease infinite; }
.menu-title {
    font-family: 'Bungee', sans-serif; font-size: 1.8rem;
    background: linear-gradient(90deg, #FF6BF5, #FFD700, #00F0FF);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
    letter-spacing: 1px;
}

/* === INPUTS === */
.menu-card input[type="text"],
.menu-card select,
.select-row select {
    width: 100%; padding: 12px 16px;
    background: rgba(0,0,0,.3); border: 1.5px solid rgba(0,180,255,.22);
    border-radius: 12px; color: #fff;
    font-family: 'Nunito', sans-serif; font-size: 1.05rem; font-weight: 700;
    outline: none; transition: border-color .2s, box-shadow .2s;
}
.menu-card input:focus, .menu-card select:focus, .select-row select:focus {
    border-color: #00F0FF;
    box-shadow: 0 0 12px rgba(0,240,255,.15);
}
.menu-card input::placeholder { color: rgba(255,255,255,.35); }
.menu-card select option { background: #0a1628; color: #fff; }

/* === AVATAR ROW === */
.avatar-row {
    width: 100%; display: flex; align-items: center; gap: 10px;
}
.avatar-row input[type="text"] { flex: 1; }
.avatar-pick {
    width: 48px; height: 48px; flex-shrink: 0;
    border-radius: 50%; border: 2px solid rgba(0,180,255,.3);
    background: rgba(0,0,0,.3);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative; overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.avatar-pick:active { transform: scale(.92); }
.avatar-pick img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
    display: none;
}
.avatar-pick img.has-pic { display: block; }
.avatar-pick .avatar-placeholder {
    font-size: 1.4rem; color: rgba(255,255,255,.5);
}
.avatar-pick img.has-pic ~ .avatar-placeholder { display: none; }

/* Music picker circle */
.music-pick {
    width: 48px; height: 48px; flex-shrink: 0;
    border-radius: 50%; border: 2px solid rgba(255,140,0,.4);
    background: rgba(255,100,0,.12);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative; overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.music-pick:active { transform: scale(.92); }
.music-placeholder { font-size: 1.4rem; color: rgba(255,200,100,.6); }
.music-selected { font-size: 1.5rem; color: #ff9800; }
.music-pick.has-song { border-color: rgba(255,160,0,.8); box-shadow: 0 0 10px rgba(255,140,0,.4); }
.music-file-name {
    font-size: 0.72rem; color: rgba(255,180,80,.8); text-align: left;
    padding: 2px 0 0 58px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%;
}

/* === BUTTONS === */
.btn-play {
    width: 100%; padding: 14px; border: none; border-radius: 14px;
    font-family: 'Bungee', sans-serif; font-size: 1.25rem;
    background: linear-gradient(135deg, #FF6BF5 0%, #FFD700 50%, #39FF14 100%);
    color: #0a1628; cursor: pointer;
    transition: transform .12s;
    -webkit-tap-highlight-color: transparent;
    animation: pulse 2.5s ease infinite;
    letter-spacing: .5px;
    box-shadow: 0 4px 16px rgba(255,107,245,.3);
}
.btn-play:active { transform: scale(.95); }
@keyframes pulse {
    0%,100% { box-shadow: 0 4px 16px rgba(255,107,245,.3); }
    50% { box-shadow: 0 4px 24px rgba(57,255,20,.4), 0 0 40px rgba(255,215,0,.15); }
}

.btn-small {
    flex: 1; padding: 10px 8px; border: none; border-radius: 10px;
    font-family: 'Nunito', sans-serif; font-size: .9rem; font-weight: 900;
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.12);
    cursor: pointer; transition: transform .12s, background .2s;
    -webkit-tap-highlight-color: transparent;
}
.btn-small:active { transform: scale(.95); background: rgba(255,255,255,.15); }

.menu-row { display: flex; gap: 10px; width: 100%; }

/* === TOGGLES === */
.toggle-row {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: rgba(0,0,0,.2); border-radius: 10px;
    border: 1px solid rgba(255,255,255,.06);
    cursor: pointer; font-size: .95rem; font-weight: 700; color: #fff;
}
.toggle-row input { display: none; }
.toggle-slider {
    width: 48px; height: 26px; background: rgba(255,255,255,.2);
    border-radius: 13px; position: relative; transition: background .2s; flex-shrink: 0;
}
.toggle-slider::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px; background: #fff; border-radius: 50%;
    transition: transform .2s;
}
.toggle-row input:checked + .toggle-slider {
    background: linear-gradient(135deg, #FF6BF5, #39FF14);
}
.toggle-row input:checked + .toggle-slider::after { transform: translateX(22px); }

.select-row {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: rgba(0,0,0,.2); border-radius: 10px;
    border: 1px solid rgba(255,255,255,.06);
    font-size: .95rem; font-weight: 700; color: #fff; gap: 12px;
}
.select-row select { width: auto; flex: 1; }

/* === HOW TO PLAY GRID === */
.htp-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%;
}
.htp-panel {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 12px 8px;
    background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
    border: 1.5px solid rgba(0,200,255,.15);
    border-radius: 14px; text-align: center;
    animation: popIn .35s cubic-bezier(.17,.67,.3,1.33) both;
}
.htp-panel:nth-child(1) { animation-delay: .05s; }
.htp-panel:nth-child(2) { animation-delay: .10s; }
.htp-panel:nth-child(3) { animation-delay: .15s; }
.htp-panel:nth-child(4) { animation-delay: .20s; }
.htp-icon { font-size: 2rem; }
.htp-title {
    font-family: 'Bungee', sans-serif; font-size: .95rem;
    background: linear-gradient(90deg, #FF6BF5, #FFD700);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.htp-desc { font-size: .68rem; color: rgba(255,255,255,.7); font-weight: 700; line-height: 1.3; }

/* === LOSS FLASH === */
@keyframes lossShake {
    0%,100% { transform: translateX(0); border-color: rgba(255,68,68,.3); }
    15%      { transform: translateX(-8px); border-color: rgba(255,68,68,.8); }
    30%      { transform: translateX(8px); }
    45%      { transform: translateX(-6px); }
    60%      { transform: translateX(6px); }
    75%      { transform: translateX(-3px); }
}
.gameover-card.loss-flash {
    animation: lossShake .5s cubic-bezier(.36,.07,.19,.97) both;
    box-shadow: 0 0 40px rgba(255,68,68,.25), 0 8px 32px rgba(0,0,0,.4);
}

/* === CANVAS === */
#gameCanvas {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #060e1a;
    z-index: 1; touch-action: none;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* === HUD — Street Fighter Style === */
#gameHUD {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 10; pointer-events: none;
    padding: 4px 6px 0;
}
.sf-hud {
    display: flex; align-items: center; justify-content: center;
    gap: 0; width: 100%;
}
.sf-plate {
    display: flex; align-items: center; gap: 8px;
    background: rgba(0,0,0,.25); backdrop-filter: blur(6px);
    padding: 5px 12px; border-radius: 14px;
    border: 2px solid rgba(0,180,255,.15);
    flex: 1; max-width: 240px;
}
.sf-left { border-color: rgba(0,240,255,.2); justify-content: flex-start; }
.sf-right { border-color: rgba(255,107,245,.2); justify-content: flex-end; }
.sf-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    border: 2.5px solid rgba(255,255,255,.4);
    object-fit: cover; background: rgba(255,255,255,.08);
    box-shadow: 0 0 8px rgba(0,180,255,.3);
}
.sf-avatar[src=""] { display: none; }
.sf-name {
    font-family: 'Bungee', sans-serif; font-size: .8rem;
    letter-spacing: .5px; text-transform: uppercase;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 90px;
    -webkit-text-stroke: .5px rgba(0,0,0,.6);
}
.sf-name-left { color: #00F0FF; }
.sf-name-right { color: #FF6BF5; }
.sf-score {
    font-family: 'Bungee', sans-serif; font-size: 1.4rem;
    min-width: 22px; text-align: center;
    text-shadow: 0 0 8px currentColor;
}
.sf-score-left { color: #00F0FF; margin-left: auto; }
.sf-score-right { color: #FF6BF5; margin-right: auto; }
.sf-center {
    display: flex; flex-direction: column; align-items: center;
    padding: 0 6px; flex-shrink: 0;
}
.sf-vs {
    font-family: 'Bungee', sans-serif; font-size: .55rem;
    color: rgba(255,255,255,.35); letter-spacing: 1px;
}
#timerDisplay {
    font-family: 'Bungee', sans-serif; font-size: .75rem;
    color: #FFD700; line-height: 1;
}

/* === ANNOUNCE TEXT === */
#announceText {
    position: fixed; top: 58px; left: 50%;
    transform: translateX(-50%);
    z-index: 15; pointer-events: none;
    font-family: 'Bungee', sans-serif; font-size: 0.8rem;
    text-align: center; white-space: nowrap;
    background: linear-gradient(90deg, #FF6BF5, #FFD700, #00F0FF);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 6px rgba(255,215,0,.5)) drop-shadow(0 1px 3px rgba(0,0,0,.9));
    animation: announceIn .25s ease-out;
}
@keyframes announceIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === CONTROLS — pill buttons === */
#gameControls {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 10; display: flex; gap: 0;
    background: rgba(6,14,26,.55);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 4px 8px env(safe-area-inset-bottom, 4px);
    justify-content: space-around;
    opacity: 0.72;
    transition: opacity .2s;
}
#gameControls:hover, #gameControls:focus-within { opacity: 1; }
.ctrl-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; flex: 1; min-height: 44px; padding: 6px 4px;
    background: transparent; border: none; border-radius: 0;
    color: #fff; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .1s, opacity .15s;
}
.ctrl-btn:active { transform: scale(.88); opacity: 1; }
.ctrl-icon { font-size: 1.25rem; line-height: 1; }
.ctrl-label { font-family: 'Nunito', sans-serif; font-size: .5rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .7; }
.ctrl-theme { color: #00c8ff; }
.ctrl-music { color: #39FF14; }
.ctrl-pause { color: #FFD700; }
.ctrl-restart { color: #FF6BF5; }

/* === BG PICKER === */
#bgPickerPanel {
    position: fixed; bottom: 68px; left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex; flex-wrap: wrap; gap: 8px;
    max-width: 300px; justify-content: center;
    background: rgba(0,0,0,.9);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 2px solid rgba(0,180,255,.25);
    border-radius: 16px;
    padding: 12px;
    animation: popIn .2s cubic-bezier(.17,.67,.3,1.33);
}
.bg-swatch {
    width: 52px; height: 44px;
    border: 2px solid rgba(255,255,255,.2);
    border-radius: 10px;
    cursor: pointer;
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 2px;
    transition: transform .12s, border-color .2s;
    -webkit-tap-highlight-color: transparent;
}
.bg-swatch:active { transform: scale(.9); }
.bg-swatch.active {
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(255,215,0,.4);
}
.swatch-label {
    font-size: .45rem; font-weight: 900; color: rgba(255,255,255,.85);
    text-shadow: 0 1px 3px rgba(0,0,0,.9);
    line-height: 1;
}

/* === PAUSE === */
#pauseOverlay { z-index: 200; background: rgba(0,0,0,.75); }
.pause-card { gap: 12px; }
.pause-card h2 {
    font-family: 'Bungee', sans-serif; font-size: 2rem;
    background: linear-gradient(90deg, #FF6BF5, #FFD700);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === GAME OVER === */
#gameOverScreen { z-index: 200; }
.gameover-card {
    gap: 14px;
    animation: popIn .35s cubic-bezier(.17,.67,.3,1.33), celebrateBorder 2s linear infinite;
}
@keyframes celebrateBorder {
    0% { border-color: rgba(255,107,245,.45); box-shadow: 0 0 25px rgba(255,107,245,.15); }
    33% { border-color: rgba(255,215,0,.45); box-shadow: 0 0 25px rgba(255,215,0,.15); }
    66% { border-color: rgba(0,240,255,.45); box-shadow: 0 0 25px rgba(0,240,255,.15); }
    100% { border-color: rgba(255,107,245,.45); box-shadow: 0 0 25px rgba(255,107,245,.15); }
}
.gameover-emoji { font-size: 72px; animation: bounce 1s ease infinite; }
.gameover-card h1 {
    font-family: 'Bungee', sans-serif; font-size: 1.5rem;
    background: linear-gradient(90deg, #FFD700, #39FF14, #00F0FF, #FF6BF5);
    background-size: 200% auto;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 2s linear infinite;
}
@keyframes shimmerText {
    to { background-position: 200% center; }
}
.gameover-card #finalScore {
    font-size: .9rem; color: rgba(255,255,255,.7);
    font-family: 'Bungee', sans-serif;
}

/* === WINNER AVATAR === */
.winner-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    object-fit: cover;
    border: 3px solid #FFD700;
    box-shadow: 0 0 20px rgba(255,215,0,.5), 0 0 40px rgba(255,215,0,.2);
    animation: popIn .4s cubic-bezier(.17,.67,.3,1.33), winnerGlow 1.5s ease infinite;
}
@keyframes winnerGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255,215,0,.5), 0 0 40px rgba(255,215,0,.2); }
    50% { box-shadow: 0 0 30px rgba(255,107,245,.5), 0 0 50px rgba(0,240,255,.3); }
}

/* === BADGE ROOM === */
.badge-room-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    width: 100%; margin: 4px 0;
}
.badge-room-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 6px;
    border-radius: 14px;
    border: 1.5px solid;
    text-align: center;
}
.badge-room-item.earned {
    background: linear-gradient(145deg, rgba(255,215,0,.15), rgba(255,107,245,.1));
    border-color: rgba(255,215,0,.5);
}
.badge-room-item.locked {
    background: rgba(255,255,255,.04);
    border-color: rgba(255,255,255,.1);
    opacity: .55;
    filter: grayscale(1);
}
.badge-room-item .br-icon { font-size: 1.6rem; }
.badge-room-item .br-name {
    font-family: 'Bungee', sans-serif; font-size: .6rem; color: #FFD700; line-height: 1.2;
}
.badge-room-item.locked .br-name { color: rgba(255,255,255,.4); }
.badge-room-item .br-desc { font-size: .55rem; color: rgba(255,255,255,.5); line-height: 1.2; }

/* === ACHIEVEMENT BADGES === */
.badge-earned-row {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
    width: 100%; margin: 2px 0;
}
.badge-chip {
    display: flex; align-items: center; gap: 5px;
    background: linear-gradient(135deg, rgba(255,215,0,.18), rgba(255,107,245,.12));
    border: 1.5px solid rgba(255,215,0,.5);
    border-radius: 20px; padding: 4px 10px;
    font-family: 'Nunito', sans-serif; font-weight: 900; font-size: .72rem;
    color: #FFD700;
    animation: badgePop .5s cubic-bezier(.17,.67,.3,1.4) both;
}
.badge-chip .badge-icon { font-size: 1rem; }
@keyframes badgePop {
    from { opacity: 0; transform: scale(.5); }
    to   { opacity: 1; transform: scale(1); }
}

/* === NEW BEST BADGE === */
.new-best-badge {
    font-family: 'Bungee', sans-serif; font-size: 1rem;
    background: linear-gradient(90deg, #FFD700, #FF6BF5, #00F0FF, #FFD700);
    background-size: 300% auto;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 1.5s linear infinite, pulse 1s ease infinite;
    text-align: center;
}

/* === MENU STATS === */
.menu-stats {
    font-family: 'Bungee', sans-serif; font-size: .75rem;
    color: rgba(255,215,0,.8); text-align: center;
    padding: 6px 12px;
    background: rgba(255,215,0,.08);
    border: 1.5px solid rgba(255,215,0,.2);
    border-radius: 10px;
    width: 100%;
}

/* === HIGH CONTRAST === */
body.high-contrast { background: #000; }
body.high-contrast .menu-card, body.high-contrast .gameover-card, body.high-contrast .pause-card {
    background: #111; border-color: #FFD700;
}

/* === RESPONSIVE === */
@media (orientation: landscape) and (max-height: 600px) {
    .menu-card, .gameover-card, .pause-card {
        padding: 10px 14px; gap: 5px; max-height: 96vh; overflow-y: auto;
    }
    .menu-title { font-size: 1.1rem; }
    .menu-emoji { font-size: 32px; }
    .splash-emoji { font-size: 40px; }
    .btn-play { padding: 8px; font-size: .95rem; }
    .btn-small { padding: 6px; font-size: .8rem; }
    .menu-card input[type="text"], .menu-card select { padding: 6px 10px; font-size: .85rem; }
    .toggle-row, .select-row { padding: 5px 10px; font-size: .85rem; }
    #announceText { font-size: 0.72rem; top: 50px; }
    .sf-plate { padding: 4px 10px; max-width: 220px; }
    .sf-score { font-size: 1.2rem; }
    .sf-name { font-size: .65rem; max-width: 80px; }
    .sf-avatar { width: 36px; height: 36px; }
    #timerDisplay { font-size: .65rem; }
    .sf-vs { font-size: .45rem; }
    .avatar-row { gap: 6px; }
    .avatar-pick { width: 40px; height: 40px; }
    .music-pick { width: 40px; height: 40px; }
    .music-file-name { font-size: .62rem; padding-left: 50px; }
    .gameover-card #finalScore { font-size: .85rem; }
    .new-best-badge { font-size: .8rem; }
    .menu-stats { font-size: .65rem; padding: 4px 8px; }
    .winner-avatar { width: 56px; height: 56px; }
}

@media (max-width: 360px) {
    .menu-card { padding: 16px 14px; }
    .menu-title { font-size: 1.4rem; }
    .btn-play { padding: 14px; font-size: 1.1rem; }
}

/* === SW UPDATE TOAST === */
#updateToast {
    position: fixed; bottom: 68px; left: 50%; transform: translateX(-50%);
    z-index: 9000;
    display: flex; align-items: center; gap: 10px;
    background: rgba(10,22,40,.92);
    border: 1px solid rgba(0,240,255,.35);
    border-radius: 14px;
    padding: 10px 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
    font-size: .85rem; color: #e0f7ff;
    white-space: nowrap;
    animation: slideUp .35s cubic-bezier(.17,.67,.3,1.2);
}
#updateToast #updateToastBtn {
    background: linear-gradient(135deg, #00c8ff, #0070ff);
    border: none; border-radius: 8px;
    color: #fff; font-family: 'Nunito', sans-serif; font-weight: 900;
    font-size: .8rem; padding: 5px 12px; cursor: pointer;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === PWA INSTALL BANNER === */
#installBanner {
    position: fixed; bottom: 68px; left: 50%; transform: translateX(-50%);
    z-index: 8900;
    display: flex; align-items: center; gap: 8px;
    background: rgba(10,22,40,.92);
    border: 1px solid rgba(255,107,245,.35);
    border-radius: 14px;
    padding: 10px 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
    font-size: .85rem; color: #ffe0fc;
    white-space: nowrap;
    animation: slideUp .35s cubic-bezier(.17,.67,.3,1.2);
}
#installBanner #installBtn {
    background: linear-gradient(135deg, #FF6BF5, #9b30e0);
    border: none; border-radius: 8px;
    color: #fff; font-family: 'Nunito', sans-serif; font-weight: 900;
    font-size: .8rem; padding: 5px 12px; cursor: pointer;
}
#installBanner #installDismiss {
    background: rgba(255,255,255,.1); border: none; border-radius: 6px;
    color: rgba(255,255,255,.6); font-size: .75rem; padding: 4px 8px; cursor: pointer;
}

/* === SCORE BARS (HUD) === */
.sf-info-col {
    display: flex; flex-direction: column; gap: 3px;
    flex: 1; min-width: 0;
}
.score-bar-wrap {
    width: 100%; height: 5px; background: rgba(255,255,255,.1);
    border-radius: 3px; overflow: hidden;
}
.score-bar {
    height: 100%; border-radius: 3px;
    transition: width .25s cubic-bezier(.25,.46,.45,.94);
}
.score-bar-left  { background: linear-gradient(90deg, #00c8ff, #39FF14); width: 0%; }
.score-bar-right { background: linear-gradient(90deg, #ff3399, #FF6BF5); width: 0%; }

/* === GLITCH EFFECT (Nemesis scores) === */
@keyframes glitchCanvas {
    0%   { filter: none; }
    15%  { filter: hue-rotate(90deg) saturate(3) brightness(1.4); transform: translateX(-4px) skewX(-2deg); }
    30%  { filter: none; transform: translateX(4px); }
    45%  { filter: hue-rotate(-90deg) saturate(4) brightness(.8); transform: translateX(0) skewX(1deg); }
    60%  { filter: none; transform: none; }
    75%  { filter: brightness(2) saturate(.2); transform: translateX(-2px); }
    100% { filter: none; transform: none; }
}
.glitch-active { animation: glitchCanvas .45s steps(1) forwards; }

/* === HALL OF FAME === */
.hof-list {
    width: 100%; display: flex; flex-direction: column; gap: 6px;
    max-height: 55vh; overflow-y: auto; padding-right: 4px;
}
.hof-list::-webkit-scrollbar { width: 4px; }
.hof-list::-webkit-scrollbar-track { background: rgba(255,255,255,.04); border-radius: 2px; }
.hof-list::-webkit-scrollbar-thumb { background: rgba(0,200,255,.3); border-radius: 2px; }
.hof-item {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px; padding: 8px 12px;
    animation: popIn .3s cubic-bezier(.17,.67,.3,1.33) both;
}
.hof-item:nth-child(1) { border-color: rgba(255,215,0,.4); background: rgba(255,215,0,.08); }
.hof-item:nth-child(2) { border-color: rgba(192,192,192,.3); background: rgba(192,192,192,.06); }
.hof-item:nth-child(3) { border-color: rgba(205,127,50,.3); background: rgba(205,127,50,.05); }
.hof-rank {
    font-family: 'Bungee', sans-serif; font-size: 1.1rem; min-width: 28px;
    color: rgba(255,255,255,.5);
}
.hof-item:nth-child(1) .hof-rank { color: #FFD700; text-shadow: 0 0 8px rgba(255,215,0,.6); }
.hof-item:nth-child(2) .hof-rank { color: #C0C0C0; }
.hof-item:nth-child(3) .hof-rank { color: #CD7F32; }
.hof-info { flex: 1; min-width: 0; }
.hof-name {
    font-family: 'Bungee', sans-serif; font-size: .85rem; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hof-meta { font-size: .7rem; color: rgba(255,255,255,.45); }
.hof-score {
    font-family: 'Bungee', sans-serif; font-size: 1.3rem;
    color: #00F0FF; text-shadow: 0 0 6px rgba(0,240,255,.5);
}
.hof-empty {
    text-align: center; color: rgba(255,255,255,.35);
    font-size: .9rem; padding: 24px 0;
}
