:root {
    --primary: #00f2ff;
    --secondary: #ff00ea;
    --danger: #ff3333;
    --gold: #ffd700;
    --toxic: #39ff14;
    --purple: #9d00ff;
    --blue: #0088ff;
    --bg: #050505;
    --panel: rgba(22, 22, 22, 0.98);
}

* {
    box-sizing: border-box;
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: white;
    font-family: 'Segoe UI', sans-serif;
    overflow: auto;
    transition: filter 0.5s;
    min-height: 100vh;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #111;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
    border: 2px solid #000;
}

::-webkit-scrollbar-thumb:hover {
    background: white;
}

@keyframes spinOrbit {
    from { transform: rotate(0deg) translateX(100px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(100px) rotate(-360deg); }
}

@keyframes portalBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes coinFlip {
    0% { transform: rotateY(0); }
    100% { transform: rotateY(1800deg); }
}

@keyframes jumpScareAnim {
    0% { transform: scale(0.1); opacity: 0; }
    50% { transform: scale(1.5); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7); }
    100% { box-shadow: 0 0 0 20px rgba(0,0,0,0); }
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.btn {
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-family: 'Bungee';
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
    font-size: 14px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.25) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}
.btn:hover::after { opacity: 1; }
.btn:hover { transform: scale(1.04); filter: brightness(1.12); }
.btn:active { transform: scale(0.94); filter: brightness(0.95); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }
.btn-primary { background: var(--primary); color: black; box-shadow: 0 4px 0 rgba(0,242,255,0.3); }
.btn-secondary { background: var(--secondary); color: white; box-shadow: 0 4px 0 rgba(255,0,234,0.3); }
.btn-danger { background: var(--danger); color: white; }
.btn-gold { background: var(--gold); color: black; }
.btn-toxic { background: var(--toxic); color: black; }
.btn-purple { background: var(--purple); color: white; }
.btn-blue { background: var(--blue); color: white; }

.back-btn { position: fixed; top: 20px; left: 20px; z-index: 1000; }

.notification {
    position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-20px);
    background: rgba(10,10,18,0.95); border: 1px solid rgba(255,255,255,0.12); padding: 12px 24px;
    font-family: 'Bungee'; z-index: 99999; display: none; color: var(--gold);
    font-size: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); border-radius: 14px;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    max-width: min(420px, 90vw);
}

#notif,
#whisper-notif,
#chat-feed,
#dm-feed,
.game-status,
.reaction-readout,
#leaderboard-list {
    direction: ltr;
    unicode-bidi: plaintext;
    text-align: left;
}

.whisper-notif {
    display: none;
    position: fixed;
    top: 18px;
    right: 20px;
    width: min(340px, 92vw);
    background: linear-gradient(135deg, rgba(20, 20, 25, 0.97), rgba(40, 0, 60, 0.94));
    border: 2px solid var(--secondary);
    border-radius: 12px;
    padding: 12px 42px 12px 12px;
    z-index: 2147483647;
    box-shadow: 0 0 25px rgba(255, 0, 234, 0.35);
    cursor: pointer;
}

.whisper-title {
    font-family: 'Black Ops One';
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.whisper-text {
    font-family: 'Roboto Mono';
    font-size: 12px;
    color: #ddd;
    line-height: 1.35;
}

.whisper-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
}

#auth-screen {
    position: fixed; inset: 0; z-index: 10000; background: #000;
    display: flex; justify-content: center; align-items: center;
    background-image: radial-gradient(circle, #111 10%, #000 90%);
}

.login-box {
    width: 450px; text-align: center; border: 4px solid var(--primary);
    box-shadow: 0 0 60px var(--primary); padding: 50px; background: #111; border-radius: 20px;
}

.login-input {
    width: 100%; padding: 15px; margin: 10px 0; background: #222;
    border: 1px solid #444; color: white; font-family: 'Roboto Mono';
    text-align: center; font-size: 18px; border-radius: 5px;
}

#site-hub {
    display: none; min-height: 100vh; flex-direction: column; align-items: flex-start;
    padding: 40px 20px 60px; position: relative; overflow-y: auto;
    background: linear-gradient(-45deg, #050505, #1a001a, #001a1a);
    background-size: 400% 400%; animation: portalBG 15s ease infinite;
    max-width: 1400px; margin: 0 auto;
}
#site-hub > * {
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}
#site-hub .hub-title, #site-hub .hub-stats, #site-hub .game-grid {
    width: 100%;
    max-width: 1100px;
}
#site-hub .hub-stats {
    justify-content: flex-start;
}


.hub-title {
    font-family: 'Black Ops One'; font-size: clamp(28px, 5vw, 56px); color: transparent;
    -webkit-text-stroke: 2px var(--primary); margin: 0; text-shadow: 0 0 16px var(--primary);
    text-align: center;
}

.hub-stats {
    font-family: 'Bungee'; color: #fff; font-size: 14px; background: rgba(0,0,0,0.7);
    padding: 8px 16px; border-radius: 20px; border: 1px solid var(--gold);
    margin-top: 10px; display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap; justify-content: center;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    z-index: 2;
    margin-top: 35px;
    width: min(1400px, 92vw);
    padding-bottom: 50px;
}

.game-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.55);
    border-color: #00ffe8;
}

.game-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.screen-fade {
    animation: fadeIn 0.35s ease both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

#hub-event-progress {
    width: min(900px, 90vw);
    margin-top: 12px;
    height: 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    overflow: hidden;
}

#hub-event-progress-fill {
    width: 0%; height: 100%; background: linear-gradient(90deg, #00f2ff, #ff00ea);
    transition: width 0.4s ease;
}

body::before {
    content: '';
    position: fixed; inset: 0;
    pointer-events: none;
    background-image: radial-gradient(circle at 20% 15%, rgba(0,255,255,0.2), transparent 15%), radial-gradient(circle at 80% 35%, rgba(255,0,234,0.2), transparent 20%), radial-gradient(circle at 40% 80%, rgba(255,255,40,0.15), transparent 14%);
    mix-blend-mode: screen;
    animation: driftBG 16s ease-in-out infinite;
    z-index: 1;
}

@keyframes driftBG {
    0% { transform: translate(0, 0); }
    50% { transform: translate(8px, -8px); }
    100% { transform: translate(0, 0); }
}

.game-mode-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    min-height: 100vh;
    inset: 0;
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(4px);
    z-index: 100000;
    overflow-y: auto;
    padding: 20px;
}

.controller-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 10px 0;
}

.game-status {
    margin-top: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 10px;
    border-radius: 10px;
}

.card-row {
    display: flex;
    gap: 8px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.horse-track {
    margin-top: 10px;
    display: grid;
    gap: 8px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 10px;
}

.horse-lane {
    width: 100%;
    height: 28px;
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    position: relative;
}

.horse-lane .horse-emoji {
    position: absolute;
    left: 0;
    transform: translateX(0);
    transition: transform 0.1s linear;
}

.scratch-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.scratch-cell {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.scratch-cell.revealed {
    background: rgba(255,255,255,0.2);
}



.mines-input {
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: #111;
    border-radius: 8px;
    color: white;
}

.mission-card { margin-bottom: 6px; }

.mission-progress-fill { transition: width 0.3s ease; }

.mission-title { font-size: 10px; }

.mission-meta { font-size: 10px; }

.mission-list { overflow-y: auto; }

.btn-green { background: #0f0; color: black; }

.mission-card .btn { font-size: 10px; }

.mission-card span { font-size: 10px; }

.game-mode-panel h1 { margin: 10px 0; }

#event-banner { position: fixed; top: 0; width: 100%; text-align: center; font-family: 'Bungee'; font-size: 14px; background: rgba(0, 0, 0, 0.8); padding: 5px; color: #fff; z-index: 9999; display: none; }

.mission-card .btn { margin-left: auto; }

.mission-card .mission-icon { min-width: 40px; }

.horse-lane .finish-line { position: absolute; right: 0; width: 4px; height: 100%; background: #fff; }

#leaderboard-panel, #friends-panel, #prestige-panel, #auction-panel { width: min(1100px,90vw); margin-top: 20px; border: 1px solid rgba(255,255,255,0.2); border-radius:12px; padding:10px; background:rgba(0,0,0,.55); }

#leaderboard-panel h3, #friends-panel h3, #prestige-panel h3, #auction-panel h3 { margin:0 0 8px 0; }

.missions-panel {
    width: min(1100px, 92vw);
    margin-top: 22px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.68), rgba(0, 20, 25, 0.62));
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 0 28px rgba(0, 0, 0, 0.45);
}

.missions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Black Ops One';
    letter-spacing: 1px;
    color: var(--gold);
    margin-bottom: 10px;
}

#daily-mission-counter {
    font-family: 'Roboto Mono';
    font-size: 12px;
    color: #ddd;
}

.missions-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 6px;
}

.mission-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px;
}

.mission-card.ready {
    border-color: rgba(255, 215, 0, 0.65);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.16);
}

.mission-card.claimed {
    opacity: 0.72;
}

.mission-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    background: rgba(255, 255, 255, 0.08);
}

.mission-content {
    flex: 1;
    min-width: 0;
}

.mission-title {
    font-family: 'Bungee';
    font-size: 11px;
    color: #fff;
    margin-bottom: 6px;
}

.mission-progress {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.mission-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 999px;
    transition: width 0.25s ease;
}

.mission-meta {
    font-family: 'Roboto Mono';
    font-size: 11px;
    color: #bbb;
    margin-top: 6px;
}

.game-card {
    width: 220px; background: rgba(20,20,25,0.9); border: 2px solid #444;
    border-radius: 20px; padding: 25px; text-align: center; transition: 0.3s;
    cursor: pointer; position: relative; overflow: hidden;
    backdrop-filter: blur(3px);
    justify-self: center;
}

.game-card:hover {
    transform: translateY(-20px); border-color: var(--gold);
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.2);
}

.game-card h2 {
    margin: 0 0 14px;
    font-family: 'Black Ops One';
    letter-spacing: 1px;
}

.game-icon {
    font-size: 50px; margin-bottom: 20px; display: block;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.5));
}

#event-banner {
    display: none; position: fixed; top: 0; width: 100%;
    background: linear-gradient(90deg, gold, orange); color: black;
    text-align: center; font-family: 'Black Ops One'; font-size: 20px;
    padding: 10px; z-index: 30000; animation: pulseRed 1s infinite;
    border-bottom: 3px solid white;
}

#game-clicker {
    display: none; height: 100vh; grid-template-columns: 350px 1fr 350px;
    background: radial-gradient(circle at center, #1a1a1a, #000);
}

.shop-col {
    background: rgba(15,15,15,0.98); border-right: 2px solid #333;
    border-left: 2px solid #333; display: flex; flex-direction: column;
}

.shop-header {
    padding: 20px; text-align: center; font-family: 'Black Ops One';
    color: white; background: #111; border-bottom: 2px solid #333;
    font-size: 22px; letter-spacing: 2px;
}

.shop-list { flex: 1; overflow-y: auto; padding: 20px; }

/* Always show a scrollbar thumb even when the list is not overflowing, to match the other panel style. */
.shop-list.force-scroll { overflow-y: scroll; }

.shop-card {
    background: linear-gradient(135deg, #222, #151515); border: 2px solid #333;
    border-left: 5px solid #555; border-radius: 12px; padding: 15px; margin-bottom: 15px;
    display: flex; align-items: center; justify-content: space-between;
    transition: 0.2s; box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}

.shop-card:hover { transform: translateX(5px); border-color: #555; }
.shop-card.power { border-left-color: var(--primary); }
.shop-card.auto { border-left-color: var(--secondary); }
.shop-card.pet { border-left-color: orange; }
.shop-card.skin { border-left-color: white; }

.card-icon { font-size: 35px; margin-right: 15px; width: 40px; text-align: center; }
.card-info { flex: 1; }
.card-title { font-family: 'Bungee'; font-size: 13px; color: white; display: block; margin-bottom: 3px; }
.card-stats { font-family: 'Roboto Mono'; font-size: 11px; color: #aaa; display: block; }

.card-btn {
    background: #333; color: #888; border: none; padding: 8px 15px;
    border-radius: 6px; font-weight: bold; cursor: not-allowed;
    font-family: 'Black Ops One'; font-size: 12px;
}

.card-btn.can-buy { background: var(--toxic); color: black; cursor: pointer; box-shadow: 0 3px 0 #005500; }
.card-btn.can-buy:active { transform: translateY(2px); box-shadow: none; }

.clicker-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }

.upgrade-slider-wrap {
    width: min(540px, 86%);
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 18px;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.35);
}

.right-slider-wrap {
    width: calc(100% - 24px);
    margin: 12px;
    margin-bottom: 8px;
}

.upgrade-slider-text {
    display: block;
    font-family: 'Bungee';
    font-size: 12px;
    color: #ddd;
    margin-bottom: 8px;
    text-align: center;
}

.upgrade-tier-slider {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
    height: 8px;
    border-radius: 999px;
    background: rgba(0, 242, 255, 0.16);
    outline: none;
}

.upgrade-tier-slider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 242, 255, 0.22), rgba(0, 242, 255, 0.5));
    border: 1px solid rgba(0, 242, 255, 0.35);
}

.upgrade-tier-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -6px;
    border-radius: 50%;
    background: #00f2ff;
    border: 2px solid #ffffff;
    box-shadow: 0 0 12px rgba(0, 242, 255, 0.9);
}

.upgrade-tier-slider::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 242, 255, 0.22), rgba(0, 242, 255, 0.5));
    border: 1px solid rgba(0, 242, 255, 0.35);
}

.upgrade-tier-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00f2ff;
    border: 2px solid #ffffff;
    box-shadow: 0 0 12px rgba(0, 242, 255, 0.9);
}

.toilet-btn {
    width: 300px; height: 300px; background: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 160px;
    cursor: pointer; border: 12px solid var(--primary); box-shadow: 0 0 100px var(--primary);
    z-index: 10; transition: 0.05s; position: relative;
}

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

.pet-orbit { position: absolute; width: 100%; height: 100%; top: 0; left: 0; pointer-events: none; }

.pet-slot {
    position: absolute; width: 50px; height: 50px; font-size: 40px;
    text-align: center; line-height: 50px; animation: spinOrbit 6s linear infinite;
    top: 50%; left: 50%; margin-top: -25px; margin-left: -25px;
    filter: drop-shadow(0 0 10px var(--secondary));
}

.money-display {
    font-family: 'Black Ops One'; font-size: 60px; color: var(--gold);
    text-shadow: 0 0 25px rgba(255,215,0,0.6); margin-bottom: 5px;
}

.dps-display {
    font-family: 'Bungee'; color: #888; font-size: 16px; margin-bottom: 50px;
    background: #111; padding: 8px 20px; border-radius: 20px; border: 1px solid #333;
}

#game-guess, #game-slots, #game-crate, #game-crypto, #game-mines, #game-plinko, #game-roulette, #game-flip, #game-rps, #game-target, #game-reaction, #game-code, #game-duel {
    display: none; height: 100vh; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle, #111, #000);
}

.reaction-stage {
    width: min(620px, 90vw);
    height: 230px;
    border-radius: 18px;
    border: 3px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Black Ops One';
    font-size: clamp(28px, 5vw, 54px);
    letter-spacing: 2px;
    background: linear-gradient(135deg, #1a1a1a, #0b0b0b);
    box-shadow: inset 0 0 35px rgba(255, 255, 255, 0.07), 0 0 35px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    user-select: none;
}

.reaction-stage.waiting {
    border-color: #888;
    color: #ddd;
}

.reaction-stage.ready {
    border-color: #39ff14;
    color: #062806;
    text-shadow: none;
    background: radial-gradient(circle at center, #8eff7e, #39ff14);
}

.reaction-readout {
    margin-top: 16px;
    font-family: 'Bungee';
    font-size: 18px;
    color: var(--gold);
    text-align: center;
}

.code-log {
    width: min(520px, 90vw);
    min-height: 210px;
    max-height: 260px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 10px 12px;
    font-family: 'Roboto Mono';
    color: #ddd;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.code-log-line {
    padding: 7px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.duel-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 12px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.duel-board {
    width: min(620px, 92vw);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #3a3a3a;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.35);
}

.duel-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-family: 'Bungee';
    color: #ddd;
    margin-bottom: 10px;
}

.duel-guess-buttons {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.rps-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.rps-result {
    margin-top: 20px;
    min-width: 360px;
    text-align: center;
    font-family: 'Roboto Mono';
    padding: 12px 16px;
    border: 1px solid #333;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
}

.target-hud {
    display: flex;
    gap: 25px;
    font-family: 'Bungee';
    margin: 15px 0;
}

.target-area {
    width: min(700px, 92vw);
    height: min(420px, 58vh);
    border: 3px solid var(--danger);
    border-radius: 14px;
    position: relative;
    background: radial-gradient(circle at center, #1a0a0a, #080808);
    overflow: hidden;
    touch-action: manipulation;
}

.target-dot {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid white;
    background: radial-gradient(circle, #ff7777, var(--danger));
    position: absolute;
    cursor: crosshair;
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.8);
    animation: pulseRed 0.9s infinite;
}

#game-shooter {
    display: none; height: 100vh; background: #000022; position: relative; overflow: hidden; cursor: none;
}

.cards-container { display: flex; gap: 30px; perspective: 1200px; margin: 60px 0; }

.guess-card {
    width: 180px; height: 260px; position: relative; transform-style: preserve-3d;
    transition: 0.6s; cursor: pointer;
}

.guess-card.flipped { transform: rotateY(180deg); }

.card-face {
    position: absolute; inset: 0; backface-visibility: hidden; display: flex;
    align-items: center; justify-content: center; font-size: 80px;
    border-radius: 18px; border: 4px solid #444;
}

.card-front { background: #222; color: var(--secondary); }
.card-back { background: white; transform: rotateY(180deg); }

.shooter-ui {
    position: absolute; top: 20px; right: 20px; text-align: right;
    z-index: 10; font-family: 'Bungee'; pointer-events: none; font-size: 24px;
}

.player-ship {
    position: absolute; bottom: 30px; width: 70px; height: 70px; font-size: 60px;
    transform: translateX(-50%); z-index: 5; text-align: center;
}

.enemy { position: absolute; font-size: 50px; z-index: 4; }
.bullet { position: absolute; width: 8px; height: 25px; background: var(--toxic); z-index: 3; }

#loading-screen {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.loading-logo {
    font-family: 'Black Ops One';
    font-size: clamp(34px, 7vw, 76px);
    color: transparent;
    -webkit-text-stroke: 2px var(--primary);
    text-shadow: 0 0 30px rgba(0,242,255,0.45);
    animation: pulseLogo 1.2s ease-in-out infinite;
}

.loading-sub {
    font-family: 'Roboto Mono';
    font-size: 13px;
    opacity: 0.85;
}

.loading-bar {
    width: min(420px, 80vw);
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    overflow: hidden;
}

#loading-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--gold));
    transition: width 0.2s ease;
}

@keyframes pulseLogo {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.02); filter: brightness(1.2); }
}

.notification {
    display: none;
    align-items: center;
    gap: 8px;
    animation: toastSlideIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.notif-icon { font-size: 18px; }
.notif-title { font-family: 'Bungee'; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.notif-message { font-family: 'Roboto Mono'; font-size: 12px; color: #eafcff; }

.notification.win { border-color: rgba(45,253,119,0.5); box-shadow: 0 8px 32px rgba(45,253,119,0.2); }
.notification.loss { border-color: rgba(255,85,85,0.5); box-shadow: 0 8px 32px rgba(255,85,85,0.2); }
.notification.info { border-color: rgba(0,242,255,0.4); box-shadow: 0 8px 32px rgba(0,242,255,0.15); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.login-floaters {
    position: absolute;
    inset: 8px;
    pointer-events: none;
    opacity: 0.25;
    font-size: 20px;
}

.login-box { position: relative; overflow: hidden; }

.login-floaters span {
    position: absolute;
    animation: floatEmoji 5s ease-in-out infinite;
}

.login-floaters span:nth-child(1) { left: 8%; top: 12%; animation-delay: 0s; }
.login-floaters span:nth-child(2) { left: 78%; top: 20%; animation-delay: 1s; }
.login-floaters span:nth-child(3) { left: 18%; top: 72%; animation-delay: 2s; }
.login-floaters span:nth-child(4) { left: 72%; top: 76%; animation-delay: 3s; }

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

.game-card {
    position: relative;
}

.game-card::after {
    content: attr(data-desc);
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    font-size: 11px;
    font-family: 'Roboto Mono';
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    color: #ddf9ff;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 6px;
    pointer-events: none;
}

.game-card:hover::after {
    opacity: 1;
    transform: translateY(0);
}

#admin-panel { align-items: stretch; justify-content: center; }

.admin-shell {
    width: min(1280px, 96vw);
    height: min(90vh, 900px);
    background: rgba(8,10,20,0.96);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 18px;
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
    display: grid;
    grid-template-columns: 230px 1fr;
    overflow: hidden;
}

.admin-sidebar {
    background: linear-gradient(180deg, rgba(0,15,25,0.9), rgba(15,0,25,0.9));
    border-right: 1px solid rgba(255,255,255,0.12);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
}

.admin-nav-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    color: white;
    cursor: pointer;
    font-family: 'Bungee';
    font-size: 12px;
}

.admin-nav-btn.active { border-color: var(--primary); box-shadow: 0 0 18px rgba(0,242,255,0.3); }

.admin-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    padding: 12px 14px;
}

.admin-header h1 {
    margin: 0;
    font-family: 'Black Ops One';
    letter-spacing: 1px;
}

.admin-sub { font-size: 12px; font-family: 'Roboto Mono'; color: #9ac9d0; }

.admin-section {
    display: none;
    padding: 12px;
    overflow: auto;
    min-height: 0;
}

.admin-section.active { display: block; }

#admin-section-players.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.admin-card {
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-card strong { font-size: 22px; font-family: 'Black Ops One'; }

.admin-row { margin-bottom: 10px; }

.admin-table-wrap {
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    overflow: auto;
    flex: 1;
    min-height: 0;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Roboto Mono';
    font-size: 12px;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 8px;
    text-align: left;
    vertical-align: middle;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-family: 'Bungee';
}

.status-online { background: rgba(45,253,119,0.2); color: #7fffad; border: 1px solid rgba(45,253,119,0.5); }
.status-offline { background: rgba(150,150,150,0.2); color: #d5d5d5; border: 1px solid rgba(160,160,160,0.5); }
.status-banned { background: rgba(255,60,60,0.2); color: #ff8f8f; border: 1px solid rgba(255,60,60,0.5); }

.admin-scroll {
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    max-height: 330px;
    overflow: auto;
    padding: 8px;
}

.event-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 12px;
}

.event-status {
    border-radius: 999px;
    padding: 3px 10px;
    font-family: 'Bungee';
    font-size: 11px;
}

.event-status.on { background: rgba(35,240,120,0.2); color: #4dffac; }
.event-status.off { background: rgba(255,75,75,0.2); color: #ff8a8a; }

.switch { position: relative; display: inline-block; width: 58px; height: 32px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #444; transition: 0.2s; border-radius: 999px;
}
.slider:before {
    content: ""; position: absolute; height: 24px; width: 24px; left: 4px; top: 4px;
    background: white; transition: 0.2s; border-radius: 50%;
}
.switch input:checked + .slider { background: #2de673; }
.switch input:checked + .slider:before { transform: translateX(26px); }

#admin-edit-modal,
#admin-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.admin-dialog-box {
    width: min(420px, 92vw);
    background: rgba(13,13,24,0.98);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* --- New Admin Section Styles --- */
.admin-game-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.admin-game-toggle-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.admin-game-toggle-card span {
    font-family: 'Bungee';
    font-size: 11px;
    color: #ddd;
}

.admin-top-players {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-top-players li {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-family: 'Roboto Mono';
    font-size: 12px;
    color: #ccc;
}

.admin-top-players li:first-child { color: #ffd700; font-weight: bold; }
.admin-top-players li:nth-child(2) { color: #c0c0c0; }
.admin-top-players li:nth-child(3) { color: #cd7f32; }

.admin-action-log {
    max-height: 200px;
    overflow: auto;
    padding: 8px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    font-family: 'Roboto Mono';
    font-size: 11px;
    color: #aaa;
}

.admin-action-log div {
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.admin-action-log .log-time { color: #666; margin-right: 8px; }

.admin-section h4 {
    margin: 0 0 8px 0;
    font-family: 'Bungee';
    font-size: 13px;
}

.admin-sidebar { overflow-y: auto; }

#admin-section-economy .controller-row,
#admin-section-games .controller-row,
#admin-section-security .controller-row,
#admin-section-tools .controller-row,
#admin-section-editor .controller-row {
    flex-wrap: wrap;
}

#settings-modal,
#rewards-modal,
#daily-popup,
#profile-popup,
#inventory-modal,
#weapon-shop-modal,
#auction-house-modal,
#updates-modal {
    animation: modalIn 0.22s ease both;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.98) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.achievement-card.legendary {
    position: relative;
    overflow: hidden;
}

.achievement-card.legendary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255, 215, 0, 0.26), transparent);
    transform: translateX(-120%);
    animation: shimmer 1.8s infinite;
}

.achievement-card.locked {
    filter: grayscale(0.5);
    opacity: 0.72;
}

.achievement-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 8px;
    right: 10px;
}

@keyframes shimmer {
    to { transform: translateX(120%); }
}

.msg-user::before {
    content: '●';
    color: #7a7a7a;
    margin-right: 4px;
}

.msg-user.online::before { color: #39ff14; }

.admin-badge {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 4px;
    border-radius: 4px;
    background: #c72424;
    color: white;
    font-size: 10px;
    font-family: 'Bungee';
}

.empty-state {
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    color: #b5c8d1;
    font-family: 'Roboto Mono';
    background: rgba(255,255,255,0.03);
}

.ripple {
    position: absolute;
    border-radius: 999px;
    transform: scale(0);
    animation: rippleAnim 0.5s linear;
    background: rgba(255,255,255,0.4);
    pointer-events: none;
}

@keyframes rippleAnim {
    to { transform: scale(3.6); opacity: 0; }
}

button,
.btn,
input,
select,
textarea,
a {
    outline: none;
}

button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    box-shadow: 0 0 0 2px rgba(0,242,255,0.45), 0 0 0 4px rgba(0,0,0,0.45);
}

.msg-time { font-size: 11px; }
.msg-user { font-size: 11px; }

@media (max-width: 980px) {
    .admin-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .admin-sidebar {
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.12);
        padding: 8px;
    }

    .admin-nav-btn span {
        display: none;
    }

    .admin-main { min-height: 0; }
}



#shooter-shop-modal {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.95);
    z-index: 100; flex-direction: column; align-items: center; justify-content: center;
}

.mines-ui { display: flex; gap: 40px; }

.mines-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
    width: 500px; height: 500px; background: #151515; padding: 15px; border-radius: 15px;
}

.mine-tile {
    background: #2a2a2a; border-radius: 8px; cursor: pointer; display: flex;
    align-items: center; justify-content: center; font-size: 40px;
}

.mine-tile.revealed { background: #0a0a0a; border: 2px solid #333; }
.mine-tile.safe { border-color: cyan; }
.mine-tile.exploded { border-color: red; }

.mines-input {
    width: 100%; background: #222; border: 1px solid #444; padding: 10px; color: white; text-align: center;
}

.plinko-board {
    width: 600px; height: 500px; position: relative; background: #111;
    border: 4px solid var(--secondary); border-radius: 20px; overflow: hidden; margin-bottom: 20px;
}

.plinko-peg { position: absolute; width: 8px; height: 8px; background: white; border-radius: 50%; }
.plinko-ball { position: absolute; width: 14px; height: 14px; background: var(--primary); border-radius: 50%; z-index: 10; }

.plinko-slot {
    position: absolute; bottom: 0; width: 10%; height: 30px; display: flex;
    align-items: center; justify-content: center; font-size: 10px;
    font-weight: bold; color: black; border-top: 2px solid black;
}

.roulette-track-container {
    width: 800px; height: 120px; background: #111; border: 4px solid var(--gold);
    border-radius: 10px; overflow: hidden; position: relative; margin-bottom: 40px;
}

.roulette-track { display: flex; height: 100%; transition: transform 5s cubic-bezier(0.1, 0.9, 0.3, 1); }

.roulette-tile {
    width: 100px; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 40px; flex-shrink: 0; border-right: 2px solid rgba(0,0,0,0.5); font-family: 'Black Ops One';
}

.r-red { background: #b00; }
.r-black { background: #111; }
.r-green { background: #0b0; }

.coin {
    width: 250px; height: 250px; position: relative; transform-style: preserve-3d;
    transition: transform 3s ease-out; margin-bottom: 50px;
}

.coin-side {
    position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 100px; border: 10px solid var(--gold);
    background: #333; backface-visibility: hidden;
}

.coin-front { transform: rotateY(0deg); }
.coin-back { transform: rotateY(180deg); }

#game-flappy {
    display: none; height: 100vh; flex-direction: column; align-items: center;
    justify-content: center; background: skyblue; position: relative; overflow: hidden;
}

#flappy-canvas {
    border: 4px solid #333; background: #4ec0ca; box-shadow: 0 0 50px rgba(0,0,0,0.5); cursor: pointer;
}

.flappy-score {
    position: absolute; top: 100px; font-family: 'Black Ops One'; font-size: 60px;
    color: white; -webkit-text-stroke: 2px black; z-index: 10;
}

#game-memory {
    display: none; height: 100vh; flex-direction: column; align-items: center;
    justify-content: center; background: radial-gradient(circle, #200020, #000);
}

.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; perspective: 1000px; }

.mem-card {
    width: 100px; height: 100px; position: relative; transform-style: preserve-3d; transition: 0.5s; cursor: pointer;
}

.mem-card.flipped { transform: rotateY(180deg); }

.mem-face {
    position: absolute; inset: 0; backface-visibility: hidden; display: flex; align-items: center;
    justify-content: center; font-size: 40px; border-radius: 10px; border: 2px solid #555;
}

.mem-front { background: linear-gradient(45deg, #333, #111); color: var(--gold); font-family: 'Bungee'; }
.mem-back { background: white; transform: rotateY(180deg); border-color: var(--primary); }
.mem-back.matched { background: lime; border-color: white; box-shadow: 0 0 20px lime; }

#cat { position: fixed; pointer-events: none; z-index: 999999; font-size: 30px; }

.crypto-dashboard { width: 100%; max-width: 1000px; display: flex; flex-direction: column; gap: 20px; }

.crypto-header {
    display: flex; justify-content: space-between; align-items: center; background: #111;
    padding: 15px; border: 1px solid #333; border-radius: 10px;
}

.crypto-networth { font-family: 'Black Ops One'; font-size: 24px; color: var(--gold); }

.news-ticker-container {
    width: 100%; background: #220000; border: 1px solid red; overflow: hidden;
    white-space: nowrap; padding: 5px 0; border-radius: 5px; margin-bottom: 10px;
}

.news-ticker {
    display: inline-block; padding-left: 100%; animation: ticker 15s linear infinite;
    font-family: 'Roboto Mono'; color: white; font-size: 14px;
}

@keyframes ticker {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

.coin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; width: 100%; }

.coin-card {
    background: #0a0a0a; border: 1px solid #333; padding: 15px; border-radius: 10px;
    position: relative; overflow: hidden; transition: 0.3s; box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.coin-card:hover { border-color: var(--primary); transform: translateY(-5px); box-shadow: 0 0 20px rgba(0, 242, 255, 0.1); }

.coin-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.coin-name { font-family: 'Black Ops One'; font-size: 20px; color: white; }
.coin-price { font-family: 'Roboto Mono'; font-size: 18px; color: var(--gold); }

.coin-chart { width: 100%; height: 60px; background: rgba(255,255,255,0.02); border-bottom: 1px solid #222; margin-bottom: 10px; }

.coin-stats { display: flex; justify-content: space-between; font-size: 12px; font-family: 'Bungee'; color: #888; margin-bottom: 10px; }

.trend-up { color: var(--toxic); }
.trend-down { color: var(--danger); }

.trade-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }

.trade-btn { border: none; padding: 8px; font-family: 'Bungee'; cursor: pointer; border-radius: 4px; transition: 0.2s; font-size: 12px; }

.btn-buy { background: rgba(57, 255, 20, 0.2); color: var(--toxic); border: 1px solid var(--toxic); }
.btn-buy:hover { background: var(--toxic); color: black; }
.btn-sell { background: rgba(255, 51, 51, 0.2); color: var(--danger); border: 1px solid var(--danger); }
.btn-sell:hover { background: var(--danger); color: white; }

#side-buttons-bar {
    position: fixed;
    top: 80px;
    right: 12px;
    z-index: 2147483647;
    display: none;
    flex-direction: column;
    gap: 6px;
    pointer-events: auto;
}

#side-buttons-bar button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.5;
    transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

#side-buttons-bar button:hover {
    opacity: 1;
    transform: scale(1.18);
    box-shadow: 0 0 18px rgba(0,242,255,0.5), 0 0 40px rgba(0,242,255,0.15);
    border-color: var(--primary);
}
#side-buttons-bar button:active {
    transform: scale(0.92);
    box-shadow: 0 0 6px rgba(0,242,255,0.3);
}

.weapon-grid {
    width: min(1200px, 96vw);
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.weapon-card {
    background: rgba(8, 8, 18, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px;
    box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.5);
}

.weapon-title {
    font-family: 'Bungee';
    font-size: 14px;
}

.weapon-meta {
    font-family: 'Roboto Mono';
    font-size: 12px;
    opacity: 0.9;
    margin: 6px 0;
}

.rarity-common { border-color: #ffffff; box-shadow: 0 0 10px rgba(255,255,255,0.25); }
.rarity-rare { border-color: #00eaff; box-shadow: 0 0 14px rgba(0,234,255,0.35); }
.rarity-epic { border-color: #b34dff; box-shadow: 0 0 14px rgba(179,77,255,0.4); }
.rarity-legendary { border-color: #ffcf3a; box-shadow: 0 0 14px rgba(255,207,58,0.45); }

.auction-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-family: 'Roboto Mono';
    font-size: 12px;
}



/* --- CHAT OVERLAY --- */
#chat-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 2147483636;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
#chat-overlay.open { display: block; opacity: 1; }

/* --- CHAT PANEL (slide-in from right) --- */
#chat-modal {
    position: fixed;
    top: 0; right: 0;
    width: 380px;
    height: 100%;
    background: rgba(8, 8, 14, 0.96);
    border-left: 2px solid rgba(0, 242, 255, 0.25);
    z-index: 2147483638;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
#chat-modal.open {
    transform: translateX(0);
}
#chat-modal.minimized {
    height: 48px;
    top: auto;
    bottom: 70px;
    right: 12px;
    width: 200px;
    border-radius: 12px;
    border: 2px solid rgba(0,242,255,0.3);
    transform: translateX(0);
}
#chat-modal.minimized .chat-messages,
#chat-modal.minimized .chat-input-area { display: none; }

.chat-header {
    background: rgba(0,0,0,0.5);
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Black Ops One';
    color: var(--primary);
    font-size: 14px;
    letter-spacing: 1px;
    flex-shrink: 0;
}
.chat-header-btn {
    width: 30px; height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: #aaa;
    cursor: pointer;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.chat-header-btn:hover { background: rgba(255,255,255,0.12); color: white; }
.chat-close-btn:hover { background: rgba(255,50,50,0.3); color: #ff5555; border-color: rgba(255,50,50,0.4); }

.chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: 'Roboto Mono';
    font-size: 12px;
    scroll-behavior: smooth;
}

.chat-input-area {
    padding: 12px;
    background: rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.chat-input-area input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    font-family: 'Roboto Mono';
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input-area input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(0,242,255,0.15);
}
.chat-emoji-btn, .chat-send-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.chat-emoji-btn {
    background: rgba(255,255,255,0.06);
    color: white;
}
.chat-emoji-btn:hover { background: rgba(255,255,255,0.12); transform: scale(1.1); }
.chat-send-btn {
    background: var(--primary);
    color: #000;
    font-weight: bold;
}
.chat-send-btn:hover { background: #33f5ff; transform: scale(1.08); box-shadow: 0 0 14px rgba(0,242,255,0.5); }

/* --- CHAT MESSAGE BUBBLES --- */
.chat-msg {
    background: rgba(255,255,255,0.06);
    padding: 8px 12px;
    border-radius: 12px 12px 12px 4px;
    max-width: 88%;
    word-wrap: break-word;
    color: #ddd;
    animation: msgSlideIn 0.25s ease both;
    position: relative;
}
.chat-msg.mine {
    align-self: flex-end;
    background: rgba(0,120,255,0.2);
    border: 1px solid rgba(0,120,255,0.15);
    border-radius: 12px 12px 4px 12px;
    color: white;
}

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

.msg-user {
    font-weight: bold;
    color: var(--gold);
    font-size: 10px;
    margin-bottom: 3px;
    display: block;
}
.msg-user.online::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--toxic);
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.msg-time { font-size: 9px; color: #555; float: right; margin-left: 5px; margin-top: 3px; }

.chat-del-btn { background: none; border: none; color: #444; cursor: pointer; font-size: 10px; margin-left: 5px; float: right; transition: color 0.2s; }
.chat-del-btn:hover { color: #ff5555; }

.owner-tag { background: var(--danger); color: white; padding: 2px 5px; border-radius: 3px; font-size: 8px; margin-right: 5px; font-weight: bold; font-family: 'Black Ops One'; }

.notif-dot {
    position: absolute; top: -5px; right: -5px; width: 15px; height: 15px; background: red;
    border-radius: 50%; border: 2px solid white; display: none; animation: pulseRed 1s infinite;
}

/* --- TROPHY / ACHIEVEMENT MODAL --- */
#daily-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.daily-box {
    width: min(420px, 90vw);
    background: rgba(15, 15, 20, 0.98);
    border: 2px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
    padding: 28px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.daily-box h1 {
    margin: 0;
    font-size: 42px;
    letter-spacing: 2px;
}

.daily-box button {
    width: 100%;
    max-width: 300px;
}

#rewards-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.rewards-box {
    width: min(650px, 95vw);
    max-height: 85vh;
    background: rgba(15, 15, 20, 0.97);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.achievement-card {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 14px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    margin-bottom: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.achievement-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.25);
}
.achievement-card.claimed { opacity: 0.6; }
.achievement-card.ready { border-color: var(--gold); }

.achievement-icon {
    font-size: 42px;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.achievement-body { flex: 1; }
.achievement-title { font-family: 'Black Ops One'; font-size: 16px; margin: 0; color: white; }
.achievement-desc { font-size: 12px; color: #aaa; margin: 4px 0 8px; }

.achievement-progress { display: flex; align-items: center; gap: 10px; }
.achievement-progress-bar {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}
.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 999px;
    transition: width 0.3s;
}
.achievement-progress-text { font-size: 12px; color: #bbb; min-width: 55px; text-align: right; }
.achievement-reward { font-size: 12px; color: #ccc; margin-top: 6px; }

.achievement-action { display: flex; align-items: center; }

/* --- CRATE UI --- */
#crate-result-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.crate-result-box {
    width: min(480px, 90vw);
    background: rgba(15, 15, 20, 0.97);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 80px rgba(255, 215, 0, 0.4);
}

.crate-result-icon { font-size: 70px; margin-bottom: 18px; text-shadow: 0 0 30px var(--gold); }
.crate-result-text { font-family: 'Bungee'; font-size: 22px; margin-bottom: 24px; color: var(--primary); }

.crate-window {
    position: relative;
    width: min(940px, 92vw);
    height: 220px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 30%, rgba(0, 255, 255, 0.08), rgba(0, 0, 0, 0.85));
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 0 0 60px rgba(0, 255, 255, 0.12);
    margin: 25px 0;
}

.crate-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.crate-track {
    position: absolute;
    top: 50%;
    left: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translateY(-50%);
}

.crate-item {
    width: 140px;
    height: 180px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Bungee';
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.crate-item:hover { transform: translateY(-4px); }
.crate-item.common { border-color: rgba(255, 255, 255, 0.15); }
.crate-item.rare { border-color: rgba(0, 200, 255, 0.6); }
.crate-item.epic { border-color: rgba(250, 0, 255, 0.7); }
.crate-item.legendary { border-color: rgba(255, 215, 0, 0.9); }
.crate-item.winner { transform: scale(1.05); box-shadow: 0 0 30px rgba(255, 255, 255, 0.9); }

.item-icon { font-size: 48px; margin-bottom: 10px; }
.item-val { font-size: 18px; color: var(--gold); }

/* --- SETTINGS MODAL --- */
#settings-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 25px;
}

#updates-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 25px;
}

.updates-box {
    width: min(580px, 92vw);
    background: rgba(15, 15, 20, 0.97);
    border: 2px solid rgba(255, 215, 0, 0.6);
    border-radius: 20px;
    box-shadow: 0 0 80px rgba(255, 215, 0, 0.25);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.updates-list {
    margin: 0;
    padding-left: 18px;
    color: #ddd;
    font-family: 'Roboto Mono';
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-box {
    width: min(540px, 92vw);
    background: rgba(15, 15, 20, 0.97);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.7);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-content { display: flex; flex-direction: column; gap: 12px; }

.settings-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
}

.settings-option:hover { background: rgba(255, 255, 255, 0.06); }

.settings-option input { accent-color: var(--primary); }

.settings-footer { display: flex; justify-content: flex-end; }

/* --- DEVICE MODES --- */
body.device-phone {
    zoom: 0.78;
}


body.setting-no-toast .notification {
    display: none !important;
}

body.setting-reduce-motion *,
body.setting-reduce-motion *::before,
body.setting-reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

body.device-laptop {
    zoom: 0.9;
}

body.device-pc {
    zoom: 1;
}

#dm-window {
    display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 400px; height: 500px; background: #080808; border: 3px solid var(--secondary);
    border-radius: 15px; z-index: 2147483647; flex-direction: column; box-shadow: 0 0 100px rgba(255, 0, 234, 0.4); overflow: hidden;
}

.dm-header {
    background: #1a001a; padding: 15px; border-bottom: 2px solid var(--secondary);
    display: flex; justify-content: space-between; align-items: center; color: white; font-family: 'Black Ops One';
}

.dm-content {
    flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column;
    gap: 10px; background: radial-gradient(circle at center, #110011, #000);
}

.dm-input-box { padding: 15px; border-top: 1px solid #333; background: #111; display: flex; gap: 10px; }

.dm-msg { padding: 10px; border-radius: 10px; font-family: 'Roboto Mono'; font-size: 12px; max-width: 80%; }
.dm-msg.them { background: #333; color: #eee; align-self: flex-start; border-bottom-left-radius: 0; border-left: 3px solid var(--secondary); }
.dm-msg.me { background: var(--secondary); color: white; align-self: flex-end; border-bottom-right-radius: 0; }

/* ==============================
   NEW GAMES & FEATURES CSS
   ============================== */

/* Crash */
#game-crash { flex-direction: column; align-items: center; gap: 10px; }

/* Baccarat */
#game-baccarat { flex-direction: column; align-items: center; gap: 10px; }

/* Word Scramble */
#game-scramble { flex-direction: column; align-items: center; gap: 10px; }

/* Snake */
#game-snake { flex-direction: column; align-items: center; gap: 10px; }
#snake-canvas { image-rendering: pixelated; }

/* Tic Tac Toe */
#game-tictactoe { flex-direction: column; align-items: center; gap: 10px; }
.ttt-grid {
    display: grid;
    grid-template-columns: repeat(3, 90px);
    grid-template-rows: repeat(3, 90px);
    gap: 4px;
}
.ttt-cell {
    width: 90px;
    height: 90px;
    background: rgba(255,255,255,0.08);
    border: 2px solid var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-family: 'Bungee';
    color: var(--primary);
    cursor: pointer;
    transition: all 0.15s;
}
.ttt-cell:hover:not(.taken) { background: rgba(0,242,255,0.15); }
.ttt-cell.taken { cursor: default; }

/* Bowling */
#game-bowling { flex-direction: column; align-items: center; gap: 10px; }

/* Trivia */
#game-trivia { flex-direction: column; align-items: center; gap: 10px; }
.trivia-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 500px;
}
.trivia-btn { min-width: 200px; }

/* Penalty */
#game-penalty { flex-direction: column; align-items: center; gap: 10px; }
.penalty-goal {
    display: flex;
    gap: 6px;
    width: 360px;
    height: 160px;
    background: linear-gradient(180deg, #1a3a1a, #0a200a);
    border: 3px solid #228b22;
    border-radius: 12px;
    overflow: hidden;
}
.penalty-zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    cursor: pointer;
    transition: background 0.2s;
    border-right: 1px solid rgba(255,255,255,0.1);
}
.penalty-zone:last-child { border-right: none; }
.penalty-zone:hover { background: rgba(255,255,255,0.12); }

/* Social Panels */
#online-counter { text-align: center; }
#clan-panel, #trading-panel, #stats-panel, #gem-shop-panel, #black-market-panel,
#lottery-panel, #notif-history-panel, #cosmetics-panel {
    background: var(--panel);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}
#clan-panel h3, #trading-panel h3, #stats-panel h3, #gem-shop-panel h3,
#black-market-panel h3, #lottery-panel h3, #notif-history-panel h3, #cosmetics-panel h3 {
    font-family: 'Black Ops One';
    margin: 0 0 10px;
}

/* Stats rows */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #222;
    font-family: 'Roboto Mono';
    font-size: 13px;
}

/* Shop item cards (gem shop, black market) */
.shop-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.05);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    gap: 10px;
}
.shop-item-card strong { font-family: 'Bungee'; font-size: 13px; white-space: nowrap; }
.shop-item-card span { flex: 1; font-size: 11px; color: #aaa; }

/* Notification history */
.notif-row {
    padding: 4px 0;
    border-bottom: 1px solid #1a1a1a;
    font-size: 12px;
    font-family: 'Roboto Mono';
    color: #ccc;
}
.notif-row span { color: #666; margin-right: 8px; }

/* SKILL TREE */
#skill-tree-panel {
    background: var(--panel);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 14px;
    margin-top: 12px;
}
#skill-points { margin-bottom: 10px; font-family: 'Bungee'; color: var(--primary); }
#skill-tree { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.skill-node { border: 1px solid #444; border-radius: 8px; padding: 10px; background: rgba(255,255,255,0.03); cursor: pointer; transition: all 0.2s; }
.skill-node:hover { box-shadow: 0 0 12px rgba(60,220,255,0.2); border-color: var(--primary); }
.skill-node.locked { opacity: 0.55; cursor: not-allowed; }
.skill-node.active { border-color: var(--gold); box-shadow: 0 0 16px rgba(255,215,0,0.25); }
.skill-node-title { font-family: 'Bungee'; font-size: 13px; }
.skill-node-desc { font-size: 11px; color: #aaa; margin: 3px 0; }
.skill-node-cost { font-size: 12px; color: var(--secondary); }
.skill-tree-rewards { margin-top: 10px; font-size: 12px; color: #ddd; }


/* Avatar + minimap + weather */
.avatar-preview { margin-top: 10px; border: 1px solid #333; padding: 8px; border-radius: 10px; background: rgba(0,0,0,0.25); }
.avatar-display { font-size: 40px; margin: 8px 0; text-align: center; }
.minimap { margin-top: 8px; border: 1px solid #333; border-radius: 10px; padding: 10px; background: rgba(0,0,0,0.25); min-height: 90px; color: #ccc; font-size: 11px; }
.weather-panel { margin-top: 8px; font-size: 12px; color: #ddd; border: 1px solid #333; border-radius: 10px; padding: 8px; background: rgba(0,0,0,0.25); }

#avatar-selector { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); z-index: 3000000; display: flex; align-items: center; justify-content: center; }
.avatar-selector-box { background: #0b0b0f; border: 1px solid #2a2a2a; padding: 20px; border-radius: 16px; width: min(420px, calc(100% - 40px)); }
.avatar-options { display: grid; grid-template-columns: repeat(5,minmax(60px,1fr)); gap: 10px; margin-bottom: 12px; }
.avatar-option { width: 60px; height: 60px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; cursor: pointer; border: 1px solid #444; background: rgba(0,0,0,0.3); }
.avatar-option.active { border-color: var(--primary); box-shadow: 0 0 10px rgba(0,242,255,0.4); }

/* Weather overlay effect */
#weather-overlay { position: fixed; inset: 0; pointer-events: none; z-index: 1900000; mix-blend-mode: screen; }
.weather-rain, .weather-snow, .weather-fog, .weather-night { position: absolute; inset: 0; pointer-events: none; }
.weather-rain { background: repeating-linear-gradient(180deg, rgba(255,255,255,0.12) 0, rgba(255,255,255,0.12) 1px, transparent 1px, transparent 10px); animation: rainFall 0.8s linear infinite; }
.weather-fog { background: linear-gradient(rgba(180,180,180,0.14), rgba(180,180,180,0.05)); }
.weather-night { background: radial-gradient(circle at 30% 30%, rgba(30,40,70,0.2), rgba(5,10,30,0.8)); }
.weather-snow { background: repeating-linear-gradient(0deg, rgba(255,255,255,0.1) 0, rgba(255,255,255,0.1) 1px, transparent 1px, transparent 8px); }

.dungeon-mode {
    background: radial-gradient(circle at 50% 30%, #0b1022 0%, #050914 45%, #03060f 100%) !important;
    color: #eef4ff !important;
}

.dungeon-mode #site-hub,
.dungeon-mode .game-mode-panel {
    background: linear-gradient(180deg, rgba(7, 11, 24, 0.97), rgba(3, 6, 14, 0.97)) !important;
    border: 1px solid rgba(102, 176, 255, 0.22);
}

#game-dungeon {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    gap: 10px;
}

#game-dungeon::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 18% 25%, rgba(75, 124, 255, 0.2), transparent 30%),
        radial-gradient(circle at 82% 35%, rgba(255, 93, 177, 0.16), transparent 30%),
        linear-gradient(145deg, #050912 0%, #0a1120 38%, #05080f 100%);
    animation: dungeonFogDrift 16s ease-in-out infinite;
}

#game-dungeon::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.02) 0,
        rgba(255, 255, 255, 0.02) 1px,
        transparent 1px,
        transparent 46px
    );
    opacity: 0.4;
}

#game-dungeon h1 {
    color: #ffd86a;
    text-shadow: 0 0 16px rgba(255, 216, 106, 0.65), 0 0 26px rgba(130, 200, 255, 0.28);
    letter-spacing: 2px;
}

#dungeon-wave-counter {
    margin-top: 2px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(115, 210, 255, 0.45);
    background: rgba(0, 16, 30, 0.62);
    font-family: 'Bungee';
    color: #8ceeff;
    box-shadow: 0 0 16px rgba(78, 193, 255, 0.22);
}

#dungeon-health-wrap,
#enemy-health-wrap {
    width: min(700px, 92vw);
    height: 20px;
    margin: 5px 0;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(180deg, rgba(6, 8, 14, 0.9), rgba(20, 22, 34, 0.9));
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.5);
}

.dungeon-health,
.enemy-health {
    position: relative;
    height: 100%;
    width: 100%;
    transition: width 0.38s ease;
}

.dungeon-health {
    background: linear-gradient(90deg, #16c85a, #8dff7f);
}

.enemy-health {
    background: linear-gradient(90deg, #ff4f63, #ff9f95);
}

.dungeon-health::after,
.enemy-health::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 0,
        rgba(255, 255, 255, 0.2) 8px,
        transparent 8px,
        transparent 16px
    );
    mix-blend-mode: screen;
    animation: barStripeMove 0.9s linear infinite;
}

#game-dungeon.hit-flash {
    animation: dungeonFlash 0.18s ease;
}

.dungeon-scene {
    width: min(860px, 94vw);
    min-height: 138px;
    margin: 12px 0;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid rgba(142, 180, 255, 0.3);
    background:
        radial-gradient(circle at 50% 24%, rgba(88, 120, 255, 0.2), transparent 60%),
        linear-gradient(180deg, rgba(9, 14, 30, 0.86), rgba(5, 8, 18, 0.9));
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.35), 0 10px 36px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.dungeon-scene.battle-glow {
    box-shadow: 0 0 0 1px rgba(255, 127, 127, 0.4), 0 0 40px rgba(255, 62, 62, 0.3), inset 0 0 44px rgba(255, 62, 62, 0.08);
}

.scene-avatar {
    min-width: 82px;
    min-height: 82px;
    padding: 10px;
    border-radius: 16px;
    font-size: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
    animation: avatarIdleBob 2.6s ease-in-out infinite;
}

.scene-avatar.attacking {
    transform: translateX(10px) scale(1.08);
    filter: drop-shadow(0 0 14px #8cffb3);
    box-shadow: 0 0 0 1px rgba(140, 255, 179, 0.4), 0 0 22px rgba(140, 255, 179, 0.35);
}

.scene-avatar.angered {
    transform: translateX(-10px) scale(1.08);
    filter: drop-shadow(0 0 14px #ff7878);
    box-shadow: 0 0 0 1px rgba(255, 120, 120, 0.45), 0 0 24px rgba(255, 92, 92, 0.36);
}

#game-dungeon .game-status {
    width: min(760px, 94vw);
    border: 1px solid rgba(138, 198, 255, 0.35);
    background: rgba(8, 14, 28, 0.72);
    color: #dbeeff;
    box-shadow: inset 0 0 22px rgba(102, 164, 255, 0.1);
}

#game-dungeon .controller-row .btn {
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

#game-dungeon .controller-row .btn:hover {
    transform: translateY(-2px) scale(1.03);
}

@keyframes dungeonFlash {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.28) saturate(1.1); }
    100% { filter: brightness(1); }
}

@keyframes dungeonFogDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(0, -12px) scale(1.02); }
}

@keyframes barStripeMove {
    from { background-position: 0 0; }
    to { background-position: 24px 0; }
}

@keyframes avatarIdleBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
.screen-shake { animation: screenShake 0.2s ease-in-out; }
@keyframes screenShake { 0%{transform:translateX(0);}25%{transform:translateX(-3px);}50%{transform:translateX(3px);}75%{transform:translateX(-2px);}100%{transform:translateX(0);} }

@keyframes floatDamage {0%{opacity:1;transform:translateY(0);}100%{opacity:0;transform:translateY(-50px);} }
.dmg-float { position:absolute;pointer-events:none;font-family:'Bungee';font-size:22px;color:#ffcccb;text-shadow:0 0 6px rgba(0,0,0,0.8);animation:floatDamage 0.8s forwards; }

@keyframes dungeonTransition {0%{opacity:0;transform:scale(0.96);}100%{opacity:1;transform:scale(1);} }
#game-dungeon { animation:dungeonTransition 0.35s ease; }

@keyframes rainFall { from { background-position: 0 -20px; } to { background-position: 0 20px; } }

.custom-tooltip {
    position: fixed;
    pointer-events: none;
    display: none;
    z-index: 3000002;
    background: rgba(10,10,15,0.95);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    padding: 5px 10px;
    font-family: 'Roboto Mono';
    font-size: 12px;
    box-shadow: 0 3px 17px rgba(0,0,0,0.5);
}

.animated-counter { transition: all 0.3s ease; }

/* Right click menu */
#context-menu { position: absolute; display: none; background: rgba(12,12,18,0.95); border: 1px solid #333; border-radius: 8px; z-index: 3000001; padding: 8px 0; width: 180px; box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
#context-menu .context-item { padding: 7px 12px; font-family: 'Roboto Mono'; font-size: 12px; color: #ddd; cursor: pointer; }
#context-menu .context-item:hover { background: rgba(255,255,255,0.1); color: #fff; }


/* ======================================================
   GAME CARD RARITY TIERS
   ====================================================== */
.game-card {
    overflow: hidden;
}
.game-card.gc-rare {
    border-color: #00b4ff !important;
    box-shadow: 0 0 12px rgba(0, 180, 255, 0.25), inset 0 0 20px rgba(0, 180, 255, 0.05);
}
.game-card.gc-epic {
    border-color: #b300ff !important;
    box-shadow: 0 0 16px rgba(179, 0, 255, 0.3), inset 0 0 24px rgba(179, 0, 255, 0.06);
}
.game-card.gc-legendary {
    border-color: #ffd700 !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.35), inset 0 0 30px rgba(255, 215, 0, 0.08);
    animation: legendaryPulse 3s ease-in-out infinite;
}
@keyframes legendaryPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.35), inset 0 0 30px rgba(255, 215, 0, 0.08); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.55), inset 0 0 40px rgba(255, 215, 0, 0.12); }
}
.gc-ribbon {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 18px;
    filter: drop-shadow(0 0 6px rgba(255,215,0,0.6));
    animation: ribbonBounce 2s ease infinite;
}
@keyframes ribbonBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.game-card.gc-rare h2 { color: #00b4ff; }
.game-card.gc-epic h2 { color: #b300ff; }
.game-card.gc-legendary h2 { color: #ffd700; text-shadow: 0 0 10px rgba(255,215,0,0.4); }

/* ======================================================
   CLAN DASHBOARD
   ====================================================== */
.clan-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.clan-name-display {
    font-family: 'Black Ops One';
    font-size: 20px;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255,215,0,0.3);
}
.clan-role-badge {
    font-family: 'Bungee';
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid #444;
}
.clan-role-badge.role-leader { background: rgba(255,215,0,0.2); border-color: var(--gold); color: var(--gold); }
.clan-role-badge.role-officer { background: rgba(0,242,255,0.15); border-color: var(--primary); color: var(--primary); }
.clan-stats-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.clan-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid #333;
    border-radius: 10px;
    padding: 10px 6px;
    gap: 2px;
}
.clan-stat span { font-size: 18px; }
.clan-stat strong { font-family: 'Bungee'; font-size: 14px; color: var(--primary); }
.clan-stat small { font-size: 10px; color: #888; font-family: 'Roboto Mono'; }
.clan-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    border-bottom: 2px solid #222;
    padding-bottom: 6px;
}
.clan-tab {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid #333;
    border-radius: 8px 8px 0 0;
    padding: 8px;
    color: #aaa;
    font-family: 'Bungee';
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}
.clan-tab:hover { background: rgba(255,255,255,0.1); color: white; }
.clan-tab.active { background: rgba(0,242,255,0.15); color: var(--primary); border-color: var(--primary); }
.clan-tab-content { display: none; }
.clan-tab-content.active { display: block; }
.clan-members-list { max-height: 200px; overflow-y: auto; }
.clan-member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid #1a1a1a;
    font-family: 'Roboto Mono';
    font-size: 12px;
}
.clan-member-row:hover { background: rgba(255,255,255,0.03); }
.clan-member-actions { display: flex; gap: 4px; }
.btn-xs { padding: 2px 8px !important; font-size: 10px !important; min-width: auto !important; }
.clan-chat-feed {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
}
.clan-chat-msg {
    padding: 3px 0;
    font-size: 12px;
    font-family: 'Roboto Mono';
    animation: msgSlideIn 0.3s ease;
}
.clan-chat-user { color: var(--primary); font-weight: bold; margin-right: 6px; }
.clan-chat-input-row { display: flex; gap: 6px; }
.clan-chat-input-row input { flex: 1; }

/* ======================================================
   COSMETICS SELECTABLE SYSTEM
   ====================================================== */
.cosmetics-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cosmetics-category {
    background: rgba(255,255,255,0.03);
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 12px;
}
.cosmetics-category h4 {
    margin: 0 0 8px;
    font-family: 'Bungee';
    font-size: 13px;
    color: var(--primary);
}
.color-picker-row, .title-picker-row, .frame-picker-row, .badge-picker-row, .effect-picker-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cos-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #555;
    transition: all 0.2s;
    position: relative;
}
.cos-swatch:hover { transform: scale(1.15); border-color: #aaa; }
.cos-swatch.owned { border-color: var(--primary); }
.cos-swatch.active {
    border-color: white;
    box-shadow: 0 0 12px currentColor;
}
.cos-swatch.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    text-shadow: 0 0 4px black;
}
.cos-chip {
    padding: 6px 14px;
    border-radius: 20px;
    font-family: 'Bungee';
    font-size: 11px;
    cursor: pointer;
    background: rgba(255,255,255,0.06);
    border: 1px solid #444;
    color: #aaa;
    transition: all 0.2s;
}
.cos-chip:hover { background: rgba(255,255,255,0.12); color: white; transform: translateY(-2px); }
.cos-chip.owned { border-color: var(--primary); color: var(--primary); }
.cos-chip.active {
    background: rgba(0,242,255,0.2);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 10px rgba(0,242,255,0.3);
}

/* ======================================================
   WEEKLY MISSIONS
   ====================================================== */
.weekly-missions-panel {
    border-color: var(--gold) !important;
    background: linear-gradient(135deg, rgba(255,215,0,0.05), rgba(0,0,0,0)) !important;
}
.weekly-missions-panel .missions-header {
    border-bottom-color: rgba(255,215,0,0.3);
}
.weekly-missions-panel .missions-header span:first-child {
    color: var(--gold);
}
.mission-card.weekly {
    border-left: 3px solid var(--gold);
}
.mission-card.weekly.ready {
    border-left-color: var(--gold);
    box-shadow: 0 0 15px rgba(255,215,0,0.2);
}
.weekly-progress { background: rgba(255,215,0,0.1) !important; }
.weekly-fill { background: linear-gradient(90deg, var(--gold), #ff8c00) !important; }

/* ======================================================
   GAME PANEL UI UPGRADES
   ====================================================== */
.game-mode-panel h1 {
    font-family: 'Black Ops One';
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(0,242,255,0.3);
    margin-bottom: 16px;
}
.game-mode-panel .back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
}
.game-status {
    font-family: 'Roboto Mono';
    padding: 10px 20px;
    border-radius: 8px;
    background: rgba(0,0,0,0.4);
    border: 1px solid #333;
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
}
.controller-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}
.mines-input {
    background: rgba(255,255,255,0.08);
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    padding: 10px 14px;
    font-family: 'Roboto Mono';
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.mines-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(0,242,255,0.2);
    outline: none;
}

/* Name effects keyframes */
@keyframes nameShake {
    0%, 100% { transform: translate(0); }
    25% { transform: translate(-1px, 1px); }
    75% { transform: translate(1px, -1px); }
}
@keyframes nameRainbow {
    0% { color: #ff0000; }
    16% { color: #ff8800; }
    33% { color: #ffff00; }
    50% { color: #00ff00; }
    66% { color: #0088ff; }
    83% { color: #8800ff; }
    100% { color: #ff0000; }
}
@keyframes namePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Mobile responsive for new games */
@media (max-width: 600px) {
    .ttt-grid { grid-template-columns: repeat(3, 70px); grid-template-rows: repeat(3, 70px); }
    .ttt-cell { width: 70px; height: 70px; font-size: 28px; }
    .penalty-goal { width: 280px; height: 120px; }
    .trivia-btn { min-width: 140px; font-size: 12px; }
    #snake-canvas { width: 300px; height: 300px; }
}

/* Profile popup */
#profile-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-popup-box {
    background: var(--panel);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 24px;
    width: 380px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0,242,255,0.3);
}

/* Typing race */
#game-typing { flex-direction: column; align-items: center; gap: 10px; }

/* Hub panels for new features */
#hub-themes-panel, #weekly-challenge-panel, #dividend-panel,
#weekly-report-panel, #login-history-panel {
    background: var(--panel);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}
#hub-themes-panel h3, #weekly-challenge-panel h3, #dividend-panel h3,
#weekly-report-panel h3, #login-history-panel h3 {
    font-family: 'Black Ops One';
    margin: 0 0 10px;
}

/* Animated avatar frame in chat */
.msg-user[onclick] { text-decoration: underline; }
.msg-user[onclick]:hover { color: var(--primary); }
.avatar-frame-gold { text-shadow: 0 0 8px #ffd700; }
.avatar-frame-diamond { text-shadow: 0 0 8px #b9f2ff; }
.avatar-frame-fire { text-shadow: 0 0 8px #ff4400; }
.avatar-frame-toxic { text-shadow: 0 0 8px #39ff14; }
.avatar-frame-galaxy { text-shadow: 0 0 8px #9d00ff; }

/* ============================================================
   FLOATING TEXT ANIMATIONS (XP, MONEY, LEVEL UP)
   ============================================================ */
.float-text {
    position: fixed;
    z-index: 99999;
    font-family: 'Bungee';
    font-size: 18px;
    pointer-events: none;
    animation: floatUp 1.2s ease-out forwards;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.float-text.money { color: var(--gold); }
.float-text.xp { color: var(--primary); }
.float-text.level { color: var(--toxic); font-size: 28px; }

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-80px) scale(1.1); }
}

/* ============================================================
   SCREEN SHAKE
   ============================================================ */
.screen-shake { animation: screenShake 0.4s ease both; }
@keyframes screenShake {
    0%, 100% { transform: translate(0); }
    10% { transform: translate(-4px, 2px); }
    20% { transform: translate(4px, -2px); }
    30% { transform: translate(-3px, 3px); }
    40% { transform: translate(3px, -1px); }
    50% { transform: translate(-2px, 1px); }
    60% { transform: translate(2px, -2px); }
    70% { transform: translate(-1px, 1px); }
    80% { transform: translate(1px, 0px); }
}

/* ============================================================
   GAME-MODE-PANEL SLIDE ANIMATION
   ============================================================ */
.game-mode-panel {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.game-mode-panel[style*="display: flex"],
.game-mode-panel[style*="display:flex"] {
    animation: panelSlideIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes panelSlideIn {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================================
   WEAPON CARD HOVER GLOW
   ============================================================ */
.weapon-card {
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.weapon-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,242,255,0.15);
}
.weapon-card.rarity-legendary:hover {
    box-shadow: 0 8px 30px rgba(255,215,0,0.3);
}
.weapon-card.rarity-epic:hover {
    box-shadow: 0 8px 30px rgba(157,0,255,0.25);
}

/* ============================================================
   COMPREHENSIVE RESPONSIVE DESIGN
   ============================================================ */

/* --- TABLETS (768px - 900px) --- */
@media (max-width: 900px) {
    .btn, button { min-height: 44px; min-width: 44px; }

    #side-buttons-bar {
        top: auto;
        bottom: 12px;
        right: 50%;
        transform: translateX(50%);
        flex-direction: row;
        gap: 8px;
        background: rgba(0,0,0,0.6);
        padding: 6px 10px;
        border-radius: 24px;
        border: 1px solid rgba(255,255,255,0.1);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    #side-buttons-bar button {
        width: 42px;
        height: 42px;
        font-size: 17px;
    }

    #chat-modal {
        width: 100%;
        border-left: none;
        border-radius: 0;
    }

    #dm-window {
        width: 90vw;
        height: 70vh;
    }

    .game-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: 10px;
    }

    .ttt-grid {
        grid-template-columns: repeat(3, 70px);
        grid-template-rows: repeat(3, 70px);
    }
    .ttt-cell { width: 70px; height: 70px; font-size: 28px; }

    .penalty-goal { width: 300px; height: 130px; }
}

/* --- MOBILE (max 600px) --- */
@media (max-width: 600px) {
    .hub-title { font-size: clamp(28px, 10vw, 50px); }
    .hub-stats { font-size: 13px; }

    #side-buttons-bar {
        bottom: 8px;
        gap: 6px;
        padding: 5px 8px;
    }
    #side-buttons-bar button {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    #chat-modal {
        width: 100%;
        border-left: none;
        border-radius: 0;
    }
    #chat-modal.minimized {
        width: 160px;
        bottom: 60px;
        right: 8px;
    }

    #dm-window {
        width: 95vw;
        height: 65vh;
    }

    .game-grid { grid-template-columns: 1fr; }

    .weapon-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .daily-box { width: 92vw; padding: 18px; }
    .rewards-box, .settings-box, .updates-box { width: 95vw; }

    .penalty-goal { width: 95vw; max-width: 340px; height: 120px; }
    .ttt-grid {
        grid-template-columns: repeat(3, 60px);
        grid-template-rows: repeat(3, 60px);
    }
    .ttt-cell { width: 60px; height: 60px; font-size: 24px; }

    .trivia-answers { flex-direction: column; }
    .trivia-btn { min-width: 0; width: 100%; }
}

/* --- SMALL MOBILE (max 380px) --- */
@media (max-width: 380px) {
    .hub-title { font-size: 26px; }

    #side-buttons-bar button {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .notification {
        font-size: 11px;
        padding: 8px 14px;
    }
}

/* --- LANDSCAPE PHONE --- */
@media (max-height: 500px) and (orientation: landscape) {
    #side-buttons-bar {
        top: 10px;
        bottom: auto;
        right: 10px;
        flex-direction: column;
        transform: none;
        background: none;
        padding: 0;
        border: none;
    }
    #side-buttons-bar button {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    #chat-modal {
        width: 50%;
    }
}

/* --- LARGE DESKTOP (1920px+) --- */
@media (min-width: 1920px) {
    #chat-modal { width: 420px; }
    .weapon-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

/* --- KEYBOARD VISIBLE (mobile) --- */
@media (max-height: 450px) {
    .chat-input-area {
        padding: 6px;
        position: sticky;
        bottom: 0;
    }
    .chat-messages { max-height: 60vh; }
}

/* --- SAFE AREA (notch phones) --- */
@supports (padding: max(0px)) {
    #side-buttons-bar { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
    .chat-input-area { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* ============================================================
   ADMIN BADGE IN CHAT
   ============================================================ */
.admin-badge {
    background: linear-gradient(135deg, #ff3333, #cc0000);
    color: white;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 8px;
    margin-left: 4px;
    font-weight: bold;
    font-family: 'Black Ops One';
    vertical-align: middle;
}
/* -----------------------------------------------
   ? ULTIMATE ABILITY BAR
----------------------------------------------- */
#ultimate-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(0,0,0,0.45);
    border: 1px solid #222;
    border-radius: 8px;
    margin: 6px auto;
    max-width: 560px;
    font-family: 'Bungee', monospace;
    font-size: 12px;
}
#ultimate-bar-track {
    flex: 1;
    height: 10px;
    background: #1a1a1a;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #333;
}
#ult-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffd700, #ff8c00);
    border-radius: 5px;
    transition: width 0.3s ease;
}
#ult-pct { color: var(--gold); min-width: 36px; }

@keyframes pulseGold {
    from { box-shadow: 0 0 4px var(--gold); }
    to   { box-shadow: 0 0 18px var(--gold), 0 0 35px #ff8c00; }
}

/* Random Event Banner */
#random-event-banner {
    display: none;
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1a0050, #003880);
    border: 2px solid var(--primary);
    color: white;
    font-family: 'Black Ops One', monospace;
    font-size: 16px;
    padding: 12px 28px;
    border-radius: 12px;
    z-index: 99999;
    text-align: center;
    box-shadow: 0 0 24px var(--primary);
    max-width: 90vw;
    pointer-events: none;
}
@keyframes eventBannerAnim {
    0%   { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    75%  { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* -----------------------------------------------
   ?? FEATURE MODAL BASE
----------------------------------------------- */
.feature-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    align-items: center;
    justify-content: center;
    z-index: 90000;
    padding: 16px;
}
.feature-modal {
    background: var(--panel);
    border: 1px solid #333;
    border-radius: 14px;
    padding: 20px 22px;
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0,242,255,0.12);
}
.feature-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.feature-modal-header h2 {
    margin: 0;
    font-family: 'Black Ops One', monospace;
    color: var(--primary);
    font-size: 22px;
}

/* -----------------------------------------------
   ?? EVOLUTION
----------------------------------------------- */
.evo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.evo-card {
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    border: 1px solid #333;
    background: rgba(255,255,255,0.03);
    transition: transform 0.2s;
}
.evo-locked   { opacity: 0.4; filter: grayscale(1); }
.evo-unlocked { border-color: #555; }
.evo-active   { border-color: var(--gold); background: rgba(255,215,0,0.08); box-shadow: 0 0 14px rgba(255,215,0,0.2); }
.evo-emoji    { font-size: 40px; display: block; margin-bottom: 6px; }
.evo-name     { font-family: 'Black Ops One', monospace; color: var(--primary); font-size: 13px; }
.evo-desc     { color: #aaa; font-size: 11px; margin: 4px 0; }
.evo-badge-active { background: var(--gold); color: black; border-radius: 4px; padding: 2px 6px; font-size: 10px; font-weight: bold; margin-top: 6px; display: inline-block; }

/* -----------------------------------------------
   ?? TITLES
----------------------------------------------- */
.title-list { display: flex; flex-direction: column; gap: 8px; }
.title-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #333;
    background: rgba(255,255,255,0.03);
    cursor: default;
    transition: background 0.2s;
}
.title-earned  { cursor: pointer; border-color: #555; }
.title-earned:hover { background: rgba(255,255,255,0.07); }
.title-active  { border-color: var(--gold); background: rgba(255,215,0,0.07); }
.title-locked  { opacity: 0.45; }
.title-emoji   { font-size: 28px; }
.title-info    { flex: 1; }
.title-name    { font-family: 'Black Ops One', monospace; color: var(--primary); font-size: 14px; }
.title-desc    { color: #888; font-size: 11px; }
.title-status  { font-family: 'Bungee', monospace; font-size: 11px; padding: 3px 8px; border-radius: 4px; border: 1px solid #555; white-space: nowrap; }
.earned-st     { border-color: var(--toxic); color: var(--toxic); }
.lock-st       { border-color: #444; color: #666; }

/* -----------------------------------------------
   ?? WORLD MAP
----------------------------------------------- */
.world-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.world-card {
    border-radius: 12px;
    padding: 16px 12px;
    border: 1px solid #333;
    background: rgba(255,255,255,0.03);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.world-on  { border-color: var(--primary); }
.world-off { opacity: 0.5; filter: grayscale(0.7); }
.world-top { display: flex; align-items: center; justify-content: center; gap: 8px; }
.world-emoji { font-size: 28px; }
.world-name  { font-family: 'Black Ops One', monospace; color: var(--primary); font-size: 16px; }
.world-enemies { color: #aaa; font-size: 11px; }
.world-loot    { color: var(--gold); font-size: 12px; }

/* -----------------------------------------------
   ?? TALENT LOADOUTS
----------------------------------------------- */
.talent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.talent-card {
    border: 1px solid #333;
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    background: rgba(255,255,255,0.03);
    transition: all 0.2s;
}
.talent-card:hover   { background: rgba(255,255,255,0.08); transform: scale(1.02); }
.talent-active       { border-color: var(--toxic); background: rgba(57,255,20,0.07); box-shadow: 0 0 10px rgba(57,255,20,0.15); }
.talent-emoji        { font-size: 36px; display: block; margin-bottom: 6px; }
.talent-name         { font-family: 'Black Ops One', monospace; color: var(--primary); font-size: 13px; }
.talent-desc         { color: #aaa; font-size: 11px; margin: 4px 0; }
.talent-mults        { color: var(--gold); font-size: 11px; }
.talent-active-badge { color: var(--toxic); font-size: 11px; font-weight: bold; margin-top: 5px; }

/* -----------------------------------------------
   ?? FISHING
----------------------------------------------- */
#game-fishing {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}
.fish-catch {
    padding: 6px 12px;
    border-bottom: 1px solid #222;
    font-size: 13px;
    color: var(--gold);
    text-align: left;
}

/* -----------------------------------------------
   ??? TREASURE HUNT
----------------------------------------------- */
#game-treasure {
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.treasure-board {
    display: grid;
    grid-template-columns: repeat(4, 70px);
    grid-template-rows: repeat(4, 70px);
    gap: 8px;
    margin: 12px auto;
}
.treasure-cell {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    background: rgba(255,255,255,0.04);
    transition: all 0.18s;
}
.t-hidden:hover { background: rgba(255,255,255,0.1); transform: scale(1.05); border-color: var(--primary); }
.t-gem   { background: rgba(0,242,255,0.12); border-color: var(--primary); cursor: default; }
.t-bomb  { background: rgba(255,51,51,0.15); border-color: var(--danger); cursor: default; }
.t-empty { background: rgba(255,255,255,0.02); color: #444; cursor: default; }

/* -----------------------------------------------
   ?? FUSION
----------------------------------------------- */
.fusion-inventory {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    min-height: 60px;
    margin-bottom: 12px;
}
.fusion-item {
    padding: 6px 12px;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    background: rgba(255,255,255,0.05);
    transition: all 0.2s;
}
.fusion-item:hover { background: rgba(255,255,255,0.12); }
.fsel { border-color: var(--gold); background: rgba(255,215,0,0.1); }
.fusion-slots-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}
.f-slot {
    padding: 10px 18px;
    border: 2px dashed #555;
    border-radius: 8px;
    min-width: 130px;
    text-align: center;
    color: #aaa;
    font-size: 13px;
}
.f-plus { font-size: 28px; color: var(--gold); font-weight: bold; }
.f-result-preview { color: var(--primary); font-size: 16px; font-family: 'Black Ops One', monospace; margin-bottom: 10px; }

#account-rank-panel {
    width: min(900px, 90vw);
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(0,0,0,0.35);
}

.account-rank-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-family: 'Bungee';
    font-size: 12px;
    color: #fff;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

#account-rank-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.18);
}

#account-rank-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #39ff14, #00f2ff, #ffd700);
    transition: width 0.35s ease;
}

#account-streak-row {
    margin-top: 6px;
    font-family: 'Roboto Mono';
    font-size: 12px;
    color: var(--gold);
}

/* ============================================================
   EXTRA MOTION PASS
   ============================================================ */
@keyframes hubNeonBreathe {
    0%, 100% { text-shadow: 0 0 14px rgba(0, 242, 255, 0.35); }
    50% { text-shadow: 0 0 26px rgba(0, 242, 255, 0.65), 0 0 38px rgba(255, 0, 234, 0.25); }
}

@keyframes cardEnterUp {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes iconFloatBob {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.03); }
}

@keyframes statsShimmerSweep {
    from { transform: translateX(-120%); opacity: 0; }
    20%, 80% { opacity: 0.35; }
    to { transform: translateX(120%); opacity: 0; }
}

@keyframes statusBlink {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

@keyframes buttonAura {
    0%, 100% { box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
    50% { box-shadow: 0 0 14px rgba(0, 242, 255, 0.22); }
}

#site-hub .hub-title {
    animation: hubNeonBreathe 2.8s ease-in-out infinite;
}

#site-hub .hub-stats {
    position: relative;
    overflow: hidden;
}

#site-hub .hub-stats::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    pointer-events: none;
    animation: statsShimmerSweep 3.8s linear infinite;
}

#site-hub .game-grid .game-card {
    opacity: 0;
    animation: cardEnterUp 0.55s ease forwards;
}

#site-hub .game-grid .game-card:nth-child(1) { animation-delay: 0.04s; }
#site-hub .game-grid .game-card:nth-child(2) { animation-delay: 0.1s; }
#site-hub .game-grid .game-card:nth-child(3) { animation-delay: 0.16s; }
#site-hub .game-grid .game-card:nth-child(4) { animation-delay: 0.22s; }
#site-hub .game-grid .game-card:nth-child(5) { animation-delay: 0.28s; }
#site-hub .game-grid .game-card:nth-child(6) { animation-delay: 0.34s; }
#site-hub .game-grid .game-card:nth-child(7) { animation-delay: 0.4s; }
#site-hub .game-grid .game-card:nth-child(8) { animation-delay: 0.46s; }
#site-hub .game-grid .game-card:nth-child(9) { animation-delay: 0.52s; }
#site-hub .game-grid .game-card:nth-child(n+10) { animation-delay: 0.58s; }

#site-hub .game-card .game-icon {
    animation: iconFloatBob 3.2s ease-in-out infinite;
    transform-origin: center;
}

#site-hub .game-grid .game-card:nth-child(odd) .game-icon {
    animation-delay: 0.45s;
}

.status-online,
.event-status.on {
    animation: statusBlink 1.8s ease-in-out infinite;
}

.btn-primary,
.btn-secondary,
.btn-gold,
.btn-toxic {
    animation: buttonAura 2.6s ease-in-out infinite;
}

/* ============================================================
   DUNGEON UI EXTENSIONS
   ============================================================ */
#game-dungeon #dungeon-run-stats,
#game-dungeon #dungeon-progress-tracker,
#game-dungeon #dungeon-reward-preview,
#game-dungeon #dungeon-loot-feed {
    width: min(760px, 94vw);
}

#game-dungeon #dungeon-loot-feed {
    min-height: 34px;
    text-align: left;
}

.dungeon-map-preview {
    width: min(760px, 94vw);
    min-height: 64px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(155, 210, 255, 0.3);
    background: rgba(4, 12, 24, 0.7);
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 6px;
}

.dungeon-map-cell {
    height: 26px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-family: 'Bungee';
}

.dungeon-map-cell.unknown {
    background: rgba(255, 255, 255, 0.05);
    color: transparent;
}

.dungeon-map-cell.discovered {
    background: rgba(0, 242, 255, 0.16);
    color: #c9f8ff;
}

.dungeon-map-cell.current {
    background: rgba(255, 216, 106, 0.22);
    border-color: rgba(255, 216, 106, 0.75);
    color: #ffe9a5;
    box-shadow: 0 0 16px rgba(255, 216, 106, 0.35);
}

.dungeon-map-cell.cleared {
    background: rgba(60, 255, 130, 0.16);
    color: #9dffc6;
}

#dungeon-boss-health-wrap {
    width: 100%;
    height: 20px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 119, 145, 0.55);
    background: rgba(30, 4, 14, 0.7);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.4);
}

#dungeon-boss-health {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff1f57, #ff8f4f);
    transition: width 0.25s ease;
    position: relative;
}

#dungeon-boss-health::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.25) 0,
        rgba(255, 255, 255, 0.25) 8px,
        transparent 8px,
        transparent 16px
    );
    animation: barStripeMove 0.85s linear infinite;
}

/* ============================================================
   TOWER DEFENSE UI
   ============================================================ */
#game-tower {
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: 12px 16px 20px;
}
#td-hud {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(0,0,0,0.55);
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 14px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
#td-main {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: center;
}
#td-canvas {
    border: 2px solid var(--primary);
    border-radius: 4px;
    cursor: crosshair;
    image-rendering: pixelated;
    display: block;
    max-width: 100%;
}
#td-sidebar {
    width: 138px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.td-section-label {
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--primary);
    border-bottom: 1px solid rgba(0,242,255,0.3);
    padding-bottom: 2px;
    margin-bottom: 2px;
    text-transform: uppercase;
}
.td-tower-btn {
    width: 100%;
    background: rgba(0,242,255,0.07);
    border: 1px solid rgba(0,242,255,0.25);
    border-radius: 5px;
    color: #fff;
    font-size: 11px;
    padding: 5px 6px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
    margin-bottom: 2px;
    line-height: 1.4;
}
.td-tower-btn:hover { background: rgba(0,242,255,0.18); border-color: var(--primary); }
.td-tower-btn.active { background: rgba(0,242,255,0.25); border-color: var(--primary); box-shadow: 0 0 6px var(--primary); }
#td-info-box {
    font-size: 11px;
    color: #aaa;
    line-height: 1.45;
    min-height: 64px;
}
#td-upgrade-info {
    font-size: 11px;
    color: #ccc;
    margin-bottom: 3px;
    line-height: 1.5;
}
#td-upgrade-box .btn { padding: 5px 8px; font-size: 12px; }

/* ============================================================
   🌐 WEB HOSTING & FILE MANAGER
   ============================================================ */
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    transition: all 0.2s ease;
    word-break: break-all;
    margin-bottom: 4px;
}
.file-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}
.file-item.active {
    background: rgba(0, 242, 255, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}
.file-icon {
    margin-right: 8px;
    font-size: 14px;
    flex-shrink: 0;
}
.file-delete-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-weight: bold;
    cursor: pointer;
    padding: 0 4px;
    font-size: 12px;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.file-delete-btn:hover {
    opacity: 1;
}

.domain-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 6px;
}
.domain-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--gold);
}
.domain-row.active {
    border-color: var(--gold);
    background: rgba(255, 215, 0, 0.08);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}

.public-site-card {
    background: linear-gradient(135deg, rgba(20,20,25,0.9), rgba(10,10,12,0.95));
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    transition: all 0.25s;
}
.public-site-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 242, 255, 0.15);
}
.public-site-title {
    font-family: 'Black Ops One', monospace;
    font-size: 16px;
    color: var(--primary);
    margin: 0;
}
.public-site-desc {
    font-size: 12px;
    color: #bbb;
    margin: 0;
    line-height: 1.4;
    flex: 1;
}
.public-site-meta {
    font-family: 'Roboto Mono', monospace;
    font-size: 10px;
    color: #666;
}

/* ============================================================
   📱 CLICKER RESPONSIVENESS OVERRIDES
   ============================================================ */
.clicker-mobile-nav {
    display: none;
    width: 100%;
    background: #111;
    border-bottom: 2px solid #333;
    z-index: 100;
    flex-shrink: 0;
}
.clicker-nav-btn {
    flex: 1;
    background: none;
    border: none;
    color: #888;
    padding: 12px 6px;
    font-family: 'Bungee';
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border-bottom: 3px solid transparent;
}
.clicker-nav-btn.active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: var(--primary);
}

@media (max-width: 900px) {
    #game-clicker {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto 1fr !important;
        height: 100vh !important;
        overflow: hidden !important;
    }
    .clicker-mobile-nav {
        display: flex !important;
    }
    #game-clicker .shop-col {
        border: none !important;
        height: 100% !important;
        display: none; /* Controlled by js switchClickerTab */
    }
    #game-clicker .clicker-stage {
        height: 100% !important;
        display: flex; /* Active by default */
        padding: 20px !important;
    }
    #game-clicker .clicker-stage .dps-display {
        margin-bottom: 25px !important;
    }
    #game-clicker .clicker-stage .toilet-btn {
        width: clamp(180px, 50vw, 260px) !important;
        height: clamp(180px, 50vw, 260px) !important;
        font-size: clamp(90px, 25vw, 130px) !important;
    }
}

/* ============================================================
   🦅 MOBILE CANVAS SCALING FOR GENERAL PHONES
   ============================================================ */
#flappy-canvas,
#snake-canvas,
#td-canvas {
    max-width: 100% !important;
    height: auto !important;
    max-height: 70vh !important;
    box-sizing: border-box !important;
}

#game-flappy,
#game-snake,
#game-tower {
    padding: 10px !important;
    box-sizing: border-box !important;
}

/* ============================================================
   🌲 HIERARCHICAL TREE STYLING
   ============================================================ */
.tree-folder-row {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.tree-folder-row:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 215, 0, 0.2);
    transform: translateX(2px);
}

/* =====================================================================
   v4 POLISH LAYER (2026-10) — additive overrides, safe to delete as a block
   ===================================================================== */
:root { color-scheme: dark; }
html { -webkit-text-size-adjust: 100%; }

/* `* { user-select: none }` stops typing/paste in Safari and makes text uncopyable — restore for fields */
input, textarea, select, [contenteditable], pre, .selectable {
    -webkit-user-select: text;
    user-select: text;
}

/* Visible keyboard focus (the original sheet removed outlines) */
button:focus-visible, .btn:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
.game-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.login-input:focus, .mines-input:focus { border-color: var(--primary); }

/* ---- Login ---- */
.login-box {
    width: min(450px, 92vw);
    padding: clamp(24px, 6vw, 50px);
    background: linear-gradient(160deg, #15151d, #0c0c11);
}
.login-box h1 { font-size: clamp(30px, 9vw, 50px) !important; line-height: 1.05; }
.login-input { transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.login-input:focus { box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.18); }

/* ---- Hub ---- */
.hub-stats, .missions-panel,
#leaderboard-panel, #friends-panel, #prestige-panel, #auction-panel {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.game-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.game-card {
    width: 100%;
    max-width: 260px;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(30, 30, 42, 0.94), rgba(12, 12, 18, 0.94));
}
.game-card:hover, .game-card:focus-visible {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 14px 40px rgba(0, 242, 255, 0.22);
}
.game-card h2 { font-size: clamp(15px, 2.2vw, 20px); }
.game-card .btn { min-height: 40px; }

#hub-search-wrap {
    width: 100%;
    max-width: 1100px;
    margin-top: 22px;
}
#hub-search {
    width: 100%;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-family: 'Roboto Mono', monospace;
    font-size: 15px;
    text-align: left;
}
#hub-search::placeholder { color: #8aa; }
#hub-search-empty {
    display: none;
    text-align: center;
    color: #9ab;
    font-family: 'Roboto Mono', monospace;
    padding: 30px 0;
}

/* ---- Game boards that had fixed pixel widths ---- */
.mines-ui { flex-wrap: wrap; justify-content: center; gap: 20px; }
.mines-grid { width: min(500px, 92vw); height: auto; aspect-ratio: 1 / 1; }
.mine-tile { font-size: clamp(22px, 7vw, 40px); }
.cards-container { flex-wrap: wrap; justify-content: center; margin: 30px 0; }
.rps-result { min-width: 0; width: min(360px, 92vw); }
.guess-card { width: min(180px, 40vw); height: min(260px, 58vw); }

@media (max-width: 900px) {
    #game-clicker { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
    #game-clicker .clicker-stage { order: -1; padding: 24px 0; }
    #game-clicker .shop-col { max-height: 55vh; border-left: none; border-right: none; }
    .toilet-btn { width: min(260px, 70vw); height: min(260px, 70vw); font-size: clamp(90px, 28vw, 150px); }
    .money-display { font-size: clamp(34px, 11vw, 60px); }
}
@media (max-width: 720px) {
    .plinko-board { zoom: 0.6; }
    .roulette-track-container { zoom: 0.42; }
}

/* ---- Performance: skip the always-repainting background on phones ---- */
@media (max-width: 700px) {
    body::before { display: none; }
    #site-hub { animation: none; }
}

/* ---- Accessibility: honor reduced-motion for decorative effects only ---- */
@media (prefers-reduced-motion: reduce) {
    body::before, #site-hub, .login-floaters span, .news-ticker,
    .target-dot, #event-banner, .loading-logo { animation: none !important; }
    html { scroll-behavior: auto; }
}

/* Credit line: gradient strip so it never collides with buttons underneath */
.credit-bar {
    padding: 14px 0 6px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
}
#site-hub { padding-bottom: 80px; }


/* =====================================================================
   v5 GAME UI LAYER (2026-10) — applies to every game screen (.gp is added by ui.js)
   ===================================================================== */
:root { --glass: rgba(16, 18, 30, 0.74); --glass-line: rgba(255, 255, 255, 0.13); }

/* Per-game theme: --ga accent, --gb background glow */
#game-blackjack { --ga: #2ecc71; --gb: #0f3a24; }
#game-horse     { --ga: #e0a82e; --gb: #3a2a0a; }
#game-scratch   { --ga: #ffd700; --gb: #3a300a; }
#game-tower     { --ga: #ff7a18; --gb: #3a1d08; }
#game-dice      { --ga: #b44dff; --gb: #2a0f4a; }
#game-crash     { --ga: #ff4040; --gb: #3a0e0e; }
#game-baccarat  { --ga: #e0524a; --gb: #36100f; }
#game-scramble  { --ga: #f5cd2a; --gb: #3a320a; }
#game-snake     { --ga: #39ff14; --gb: #0a3a0e; }
#game-tictactoe { --ga: #28c4ff; --gb: #0a2c44; }
#game-bowling   { --ga: #ff9a1f; --gb: #3a210a; }
#game-trivia    { --ga: #b966ff; --gb: #26104a; }
#game-typing    { --ga: #00f2ff; --gb: #0a343b; }
#game-penalty   { --ga: #39ff14; --gb: #0c3a18; }
#game-memory    { --ga: #ff2de6; --gb: #3a0c36; }
#game-clicker   { --ga: #00f2ff; --gb: #0a343b; }
#game-plinko    { --ga: #ff2de6; --gb: #3a0c36; }
#game-roulette  { --ga: #ffd700; --gb: #3a2a0a; }
#game-flip      { --ga: #d6dbe6; --gb: #262b38; }
#game-guess     { --ga: #ff5fdc; --gb: #3a0e33; }
#game-shooter   { --ga: #5b7cff; --gb: #0e1547; }
#game-slots     { --ga: #ff3d9a; --gb: #3a0e26; }
#game-crate     { --ga: #ffcf3a; --gb: #3a300a; }
#game-crypto    { --ga: #39ff14; --gb: #0c3a18; }
#game-mines     { --ga: #ff9a1f; --gb: #3a210a; }
#game-rps       { --ga: #28c4ff; --gb: #0a2c44; }
#game-target    { --ga: #ff4040; --gb: #3a0e0e; }
#game-reaction  { --ga: #ffd700; --gb: #3a300a; }
#game-code      { --ga: #39ff14; --gb: #0a3a14; }
#game-duel      { --ga: #ff4060; --gb: #3a0e1c; }
#game-dungeon   { --ga: #a68bff; --gb: #1c0f40; }
#game-fishing   { --ga: #4aa8ff; --gb: #0a2c52; }
#game-treasure  { --ga: #ffcf3a; --gb: #3a2a0a; }

/* The drifting colour blobs from the hub sit on top of games and wash them out */
body.in-game::before { display: none; }

.gp:not(#game-flappy):not(#game-shooter):not(#game-dungeon) {
    background:
        radial-gradient(900px 480px at 50% -8%, color-mix(in srgb, var(--ga, #00f2ff) 26%, transparent), transparent 70%),
        radial-gradient(700px 400px at 90% 110%, color-mix(in srgb, var(--ga, #00f2ff) 14%, transparent), transparent 70%),
        linear-gradient(180deg, var(--gb, #12121c), #05060a 78%);
    backdrop-filter: none;
}
#game-flappy { background: linear-gradient(180deg, #1b9ccf, #8fdcf2 70%, #d5f3fa); }
#game-shooter { background: radial-gradient(900px 500px at 50% 0%, #1b2a8a55, transparent 70%), #02030f; }

/* Older panels were fixed-height and clipped tall content */
#game-flappy, #game-memory, #game-plinko, #game-roulette, #game-flip, #game-guess, #game-slots, #game-crate,
#game-crypto, #game-mines, #game-rps, #game-target, #game-reaction, #game-code, #game-duel {
    overflow-y: auto;
    justify-content: safe center;
    padding: 70px 14px 24px;
}
.game-mode-panel { padding-top: 70px; }

/* Exit button -> floating pill */
.gp .back-btn, .back-btn {
    top: 14px; left: 14px;
    padding: 9px 18px 9px 14px;
    border-radius: 999px;
    background: var(--glass) !important;
    color: #fff !important;
    border: 1px solid var(--glass-line);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    font-size: 13px; letter-spacing: 1px;
}
.back-btn::before { content: '\2190'; margin-right: 8px; font-size: 1.15em; }
.back-btn:hover { border-color: var(--ga, #00f2ff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ga, #00f2ff) 25%, transparent); }

/* Titles */
.gp h1 {
    margin: 4px 0 14px;
    font-family: 'Black Ops One', 'Bungee', sans-serif;
    font-size: clamp(26px, 5vw, 44px);
    letter-spacing: 3px;
    text-align: center;
    background: linear-gradient(90deg, #fff 10%, var(--ga, #00f2ff) 90%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 14px color-mix(in srgb, var(--ga, #00f2ff) 50%, transparent));
}

/* Control rows become glass cards */
.gp .controller-row {
    background: var(--glass);
    border: 1px solid var(--glass-line);
    border-radius: 16px;
    padding: 12px 16px;
    justify-content: center;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.gp .mines-input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-line);
    border-radius: 10px;
    padding: 10px 12px;
    color: #fff;
    font-family: 'Roboto Mono', monospace;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gp .mines-input:focus { outline: none; border-color: var(--ga, #00f2ff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ga, #00f2ff) 25%, transparent); }
.gp select.mines-input { cursor: pointer; }
.gp .btn { border-radius: 10px; min-height: 40px; }

/* Bet shortcuts injected next to bet inputs */
.bet-chips { display: inline-flex; gap: 6px; }
.bet-chips button {
    padding: 8px 11px; min-height: 40px; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--glass-line); background: rgba(255, 255, 255, 0.07); color: #e8f6ff;
    font-family: 'Bungee', sans-serif; font-size: 12px; transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.bet-chips button:hover { background: color-mix(in srgb, var(--ga, #00f2ff) 25%, transparent); border-color: var(--ga, #00f2ff); }
.bet-chips button:active { transform: scale(0.94); }

/* Status line */
.gp .game-status {
    background: var(--glass);
    border: 1px solid var(--glass-line);
    border-left: 4px solid var(--ga, #00f2ff);
    border-radius: 12px;
    padding: 12px 18px;
    font-family: 'Roboto Mono', monospace;
    font-size: 15px;
    text-align: center;
    min-width: min(420px, 90vw);
    max-width: 92vw;
    margin: 12px auto 0;
}
.gp .game-status.win { border-left-color: #39ff14; background: rgba(57, 255, 20, 0.10); color: #d9ffd0; animation: statusPop 0.45s ease; }
.gp .game-status.lose { border-left-color: #ff4040; background: rgba(255, 64, 64, 0.10); color: #ffd6d6; animation: statusShake 0.4s ease; }
@keyframes statusPop { 0% { transform: scale(0.94); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes statusShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Wallet chip (visible inside any game) */
#wallet-chip {
    position: fixed; top: 14px; right: 14px; z-index: 100002;
    display: none; align-items: center; gap: 14px;
    padding: 9px 16px; border-radius: 999px;
    background: var(--glass); border: 1px solid var(--glass-line);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    font-family: 'Bungee', sans-serif; font-size: 13px; color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}
#wallet-chip b { color: var(--gold); font-weight: normal; }
#wallet-chip i { font-style: normal; color: var(--secondary); }
#wallet-chip.bump b { animation: walletBump 0.5s ease; }
@keyframes walletBump { 40% { transform: scale(1.25); color: #fff; } }
.shooter-ui { top: 64px; }

/* Win confetti */
.confetti-bit {
    position: fixed; z-index: 100003; pointer-events: none; font-size: 22px;
    animation: confettiFly 1.1s ease-out forwards;
}
@keyframes confettiFly {
    0% { transform: translate(0, 0) scale(0.6) rotate(0); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(var(--rot)); opacity: 0; }
}

/* Cards (blackjack / baccarat had no styling at all) */
.bj-area { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; margin: 14px 0; width: min(760px, 94vw); }
.bj-area > div {
    flex: 1 1 280px; text-align: center; padding: 14px;
    background: var(--glass); border: 1px solid var(--glass-line); border-radius: 18px;
}
.bj-area h3 { margin: 0 0 8px; font-family: 'Bungee', sans-serif; font-size: 14px; letter-spacing: 2px; color: var(--ga); }
.bj-area .card-row { justify-content: center; min-height: 86px; }
.bj-area [id$="value"], .bj-area [id$="-val"] {
    display: inline-block; margin-top: 8px; padding: 2px 14px; border-radius: 999px;
    background: rgba(0, 0, 0, 0.45); font-family: 'Bungee', sans-serif; font-size: 18px; color: var(--gold);
}
.bj-card {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 54px; height: 78px; padding: 0 6px; border-radius: 9px;
    background: linear-gradient(160deg, #ffffff, #dfe6ee);
    color: #15161c; font-family: 'Black Ops One', 'Bungee', sans-serif; font-size: 22px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(0, 0, 0, 0.08);
    animation: cardDeal 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
@keyframes cardDeal { from { transform: translateY(-30px) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 600px) {
    #wallet-chip { top: 10px; right: 10px; padding: 7px 11px; font-size: 11px; gap: 9px; }
    .gp .back-btn, .back-btn { top: 10px; left: 10px; padding: 8px 13px 8px 11px; }
    .gp .controller-row { padding: 10px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .bj-card, .gp .game-status.win, .gp .game-status.lose, #wallet-chip.bump b, .confetti-bit { animation: none; }
}

/* Class-based panels were laid out as a ROW (side-by-side slivers); stack them like trivia/penalty always did */
.game-mode-panel.gp:not(#game-dungeon) { flex-direction: column; align-items: center; gap: 10px; }
.game-mode-panel.gp:not(#game-dungeon) > .back-btn { align-self: flex-start; }

/* Blackjack draws playing cards with .scratch-cell; baccarat uses .bj-card — make both look like cards */
.card-row .scratch-cell {
    width: 62px; height: 88px; padding: 0;
    border-radius: 10px; border: 0;
    background: linear-gradient(160deg, #ffffff, #dfe6ee);
    color: #15161c;
    font-family: 'Black Ops One', 'Bungee', sans-serif; font-size: 24px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(0, 0, 0, 0.08);
    animation: cardDeal 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
    cursor: default;
}
.card-row .pc-red, .bj-card.pc-red { color: #d62839; }
.card-row .pc-back {
    color: transparent;
    background: repeating-linear-gradient(45deg, #1b2a6b 0 7px, #2a3f9a 7px 14px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5), inset 0 0 0 3px #fff;
}

/* Containers that shrank to their content inside the centred column */
.gp .horse-track { width: min(760px, 94vw); }
.gp .horse-lane { height: 34px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--glass-line); }
.gp .horse-lane .horse-emoji { font-size: 22px; line-height: 34px; }
.gp .scratch-board { gap: 10px; }

/* ---- Phone fixes found by measuring every game at 375px ---- */
.gp { overflow-x: hidden; }
.gp .controller-row { max-width: 100%; }
.gp .controller-row > * { max-width: 100%; }
.gp .memory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(460px, 92vw); gap: 10px; }
.gp .mem-card { width: 100%; height: auto; aspect-ratio: 1 / 1; }
.gp .mem-face { font-size: clamp(22px, 8vw, 40px); }
@media (max-width: 600px) {
    .gp .controller-row input.mines-input[style*="width"] { width: 120px !important; }
    .gp .controller-row select.mines-input[style*="width"] { width: 130px !important; }
    .gp .controller-row .btn { padding: 9px 12px; font-size: 12px; }
    .bet-chips button { padding: 8px 8px; }
    .gp .crypto-dashboard, .gp .news-ticker-container { max-width: 94vw; }
    .gp h1 { letter-spacing: 1px; }
}
#game-plinko > div:not(.plinko-board) { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; max-width: 94vw; }

/* ---- Slots: an actual machine ---- */
#game-slots .slot-machine {
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    padding: 22px 26px 26px; border-radius: 28px;
    background: linear-gradient(160deg, #3b0f2a, #12060f);
    border: 3px solid #ff3d9a;
    box-shadow: 0 0 40px rgba(255, 61, 154, 0.35), inset 0 0 30px rgba(0, 0, 0, 0.6);
}
#game-slots .slot-machine h1 { margin: 0; }
#game-slots .slot-reels {
    display: flex; gap: 12px; padding: 14px; border-radius: 18px;
    background: #05020a; border: 2px solid rgba(255, 215, 0, 0.55);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.9);
}
#game-slots .reel {
    width: clamp(78px, 22vw, 124px); height: clamp(96px, 27vw, 150px);
    display: flex; align-items: center; justify-content: center;
    font-size: clamp(44px, 13vw, 78px);
    background: linear-gradient(180deg, #d9d9e6 0%, #ffffff 18%, #ffffff 82%, #cfcfdc 100%);
    border-radius: 12px; color: #111;
    box-shadow: inset 0 10px 14px rgba(0, 0, 0, 0.25), inset 0 -10px 14px rgba(0, 0, 0, 0.25);
}
#game-slots .reel.spinning { filter: blur(1.2px); }
#game-slots .btn-purple { font-size: 20px; padding: 12px 40px; min-height: 52px; }
#game-slots .game-status { margin-top: 0; min-width: min(380px, 80vw); font-size: 13px; }

/* ---- Mines ---- */
#game-mines .mines-ui { align-items: flex-start; justify-content: center; }
#game-mines .mines-controls {
    display: flex; flex-direction: column; gap: 12px; width: min(280px, 92vw);
    padding: 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-line);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
#game-mines .mn-label { display: flex; flex-direction: column; gap: 6px; font-family: 'Bungee', sans-serif; font-size: 11px; letter-spacing: 1px; color: #bcd; }
#game-mines .mn-label .bet-chips { align-self: stretch; }
#game-mines .mn-label .bet-chips button { flex: 1; }
#game-mines #mn-multi {
    text-align: center; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.45);
    font-family: 'Black Ops One', sans-serif; font-size: 34px; color: var(--gold);
    text-shadow: 0 0 18px rgba(255, 215, 0, 0.45);
}
#game-mines .mines-grid { background: var(--glass); border: 1px solid var(--glass-line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
#game-mines .mine-tile { background: linear-gradient(160deg, #3a3f52, #23273a); transition: transform 0.12s ease, background 0.2s ease; }
#game-mines .mine-tile:hover:not(.revealed) { transform: translateY(-2px); background: linear-gradient(160deg, #4b5170, #2c3150); }
#game-mines .mine-tile.safe { background: rgba(0, 255, 255, 0.12); }
#game-mines .mine-tile.exploded { background: rgba(255, 0, 0, 0.22); }

/* ---- Dungeon: its ~19 panels were laid out in ONE row (4,600px wide) and clipped ---- */
#game-dungeon {
    flex-direction: column; align-items: center; gap: 10px;
    padding: 70px 14px 40px;
}
#game-dungeon > .back-btn { position: fixed; z-index: 5; }
#game-dungeon #dungeon-run-stats, #game-dungeon #dungeon-progress-tracker,
#game-dungeon #dungeon-reward-preview, #game-dungeon #dungeon-loot-feed,
#game-dungeon #dungeon-wave-counter, #game-dungeon #dungeon-info { width: min(760px, 94vw); }
#game-dungeon .dungeon-scene, #game-dungeon .dungeon-enemy, #game-dungeon .dungeon-player { max-width: 94vw; }

/* ---- Shooter: keep ARMORY clear of the exit pill ---- */
#game-shooter .shooter-shop-btn { position: fixed; top: 110px; right: 14px; z-index: 60; }

/* ---- Hosting upgrade ---- */
#viewer-like-btn.liked { background: #ff2d6f; color: #fff; box-shadow: 0 0 14px rgba(255, 45, 111, 0.6); }
.public-site-card { transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; }
.public-site-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 10px 26px rgba(0, 242, 255, 0.16); }
.public-site-desc { min-height: 2.6em; }

/* ---- Hosting developer tools (devtools.js) ---- */
#dev-pane { display: flex; flex: 1; min-height: 0; gap: 8px; }
#dev-pane.split > #file-code-editor, #dev-pane.split > #editor-live-preview { flex: 1 1 0; min-width: 0; }
@media (max-width: 760px) { #dev-pane.split { flex-direction: column; } }
#dev-find {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; padding: 8px;
    background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; flex-shrink: 0;
}
#dev-find .mines-input { width: 150px; padding: 6px 8px; font-size: 12px; }
#dev-find .btn { padding: 5px 9px; font-size: 11px; min-height: 0; }
#dev-find-n { font-family: 'Roboto Mono', monospace; font-size: 11px; color: #9ac9d0; min-width: 70px; }
.dev-chk { display: inline-flex; align-items: center; gap: 4px; font-family: 'Roboto Mono', monospace; font-size: 11px; color: #bcd; cursor: pointer; }
#dev-status {
    display: flex; align-items: center; gap: 14px; flex-shrink: 0; margin-top: 6px; padding: 5px 10px;
    font-family: 'Roboto Mono', monospace; font-size: 11px; color: #9ab; background: rgba(0, 0, 0, 0.45); border-radius: 8px;
}
#dev-status .dirty { color: #ffb347; }
#dev-status .clean { color: #39ff14; }
#dev-status .dev-hint { opacity: 0.7; cursor: help; }
#dev-console {
    display: none; flex-direction: column; flex-shrink: 0; height: 150px; margin-top: 6px;
    background: #07070c; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 8px; overflow: hidden;
}
.dev-console-bar { display: flex; align-items: center; gap: 10px; padding: 4px 10px; background: rgba(255, 255, 255, 0.06); font-size: 11px; font-family: 'Bungee', sans-serif; }
#dev-console-count { margin-right: auto; font-family: 'Roboto Mono', monospace; color: #9ab; }
#dev-console-list { flex: 1; overflow-y: auto; padding: 4px 10px; font-family: 'Roboto Mono', monospace; font-size: 12px; user-select: text; }
.dev-line { padding: 2px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); white-space: pre-wrap; word-break: break-word; }
.dev-line.warn { color: #ffd166; }
.dev-line.error { color: #ff6b6b; background: rgba(255, 60, 60, 0.07); }
.dev-line.info { color: #6ec7ff; }
#dev-history { display: none; position: fixed; inset: 0; z-index: 99999999; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.7); padding: 14px; }
.dev-history-box { width: min(620px, 96vw); max-height: 86vh; display: flex; flex-direction: column; gap: 12px; padding: 18px; background: #0d0d18; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 16px; }
.dev-history-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dev-history-head h3 { margin: 0; font-family: 'Black Ops One', sans-serif; font-size: 16px; color: var(--primary); }
.dev-history-new { display: flex; gap: 8px; flex-wrap: wrap; }
.dev-history-new input { flex: 1; min-width: 180px; }
#dev-h-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; font-family: 'Roboto Mono', monospace; font-size: 12px; }
.dev-h-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; }
.dev-h-row span { color: #8aa; font-size: 11px; }
.dev-h-row .btn { padding: 5px 10px; font-size: 11px; min-height: 0; }
.dev-empty { padding: 20px; text-align: center; color: #8aa; }

/* ---- hosting editor: keep the code area usable ---- */
#new-domain-template { width: auto !important; flex: 0 0 190px; }
#dev-pane { min-height: 240px; }
#editor-wrapper { overflow-y: auto; }
#dev-console { height: 120px; }
#domain-description { width: auto; }

/* ---- Admin Plus (admin-plus.js) ---- */
.ap-body h3 { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.ap-body h4 { margin: 18px 0 8px; font-family: 'Bungee', sans-serif; font-size: 13px; color: var(--gold); }
.ap-refresh { margin-left: auto; padding: 4px 10px; font-size: 11px; }
.ap-note { color: #9ab; font-family: 'Roboto Mono', monospace; font-size: 12px; margin: 6px 0 12px; }
.ap-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.ap-row .mines-input { flex: 1; min-width: 160px; }
.ap-bar { position: relative; height: 22px; margin: 14px 0; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.ap-bar > div { height: 100%; background: linear-gradient(90deg, #00f2ff, #39ff14); transition: width 0.4s ease; }
.ap-bar > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'Bungee', sans-serif; font-size: 12px; text-shadow: 0 1px 3px #000; }
.ap-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 14px; }
.ap-chart { width: 100%; height: auto; background: rgba(0, 0, 0, 0.3); border-radius: 10px; }
.ap-warn { color: #ff8f8f; }
.ap-tag { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: rgba(255, 200, 0, 0.15); color: #ffd166; border: 1px solid rgba(255, 200, 0, 0.35); }
.ap-tag.s2 { background: rgba(255, 120, 0, 0.15); color: #ffa24d; border-color: rgba(255, 120, 0, 0.4); }
.ap-tag.s3 { background: rgba(255, 60, 60, 0.15); color: #ff8f8f; border-color: rgba(255, 60, 60, 0.45); }
.ap-body .admin-table .btn { padding: 4px 8px; font-size: 11px; min-height: 0; }
.ap-body small { color: #8aa; }
#ap-palette { display: none; position: fixed; inset: 0; z-index: 2147483647; align-items: flex-start; justify-content: center; padding-top: 14vh; background: rgba(0, 0, 0, 0.6); }
.ap-pal-box { width: min(560px, 94vw); background: #0d0d18; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
#ap-pal-q { width: 100%; padding: 16px 18px; font-size: 16px; background: transparent; border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.12); color: #fff; outline: none; font-family: 'Roboto Mono', monospace; user-select: text; }
.ap-pal-item { padding: 11px 18px; cursor: pointer; font-family: 'Roboto Mono', monospace; font-size: 13px; color: #cde; }
.ap-pal-item.on, .ap-pal-item:hover { background: rgba(0, 242, 255, 0.14); color: #fff; }
.ap-pal-empty { padding: 18px; color: #789; text-align: center; }

/* Skill game trio */
.skill-game-panel { min-height: 100vh; justify-content: center; padding: 46px 20px 34px; background: radial-gradient(circle at 50% 10%, rgba(0,242,255,.13), transparent 42%), #070912; }
.skill-game-panel h1 { margin: 6px 0 8px; font-size: clamp(30px, 6vw, 52px); letter-spacing: 2px; }
.skill-game-eyebrow { color: var(--primary); font: 11px 'Roboto Mono', monospace; letter-spacing: 3px; text-transform: uppercase; }
.skill-game-subtitle { max-width: 620px; color: #9aa7bd; text-align: center; margin: 0 0 20px; }
.runner-hud, .clash-hud, .rhythm-hud { width: min(720px, 94vw); display:flex; justify-content:space-between; gap:12px; color:#dbe8ff; font: 12px 'Roboto Mono', monospace; padding:12px 16px; border:1px solid rgba(0,242,255,.25); background:rgba(5,12,26,.75); border-radius:14px 14px 0 0; }
.runner-track { width:min(520px, 94vw); height:390px; position:relative; overflow:hidden; display:grid; grid-template-columns:repeat(3, 1fr); gap:7px; padding:12px; background:linear-gradient(180deg,#101935,#050817); border:1px solid rgba(0,242,255,.35); box-shadow:0 0 35px rgba(0,242,255,.12) inset; }
.runner-lane { position:relative; border:1px dashed rgba(255,255,255,.1); border-radius:10px; }
.runner-object { position:absolute; left:50%; transform:translateX(-50%); width:62px; height:62px; display:grid; place-items:center; border-radius:16px; font-size:29px; box-shadow:0 0 22px currentColor; }
.runner-player { bottom:18px; background:#00f2ff; color:#00f2ff; animation:runnerGlow 1s infinite alternate; }
.runner-coin { background:#ffd166; color:#ffd166; }
.runner-hazard { background:#ff4d6d; color:#ff4d6d; }
.runner-controls { display:flex; gap:10px; margin:14px 0 2px; }
.clash-word { min-width:min(520px,90vw); margin:22px 0; text-align:center; font:clamp(34px,9vw,76px) 'Bungee'; letter-spacing:3px; text-shadow:0 0 25px currentColor; }
.clash-options { display:grid; grid-template-columns:repeat(4, minmax(90px,1fr)); gap:10px; width:min(620px,94vw); }
.clash-option { min-height:58px; border:1px solid rgba(255,255,255,.2); border-radius:12px; color:#fff; font:14px 'Bungee'; cursor:pointer; background:#131a2e; transition:transform .15s, filter .15s; }
.clash-option:hover { transform:translateY(-3px); filter:brightness(1.2); }
.rhythm-meter { width:min(720px,94vw); height:86px; position:relative; margin:24px 0 16px; overflow:hidden; border:1px solid rgba(255,255,255,.16); border-radius:16px; background:repeating-linear-gradient(90deg,#10182e 0 36px,#172442 36px 38px); }
#rhythm-zone { position:absolute; top:8px; bottom:8px; left:41%; width:18%; border-radius:10px; background:rgba(255,209,102,.22); border:2px solid #ffd166; box-shadow:0 0 24px rgba(255,209,102,.45); }
#rhythm-pulse { position:absolute; top:10px; bottom:10px; left:0; width:8px; border-radius:8px; background:#00f2ff; box-shadow:0 0 20px #00f2ff; }
.rhythm-meter.playing #rhythm-pulse { animation:rhythmSlide 1.35s linear infinite alternate; }
.rhythm-tap { min-width:min(360px,90vw); padding:18px 24px; border:1px solid #ffd166; border-radius:14px; color:#17120a; background:#ffd166; font:16px 'Bungee'; cursor:pointer; box-shadow:0 8px 30px rgba(255,209,102,.2); }
.rhythm-tap:active { transform:scale(.97); }
@keyframes runnerGlow { from { box-shadow:0 0 12px #00f2ff; } to { box-shadow:0 0 30px #00f2ff; } }
@keyframes rhythmSlide { from { left:3%; } to { left:95%; } }
@media (max-width:600px) { .runner-track { height:330px; } .clash-options { grid-template-columns:repeat(2,1fr); } .runner-hud, .clash-hud, .rhythm-hud { font-size:10px; padding:10px 8px; } }

/* ---- Clicker upgrade (clicker-plus.js) ---- */
#clicker-col-stage { overflow-y: auto; justify-content: safe center; padding: 56px 12px 16px; }
#clicker-col-stage .dps-display { margin-bottom: 12px; }
#cp-stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 30px; }
.cp-chip { padding: 5px 12px; border-radius: 999px; font-family: 'Roboto Mono', monospace; font-size: 12px; color: #cfeaff; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); }
#cp-combo { width: min(340px, 78%); margin: 34px auto 0; text-align: center; }
#cp-combo-lbl { font-family: 'Bungee', sans-serif; font-size: 12px; color: #ffb347; letter-spacing: 1px; margin-bottom: 6px; }
.cp-combo-track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
#cp-combo-fill { width: 0; height: 100%; background: linear-gradient(90deg, #ffd700, #ff7a18, #ff2d6f); transition: width 0.08s linear; }
#cp-frenzy { display: none; margin: 10px auto 0; padding: 6px 14px; width: max-content; border-radius: 999px; font-family: 'Bungee', sans-serif; font-size: 13px; color: #1a0a00; background: linear-gradient(90deg, #ffd700, #ff7a18); animation: cpPulse 0.6s ease-in-out infinite alternate; }
@keyframes cpPulse { from { transform: scale(1); } to { transform: scale(1.06); } }
#cp-stats-line { margin: 14px 0 0; font-family: 'Roboto Mono', monospace; font-size: 11px; color: #789; text-align: center; }
.cp-hint { margin-top: 6px; font-size: 11px; color: #567; text-align: center; font-family: 'Roboto Mono', monospace; }
.cp-iconbtn { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(16, 18, 30, 0.7); color: #fff; font-size: 18px; cursor: pointer; z-index: 30; }
.toilet-btn.cp-squish { animation: cpSquish 0.13s ease; }
@keyframes cpSquish { 0% { transform: scale(1); } 40% { transform: scale(0.9, 0.94); } 100% { transform: scale(1); } }
.toilet-btn.cp-glow { border-color: #ff9a1f; box-shadow: 0 0 110px #ff7a18, 0 0 40px #ffd700; }
.cp-flash { animation: cpFlash 0.35s ease; }
@keyframes cpFlash { 0% { box-shadow: inset 0 0 0 0 rgba(255, 215, 0, 0); } 30% { box-shadow: inset 0 0 120px 10px rgba(255, 215, 0, 0.35); } 100% { box-shadow: inset 0 0 0 0 rgba(255, 215, 0, 0); } }
.cp-pop { position: fixed; z-index: 9500; pointer-events: none; transform: translate(-50%, -50%); font-family: 'Bungee', sans-serif; font-size: 26px; color: #7dff6a; text-shadow: 0 2px 6px #000; animation: cpPop 0.9s ease-out forwards; white-space: nowrap; }
.cp-pop.crit { font-size: 36px; color: #ffd700; }
.cp-pop.frenzy { color: #ff9a1f; }
@keyframes cpPop { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0.7); } 20% { transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - 100px)) scale(1); } }
.cp-bit { position: fixed; z-index: 9400; pointer-events: none; font-size: 18px; animation: cpBit 0.8s ease-out forwards; }
@keyframes cpBit { 0% { transform: translate(0, 0) scale(0.6); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; } }
.cp-ring { position: fixed; z-index: 9300; pointer-events: none; width: 24px; height: 24px; border: 4px solid rgba(0, 242, 255, 0.8); border-radius: 50%; transform: translate(-50%, -50%); animation: cpRing 0.55s ease-out forwards; }
@keyframes cpRing { to { transform: translate(-50%, -50%) scale(13); opacity: 0; } }
#cp-golden { position: absolute; z-index: 25; width: 78px; height: 78px; border: 0; background: transparent; font-size: 58px; cursor: pointer; filter: drop-shadow(0 0 14px #ffd700) drop-shadow(0 0 30px #ff9a1f); animation: cpGold 1.1s ease-in-out infinite alternate; }
@keyframes cpGold { from { transform: scale(0.92) rotate(-6deg); } to { transform: scale(1.12) rotate(6deg); } }

/* shop: honest affordability, owned counts, bulk selector */
.cp-bulk { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: rgba(0, 0, 0, 0.35); border-bottom: 1px solid #222; }
.cp-bulk span { font-family: 'Bungee', sans-serif; font-size: 11px; color: #789; margin-right: 4px; }
.cp-bulk button { flex: 1; padding: 6px 4px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.06); color: #cde; font-family: 'Bungee', sans-serif; font-size: 11px; cursor: pointer; }
.cp-bulk button.on { background: var(--primary); color: #000; border-color: var(--primary); }
.shop-card.cant { opacity: 0.58; }
.shop-card.afford { border-left-color: var(--toxic); }
.shop-card.afford:hover { border-color: var(--toxic); }
.shop-card .card-btn { min-width: 86px; line-height: 1.2; }
.shop-card.afford .card-btn { background: var(--toxic); color: #000; cursor: pointer; box-shadow: 0 3px 0 #005500; }
.shop-card.afford .card-btn:active { transform: translateY(2px); box-shadow: none; }
.shop-card.owned .card-btn { background: #1d2740; color: #7ab8ff; cursor: default; box-shadow: none; }
.cp-qty { display: block; font-size: 10px; opacity: 0.75; }
.cp-price { display: block; font-size: 13px; }
.cp-own { font-style: normal; color: var(--gold); font-size: 12px; margin-left: 4px; }
.card-next { display: block; font-family: 'Roboto Mono', monospace; font-size: 10px; color: #6c8; margin-top: 2px; }
.shop-card.gemcard .card-next { color: #c8a; }
@media (max-height: 820px) { .toilet-btn { width: 230px; height: 230px; font-size: 115px; } }
@media (max-width: 900px) { #clicker-col-stage { padding-top: 64px; } }
@media (prefers-reduced-motion: reduce) { .cp-pop, .cp-bit, .cp-ring, #cp-golden, #cp-frenzy, .toilet-btn.cp-squish { animation: none; } }

/* Clicker layout: lists scroll inside the screen instead of stretching the whole grid row */
@media (min-width: 901px) {
    #game-clicker { grid-template-rows: minmax(0, 1fr); overflow: hidden; }
    #game-clicker .shop-col { min-height: 0; overflow: hidden; padding-top: 58px; }
    #game-clicker .shop-list { min-height: 0; }
    #clicker-col-stage { min-height: 0; }
}
/* new games added later get a theme too */
#game-neonrunner { --ga: #00e5ff; --gb: #0a2a44; }
#game-colorclash { --ga: #c05cff; --gb: #26104a; }
#game-rhythm { --ga: #ffd700; --gb: #3a2a0a; }

/* ---- Clicker on phones: tab bar on top (below the exit pill / wallet), full-height scrolling lists ---- */
@media (max-width: 900px) {
    #game-clicker { padding-top: 54px; grid-template-rows: auto minmax(0, 1fr) !important; }
    #game-clicker .clicker-stage { order: 0 !important; padding: 14px 12px 16px !important; }
    #game-clicker .shop-col { max-height: none !important; min-height: 0; overflow: hidden; }
    #game-clicker .shop-list { min-height: 0; }
    #cp-combo { width: min(320px, 86%); }
    #cp-stats-line, .cp-hint { font-size: 10px; }
}

/* golden toilet: unmistakably golden, with a spinning halo */
#cp-golden { width: 96px; height: 96px; font-size: 64px; filter: sepia(1) saturate(7) hue-rotate(2deg) brightness(1.15) drop-shadow(0 0 14px #ffd700) drop-shadow(0 0 32px #ff9a1f); }
#cp-golden::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 3px dashed #ffd700; animation: cpSpin 3s linear infinite; }
@keyframes cpSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #cp-golden::after { animation: none; } }

/* ---- Clicker: research lab, achievements, next goal ---- */
#cp-goal { width: min(380px, 86%); margin: -14px auto 22px; text-align: center; }
#cp-goal-tx { display: block; font-family: 'Roboto Mono', monospace; font-size: 12px; color: #ffd98a; margin-bottom: 5px; }
.cp-goal-track { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
#cp-goal-fill { width: 0; height: 100%; background: linear-gradient(90deg, #39ff14, #00f2ff); transition: width 0.25s ease; }
#cp-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
#cp-actions button { padding: 9px 16px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(16, 18, 30, 0.75); color: #fff; font-family: 'Bungee', sans-serif; font-size: 12px; cursor: pointer; transition: border-color 0.15s, transform 0.1s; }
#cp-actions button:hover { border-color: var(--primary); transform: translateY(-2px); }
#cp-lab-badge { display: none; margin-left: 4px; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: #39ff14; color: #000; font-size: 11px; }

#cp-lab { display: none; position: fixed; inset: 0; z-index: 100010; align-items: center; justify-content: center; padding: 14px; background: rgba(0, 0, 0, 0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cp-lab-box { width: min(980px, 100%); max-height: 92vh; display: flex; flex-direction: column; background: linear-gradient(180deg, #11131f, #080910); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 18px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7); overflow: hidden; }
.cp-lab-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.cp-lab-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.cp-lab-tabs button { padding: 9px 16px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.05); color: #cde; font-family: 'Bungee', sans-serif; font-size: 12px; cursor: pointer; }
.cp-lab-tabs button.on { background: var(--primary); color: #000; border-color: var(--primary); }
#cp-lab-close { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 60, 60, 0.18); color: #fff; font-size: 16px; cursor: pointer; }
#cp-lab-body { overflow-y: auto; padding: 14px; }
.cp-lab-note { margin-bottom: 12px; font-family: 'Roboto Mono', monospace; font-size: 12px; color: #9ab; }
.cp-lab-note b { color: var(--gold); }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.cp-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.12); border-left: 4px solid #555; }
.cp-card.afford { border-left-color: #39ff14; }
.cp-card.maxed { border-left-color: var(--gold); background: rgba(255, 215, 0, 0.06); }
.cp-card-ic { font-size: 30px; width: 44px; text-align: center; flex-shrink: 0; }
.cp-card-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cp-card-tx b { font-family: 'Bungee', sans-serif; font-size: 13px; }
.cp-card-tx em { font-style: normal; font-size: 11px; color: var(--gold); margin-left: 6px; font-family: 'Roboto Mono', monospace; }
.cp-card-tx span { font-family: 'Roboto Mono', monospace; font-size: 11px; color: #9bb; }
.cp-card-tx span i { font-style: normal; color: #7dff6a; }
.cp-card-tx small { font-family: 'Roboto Mono', monospace; font-size: 10px; color: #789; }
.cp-pips { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-top: 3px; }
.cp-pips div { height: 100%; background: linear-gradient(90deg, #00f2ff, #ff00ea); }
.cp-r-buy { flex-shrink: 0; min-width: 84px; padding: 9px 10px; border-radius: 10px; border: 0; background: #2a2d3a; color: #778; font-family: 'Bungee', sans-serif; font-size: 12px; cursor: not-allowed; }
.cp-card.afford .cp-r-buy { background: var(--toxic); color: #000; cursor: pointer; box-shadow: 0 3px 0 #005500; }
.cp-card.maxed .cp-r-buy { background: rgba(255, 215, 0, 0.18); color: var(--gold); }
.cp-reward { flex-shrink: 0; font-family: 'Bungee', sans-serif; font-size: 12px; color: #c9f; }
@media (max-width: 600px) { .cp-grid { grid-template-columns: 1fr; } .cp-lab-tabs button { padding: 8px 10px; font-size: 11px; } #cp-lab { padding: 6px; } }

/* keep the clicker hint text clear of the fixed credit strip */
#clicker-col-stage { padding-bottom: 46px; }
