/* =============================================
   QUANTUM BUTTON V1.0.0 — COMPONENTS.CSS
   Buttons, cards, themes, modals, animations
   ============================================= */

/* --- BUTTONS --- */
.btn-main {
    background: linear-gradient(180deg, rgba(0, 243, 255, 0.2) 0%, rgba(0, 243, 255, 0) 100%);
    border: 2px solid var(--neon-blue);
    box-shadow: 0 0 15px var(--neon-blue), inset 0 0 20px rgba(0, 243, 255, 0.1);
    text-shadow: 0 0 5px var(--neon-blue);
    clip-path: polygon(10% 0, 100% 0, 100% 80%, 90% 100%, 0 100%, 0 20%);
    transition: all 0.1s ease-out;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    z-index: 10;
    touch-action: manipulation;
}
.btn-main:active { 
    transform: scale(0.95); 
    background: var(--neon-blue); 
    color: black; 
    text-shadow: none; 
}

/* --- APP CONTAINER --- */
#app-container { 
    position: relative; 
    z-index: 1; 
    background: black; 
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

.screen { z-index: 200; }

/* --- MODE CARDS --- */
.mode-card {
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: all 0.2s ease;
}
.mode-card:hover {
    box-shadow: 0 0 15px var(--neon-blue);
    border-color: var(--neon-blue);
}
.mode-card:active { transform: scale(0.98); }

/* --- SCROLLBAR --- */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* --- HUD --- */
#game-hud { z-index: 100 !important; pointer-events: none; }
#game-hud button { pointer-events: auto !important; }

/* --- HUD MULTIPLIER TIERS ---
 * The MULT slot sits between SCORE and STREAK in both the solo HUD
 * (index.html #hud-mult-box) and the VS HUD (injected #vs-hud-mult-box).
 * Tier classes are applied by UI.applyHudMultTier in ui-menu.js based on
 * the current combined per-tap multiplier (base × combo from streak).
 *
 * Colors mirror engine.js comboColors so the player sees a consistent
 * visual language: green = first combo tier, blue = second, purple =
 * third, gold = ultra combo. Rainbow is the cap — only fires at 10×
 * (combo 5 + active 2× boost).
 *
 * Transitions are intentionally short (180ms) so the tier flip feels
 * "snappy" on each streak threshold cross, not laggy. */
.hud-mult-tier-1 {
    border-color: rgba(255,255,255,0.15) !important;
    box-shadow: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.hud-mult-tier-1 #hud-mult,
.hud-mult-tier-1 #vs-hud-mult {
    color: #ffffff;
    text-shadow: none;
}
.hud-mult-tier-2 {
    border-color: #4ade80 !important;
    box-shadow: 0 0 10px rgba(74,222,128,0.55);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.hud-mult-tier-2 #hud-mult,
.hud-mult-tier-2 #vs-hud-mult {
    color: #4ade80;
    text-shadow: 0 0 6px rgba(74,222,128,0.7);
}
.hud-mult-tier-3 {
    border-color: #60a5fa !important;
    box-shadow: 0 0 14px rgba(96,165,250,0.7);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.hud-mult-tier-3 #hud-mult,
.hud-mult-tier-3 #vs-hud-mult {
    color: #60a5fa;
    text-shadow: 0 0 8px rgba(96,165,250,0.8);
}
.hud-mult-tier-4 {
    border-color: #c084fc !important;
    box-shadow: 0 0 18px rgba(192,132,252,0.8);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.hud-mult-tier-4 #hud-mult,
.hud-mult-tier-4 #vs-hud-mult {
    color: #c084fc;
    text-shadow: 0 0 10px rgba(192,132,252,0.9);
}
.hud-mult-tier-5 {
    border-color: #ffd700 !important;
    box-shadow: 0 0 22px rgba(255,215,0,0.9);
    transition: border-color 180ms ease, box-shadow 180ms ease;
    animation: hud-mult-gold-pulse 1.2s ease-in-out infinite;
}
.hud-mult-tier-5 #hud-mult,
.hud-mult-tier-5 #vs-hud-mult {
    color: #ffd700;
    text-shadow: 0 0 12px rgba(255,215,0,1);
}
@keyframes hud-mult-gold-pulse {
    0%,100% { box-shadow: 0 0 22px rgba(255,215,0,0.9); }
    50%     { box-shadow: 0 0 32px rgba(255,215,0,1); }
}

/* Rainbow tier — reserved for max-stacked multiplier (10×, combo 5 × boost 2).
 * Animated hue rotation on both border and text — high-energy reward state. */
.hud-mult-tier-rainbow {
    border-color: #ff00ff !important;
    box-shadow: 0 0 28px rgba(255,0,255,0.9);
    animation: hud-mult-rainbow-pulse 1.8s linear infinite;
}
.hud-mult-tier-rainbow #hud-mult,
.hud-mult-tier-rainbow #vs-hud-mult {
    background: linear-gradient(90deg, #ff0080, #ff8c00, #ffd700, #00ff80, #00bfff, #ff00ff, #ff0080);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: hud-mult-rainbow-shift 1.8s linear infinite;
    text-shadow: none;
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.6));
}
@keyframes hud-mult-rainbow-pulse {
    0%   { box-shadow: 0 0 28px rgba(255,0,128,0.9);  border-color: #ff0080; }
    20%  { box-shadow: 0 0 28px rgba(255,140,0,0.9);  border-color: #ff8c00; }
    40%  { box-shadow: 0 0 28px rgba(255,215,0,0.9);  border-color: #ffd700; }
    60%  { box-shadow: 0 0 28px rgba(0,255,128,0.9);  border-color: #00ff80; }
    80%  { box-shadow: 0 0 28px rgba(0,191,255,0.9);  border-color: #00bfff; }
    100% { box-shadow: 0 0 28px rgba(255,0,128,0.9);  border-color: #ff0080; }
}
@keyframes hud-mult-rainbow-shift {
    0%   { background-position:   0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ──────────────────────────────────────────────
 * STG NETWORK — cross-product perk visuals
 * ──────────────────────────────────────────────
 * All overrides hang off `.stg-achievo-linked` on documentElement, toggled
 * by js/stg-network.js applyPerks(). Mock-only today; same selectors will
 * fire when backend sync lands.
 *
 * Three perks rendered here:
 *   1. RGB rainbow name — applied to any element with `.stg-name`
 *   2. Achievo VIP button skin — overrides #q-button-inner (only when no
 *      manual skin is active, so user-purchased skins still win)
 *   3. STG connection card — premium glow for the settings panel card
 *
 * Honours prefers-reduced-motion: kills the rainbow animation but keeps
 * the gradient fill so the perk is still visible.
 */
:root.stg-achievo-linked .stg-name {
    background: linear-gradient(90deg, #ff0099, #ffd166, #50e3a4, #00f3ff, #9b5cff, #ff0099);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: stg-rgb-shift 6s linear infinite;
}
@keyframes stg-rgb-shift {
    0%   { background-position: 0% 0; }
    100% { background-position: -300% 0; }
}

/* Achievo VIP button skin — applied via inline override at runtime by the
 * skin renderer, but kept here as a CSS fallback for any path that doesn't
 * route through engine-skins.js. Purple → cyan gradient + glow. */
:root.stg-achievo-linked #q-button-inner[data-skin="ACHIEVO_VIP"] {
    background:
        radial-gradient(circle at 30% 30%, rgba(155, 92, 255, 0.6), transparent 60%),
        linear-gradient(135deg, #9b5cff, #4ad0ff);
    box-shadow:
        0 0 40px rgba(155, 92, 255, 0.7),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
    border-color: rgba(74, 208, 255, 0.8);
}

/* Settings panel STG connection card — premium glow when linked. */
.stg-link-card {
    background: linear-gradient(135deg, rgba(155, 92, 255, 0.08), rgba(74, 208, 255, 0.06));
    border: 1px solid rgba(155, 92, 255, 0.35);
    border-radius: 10px;
    padding: 14px;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
:root.stg-achievo-linked .stg-link-card {
    border-color: rgba(74, 208, 255, 0.7);
    box-shadow: 0 0 22px rgba(155, 92, 255, 0.35);
}
.stg-link-card .stg-link-status {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #9ca3af;
}
:root.stg-achievo-linked .stg-link-card .stg-link-status {
    color: #4ad0ff;
    text-shadow: 0 0 8px rgba(74, 208, 255, 0.5);
}

/* Accessibility — kill the rainbow animation for users who opted out. */
@media (prefers-reduced-motion: reduce) {
    :root.stg-achievo-linked .stg-name {
        animation: none !important;
    }
}

/* --- GAME THEMES (border/glow applied to #app-container, NOT body) ---
   The theme-* classes go on body via engine-skins.js applySkin. Earlier
   versions of these rules set `border` / `box-shadow` on the body itself,
   which drew the border at the viewport edges instead of around the
   phone-shaped game container — fixed 2026-05-27 (Josh reported the
   green skin border running down the outside of the screen, outside the
   QUANTUM BUTTON vertical text). All border + glow declarations now
   scope to `#app-container` so they trace the actual play container. */
.theme-neon #app-container { border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 0 20px rgba(0, 243, 255, 0.1); }

/* Only show container border on desktop where the app is centered */
@media (min-width: 601px) {
    #app-container {
        border-left: 1px solid rgba(255,255,255,0.05);
        border-right: 1px solid rgba(255,255,255,0.05);
    }
}

.theme-gold #app-container {
    border: 3px solid var(--neon-gold) !important;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 20px rgba(255, 215, 0, 0.1) !important;
    animation: gold-border-shimmer 3s ease-in-out infinite !important;
}

@keyframes gold-border-shimmer {
    0%, 100% {
        border-color: #ffd700;
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 20px rgba(255, 215, 0, 0.1);
    }
    33% {
        border-color: #fff8dc;
        box-shadow: 0 0 45px rgba(255, 248, 220, 0.7), inset 0 0 30px rgba(255, 215, 0, 0.15);
    }
    66% {
        border-color: #daa520;
        box-shadow: 0 0 35px rgba(218, 165, 32, 0.5), inset 0 0 25px rgba(255, 215, 0, 0.12);
    }
}

.theme-devil #app-container { border: 2px solid var(--neon-red) !important; box-shadow: 0 0 40px rgba(255, 0, 0, 0.6); }
.theme-devil #game-area { box-shadow: inset 0 0 100px rgba(255, 0, 0, 0.2); }
.theme-devil #fire-layer { opacity: 0.25 !important; }
.theme-devil #app-container {
    animation: devil-flicker-border 0.8s ease-in-out infinite alternate !important;
}
@keyframes devil-flicker-border {
    0% { border-color: #ff0000; box-shadow: 0 0 30px rgba(255, 0, 0, 0.5); }
    30% { border-color: #ff4400; box-shadow: 0 0 40px rgba(255, 68, 0, 0.6); }
    60% { border-color: #ff2200; box-shadow: 0 0 25px rgba(255, 34, 0, 0.4); }
    100% { border-color: #ff6600; box-shadow: 0 0 35px rgba(255, 102, 0, 0.5); }
}

.theme-glitch #app-container { border: 2px solid #0f0 !important; animation: glitch-border 0.2s infinite; }
.glitch-text { 
    animation: glitch-text 0.1s infinite; 
    color: #0f0 !important; 
    text-shadow: 2px 0 red, -2px 0 blue;
    display: inline-block;
}

@keyframes glitch-border {
    0% { border-color: #0f0; } 25% { border-color: #f0f; } 50% { border-color: #0ff; } 100% { border-color: #0f0; }
}
@keyframes glitch-text {
    0% { transform: translate(0); } 20% { transform: translate(-2px, 2px); } 40% { transform: translate(-2px, -2px); } 60% { transform: translate(2px, 2px); } 80% { transform: translate(2px, -2px); } 100% { transform: translate(0); }
}

.theme-neon-rgb { 
    border: none !important; 
    box-shadow: none !important; 
    position: relative;
    z-index: 1;
}

.theme-neon-rgb::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: conic-gradient(from 0deg, #ff0000, #ffd700, #00f3ff, #a855f7, #ff0000);
    filter: blur(10px);
    animation: rotate 4s linear infinite;
    z-index: -1;
    border-radius: inherit;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes rotate-border { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.theme-anime #app-container { border: 3px solid #1a1a2e !important; box-shadow: 0 0 25px rgba(232,67,147,0.3); }
.theme-anime #game-area {
    background-image: radial-gradient(circle, rgba(196,78,255,0.1) 1px, transparent 1px);
    background-size: 8px 8px;
}
.theme-anime #app-container {
    border-color: #e84393 !important;
    border-width: 3px !important;
    box-shadow: 0 0 30px rgba(232,67,147,0.3), 0 0 60px rgba(196,78,255,0.12) !important;
}

.theme-cosmic #app-container { border: 2px solid #6432ff !important; box-shadow: 0 0 40px rgba(100, 50, 255, 0.4); }

/* MOBILE TAP FEEDBACK
   On touch devices, hover never fires — buttons with only hover:* states
   look dead during a tap, confusing players. This adds a universal
   "press" feedback on any button or element marked role=button. Only
   activates inside touch viewports so desktop hover stays untouched. */
@media (hover: none) and (pointer: coarse) {
    button:active,
    [role="button"]:active,
    .btn-main:active,
    .mode-card:active {
        transform: scale(0.96) !important;
        transition: transform 0.05s ease-out !important;
        opacity: 0.92 !important;
    }
    /* Disable the system tap-highlight rectangle since we now have our own */
    button,
    [role="button"],
    a {
        -webkit-tap-highlight-color: transparent;
    }
}
.theme-cosmic #game-area { box-shadow: inset 0 0 100px rgba(0, 200, 255, 0.1); }

/* SKIN-MATCHING GAME BORDERS */
.theme-gold #app-container {
    border-color: var(--neon-gold) !important;
    border-width: 3px !important;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4), 0 0 80px rgba(255, 215, 0, 0.15) !important;
    animation: gold-border-shimmer 3s ease-in-out infinite !important;
}

.theme-neon #app-container {
    border-color: var(--neon-blue) !important;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.3);
}

.theme-glitch #app-container {
    border-color: #0f0 !important;
    animation: glitch-border 0.2s infinite;
}
.theme-glitch #game-area {
    box-shadow: inset 0 0 60px rgba(0,255,0,0.06);
}

/* --- TICKER --- */
.ticker { display: inline-block; padding-left: 100%; animation: ticker 30s linear infinite; white-space: nowrap; }
@keyframes ticker { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-100%, 0, 0); } }

/* --- TEXT EFFECTS --- */
.rainbow-text {
    background-image: linear-gradient(to right, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: rainbow 4s linear infinite;
    background-size: 200% auto;
}
@keyframes rainbow { 100% { background-position: 200% center; } }

/* --- REUSABLE ANIMATIONS --- */
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.animate-spin-slow { animation: spin-slow 4s linear infinite; }

/* S3: Chest-opening animation system */
@keyframes crateShake {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-10deg) scale(1.1); }
    75% { transform: rotate(10deg) scale(1.1); }
}
.animate-crate-shake { animation: crateShake 0.5s ease-in-out infinite; }

/* S3: Shake that builds in intensity over 1.2s */
@keyframes crate-shake-build {
    0%   { transform: translateX(0) rotate(0deg); }
    10%  { transform: translateX(-2px) rotate(-1deg); }
    20%  { transform: translateX(2px) rotate(1deg); }
    30%  { transform: translateX(-3px) rotate(-2deg); }
    40%  { transform: translateX(3px) rotate(2deg); }
    50%  { transform: translateX(-4px) rotate(-3deg); }
    60%  { transform: translateX(5px) rotate(3deg); }
    70%  { transform: translateX(-6px) rotate(-4deg); }
    80%  { transform: translateX(7px) rotate(4deg); }
    90%  { transform: translateX(-8px) rotate(-5deg); }
    100% { transform: translateX(0) rotate(0deg) scale(1.05); }
}
.animate-crate-shake-build { animation: crate-shake-build 1.2s ease-in forwards; }
.animate-crate-shake-build-fast { animation: crate-shake-build 0.6s ease-in forwards; }

/* S3: Lid flies open backward */
@keyframes crate-lid-open {
    0%   { transform: rotateX(0deg) translateY(0); }
    40%  { transform: rotateX(-80deg) translateY(-10px); }
    70%  { transform: rotateX(-110deg) translateY(-30px) scale(0.9); }
    100% { transform: rotateX(-130deg) translateY(-50px) scale(0.7); opacity: 0; }
}
.animate-lid-open { animation: crate-lid-open 0.5s ease-out forwards; }

/* S3: Light burst from inside chest */
@keyframes crate-light-burst {
    0%   { transform: scale(0); opacity: 0; }
    30%  { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(3); opacity: 0; }
}
.animate-light-burst { animation: crate-light-burst 0.6s ease-out forwards; }

/* S3: Light leaks from lid seam during buildup */
@keyframes crate-seam-glow {
    0%, 30% { opacity: 0; box-shadow: 0 0 0 transparent; }
    50%     { opacity: 0.4; box-shadow: 0 0 10px currentColor; }
    70%     { opacity: 0.7; box-shadow: 0 0 20px currentColor; }
    100%    { opacity: 1; box-shadow: 0 0 40px currentColor, 0 -10px 30px currentColor; }
}
.animate-seam-glow { animation: crate-seam-glow 1.2s ease-in forwards; }
.animate-seam-glow-fast { animation: crate-seam-glow 0.6s ease-in forwards; }

/* S3: Reward item rises from the open chest */
@keyframes crate-item-rise {
    0%   { transform: translateY(40px) scale(0.3); opacity: 0; }
    40%  { transform: translateY(-10px) scale(1.1); opacity: 1; }
    60%  { transform: translateY(-20px) scale(0.95); }
    100% { transform: translateY(-30px) scale(1); opacity: 1; }
}
.animate-item-rise { animation: crate-item-rise 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

/* S3: Particles scatter from chest opening */
@keyframes crate-particle {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--px, 30px), var(--py, -60px)) scale(0); opacity: 0; }
}
.animate-crate-particle { animation: crate-particle 0.8s ease-out forwards; }

@keyframes tease {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2) rotate(10deg); opacity: 1; }
    80% { transform: scale(0.9) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}
.animate-tease { animation: tease 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

@keyframes fortniteDance {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-30px) rotate(-360deg) scale(1.1); }
    50% { transform: translateY(0) rotate(-180deg) scale(0.9); }
    75% { transform: translateY(-15px) rotate(180deg) scale(1.1); }
}
.animate-fortnite { animation: fortniteDance 0.8s infinite ease-in-out; }

@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-50px) scale(1.5); opacity: 0; }
}
.animate-float-up { animation: floatUp 0.8s ease-out forwards; }

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}
.animate-heartbeat { animation: heartbeat 1.5s infinite ease-in-out; }

/* --- SCREEN SHAKE --- */
@keyframes shake-light {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes shake-heavy {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-10px, -5px); }
    20% { transform: translate(10px, 5px); }
    30% { transform: translate(-10px, 5px); }
    40% { transform: translate(10px, -5px); }
    50% { transform: translate(-5px, 10px); }
    60% { transform: translate(5px, -10px); }
    70% { transform: translate(-5px, -5px); }
    80% { transform: translate(5px, 5px); }
    90% { transform: translate(-5px, 5px); }
}

.shake-light { animation: shake-light 0.3s ease-in-out; }
.shake-heavy { animation: shake-heavy 0.5s ease-in-out; }

/* --- MEGA SPIN --- */
@keyframes gradient-x {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.animate-gradient-x {
    background-size: 200% 200%;
    animation: gradient-x 3s ease infinite;
}

/* NEON WHEEL COLORS */
#wheel {
    background: conic-gradient(
        var(--neon-red) 0deg 90deg,
        var(--neon-gold) 90deg 180deg,
        var(--neon-blue) 180deg 270deg,
        #a855f7 270deg 360deg
    ) !important;
}

#modal-spin {
    z-index: 10001 !important;
}

/* Hide mega-spin for non-Pro users */
#mega-spin-btn {
    display: none !important;
}

body.is-pro #mega-spin-btn {
    display: flex !important;
    height: 80px !important;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 30px rgba(234,179,8,0.5), 0 0 60px rgba(168,85,247,0.3);
    animation: pulse 2s ease-in-out infinite, gradient-x 3s ease infinite;
}

body.is-pro #go-pro-btn {
    display: none !important;
}

body.is-pro #ad-banner {
    display: none !important;
}

/* --- AVATARS --- */
#unlocked-avatars-grid img {
    width: 44px !important;
    height: 44px !important;
    object-fit: cover;
    border-radius: 8px;
}

/* --- CONFETTI --- */
@keyframes confetti-fall {
    0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffd700;
    top: -10px;
    z-index: 300;
    pointer-events: none;
    animation: confetti-fall 3s linear forwards;
}

/* --- FRIEND BOMB ANIMATIONS --- */
@keyframes bomb-flash {
    0% { opacity: 0; }
    20% { opacity: 0.8; }
    100% { opacity: 0; }
}

@keyframes bomb-particle {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(-50% + var(--end-x)), 
            calc(-50% + var(--end-y))
        ) scale(0);
        opacity: 0;
    }
}

@keyframes bomb-ring {
    0% {
        width: 20px;
        height: 20px;
        opacity: 1;
        border-width: 4px;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
        border-width: 1px;
    }
}

@keyframes bomb-emoji {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2) rotate(360deg);
        opacity: 0;
    }
}

/* ==========================================
   G1: PRE-ROUND INVENTORY SCREEN
   ========================================== */

.preround-item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    padding: 14px 8px 10px;
    border-radius: 12px;
    border: 1px solid;
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 0.2s, opacity 0.2s;
}

.preround-toggle {
    width: 52px;
    padding: 4px 0;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.preround-toggle-on {
    color: #fff;
}

.preround-toggle-off {
    background: transparent;
    border-color: #555;
    color: #888;
}

.preround-toggle:disabled {
    cursor: not-allowed;
    border-color: #333;
    color: #444;
    background: transparent;
}

.preround-countdown-ring {
    display: block;
}

/* ──────────────────────────────────────────────
   VS Items — 8-item kit visual effects
   ──────────────────────────────────────────────
   Most reactions are JS-driven (transient inset glow on the canvas,
   floating toasts, button orbit motion). These styles cover the
   persistent UI states the JS sets via class toggle.
*/

/* Decoy — opponent score is being lied to. Red tint + subtle wobble
   so even players who didn't see the toast notice the score is "off". */
.vs-decoy-spoofed {
    color: #fca5a5 !important;
    text-shadow: 0 0 12px rgba(252, 165, 165, 0.85);
    animation: vs-decoy-wobble 0.45s ease-in-out infinite alternate;
}
@keyframes vs-decoy-wobble {
    from { transform: translateX(-1px) scale(1); }
    to   { transform: translateX(1px)  scale(1.04); }
}

/* Time Freeze overlay pulse — frosted-blue glow at the canvas edges
   during a freeze. Animation declared inline in JS for tree-shaking,
   but the radial-gradient background is reused here as a fallback
   in case JS missed it. */
#vs-timefreeze-overlay {
    backdrop-filter: blur(1.5px) hue-rotate(180deg);
    -webkit-backdrop-filter: blur(1.5px) hue-rotate(180deg);
}

/* Barrier charge badge — small pill, top-left of game area. Persists
   between sabotage attempts (one decrement per absorb). */
#vs-barrier-charges {
    transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
}
#vs-barrier-charges:not(:empty) {
    animation: vs-barrier-charge-tick 0.4s ease-out;
}
@keyframes vs-barrier-charge-tick {
    0%   { transform: scale(1); box-shadow: 0 0 10px rgba(6,182,212,0.5); }
    40%  { transform: scale(1.15); box-shadow: 0 0 22px rgba(6,182,212,0.9); }
    100% { transform: scale(1); box-shadow: 0 0 10px rgba(6,182,212,0.5); }
}

/* VS item tray buttons — make sure 8 buttons fit comfortably on small
   phones. The grid layout in JS does most of the work; this just trims
   button size slightly so 2×4 doesn't crowd the right edge. */
#vs-item-tray button {
    width: 52px;
    height: 52px;
}
#vs-item-tray button span:first-child {
    font-size: 22px;
}