
/* ===================== RESET & BASE ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-primary: #070907;
    --bg-secondary: #0d120e;
    --bg-panel: #131b14;
    --bg-card: #111812;
    --bg-card-hover: #18251a;
    --green-neon: #00ff41;
    --green-bright: #39ff14;
    --green-dim: #00b32d;
    --green-dark: #0a3d1a;
    --green-glow: 0 0 12px rgba(0, 255, 65, 0.45), 0 0 28px rgba(0, 255, 65, 0.2);
    --green-glow-strong: 0 0 20px rgba(0, 255, 65, 0.8), 0 0 45px rgba(57, 255, 20, 0.45);
    --gold-frenzy: #ffd700;
    --red-dim: #ff5252;
    --blue-golf: #1e6fff;
    --text-primary: #00ff41;
    --text-secondary: #27c952;
    --text-muted: #12772d;
    --border-color: rgba(0, 255, 65, 0.22);
    --border-hover: rgba(0, 255, 65, 0.65);
    --font-main: 'Courier New', 'Lucida Console', Consolas, monospace;
    --transition-fast: 0.15s ease;
}

html, body { height: 100%; }

body {
    background: radial-gradient(circle at 40% 40%, #0d160f 0%, #060806 70%, #020402 100%);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--green-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-dim); }

/* ===================== START / SLOTS MENU SCREEN ===================== */
#start-menu-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, #0e1a10 0%, #060907 65%, #020302 100%);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#start-menu-screen.hidden { display: none; }

.menu-container {
    background: rgba(15, 24, 16, 0.94);
    border: 2px solid var(--green-neon);
    box-shadow: var(--green-glow-strong);
    border-radius: 14px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 28px 32px;
    backdrop-filter: blur(10px);
}

.menu-title {
    text-align: center;
    font-size: 1.8rem;
    color: var(--green-neon);
    text-shadow: var(--green-glow-strong);
    letter-spacing: 2px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.menu-subtitle {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 22px;
    font-style: italic;
}

.menu-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.menu-actions button {
    flex: 1;
    background: #142216;
    border: 1px solid var(--green-neon);
    color: var(--green-neon);
    padding: 10px 14px;
    border-radius: 6px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.menu-actions button:hover {
    background: var(--green-neon);
    color: #060a06;
    box-shadow: 0 0 16px rgba(0, 255, 65, 0.5);
}

.saves-scroll-area {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    background: #090e0a;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
}

.save-slot-card {
    background: #101912;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all var(--transition-fast);
}

.save-slot-card:hover {
    border-color: var(--green-neon);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.25);
    background: #172419;
}

.save-slot-card.active-slot {
    border-color: var(--green-bright);
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.35);
    background: #132215;
}

.slot-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.slot-name {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--green-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
}

.slot-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.slot-date { font-size: 0.65rem; color: var(--text-muted); }

.slot-buttons { display: flex; gap: 6px; flex-shrink: 0; }

.slot-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: bold;
    transition: all var(--transition-fast);
}

.slot-btn:hover {
    border-color: var(--green-neon);
    color: var(--green-neon);
    background: rgba(0, 255, 65, 0.1);
}

.slot-btn.play-btn {
    border-color: var(--green-neon);
    color: var(--green-neon);
    background: rgba(0, 255, 65, 0.15);
}

.slot-btn.play-btn:hover { background: var(--green-neon); color: #060906; }

.slot-btn.del-btn { border-color: rgba(255, 82, 82, 0.4); color: var(--red-dim); }
.slot-btn.del-btn:hover { background: var(--red-dim); color: #fff; border-color: var(--red-dim); }

.no-saves-msg {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: auto 0;
    padding: 30px 10px;
}

/* ===================== LAYOUT JOC ===================== */
#app {
    display: grid;
    grid-template-rows: 64px 1fr 52px;
    grid-template-columns: 1fr 440px;
    grid-template-areas:
        "header header"
        "game   shop"
        "footer footer";
    height: 100vh;
    max-width: 1650px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* ===================== HEADER & FRENZY BANNER ===================== */
#header {
    grid-area: header;
    background: rgba(13, 18, 14, 0.94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 100;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

#header h1 {
    font-size: 1.3rem;
    color: var(--green-neon);
    text-shadow: var(--green-glow);
    letter-spacing: 1.5px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.current-save-badge {
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: #112014;
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#stats {
    display: flex;
    gap: 22px;
    align-items: center;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.stat-value {
    font-size: 1.15rem;
    color: var(--green-bright);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    letter-spacing: 1px;
}

.stat-label {
    font-size: 0.62rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

#frenzy-banner {
    display: none;
    background: linear-gradient(90deg, #ff9900, #ffcc00, #ff5500);
    color: #000;
    font-weight: 900;
    font-size: 0.75rem;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 1px;
    box-shadow: 0 0 15px #ffaa00;
    animation: frenzyPulse 0.5s ease-in-out infinite alternate;
}

#frenzy-banner.active { display: flex; align-items: center; gap: 6px; }

@keyframes frenzyPulse {
    from { transform: scale(1); filter: brightness(1); }
    to { transform: scale(1.05); filter: brightness(1.2); }
}

#header-buttons { display: flex; gap: 8px; }

.btn-small {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 11px;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.72rem;
    font-weight: bold;
    transition: all var(--transition-fast);
}

.btn-small:hover {
    border-color: var(--green-neon);
    color: var(--green-neon);
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

/* ===================== GAME AREA (3D ARENA) ===================== */
#game-area {
    grid-area: game;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 16px 20px 14px;
    overflow: hidden;
    perspective: 1200px;
}

#lore-display {
    max-width: 660px;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 22, 15, 0.6);
    border: 1px solid rgba(0, 255, 65, 0.16);
    border-radius: 8px;
    padding: 8px 18px;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

#lore-text {
    font-size: 0.86rem;
    color: #4ef072;
    font-style: italic;
    line-height: 1.45;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#lore-text.visible { opacity: 1; }

/* 3D Slap Arena */
#slap-stage {
    position: relative;
    width: 380px;
    height: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
}

.energy-pedestal {
    position: absolute;
    bottom: 8px;
    width: 290px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(0,255,65,0.3) 0%, rgba(0,255,65,0.08) 50%, transparent 75%);
    border: 2px solid rgba(0, 255, 65, 0.4);
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.4), inset 0 0 20px rgba(0, 255, 65, 0.3);
    transform: rotateX(72deg);
    pointer-events: none;
    animation: pulseRing 3s ease-in-out infinite alternate;
}

@keyframes pulseRing {
    0% { transform: rotateX(72deg) scale(0.95); opacity: 0.7; }
    100% { transform: rotateX(72deg) scale(1.08); opacity: 1; filter: drop-shadow(0 0 12px #00ff41); }
}

#character-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    transition: transform 0.08s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#slap-target {
    height: 420px;
    width: auto;
    max-width: 320px;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.85)) drop-shadow(0 0 18px rgba(0, 255, 65, 0.35));
    transition: filter 0.15s ease, transform 0.08s ease;
    pointer-events: none;
    display: block;
}

#slap-stage:hover #slap-target {
    filter: drop-shadow(0 12px 24px rgba(0,0,0,0.95)) drop-shadow(0 0 28px rgba(0, 255, 65, 0.7));
}

/* ===================== RANDOMIZED 3D SLAP HANDS ===================== */
#slap-hand-3d {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    z-index: 50;
    font-size: 7.5rem;
    filter: drop-shadow(-8px 10px 14px rgba(0,0,0,0.8)) drop-shadow(0 0 25px #00ff41);
}

.slap-anim-right {
    right: -30px; top: 25%;
    animation: slapAnimRight 0.22s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}
@keyframes slapAnimRight {
    0% { opacity: 0; transform: translate3d(140px, -70px, 200px) rotate(-45deg) scale(1.8); }
    35% { opacity: 1; transform: translate3d(-15px, 10px, 40px) rotate(15deg) scale(1.05); }
    100% { opacity: 0; transform: translate3d(-40px, 30px, -30px) rotate(-10deg) scale(0.85); }
}

.slap-anim-backhand {
    left: -30px; top: 25%;
    animation: slapAnimBackhand 0.22s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}
@keyframes slapAnimBackhand {
    0% { opacity: 0; transform: translate3d(-140px, -70px, 200px) rotate(45deg) scale(-1.8, 1.8); }
    35% { opacity: 1; transform: translate3d(15px, 10px, 40px) rotate(-15deg) scale(-1.05, 1.05); }
    100% { opacity: 0; transform: translate3d(40px, 30px, -30px) rotate(10deg) scale(-0.85, 0.85); }
}

.slap-anim-overhead {
    top: -20px; left: 35%;
    animation: slapAnimOverhead 0.24s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}
@keyframes slapAnimOverhead {
    0% { opacity: 0; transform: translate3d(0, -120px, 250px) rotate(-90deg) scale(2); }
    40% { opacity: 1; transform: translate3d(0, 80px, 50px) rotate(-90deg) scale(1.1); }
    100% { opacity: 0; transform: translate3d(0, 140px, -20px) rotate(-90deg) scale(0.8); }
}

.slap-anim-tornado {
    right: 10px; top: 20%;
    animation: slapAnimTornado 0.28s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}
@keyframes slapAnimTornado {
    0% { opacity: 0; transform: translate3d(100px, -50px, 150px) rotate(0deg) scale(1.6); }
    40% { opacity: 1; transform: translate3d(-10px, 10px, 30px) rotate(360deg) scale(1.15); filter: drop-shadow(0 0 35px #ffff00); }
    100% { opacity: 0; transform: translate3d(-40px, 40px, -20px) rotate(450deg) scale(0.8); }
}

.slap-anim-critical {
    right: -20px; top: 22%;
    animation: slapAnimCrit 0.26s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}
@keyframes slapAnimCrit {
    0% { opacity: 0; transform: translate3d(160px, -90px, 250px) rotate(-30deg) scale(2.2); filter: drop-shadow(0 0 50px #ffd700); }
    35% { opacity: 1; transform: translate3d(-20px, 15px, 60px) rotate(20deg) scale(1.3); filter: drop-shadow(0 0 60px #ffd700) brightness(1.5); }
    100% { opacity: 0; transform: translate3d(-50px, 50px, -40px) scale(0.9); }
}

.slap-shockwave {
    position: absolute;
    top: 35%; left: 48%;
    transform: translate(-50%, -50%);
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 3px solid var(--green-bright);
    box-shadow: 0 0 20px var(--green-neon);
    pointer-events: none;
    animation: shockwaveExpand 0.45s ease-out forwards;
    z-index: 45;
}
@keyframes shockwaveExpand {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(5.5); }
}

.recoil-left { animation: recoilLeft 0.24s ease-out forwards; }
.recoil-right { animation: recoilRight 0.24s ease-out forwards; }
.recoil-down { animation: recoilDown 0.26s ease-out forwards; }
.recoil-heavy { animation: recoilHeavy 0.3s ease-out forwards; }

@keyframes recoilLeft {
    0% { transform: rotateY(0deg) scale(1); }
    30% { transform: translate3d(-22px, 6px, -25px) rotateY(-22deg) scale(0.95); filter: brightness(1.4) drop-shadow(0 0 30px #39ff14); }
    100% { transform: rotateY(0deg) scale(1); }
}
@keyframes recoilRight {
    0% { transform: rotateY(0deg) scale(1); }
    30% { transform: translate3d(22px, 6px, -25px) rotateY(22deg) scale(0.95); filter: brightness(1.4) drop-shadow(0 0 30px #39ff14); }
    100% { transform: rotateY(0deg) scale(1); }
}
@keyframes recoilDown {
    0% { transform: translateY(0); }
    30% { transform: translate3d(0, 24px, -30px) scale(0.92); filter: brightness(1.5) drop-shadow(0 0 30px #39ff14); }
    100% { transform: translateY(0); }
}
@keyframes recoilHeavy {
    0% { transform: scale(1); }
    25% { transform: translate3d(-15px, 20px, -40px) rotate(-8deg) scale(0.9); filter: brightness(1.8) drop-shadow(0 0 50px #ffd700); }
    100% { transform: scale(1); }
}

/* Combo Streak & Click Info Bar */
.bottom-click-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

#click-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    background: rgba(13, 22, 15, 0.5);
    padding: 6px 18px;
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 65, 0.18);
}
#click-info span {
    color: var(--green-bright);
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

#combo-badge {
    display: none;
    background: linear-gradient(90deg, #ff3300, #ff9900);
    color: #fff;
    font-weight: 900;
    font-size: 0.82rem;
    padding: 5px 14px;
    border-radius: 20px;
    box-shadow: 0 0 16px rgba(255, 80, 0, 0.7);
    letter-spacing: 1px;
    animation: comboPulse 0.3s ease infinite alternate;
}
#combo-badge.active { display: flex; align-items: center; gap: 4px; }
@keyframes comboPulse { from { transform: scale(0.96); } to { transform: scale(1.06); } }

/* ===================== PARTICLES ===================== */
#particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 200;
}

.particle {
    position: absolute;
    color: var(--green-bright);
    font-weight: 900;
    font-family: var(--font-main);
    pointer-events: none;
    animation: floatUp3D 0.9s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
    text-shadow: 0 0 10px #39ff14, 0 0 20px #00ff41;
    white-space: nowrap;
}

.particle.crit {
    color: #ffd700;
    text-shadow: 0 0 15px #ffd700, 0 0 25px #ff9900;
    font-size: 1.6rem !important;
}

.particle-emoji {
    position: absolute;
    font-size: 2.2rem;
    pointer-events: none;
    animation: floatUpSpin 0.75s ease-out forwards;
    filter: drop-shadow(0 0 10px #00ff41);
}

@keyframes floatUp3D {
    0% { opacity: 1; transform: translate3d(0, 0, 0) scale(0.9); }
    50% { opacity: 1; transform: translate3d(0, -60px, 50px) scale(1.35); }
    100% { opacity: 0; transform: translate3d(0, -130px, 80px) scale(1.6); }
}

@keyframes floatUpSpin {
    0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(0.8); }
    100% { opacity: 0; transform: translate(0, -90px) rotate(40deg) scale(1.3); }
}

/* ===================== WILD ENCOUNTER ALERT POPUP (FIXED POSITIONING UNDER HEADER) ===================== */
#wild-encounter-toast {
    position: fixed;
    top: 76px; /* Sub header, perfect vizibil */
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #181010;
    border: 2px solid #ff3333;
    box-shadow: 0 0 30px rgba(255, 50, 50, 0.75), inset 0 0 15px rgba(255, 0, 0, 0.3);
    border-radius: 12px;
    padding: 12px 22px;
    display: none; /* Ascuns nativ fara sa iasa din ecran */
    align-items: center;
    gap: 16px;
    z-index: 3500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#wild-encounter-toast.show {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.encounter-exclamation {
    font-size: 2.2rem;
    color: #ff3333;
    font-weight: 900;
    animation: exclaimPulse 0.4s ease-in-out infinite alternate;
}
@keyframes exclaimPulse { from { transform: scale(1); } to { transform: scale(1.25); } }

.encounter-info { display: flex; flex-direction: column; gap: 2px; }
.encounter-title { font-size: 0.8rem; font-weight: 900; color: #ff8888; text-transform: uppercase; letter-spacing: 1px; }
.encounter-name { font-size: 1.05rem; font-weight: 900; color: #ffbb33; text-shadow: 0 0 8px #ffaa00; }

.encounter-actions { display: flex; gap: 8px; align-items: center; }

.encounter-btn {
    background: #ff3333;
    color: #fff;
    font-family: var(--font-main);
    font-weight: 900;
    font-size: 0.85rem;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(255, 50, 50, 0.6);
    transition: transform 0.1s ease;
}
.encounter-btn:hover { transform: scale(1.06); background: #ff5555; }

.encounter-dismiss-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #bbb;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: var(--font-main);
}
.encounter-dismiss-btn:hover { color: #fff; border-color: #fff; }

/* ===================== POKÉMON BATTLE INTRO FX ===================== */
#pokemon-transition-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 5000;
    pointer-events: none;
    display: none;
}
#pokemon-transition-overlay.active { display: block; }

.poke-flash {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #fff;
    animation: pokeFlashStrobe 0.75s steps(2, start) forwards;
}
@keyframes pokeFlashStrobe {
    0% { opacity: 0; } 20% { opacity: 1; } 40% { opacity: 0; } 60% { opacity: 1; } 80% { opacity: 0; } 100% { opacity: 1; }
}

.poke-slash-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
}
.poke-slice {
    flex: 1;
    background: #000;
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.85, 0, 0.15, 1);
}
.poke-slice:nth-child(even) { transform-origin: left; }
.poke-slice:nth-child(odd) { transform-origin: right; }
.poke-slice.slice-in { transform: scaleX(1); }

/* VS Banner popup */
#poke-vs-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(3, 8, 4, 0.96);
    z-index: 5100;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#poke-vs-screen.active { display: flex; }

.vs-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    width: 100%;
    max-width: 800px;
}

.fighter-card {
    flex: 1;
    background: #0c180e;
    border: 2px solid var(--green-neon);
    box-shadow: var(--green-glow);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    animation: slideInFighter 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.fighter-card.boss-side {
    border-color: #ff9900;
    box-shadow: 0 0 25px rgba(255, 153, 0, 0.5);
    background: #191206;
}

.fighter-avatar { font-size: 5rem; margin-bottom: 10px; line-height: 1; }
.fighter-name { font-size: 1.2rem; font-weight: 900; color: var(--green-bright); }
.fighter-card.boss-side .fighter-name { color: #ffaa00; }
.fighter-quote { font-size: 0.8rem; color: #aaa; font-style: italic; margin-top: 6px; }

.vs-badge {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ff3333;
    text-shadow: 0 0 20px #ff0000;
    animation: pulseVs 0.4s ease-in-out infinite alternate;
}
@keyframes pulseVs { from { transform: scale(0.9); } to { transform: scale(1.2); } }

@keyframes slideInFighter {
    from { opacity: 0; transform: translateY(60px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===================== EPIC FULLSCREEN BOSS BATTLE ARENA ===================== */
#boss-arena-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(20, 10, 5, 0.98) 0%, rgba(4, 4, 4, 0.99) 100%);
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#boss-arena-modal.active { display: flex; }

.arena-box {
    background: #0f1510;
    border: 3px solid #ff9900;
    box-shadow: 0 0 45px rgba(255, 153, 0, 0.6);
    border-radius: 18px;
    width: 100%;
    max-width: 820px;
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.arena-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 153, 0, 0.35);
    padding-bottom: 10px;
}

.arena-boss-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: #ffaa00;
    display: flex;
    align-items: center;
    gap: 12px;
}

.arena-timer {
    font-size: 1.5rem;
    font-weight: 900;
    color: #ff3333;
    background: #250909;
    border: 2px solid #ff3333;
    padding: 4px 16px;
    border-radius: 8px;
    box-shadow: 0 0 14px rgba(255, 50, 50, 0.5);
}

.boss-hp-container {
    width: 100%;
    background: #181010;
    border: 1px solid rgba(255, 80, 80, 0.5);
    border-radius: 8px;
    height: 26px;
    position: relative;
    overflow: hidden;
}

.boss-hp-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff3333, #ff8800, #ffdd00);
    width: 100%;
    transition: width 0.08s ease;
    box-shadow: 0 0 12px #ff3333;
}

.boss-hp-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 5px #000;
}

.boss-target-area {
    width: 100%;
    height: 300px;
    background: radial-gradient(circle, #2b1d0c 0%, #110e07 70%);
    border: 2px solid rgba(255, 170, 0, 0.5);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.boss-target-avatar {
    font-size: 7rem;
    line-height: 1;
    filter: drop-shadow(0 0 25px rgba(255, 170, 0, 0.7));
    animation: bossFightIdle 1.2s ease-in-out infinite alternate;
    pointer-events: none;
    transition: transform 0.08s ease;
}
#chibi-boss-canvas {
    width: 280px;
    height: 280px;
    max-width: 90%;
    max-height: 90%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    pointer-events: none;
    filter: drop-shadow(0 0 25px rgba(255, 170, 0, 0.7));
    transition: transform 0.08s ease;
}
@keyframes bossFightIdle {
    0% { transform: translateY(-8px) scale(1); }
    100% { transform: translateY(8px) scale(1.04); }
}

.boss-target-area.hit .boss-target-avatar,
.boss-target-area.hit #chibi-boss-canvas {
    animation: bossHitStumble 0.12s ease-out;
    filter: brightness(1.8) drop-shadow(0 0 40px #ff3333);
}
@keyframes bossHitStumble {
    0%, 100% { transform: scale(1); }
    30% { transform: translate(-14px, 8px) scale(0.92) rotate(-5deg); }
    70% { transform: translate(14px, -6px) scale(0.92) rotate(5deg); }
}

.weakspot-target {
    position: absolute;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 220, 0, 0.9) 0%, rgba(255, 80, 0, 0.7) 60%, transparent 100%);
    border: 3px solid #ffff00;
    box-shadow: 0 0 25px #ffd700, inset 0 0 15px #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    animation: weakspotPulse 0.4s ease-in-out infinite alternate;
    z-index: 20;
}
@keyframes weakspotPulse {
    from { transform: scale(0.95); box-shadow: 0 0 15px #ffd700; }
    to { transform: scale(1.25); box-shadow: 0 0 30px #ff3300; }
}

#boss-attack-banner {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #990000;
    border: 2px solid #ff3333;
    box-shadow: 0 0 25px #ff0000;
    color: #fff;
    font-weight: 900;
    font-size: 0.95rem;
    padding: 8px 24px;
    border-radius: 20px;
    display: none;
    z-index: 30;
    animation: attackBlink 0.3s ease infinite alternate;
}
@keyframes attackBlink { from { filter: brightness(1); } to { filter: brightness(1.4); } }

#ko-screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 40;
}
#ko-screen.show { display: flex; }

.ko-text {
    font-size: 5.5rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 40px #ff9900, 0 0 80px #ff3300;
    letter-spacing: 4px;
    animation: koZoom 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
@keyframes koZoom {
    0% { transform: scale(0.2); opacity: 0; }
    50% { transform: scale(1.4); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.cps-gauge-box {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #090e09;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 18px;
}

.cps-gauge-val { font-size: 1.2rem; font-weight: 900; color: var(--green-bright); }
.cps-req-val { font-size: 0.85rem; color: #ffaa00; font-weight: bold; }
.arena-hint { font-size: 0.78rem; color: #aaa; text-align: center; }

.exhaust-smoke {
    position: absolute;
    bottom: 40px; right: 50px;
    width: 18px; height: 18px;
    background: rgba(30, 30, 30, 0.9);
    border-radius: 50%;
    animation: smokeFly 0.8s ease-out forwards;
    pointer-events: none;
}
@keyframes smokeFly {
    0% { transform: scale(0.6) translateY(0); opacity: 0.9; }
    100% { transform: scale(4) translateY(-80px) translateX(40px); opacity: 0; }
}

/* ===================== SHOP PANEL ===================== */
#shop-panel {
    grid-area: shop;
    background: rgba(13, 18, 14, 0.95);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 90;
}

#shop-tabs {
    display: flex;
    background: #090e0a;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.shop-tab {
    flex: 1;
    padding: 12px 4px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: bold;
    text-align: center;
    transition: all var(--transition-fast);
}

.shop-tab.active {
    background: var(--bg-panel);
    border-bottom-color: var(--green-neon);
    color: var(--green-neon);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}

.shop-tab:hover:not(.active) { color: var(--green-dim); background: rgba(0, 255, 65, 0.05); }

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px 20px;
    scrollbar-gutter: stable;
}

.tab-content.active { display: block; }

.upgrade-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 9px;
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 12px;
    align-items: center;
}

.upgrade-card:hover:not(.locked) {
    border-color: var(--border-hover);
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.25);
    background: var(--bg-card-hover);
}

.upgrade-card:active:not(.locked) { transform: scale(0.98); }
.upgrade-card.locked { opacity: 0.38; cursor: not-allowed; filter: grayscale(0.5); }
.upgrade-card.affordable { border-color: rgba(0, 255, 65, 0.45); }

.upgrade-icon {
    font-size: 1.8rem;
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upgrade-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.upgrade-name {
    font-size: 0.86rem;
    color: var(--green-neon);
    font-weight: bold;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.upgrade-badge {
    display: inline-block;
    font-size: 0.65rem;
    background: rgba(0, 255, 65, 0.15);
    border: 1px solid rgba(0, 255, 65, 0.4);
    color: var(--green-bright);
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: normal;
}

.upgrade-desc {
    font-size: 0.72rem;
    color: #4df172;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}

.upgrade-effect {
    font-size: 0.67rem;
    color: var(--text-muted);
    font-weight: bold;
    line-height: 1.25;
}

.upgrade-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
}

.upgrade-cost {
    font-size: 0.85rem;
    color: var(--green-bright);
    font-weight: bold;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.upgrade-card.locked .upgrade-cost { color: var(--red-dim); }

.upgrade-owned {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: bold;
    background: rgba(0, 255, 65, 0.1);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 65, 0.2);
}

.click-upgrade { grid-template-columns: 42px 1fr auto; }
.click-upgrade.purchased {
    opacity: 0.6;
    border-color: var(--green-dark);
    cursor: default;
    background: #0b110c;
}

.purchased-check { font-size: 1.2rem; color: var(--green-neon); font-weight: bold; }

.boss-card {
    border-color: rgba(255, 170, 0, 0.4);
    background: #141208;
}
.boss-card.beaten { border-color: rgba(0, 255, 65, 0.35); background: #0c150e; }
.boss-card .upgrade-name { color: #ffbb33; }
.boss-card.beaten .upgrade-name { color: var(--green-neon); }

.boss-call-btn {
    background: #1a2c1b;
    border: 1px solid var(--green-neon);
    color: var(--green-neon);
    font-weight: bold;
    font-family: var(--font-main);
    font-size: 0.72rem;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.boss-call-btn:hover { background: var(--green-neon); color: #000; }

/* ===================== FOOTER / ACHIEVEMENTS BAR ===================== */
#achievements-footer {
    grid-area: footer;
    background: #090e0a;
    border-top: 1px solid var(--border-color);
    padding: 0 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 100;
}

#achievements-footer .label {
    font-size: 0.75rem;
    color: var(--green-neon);
    font-weight: bold;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.achievement-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    opacity: 0.3;
    filter: grayscale(1);
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    position: relative;
    cursor: default;
}

.achievement-badge.unlocked {
    opacity: 1;
    filter: none;
    border-color: var(--green-neon);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.45);
    background: #102514;
}

.achievement-badge.unlocked:hover { transform: scale(1.18); }

.achievement-badge .tooltip {
    display: none;
    position: absolute;
    bottom: 44px;
    left: 50%;
    transform: translateX(-50%);
    background: #0a130b;
    border: 1px solid var(--green-neon);
    padding: 7px 12px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 0.72rem;
    color: var(--green-neon);
    box-shadow: var(--green-glow);
    z-index: 300;
    pointer-events: none;
}

.achievement-badge:hover .tooltip { display: block; }

/* ===================== TOAST ===================== */
#toast-container {
    position: fixed;
    top: 72px; right: 20px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #0d170f;
    border: 1px solid var(--green-neon);
    box-shadow: var(--green-glow);
    padding: 12px 18px;
    border-radius: 8px;
    animation: toastIn 0.35s ease, toastOut 0.35s ease 3.2s forwards;
    max-width: 340px;
}

.toast-title { font-size: 0.85rem; color: var(--green-neon); font-weight: bold; margin-bottom: 4px; }
.toast-desc { font-size: 0.72rem; color: var(--text-secondary); }

@keyframes toastIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100px); } }

/* ===================== MODALS ===================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal-box {
    background: var(--bg-panel);
    border: 2px solid var(--green-neon);
    box-shadow: var(--green-glow-strong);
    border-radius: 12px;
    padding: 28px;
    max-width: 520px;
    width: 100%;
    text-align: center;
}

.modal-box h3 {
    color: var(--green-neon);
    font-size: 1.2rem;
    margin-bottom: 16px;
    text-shadow: var(--green-glow);
}

.modal-box p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 22px;
}

.modal-box input[type="text"] {
    width: 100%;
    background: #080d09;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    outline: none;
}
.modal-box input[type="text"]:focus {
    border-color: var(--green-neon);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.4);
}

.modal-box button {
    background: transparent;
    border: 1px solid var(--green-neon);
    color: var(--green-neon);
    padding: 8px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: bold;
    transition: all var(--transition-fast);
}

.modal-box button:hover {
    background: var(--green-neon);
    color: #060906;
    box-shadow: 0 0 15px #00ff41;
}

#save-textarea {
    width: 100%;
    height: 110px;
    background: #080d09;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.72rem;
    padding: 10px;
    border-radius: 6px;
    resize: vertical;
    margin-bottom: 16px;
}

.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

button.danger { border-color: var(--red-dim) !important; color: var(--red-dim) !important; }
button.danger:hover { background: var(--red-dim) !important; color: #fff !important; box-shadow: 0 0 15px var(--red-dim) !important; }

/* ===================== BACKGROUND PARTICLES ===================== */
#bg-particles {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bg-dot {
    position: absolute;
    width: 2px; height: 2px;
    background: var(--green-dim);
    border-radius: 50%;
    opacity: 0.35;
    animation: bgFloat linear infinite;
}

@keyframes bgFloat {
    from { transform: translateY(105vh); opacity: 0; }
    15% { opacity: 0.35; }
    85% { opacity: 0.35; }
    to { transform: translateY(-5vh); opacity: 0; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 950px) {
    #app {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr 310px 48px;
        grid-template-areas:
            "header"
            "game"
            "shop"
            "footer";
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #slap-stage { height: 380px; width: 300px; }
    #slap-target { height: 330px; }
    #header h1 { font-size: 1.15rem; }
    .stat-value { font-size: 1.05rem; }
}

@media (max-width: 550px) {
    #header { padding: 8px 12px; flex-direction: column; height: auto; }
    #stats { gap: 14px; }
    #slap-stage { height: 310px; width: 260px; }
    #slap-target { height: 270px; }
    .vs-box { flex-direction: column; gap: 14px; }
    .boss-target-area { height: 240px; }
    .boss-target-avatar { font-size: 5rem; }
    #chibi-boss-canvas { width: 220px; height: 220px; }
}

/* ===================== RHYTHM SYSTEM STYLING ===================== */
#rhythm-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
    background: rgba(13, 22, 14, 0.75);
    border: 1px solid rgba(0, 255, 65, 0.35);
    border-radius: 20px;
    padding: 6px 16px;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.rhythm-bpm-badge {
    background: rgba(0, 255, 65, 0.15);
    border: 1px solid var(--green-neon);
    color: var(--green-bright);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

#rhythm-rating-text {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1px;
    transition: transform 0.1s ease, color 0.15s ease;
}

.hit-perfect {
    color: #ffd700 !important;
    text-shadow: 0 0 14px rgba(255, 215, 0, 0.9), 0 0 25px rgba(255, 215, 0, 0.5);
    transform: scale(1.18);
}

.hit-great {
    color: #00f0ff !important;
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.8);
    transform: scale(1.1);
}

.hit-good {
    color: #39ff14 !important;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
}

.hit-miss {
    color: #718096 !important;
}

#rhythm-streak-badge {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: #ff6b6b;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 800;
    transition: all 0.2s ease;
}

#rhythm-streak-badge.streak-high {
    background: rgba(255, 215, 0, 0.25);
    border-color: #ffd700;
    color: #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

#rhythm-target-ring {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    border: 2px dashed rgba(0, 255, 65, 0.35);
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.15);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#rhythm-pulse-ring {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    border: 2px solid rgba(0, 255, 65, 0.7);
    pointer-events: none;
    z-index: 11;
    animation: rhythmBeatPulse 0.5s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

@keyframes rhythmBeatPulse {
    0% {
        transform: scale(1.4);
        opacity: 0.1;
        border-color: rgba(0, 255, 65, 0.2);
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: scale(1.0);
        opacity: 0.95;
        border-color: rgba(57, 255, 20, 0.9);
        box-shadow: 0 0 25px rgba(0, 255, 65, 0.6);
    }
}

body.rhythm-frenzy-active::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1500;
    border: 6px solid #ffd700;
    box-shadow: inset 0 0 35px rgba(255, 215, 0, 0.6), 0 0 30px rgba(255, 0, 128, 0.6);
    animation: frenzyBorderPulse 0.4s ease-in-out infinite alternate;
}

@keyframes frenzyBorderPulse {
    0% { border-color: #ffd700; box-shadow: inset 0 0 35px rgba(255, 215, 0, 0.6); }
    50% { border-color: #00f0ff; box-shadow: inset 0 0 45px rgba(0, 240, 255, 0.7); }
    100% { border-color: #ff007f; box-shadow: inset 0 0 50px rgba(255, 0, 127, 0.8); }
}

/* ===================== STAGE BACKGROUND THEMES ===================== */
#stage-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    background: rgba(8, 14, 10, 0.82);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 14px;
    padding: 6px 16px;
    backdrop-filter: blur(8px);
    width: 90%;
    max-width: 440px;
}

.stage-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: bold;
}

#stage-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

#stage-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff41, #ffd700);
    transition: width 0.3s ease;
}

body.stage-theme-0 {
    background: radial-gradient(circle at 40% 40%, #0d1e11 0%, #060e08 65%, #020503 100%) !important;
}

body.stage-theme-1 {
    background: radial-gradient(circle at 50% 40%, #0a2233 0%, #05131e 65%, #01060a 100%) !important;
    --border-color: rgba(0, 240, 255, 0.3);
}

body.stage-theme-2 {
    background: radial-gradient(circle at 50% 40%, #1e0d33 0%, #10061e 65%, #04010a 100%) !important;
}

body.stage-theme-3 {
    background: radial-gradient(circle at 50% 40%, #2b120d 0%, #170805 65%, #070201 100%) !important;
}

body.stage-theme-4 {
    background: radial-gradient(circle at 50% 40%, #2b1e0a 0%, #191004 65%, #080501 100%) !important;
}

body.stage-theme-5 {
    background: radial-gradient(circle at 50% 40%, #1d0933 0%, #09021a 60%, #010006 100%) !important;
}

/* ===================== MULTI-CURRENCY HEADER STYLING ===================== */
.stat-currencies {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.45);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.coin-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: default;
}

.coin-copper {
    background: rgba(184, 115, 51, 0.18);
    border: 1px solid rgba(184, 115, 51, 0.55);
    color: #e69a53;
}

.coin-silver {
    background: rgba(192, 192, 192, 0.18);
    border: 1px solid rgba(215, 215, 215, 0.65);
    color: #e8e8e8;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

.coin-gold {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.7);
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* ===================== CURRENCY EXCHANGE TAB ===================== */
.exchange-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
}

.exchange-header-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.exchange-rate-banner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 8px;
    font-size: 0.82rem;
    color: #a0aec0;
}

.exchange-action-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.15s ease;
}

.exchange-action-card:hover {
    border-color: var(--green-neon);
    background: var(--bg-card-hover);
}

.exchange-btn {
    background: rgba(0, 255, 65, 0.2);
    border: 1px solid var(--green-neon);
    color: #fff;
    font-weight: bold;
    font-family: inherit;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.exchange-btn:hover {
    background: var(--green-neon);
    color: #000;
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.6);
}

.exchange-btn:active {
    transform: scale(0.95);
}

.exchange-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #4a5568;
    background: transparent;
    color: #718096;
}

.auto-convert-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 6px;
}

/* ===================== LUCKY FLOATING COIN ===================== */
#lucky-floating-coin {
    position: fixed;
    z-index: 1200;
    cursor: pointer;
    font-size: 2.8rem;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
    animation: luckyCoinFloat 8s linear forwards, luckyCoinSpin 1.2s ease-in-out infinite alternate;
    user-select: none;
}

@keyframes luckyCoinSpin {
    0% { transform: scale(0.9) rotate(-10deg); }
    100% { transform: scale(1.15) rotate(15deg); }
}

@keyframes luckyCoinFloat {
    0% {
        top: 85vh;
        left: -80px;
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        top: 15vh;
        left: 105vw;
        opacity: 0;
    }
}

/* ===================== AD SENSE SLOTS (GREEN & GOLD NEON) ===================== */
.game-ad-slot-container {
    position: relative;
    width: 100%;
    background: rgba(13, 22, 15, 0.85);
    border: 1px solid rgba(0, 255, 65, 0.3);
    box-shadow: 0 0 16px rgba(0, 255, 65, 0.15);
    border-radius: 10px;
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    z-index: 5;
}

.game-ad-slot-container:hover {
    border-color: rgba(0, 255, 65, 0.65);
    box-shadow: 0 0 22px rgba(0, 255, 65, 0.35);
}

.game-ad-badge {
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--green-neon, #00ff41);
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.game-ad-slot-container .adsbygoogle {
    width: 100%;
    min-height: 40px;
}

.game-ad-slot-container .ad-placeholder-text {
    font-size: 0.72rem;
    color: #27c952;
    letter-spacing: 0.5px;
    opacity: 0.8;
    text-align: center;
    text-shadow: 0 0 6px rgba(0, 255, 65, 0.25);
}

.game-ad-slot-container ins:not(:empty) + .ad-placeholder-text,
.game-ad-slot-container ins[data-ad-status="filled"] + .ad-placeholder-text {
    display: none !important;
}

.palma-arena-ad {
    max-width: 480px;
    margin-top: 6px;
    min-height: 50px;
    max-height: 120px;
}

.palma-shop-ad {
    margin-top: 14px;
    margin-bottom: 12px;
    min-height: 50px;
    max-height: 120px;
    border-color: rgba(255, 215, 0, 0.35);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.15);
}

.palma-shop-ad .game-ad-badge {
    color: #ffd700;
}

.palma-shop-ad .ad-placeholder-text {
    color: #ffd700;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.25);
}

.palma-shop-ad:hover {
    border-color: rgba(255, 215, 0, 0.7);
    box-shadow: 0 0 22px rgba(255, 215, 0, 0.35);
}

@media (max-width: 950px) {
    .palma-arena-ad {
        max-width: 100%;
        min-height: 48px;
        max-height: 85px;
        padding: 3px 8px;
        margin-top: 4px;
    }
    .palma-shop-ad {
        min-height: 48px;
        max-height: 85px;
        padding: 3px 8px;
        margin-top: 8px;
    }
}
