/**
 * WHAT HAPPENED clicker — main game page styles (index.html). Tokens live in theme.css.
 * Sections: page + background, loading overlay, upgrades sidebar, top bar, main area, stat card,
 * modals, shop, settings, specials panel, floating widgets, effects, mobile.
 */
:root {
    --leftbar-width: 300px;
    --topbar-height: 64px;
}

/* ========== Page + background ========== */
html { background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: var(--bg);
    background-image: url('mainimage/mainbg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
/* soft vignette so panels and text stay readable on bright backgrounds */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.55) 100%);
}
body.transitions-enabled { transition: margin-left 240ms ease; }
body.leftbar-open { margin-left: var(--leftbar-width); }
body.leftbar-closed { margin-left: 0; }

/* ========== Loading overlay ========== */
#loadingOverlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 40%, #1a1f2d, #07080c);
    z-index: 99999;
}
#loadingOverlay .loader { display: flex; flex-direction: column; align-items: center; gap: 14px; }
#loadingOverlay .loader-text { font-family: var(--font-display); letter-spacing: 2px; color: var(--gold); }
.shapes { position: relative; width: 160px; height: 120px; pointer-events: none; }
.shape { position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; border-radius: 6px; transform: translate(-50%, -50%); opacity: 0.95; }
.shape.square { width: 36px; height: 36px; border-radius: 6px; background: linear-gradient(180deg, #ffe08a, var(--gold-deep)); animation: square-rotate 700ms cubic-bezier(.19, 1, .22, 1) infinite; }
.shape:nth-child(2) { background: linear-gradient(180deg, #9fe3ff, #53b9ff); border-radius: 50%; }
.shape:nth-child(3) { background: linear-gradient(180deg, #c8f7a9, #2fd07a); }
.shape:nth-child(4) { background: linear-gradient(180deg, #e4c8ff, var(--divine)); border-radius: 50%; }
.shape:nth-child(5) { background: linear-gradient(180deg, #ffd9b3, #ff8a5c); }
@keyframes square-rotate { from { transform: translate(-50%, -50%) rotate(0); } to { transform: translate(-50%, -50%) rotate(90deg); } }

/* ========== Upgrades sidebar (normal + divine) ========== */
#leftBar,
#divineLeftBar.left-bar-clone {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--leftbar-width);
    margin: 0;
    padding: 0;
    list-style: none;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background: rgba(11, 13, 19, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35);
    transition: transform 240ms ease;
}
#divineLeftBar.left-bar-clone {
    overflow-y: auto;
    padding: 0 12px 16px;
    gap: 10px;
    background: linear-gradient(180deg, rgba(28, 16, 52, 0.95), rgba(11, 13, 19, 0.95));
}
#leftBar.collapsed,
#divineLeftBar.left-bar-clone.collapsed { transform: translateX(-100%); }

#leftBar .leftBarScroll { flex: 1 1 auto; overflow-y: auto; padding: 0 12px 12px; }
#leftBar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#leftBar li, #divineLeftBar li { width: 100%; }

/* Upgrades / Divine segmented switch */
.menu-tabs {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    gap: 4px;
    margin: 0 -12px;
    padding: 14px 12px 10px;
}
#leftBar .menu-tabs { background: rgba(11, 13, 19, 0.97); }
#divineLeftBar .menu-tabs { background: rgba(28, 16, 52, 0.98); }
.menu-tab {
    flex: 1;
    padding: 9px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    font-weight: 700;
    font-size: 13px;
}
.menu-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.menu-tab.active { background: var(--gold); border-color: transparent; color: #2a1600; }
.menu-tab--divine.active { background: linear-gradient(180deg, var(--divine), var(--divine-deep)); color: #fff; }

.divine-intro { color: var(--text-dim); font-size: 13px; line-height: 1.4; padding: 2px 4px 4px; }
/* Divine menu: Golden -> rubies for the Wilds */
.divine-exchange { margin-top: 6px; padding: 10px 12px; border-radius: var(--radius); background: rgba(255, 200, 61, 0.07); border: 1px solid rgba(255, 200, 61, 0.3); }
.divine-exchange-title { font-weight: 800; font-size: 14px; }
.divine-exchange-text, .divine-exchange-note { margin: 4px 0 0; color: var(--text-dim); font-size: 12px; line-height: 1.4; }
.divine-exchange-note:empty { display: none; }
.divine-gods { background: rgba(167, 125, 255, 0.08); border-color: rgba(167, 125, 255, 0.3); }
/* the Auto Clicker charm: its bar under the image, the clicker sitting on its target, and choosing a target */
.auto-clicker { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin: 6px auto 10px; padding: 6px 12px; max-width: 460px; border-radius: 16px; background: var(--surface-solid); border: 1px solid rgba(61, 255, 180, 0.5); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); color: var(--text); font-size: 13px; }
.auto-clicker[hidden] { display: none; }
.auto-clicker-name { font-weight: 800; color: #3dffb4; }
.auto-clicker-state { color: var(--text-dim); }
.auto-clicker-badge { position: fixed; z-index: 40; pointer-events: none; font-size: 20px; filter: drop-shadow(0 0 6px rgba(61, 255, 180, 0.8)); animation: ac-tap 0.1s ease-in-out infinite alternate; }
.auto-clicker-badge[hidden] { display: none; }
@keyframes ac-tap { from { transform: translateY(0); } to { transform: translateY(3px); } }
body.ac-placing .main-image-btn, body.ac-placing #leftBar button[id^="upgrade"], body.ac-placing #divineLeftBar button[id^="divine"]:not(.menu-tab) { outline: 2px dashed #3dffb4; outline-offset: 2px; cursor: crosshair; }
@media (prefers-reduced-motion: reduce) { .auto-clicker-badge { animation: none; } }
.divine-gods .divine-exchange-text div + div { margin-top: 2px; }
.divine-exchange-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.divine-exchange-label { font-size: 12px; font-weight: 700; color: var(--text-dim); }
.divine-exchange-row input { flex: 1 1 auto; min-width: 0; width: 80px; }

/* Upgrade cards (both bars) */
#leftBar button[id^="upgrade"] { display: none; }
#leftBar button#upgrade1 { display: flex; }
.upgrade-full-btn,
#divineLeftBar button[id^="divine"]:not(.menu-tab) {
    width: 100%;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
    padding: 8px 12px 8px 8px !important;
    text-align: left;
    color: var(--text) !important;
    background: var(--surface-2) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease, opacity 120ms ease;
    position: relative;
}
#divineLeftBar button[id^="divine"]:not(.menu-tab) { display: flex !important; }
.upgrade-full-btn:hover,
#divineLeftBar button[id^="divine"]:not(.menu-tab):hover { background: var(--surface-3) !important; border-color: var(--border-strong) !important; }
.upgrade-full-btn:active { transform: scale(0.985); }
#divineLeftBar button[id^="divine"]:not(.menu-tab) { background: rgba(167, 125, 255, 0.1) !important; border-color: rgba(167, 125, 255, 0.28) !important; }
#divineLeftBar button[id^="divine"]:not(.menu-tab):hover { background: rgba(167, 125, 255, 0.2) !important; }

.upgrade-img {
    order: 0;
    flex: 0 0 52px;
    width: 52px !important;
    height: 52px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    object-fit: cover;
    pointer-events: none;
    background: #fff;
}
.upgrade-label {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    line-height: 1.25;
}
.up-name { font-weight: 700; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-effect { color: var(--text-dim); font-size: 12px; }
.up-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.up-cost { color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.up-cost--gold { color: var(--gold); }
.up-cost--max { color: var(--divine); }
.up-level {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.up-level--new { background: rgba(255, 200, 61, 0.16); color: var(--gold); }

/* can't afford yet: dimmed, cost turns muted (still hoverable so the tooltip works) */
#leftBar button.cant-afford { opacity: 0.55; }
#leftBar button.cant-afford .up-cost { color: var(--text-dim); }
#leftBar button.cant-afford:hover { opacity: 0.85; }

/* disabled buttons (divine/special upgrades the player can't buy right now) */
.upgrade-disabled,
button[disabled] { opacity: 0.5; filter: grayscale(0.5); cursor: not-allowed; }

/* Bulk-buy bar pinned to the bottom of the upgrades bar */
.bulk-bar {
    flex: 0 0 auto;
    border-top: 1px solid var(--border);
    background: rgba(8, 9, 13, 0.95);
    padding: 10px 12px 12px;
}
.bulk-inner { display: flex; align-items: center; gap: 8px; }
.bulk-label { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); }
.bulk-row { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.bulk-btn {
    padding: 7px 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    font-weight: 700;
    font-size: 12px;
}
.bulk-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.bulk-btn.active { background: var(--gold); color: #2a1600; border-color: transparent; }

/* ========== Top bar ========== */
#topBar {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--topbar-height);
    padding: 10px 20px;
    background: linear-gradient(180deg, rgba(8, 9, 13, 0.72), rgba(8, 9, 13, 0));
}
.icon-btn {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 18, 27, 0.85);
    color: var(--text);
    font-size: 18px;
    box-shadow: var(--shadow);
}
.icon-btn:hover { background: var(--surface-3); }
.top-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 18, 27, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    transition: background 120ms ease, transform 120ms ease;
}
.nav-btn:hover { background: var(--surface-3); transform: translateY(-1px); }
.nav-btn.active { border-color: var(--gold); }
.nav-ico { font-size: 15px; line-height: 1; }
.nav-img { width: 18px; height: 18px; filter: brightness(0) saturate(100%); }
.nav-btn--gold { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); border-color: transparent; color: #2a1600; font-weight: 800; }
.nav-btn--gold:hover { background: linear-gradient(180deg, #ffd66b, var(--gold-deep)); }
.nav-btn--special .nav-ico { color: var(--gold); }
.nav-btn--menu {
    position: relative;
    gap: 6px;
    padding-right: 12px;
}
.nav-btn--menu .nav-caret {
    font-size: 11px;
    line-height: 1;
    opacity: 0.75;
    transition: transform 200ms ease;
}
.nav-btn--menu.active {
    border-color: var(--gold);
    background: var(--surface-3);
}
.nav-btn--menu.active .nav-caret {
    transform: rotate(180deg);
}
.nav-btn--menu .site-badge.dot {
    top: 2px;
    right: 2px;
}

/* ========== Main area ========== */
#mainContent {
    position: relative;
    z-index: 500;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 24px;
    text-align: center;
}
.game-title {
    margin: 4px 0 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(30px, 5vw, 60px);
    letter-spacing: 1px;
    line-height: 1.05;
    color: #fff;
    text-shadow: 0 3px 0 #1d1300, 0 6px 22px rgba(0, 0, 0, 0.55);
}
.game-title-bang { color: var(--gold); }
#equippedTitleDisplay {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 14px;
    border-radius: 999px;
    background: rgba(15, 18, 27, 0.8);
    border: 1px solid var(--border-strong);
    font-size: 13px;
}
#equippedTitleDisplay:empty { display: none; }

.main-image-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; margin: 18px 0 8px; }
.main-image-btn {
    padding: 0;
    border: none;
    background: none;
    border-radius: 20px;
    max-width: 100%;
    -webkit-tap-highlight-color: transparent;
}
.main-image-btn:focus-visible { outline-offset: 6px; }
.main-image {
    display: block;
    height: auto;
    max-width: 100% !important;
    border-radius: 20px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), 0 24px 60px rgba(0, 0, 0, 0.55);
    animation: floaty 6s ease-in-out infinite;
    transition: box-shadow 160ms ease;
    user-select: none;
    -webkit-user-drag: none;
}
.main-image-btn:hover .main-image { box-shadow: 0 0 0 3px rgba(255, 200, 61, 0.55), 0 24px 60px rgba(0, 0, 0, 0.55); }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.main-image.pulsate { animation: pulsateAnim 600ms cubic-bezier(.2, .9, .2, 1) !important; }
@keyframes pulsateAnim { 0% { transform: scale(1); } 35% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* Counters card */
.info-card { width: min(600px, 100%); padding: 18px 20px 20px; text-align: center; }
.stat-hero { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 14px; }
.stat-label { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-dim); }
.stat-hero-value {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 46px);
    line-height: 1.1;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 8px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}
.stat-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-tile--gold { background: rgba(255, 200, 61, 0.08); border-color: rgba(255, 200, 61, 0.3); }
.stat-tile--gold .stat-label, .stat-tile--gold .stat-value { color: var(--gold); }
.info-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
/* equipped followers (followers.html) and the buffs they give */
.follower-strip {
    display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 12px;
    border-radius: var(--radius); background: rgba(47, 208, 122, 0.08); border: 1px solid rgba(47, 208, 122, 0.28);
    color: var(--text); text-decoration: none; text-align: left; font-size: 13px; font-weight: 600;
}
.follower-strip:hover { background: rgba(47, 208, 122, 0.14); }
.follower-strip.is-empty { background: rgba(255, 255, 255, 0.04); border-color: var(--border); color: var(--text-dim); }
.fs-avatars { display: flex; flex: 0 0 auto; }
.fs-avatars:empty { display: none; }
.fs-avatar { width: 34px; height: 34px; border-radius: 9px; overflow: hidden; border: 2px solid var(--rc, #b4bccd); margin-left: -6px; background: #111; }
.fs-avatar:first-child { margin-left: 0; }
.fs-avatar .wf-art { width: 100%; height: 100%; display: block; }
.fs-text { flex: 1; line-height: 1.35; }
.fs-text b { color: var(--primary); }
.fs-egg { display: inline-block; margin-left: 4px; padding: 0 8px; border-radius: 999px; background: rgba(255, 200, 61, 0.15); color: var(--gold); font-weight: 800; }
.nav-btn { position: relative; }

/* ========== Modals (stats, welcome back) ========== */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2300;
    width: min(92vw, 380px);
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    animation: modal-in 180ms ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.stat-list { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.stat-list > div { display: flex; justify-content: space-between; gap: 16px; }
.stat-list dt { color: var(--text-dim); }
.stat-list dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-list hr { width: 100%; border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.welcome-body { display: flex; flex-direction: column; gap: 4px; font-size: 15px; color: var(--text-dim); margin-bottom: 16px; }
.welcome-body strong { color: var(--gold); font-size: 15px; }
#welcomeBackGained { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0 6px; text-align: center; }
.wb-amount { font-family: var(--font-display); font-size: 34px; color: var(--gold); text-shadow: 0 3px 14px rgba(255, 170, 40, 0.35); line-height: 1.1; }
.wb-label { font-size: 13px; }
#welcomeBackFor { text-align: center; font-size: 13px; }

/* ========== Shop ========== */
.shop-overlay, .settings-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); }
.shop-overlay { z-index: 1400; }
.shop-overlay.open, .settings-overlay.open { display: block; }
.shop-menu {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1405;
    width: min(94vw, 1040px);
    max-height: 92vh;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
}
.shop-menu.open { display: flex; }
.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.shop-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-width: 0; }
.gem-balance {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    border-radius: 999px;
    background: rgba(90, 169, 255, 0.12);
    border: 1px solid rgba(90, 169, 255, 0.35);
    font-weight: 800;
}
.shop-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); }
.shop-tab-btn { padding: 8px 14px; border-radius: 999px; border: none; background: transparent; color: var(--text-dim); font-weight: 700; font-size: 13px; }
.shop-tab-btn:hover { color: var(--text); }
.shop-tab-btn.active { background: var(--gold); color: #2a1600; }
.shop-content { flex: 1; overflow-y: auto; padding: 18px; }
.shop-items-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.shop-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    text-align: left;
    transition: border-color 120ms ease, transform 120ms ease;
}
.shop-item:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.shop-item.equipped { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 8px 24px rgba(255, 200, 61, 0.15); }
.shop-item-title { font-weight: 700; font-size: 14px; }
.shop-item-img { width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; border-radius: 10px; background: #000; display: block; }
.shop-item-info { color: var(--text-dim); font-size: 13px; }
.shop-item-info strong { color: var(--text); }
.shop-item > div:last-child { margin-top: auto; flex-wrap: wrap; }
.shop-item button,
#shopTabMusic button {
    border: 1px solid var(--border-strong) !important;
    border-radius: 999px !important;
    padding: 7px 12px !important;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-weight: 700;
    font-size: 13px;
}
.shop-menu button[id^="buy"] { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #2a1600; border-color: transparent !important; }
.shop-menu button[id^="equip"]:not(:disabled) { background: rgba(90, 169, 255, 0.16); border-color: rgba(90, 169, 255, 0.45) !important; color: #cfe5ff; }
.shop-menu button:disabled { opacity: 0.45; }
.shop-item div[id^="shopMusicStatus_"] { color: var(--gold) !important; font-size: 12px; }

/* ========== Settings ========== */
.settings-overlay { z-index: 1210; }
.settings-menu {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1220;
    width: min(94vw, 460px);
    max-height: 90vh;
    overflow-y: auto;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
}
.settings-menu.open { display: block; }
.settings-content { display: flex; flex-direction: column; gap: 14px; }
.settings-group { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.settings-group h4 { margin: 0; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-faint); }
.setting-row { display: flex; flex-direction: column; gap: 6px; }
.setting-row[hidden] { display: none; }
.setting-row > label { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; }
.setting-value { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.setting-inline { display: flex; align-items: center; gap: 8px; }
.setting-inline input[type=range], .setting-inline select, .setting-inline input[type=text] { flex: 1; }
.setting-help { font-size: 12px; color: var(--text-dim); }
.setting-help:empty { display: none; }
.settings-footer { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }

/* ========== Navigation Dropdown Side Bar ========== */
.nav-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1140;
    background: rgba(4, 6, 10, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease;
}
.nav-sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.nav-sidebar {
    position: fixed;
    top: calc(var(--topbar-height) + 8px);
    right: 16px;
    z-index: 1150;
    width: min(92vw, 350px);
    max-height: calc(100vh - var(--topbar-height) - 24px);
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: rgba(15, 18, 27, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: translateX(calc(100% + 30px));
    opacity: 0;
    pointer-events: none;
    transition: transform 260ms cubic-bezier(.16, 1, .3, 1), opacity 200ms ease;
}
.nav-sidebar.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.nav-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.nav-sidebar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 16px;
    color: var(--text);
    letter-spacing: 0.3px;
}
.nav-sidebar-title-icon {
    font-size: 18px;
}

.nav-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.nav-sidebar-content::-webkit-scrollbar {
    width: 6px;
}
.nav-sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}
.nav-sidebar-content::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 999px;
}
.nav-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

.nav-sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nav-sidebar-group-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 0 4px 4px;
}

.nav-sidebar-btn {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: auto !important;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    text-decoration: none;
    text-align: left;
    white-space: normal;
    box-shadow: none;
    transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.nav-sidebar-btn:hover {
    background: var(--surface-3);
    border-color: var(--border-strong);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.nav-sidebar-btn:active {
    transform: translateX(2px) scale(0.99);
}

.nav-sidebar-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 18px;
    line-height: 1;
}
.nav-sidebar-ico .nav-img {
    width: 20px;
    height: 20px;
}

.nav-sidebar-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.nav-sidebar-name {
    display: inline-block !important;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}
.nav-sidebar-desc {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.25;
}

.nav-sidebar-arrow {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-faint);
    margin-left: auto;
    transition: transform 140ms ease, color 140ms ease;
}
.nav-sidebar-btn:hover .nav-sidebar-arrow {
    transform: translateX(2px);
    color: var(--gold);
}

/* special highlight for Shop button */
.nav-sidebar-btn--shop {
    background: linear-gradient(90deg, rgba(255, 200, 61, 0.12), rgba(255, 154, 31, 0.03));
    border-color: rgba(255, 200, 61, 0.3);
}
.nav-sidebar-btn--shop .nav-sidebar-ico {
    background: linear-gradient(135deg, rgba(255, 200, 61, 0.25), rgba(255, 154, 31, 0.15));
    border-color: rgba(255, 200, 61, 0.4);
}
.nav-sidebar-btn--shop .nav-sidebar-name {
    color: #ffe082;
}
.nav-sidebar-btn--shop:hover {
    background: linear-gradient(90deg, rgba(255, 200, 61, 0.2), rgba(255, 154, 31, 0.08));
    border-color: var(--gold);
    box-shadow: 0 4px 20px rgba(255, 200, 61, 0.2);
}

/* ensure site-badge sits nicely on nav-sidebar-btn */
.nav-sidebar-btn > .site-badge {
    top: 10px;
    right: 12px;
}

/* ========== Special upgrades panel (right side) ========== */
.special-menu {
    position: fixed;
    top: calc(var(--topbar-height) + 8px);
    right: 16px;
    z-index: 1100;
    width: 360px;
    max-height: calc(100vh - var(--topbar-height) - 28px);
    display: flex;
    flex-direction: column;
    padding: 14px;
    border-radius: var(--radius-lg);
    background: rgba(15, 18, 27, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    transform: translateX(calc(100% + 30px));
    opacity: 0;
    pointer-events: none;
    transition: transform 260ms cubic-bezier(.2, .9, .2, 1), opacity 200ms ease;
}
.special-menu.open { transform: translateX(0); opacity: 1; pointer-events: auto; }
.special-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.special-title { font-weight: 800; font-size: 16px; }
.special-hint { margin: 6px 0 10px; color: var(--text-dim); font-size: 12px; line-height: 1.4; }
.menu-content { display: none; overflow-y: auto; margin: 0 -6px; padding: 0 6px 6px; }
.special-menu.open .menu-content { display: block; }
.special-menu [hidden] { display: none !important; }
.sp-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.sp-filter { display: flex; gap: 3px; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border); }
.sp-filter button { padding: 5px 12px; border-radius: 999px; border: none; background: transparent; color: var(--text-dim); font-weight: 800; font-size: 12px; }
.sp-filter button:hover { color: var(--text); }
.sp-filter button.active { background: var(--gold); color: #2a1600; }
.sp-count { display: inline-block; min-width: 18px; margin-left: 2px; padding: 0 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font-size: 11px; text-align: center; }
.sp-filter button.active .sp-count { background: rgba(0, 0, 0, 0.18); }
.sp-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 12px; font-weight: 700; color: var(--text-dim); white-space: nowrap; }
.sp-bar { flex: 1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.sp-bar i { display: block; width: 0; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); transition: width 400ms ease; }

.sp-group { margin-bottom: 10px; padding: 10px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); }
.sp-group.is-complete { border-color: rgba(47, 208, 122, 0.35); }
.sp-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.sp-group-head img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; }
.sp-group-name { flex: 1; font-weight: 800; font-size: 13px; }
.sp-group-count { padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--text-dim); font-size: 11px; font-weight: 800; }
.sp-group.is-complete .sp-group-count { background: rgba(47, 208, 122, 0.14); color: var(--primary); }
.sp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }

/* one tile per special: the upgrade's picture in a frame coloured by tier */
.sp-tile {
    --tc: #b08d57;
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    border: 2px solid var(--tc);
    background: #0b0d13;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.sp-tile img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.sp-tier-1 { --tc: #b08d57; } .sp-tier-2 { --tc: #c9d1dc; } .sp-tier-3 { --tc: #ffc83d; } .sp-tier-4 { --tc: #5ad1ff; }
.sp-tier-5 { --tc: #b07dff; } .sp-tier-6 { --tc: #ff5bd0; } .sp-tier-7 { --tc: #ff6b3d; } .sp-tier-8 { --tc: #ffffff; }
.sp-numeral { position: absolute; left: 3px; bottom: 3px; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, 0.75); color: var(--tc); font: 900 10px/16px var(--font); letter-spacing: 0.5px; }
.sp-mark { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; display: none; place-items: center; font-size: 11px; font-weight: 900; }
.sp-tile:hover, .sp-tile:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5); }
.sp-tile.is-locked { filter: grayscale(1) brightness(0.45); border-color: rgba(255, 255, 255, 0.14); }
.sp-tile.is-locked .sp-numeral { color: var(--text-dim); }
.sp-tile.is-locked .sp-mark { display: grid; background: rgba(0, 0, 0, 0.6); }
.sp-tile.is-locked .sp-mark::before { content: '🔒'; font-size: 9px; }
.sp-tile.is-poor { filter: saturate(0.55) brightness(0.8); }
.sp-tile.is-ready { box-shadow: 0 0 0 2px rgba(255, 200, 61, 0.35), 0 0 16px rgba(255, 200, 61, 0.45); animation: spReady 1.8s ease-in-out infinite; }
@keyframes spReady { 50% { box-shadow: 0 0 0 2px rgba(255, 200, 61, 0.6), 0 0 24px rgba(255, 200, 61, 0.7); } }
.sp-tile.is-owned .sp-mark { display: grid; background: var(--primary); color: #04170c; }
.sp-tile.is-owned .sp-mark::before { content: '✓'; }
.sp-tile.sp-shake { animation: spShake 320ms ease; }
@keyframes spShake { 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }
.sp-tile.sp-just-bought { animation: spPop 600ms cubic-bezier(.2, .9, .2, 1.2); }
@keyframes spPop { 40% { transform: scale(1.18); } }
.sp-empty, .sp-more { margin: 8px 2px; font-size: 12px; color: var(--text-dim); text-align: center; }

/* hover card for a special */
.sp-tip {
    position: fixed;
    z-index: 1300;
    width: 280px;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    animation: spTipIn 120ms ease;
}
.sp-tip[hidden] { display: none; }
.sp-tip--pinned { pointer-events: auto; }
@keyframes spTipIn { from { opacity: 0; transform: translateY(4px); } }
.sp-tip-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sp-tip-head img { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; border: 2px solid rgba(255, 255, 255, 0.15); }
.sp-tip-head b { display: block; font-size: 15px; line-height: 1.2; }
.sp-tip-head span { font-size: 11.5px; color: var(--text-dim); }
.sp-tip-close { margin-left: auto; align-self: flex-start; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong); background: transparent; color: var(--text-dim); }
.sp-tip-effect { font-size: 14px; font-weight: 800; color: var(--primary); }
.sp-tip-status { margin: 4px 0 8px; font-size: 12.5px; font-weight: 700; }
.sp-st--ready { color: var(--gold); }
.sp-st--poor { color: #ff8a95; }
.sp-st--locked { color: var(--text-dim); }
.sp-st--locked em { font-style: normal; opacity: 0.7; }
.sp-st--owned { color: var(--primary); }
.sp-tip-flavor { margin: 0; padding-top: 8px; border-top: 1px solid var(--border); color: #d6c9ae; font-size: 12.5px; font-style: italic; line-height: 1.45; }
.sp-tip-note { margin-top: 6px; font-size: 11px; color: var(--text-faint); }
.sp-tip-buy { margin-top: 10px; }
@media (hover: none) {
    .sp-tip--pinned { top: 12px; left: 12px; right: 12px; width: auto; }
}

/* count of specials ready to buy, on the Specials nav button */
.nav-count { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--gold); color: #2a1600; font-size: 10.5px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }

/* ========== Floating widgets ========== */
#chatFab { position: fixed; right: 18px; bottom: 18px; z-index: 1300; }
.fab-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: linear-gradient(180deg, #2b3350, #1a1f2d);
    color: #fff;
    font-size: 22px;
    box-shadow: var(--shadow-lg);
}
.fab-btn:hover { filter: brightness(1.15); }
#chatUnreadBadge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--danger);
    border: 2px solid var(--bg);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
#buffPanel { position: fixed; right: 18px; bottom: 86px; z-index: 1150; min-width: 220px; padding: 12px 14px; font-size: 13px; }
#buffPanel .buff-title { font-weight: 800; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }

#toastContainer {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    max-width: min(92vw, 520px);
}
#toastContainer .toast {
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(15, 18, 27, 0.95);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    font-size: 14px;
    text-align: center;
    animation: toast-in 180ms ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ========== Effects ========== */
/* achievement unlock popup (positioned under the Achievements button by main.js) */
#achievementPopupContainer { position: fixed; top: calc(var(--topbar-height, 64px) + 10px); right: 16px; z-index: 3000; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.achievement-popup {
    display: flex; flex-direction: column; gap: 2px;
    width: max-content; max-width: min(320px, calc(100vw - 32px));
    padding: 10px 14px; border-radius: var(--radius);
    background: var(--surface-solid); border: 1px solid rgba(255, 200, 61, 0.45); box-shadow: var(--shadow-lg);
    color: var(--text); text-decoration: none; pointer-events: auto;
    opacity: 0; transform: translateX(24px); transition: opacity 260ms ease, transform 260ms ease;
}
.achievement-popup.in { opacity: 1; transform: none; }
/* chat side panel (index.html builds it) */
.side-panel {
    position: fixed; right: 0; top: 0; z-index: 1400;
    height: 100%; width: 400px; max-width: 100vw;
    display: flex; flex-direction: column; gap: 10px;
    padding: 14px;
    background: var(--surface-solid);
    border-left: 1px solid var(--border-strong);
    box-shadow: -16px 0 40px rgba(0, 0, 0, 0.55);
    transition: transform 260ms ease;
    overflow: hidden;
}
.side-head { display: flex; align-items: center; gap: 10px; }
.side-tabs { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); }
.side-tab { border: none; background: transparent; color: var(--text-dim); font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 999px; }
.side-tab.active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.side-safe { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--text-dim); font-size: 12px; cursor: pointer; }
.side-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-area { flex: 1; min-height: 0; flex-direction: column; gap: 8px; }
.side-area[style*="block"] { display: flex !important; }
.chat-log { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; border-radius: var(--radius); background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border); font-size: 13px; line-height: 1.45; color: var(--text); }
.chat-log > div { padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); word-break: break-word; }
.chat-log > div:last-child { border-bottom: none; }
.chat-empty { color: var(--text-dim); text-align: center; padding: 24px 8px; border: none !important; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input { flex: 1; }
.side-clan-info { font-size: 13px; color: var(--text-dim); }
.side-clan-info b { color: var(--gold); }
.side-clan-info a { color: var(--blue); font-weight: 700; text-decoration: none; }
@media (max-width: 520px) { .side-panel { width: 100vw; padding: 12px 10px; } }
.stats-extra { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 6px; font-size: 14px; }
.stats-extra h4 { margin: 0 0 2px; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-dim); }
.stats-extra-row { display: flex; justify-content: space-between; gap: 12px; }
.stats-extra-row span { color: var(--text-dim); }
.stats-extra-row a, .stats-extra-row b { color: var(--text); font-weight: 700; text-align: right; text-decoration: none; }
.stats-extra-row a:hover { color: var(--gold); text-decoration: underline; }
.achievement-popup:hover { border-color: var(--gold); }
.achievement-popup--summary { background: linear-gradient(135deg, rgba(255, 200, 61, 0.16), transparent 70%), var(--surface-solid); }
.ap-kicker { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); font-weight: 800; }
.ap-title { font-size: 14px; font-weight: 800; }
.ap-msg { font-size: 12px; color: var(--text-dim); line-height: 1.35; }
#falling-container { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 200; }
/* "+N" numbers that float up from the click */
#clickFloatLayer { position: fixed; inset: 0; pointer-events: none; z-index: 1500; overflow: hidden; }
.click-float {
    position: absolute;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 22px;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 12px rgba(0, 0, 0, 0.45);
    white-space: nowrap;
    animation: click-float-up 900ms cubic-bezier(.2, .7, .3, 1) forwards;
}
.click-float.crit { font-size: 32px; color: #ff6a85; animation-duration: 1200ms; }
@keyframes click-float-up {
    0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); }
    15% { opacity: 1; transform: translate(-50%, -70%) scale(1.08); }
    100% { opacity: 0; transform: translate(-50%, -280%) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .click-float { animation-duration: 500ms; } }
.falling-image { position: fixed; top: 0; pointer-events: none; will-change: transform, opacity; border-radius: 6px; }
.crit-indicator {
    position: fixed;
    z-index: 1600;
    transform: translate(-50%, -50%);
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ff4d6a, #d61f45);
    color: #fff;
    font-family: var(--font-display);
    font-size: 24px;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(214, 31, 69, 0.45);
    animation: crit-pop 900ms ease-out forwards;
}
@keyframes crit-pop {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -120%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -180%) scale(1); }
}
.bought-anim { animation: bought-scale 260ms cubic-bezier(.2, .9, .2, 1); }
@keyframes bought-scale { 0% { transform: scale(1); } 40% { transform: scale(0.95); } 100% { transform: scale(1); } }

/* ========== Footer, ads, cookie banner ========== */
.site-footer { position: relative; z-index: 1; text-align: center; padding: 12px 0 90px; font-size: 13px; }
.site-footer a { color: var(--text-dim); }
#adWrapper { position: relative; z-index: 1; text-align: center; margin: 12px 0; }
#cookie-consent-banner { position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 2500; justify-content: center; }
#cookie-consent-banner .cookie-consent-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 900px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
}
#cookie-consent-banner .cookie-consent-text { flex: 1; font-size: 13px; line-height: 1.4; color: var(--text-dim); }
#cookie-consent-banner .cookie-consent-text a { color: var(--gold); }
#cookie-consent-banner .cookie-consent-actions { display: flex; gap: 8px; align-items: center; }
#cookie-consent-banner .btn { padding: 8px 14px; border-radius: 999px; border: none; font-weight: 700; }
#cookie-consent-banner #cookie-accept-btn { background: var(--primary); color: #04170c; }
#cookie-consent-banner .btn-link { background: transparent; color: var(--text-dim); text-decoration: underline; }

/* ========== Responsive ========== */
@media (max-width: 1180px) {
    .nav-btn { padding: 0 11px; }
    .nav-btn:not(.nav-btn--gold):not(.nav-btn--menu):not(.nav-sidebar-btn) .nav-txt { display: none; }
    .nav-btn--menu .nav-txt, .nav-sidebar-btn .nav-txt { display: inline-block !important; }
}

#leftBarOverlay { display: none; }
@media (max-width: 760px) {
    body, body.leftbar-open, body.leftbar-closed { margin-left: 0; }
    #leftBar,
    #divineLeftBar.left-bar-clone {
        width: min(88vw, 340px);
        z-index: 2500;
        transform: translateX(-100%);
    }
    #leftBar.open, #divineLeftBar.left-bar-clone.open { transform: translateX(0); }
    #leftBarOverlay { display: block; position: fixed; inset: 0; z-index: 2400; background: rgba(0, 0, 0, 0); pointer-events: none; transition: background 220ms ease; }
    #leftBarOverlay.active { background: rgba(0, 0, 0, 0.55); pointer-events: auto; }

    #topBar { padding: 10px 12px; gap: 8px; }
    /* flex-start, not flex-end: buttons that overflow off the left edge of a scroll box can't be scrolled to.
       index.html starts the nav scrolled to the end so Shop and Settings are in view. */
    .top-nav { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 2px; justify-content: flex-end; }
    .nav-btn { height: 38px; padding: 0 10px; flex: 0 0 auto; }
    .nav-btn--gold .nav-txt { display: none; }
    .nav-btn--menu .nav-txt { display: inline-block !important; }
    #mainContent { padding: 0 12px 24px; }
    .stat-tile { padding: 8px 4px; }
    .stat-value { font-size: 16px; }

    /* nav sidebar takes full right screen height on mobile */
    .nav-sidebar {
        top: 0;
        bottom: 0;
        right: 0;
        width: min(88vw, 340px);
        max-height: 100vh;
        border-radius: 0;
        border-right: none;
        border-top: none;
        border-bottom: none;
        padding-top: calc(14px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }

    /* specials become a bottom sheet */
    .special-menu {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: auto;
        max-height: 70vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(105%);
    }
    .special-menu.open { transform: translateY(0); }
    #cookie-consent-banner .cookie-consent-inner { flex-direction: column; align-items: stretch; }
}
