/* Kellerkind Web — a custom, modern idle-tycoon look. No framework, no build.
   Dark neon aesthetic, glassy cards, big touch targets, mobile-first with safe-area
   support so it feels native inside the Pi Browser and on phones. */

:root {
    --bg-0: #070b12;
    --bg-1: #0c1424;
    --surface: rgba(22, 33, 54, 0.72);
    --surface-2: rgba(30, 44, 70, 0.65);
    --stroke: rgba(120, 160, 220, 0.16);
    --stroke-strong: rgba(120, 200, 160, 0.4);

    --neon: #37f2a3;
    --neon-soft: #6bffc2;
    --gold: #ffd23f;
    --gold-soft: #ffe487;
    --danger: #ff5d6c;

    --text: #eaf2ff;
    --muted: #9db0cf;
    --muted-2: #7789ab;

    --r-lg: 22px;
    --r-md: 16px;
    --r-sm: 11px;
    --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.8);
    --glow: 0 0 24px -4px var(--neon);

    --nav-h: 74px;
    --max-w: 620px;

    font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Disable text selection / long-press copy across the game UI. Inputs stay editable
   (see the input/textarea override below) so login, keys and renaming still work. */
html { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; user-select: text; -webkit-touch-callout: default; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg-0);
    color: var(--text);
    overscroll-behavior: none;
    overflow: hidden; /* only the inner content scrolls — never the whole page */
}

body {
    /* Ambient aurora backdrop behind the centered app shell. */
    background:
        radial-gradient(1100px 700px at 15% -10%, rgba(55, 242, 163, 0.14), transparent 60%),
        radial-gradient(900px 650px at 110% 10%, rgba(255, 210, 63, 0.10), transparent 55%),
        radial-gradient(1000px 900px at 50% 120%, rgba(80, 130, 255, 0.12), transparent 60%),
        var(--bg-0);
    background-attachment: fixed;
}

/* ── App shell ─────────────────────────────────────────────────────────────── */
.app {
    max-width: var(--max-w);
    margin: 0 auto;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(180deg, rgba(12, 20, 36, 0.6), rgba(7, 11, 18, 0.85));
    border-left: 1px solid var(--stroke);
    border-right: 1px solid var(--stroke);
    overflow: hidden;
}

/* ── Top bar + KPIs ────────────────────────────────────────────────────────── */
.topbar {
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
    background: linear-gradient(180deg, rgba(10, 17, 30, 0.95), rgba(10, 17, 30, 0.55));
    border-bottom: 1px solid var(--stroke);
    backdrop-filter: blur(10px);
    z-index: 5;
}

.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.brand {
    display: flex; align-items: center; gap: 9px;
    font-weight: 800; font-size: 17px; letter-spacing: 0.2px;
}
.brand .logo {
    width: 30px; height: 30px; border-radius: 9px;
    display: grid; place-items: center; font-size: 17px;
    background: linear-gradient(135deg, rgba(55,242,163,0.9), rgba(255,210,63,0.85));
    box-shadow: var(--glow);
}
.brand .name { background: linear-gradient(90deg, var(--neon-soft), var(--gold-soft)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.share-chip {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
    color: var(--gold-soft);
    background: rgba(255, 210, 63, 0.10);
    border: 1px solid rgba(255, 210, 63, 0.3);
}

.stats { display: flex; gap: 10px; margin-top: 12px; }
.stat {
    flex: 1; padding: 10px 12px; border-radius: var(--r-md);
    background: var(--surface); border: 1px solid var(--stroke);
}
.stat .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.stat .val { font-size: 19px; font-weight: 800; margin-top: 3px; }
.stat.cash .val { color: var(--neon-soft); text-shadow: 0 0 18px rgba(55, 242, 163, 0.35); }
.stat.rps .val { color: var(--gold-soft); }
.val.pop { animation: pop 0.25s ease; }
.stat.rps .val.warn { color: var(--danger); text-shadow: none; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.09); } 100% { transform: scale(1); } }

/* thin demo timer strip under the header */
.demo-strip {
    margin-top: 10px; display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: var(--muted);
}
.demo-strip .bar { flex: 1; height: 6px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.demo-strip .bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--neon), var(--gold)); border-radius: 4px; transition: width 0.5s linear; }
.demo-strip.hidden { display: none; }
.demo-strip .buy { color: var(--gold-soft); font-weight: 700; cursor: pointer; }

/* ── Content ───────────────────────────────────────────────────────────────── */
.content {
    flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 16px 14px calc(var(--nav-h) + 20px);
    scrollbar-width: thin; scrollbar-color: var(--stroke) transparent;
}
.content::-webkit-scrollbar { width: 7px; }
.content::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 4px; }

.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin: 4px 4px 12px; }
/* Skill category headers: clear separation between groups, consistent with the
   spacing rhythm on the Earn tab. */
.cat-title { margin-top: 26px; }


/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface); border: 1px solid var(--stroke);
    border-radius: var(--r-md); box-shadow: var(--shadow);
}

.list { display: flex; flex-direction: column; gap: 10px; }

.venture {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    border-radius: var(--r-md); border: 1px solid var(--stroke);
    background: var(--surface); position: relative; overflow: hidden;
}
.venture::before { /* level progress glow along the left edge */
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: linear-gradient(180deg, var(--neon), var(--gold)); opacity: 0.85;
}
.venture .badge {
    width: 52px; height: 52px; flex: none; border-radius: 14px; font-size: 26px;
    display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--stroke);
}
.venture .info { flex: 1; min-width: 0; }
.venture .vname { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.venture .lvl { font-size: 12px; font-weight: 700; color: var(--muted); background: rgba(255,255,255,0.05); padding: 1px 8px; border-radius: 999px; }
.venture .vrps { font-size: 12.5px; color: var(--gold-soft); margin-top: 3px; }
.venture .vsub { font-size: 11.5px; color: var(--muted-2); margin-top: 1px; }

.buy-btn {
    flex: none; min-width: 104px; padding: 11px 12px; border: none; cursor: pointer;
    border-radius: var(--r-sm); font-weight: 800; font-size: 13px; color: #06251a;
    background: linear-gradient(135deg, var(--neon-soft), var(--neon));
    transition: transform 0.06s ease, filter 0.15s ease; text-align: center; line-height: 1.15;
}
.buy-btn .c-label { font-size: 10px; font-weight: 700; opacity: 0.65; display: block; }
.buy-btn:active { transform: scale(0.97); }
.buy-btn:disabled { background: rgba(255,255,255,0.06); color: var(--muted-2); cursor: not-allowed; }

.venture.locked { opacity: 0.55; filter: grayscale(0.6); }
.venture.locked .badge { color: var(--muted-2); }

/* buy-amount toggle */
.amount-toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--stroke); border-radius: 999px; padding: 3px; gap: 3px; }
.amount-toggle button { border: none; background: transparent; color: var(--muted); font-weight: 800; font-size: 12.5px; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.amount-toggle button.active { background: var(--neon); color: #052018; }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* upgrade card */
.upgrade { display: flex; align-items: center; gap: 12px; padding: 12px; }
.upgrade .badge { width: 46px; height: 46px; flex: none; border-radius: 12px; font-size: 22px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--stroke); }
.upgrade .uname { font-weight: 800; font-size: 14.5px; }
.upgrade .udesc { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Generic buttons ───────────────────────────────────────────────────────── */
.btn { border: none; cursor: pointer; border-radius: var(--r-md); font-weight: 800; font-size: 15px; padding: 14px 18px; transition: transform 0.06s ease, filter 0.15s ease; }
.btn:active { transform: scale(0.98); }
.btn.primary { color: #06251a; background: linear-gradient(135deg, var(--neon-soft), var(--neon)); box-shadow: 0 12px 26px -14px rgba(55,242,163,0.8); }
.btn.gold { color: #2a1c00; background: linear-gradient(135deg, var(--gold-soft), var(--gold)); box-shadow: 0 12px 26px -14px rgba(255,210,63,0.8); }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--stroke); }
.btn.danger { background: rgba(255,93,108,0.12); color: var(--danger); border: 1px solid rgba(255,93,108,0.4); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.link { color: var(--neon-soft); font-weight: 700; cursor: pointer; background: none; border: none; font-size: 13.5px; }

/* ── Bottom navigation ─────────────────────────────────────────────────────── */
.nav {
    position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex; align-items: stretch;
    background: linear-gradient(180deg, rgba(10,16,28,0.7), rgba(8,12,20,0.98));
    border-top: 1px solid var(--stroke); backdrop-filter: blur(14px); z-index: 10;
}
.nav-btn { flex: 1; border: none; background: transparent; color: var(--muted-2); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; position: relative; }
.nav-btn .ic { font-size: 22px; transition: transform 0.15s ease; }
.nav-btn.active { color: var(--neon-soft); }
.nav-btn.active .ic { transform: translateY(-2px) scale(1.12); filter: drop-shadow(0 0 8px rgba(55,242,163,0.6)); }
.nav-btn.active::after { content: ""; position: absolute; top: 8px; width: 30px; height: 3px; border-radius: 3px; background: var(--neon); }

/* ── Prestige panel ────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 26px 18px; border-radius: var(--r-lg); border: 1px solid var(--stroke-strong);
    background: radial-gradient(400px 200px at 50% -20%, rgba(255,210,63,0.18), transparent 70%), var(--surface); margin-bottom: 16px; }
.hero .big { font-size: 40px; font-weight: 900; background: linear-gradient(90deg, var(--gold-soft), var(--neon-soft)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .cap { color: var(--muted); font-size: 13px; margin-top: 4px; }

.kv { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--stroke); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .v { font-weight: 800; color: var(--neon-soft); }

/* ── Modals + toasts ───────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(4,7,13,0.7); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 18px; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 100%; max-width: 440px; background: linear-gradient(180deg, #131f34, #0d1526); border: 1px solid var(--stroke); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 22px; animation: rise 0.25s ease; max-height: 88vh; overflow-y: auto; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal h2 { margin: 0 0 4px; font-size: 20px; }
.modal .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.input { width: 100%; padding: 13px 14px; border-radius: var(--r-sm); border: 1px solid var(--stroke); background: rgba(6,10,18,0.7); color: var(--text); font-size: 15px; }
.input:focus { outline: none; border-color: var(--stroke-strong); box-shadow: 0 0 0 3px rgba(55,242,163,0.12); }
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap .input { padding-right: 46px; }
.pw-toggle { position: absolute; top: 50%; transform: translateY(-50%); right: 6px; background: none; border: 0; cursor: pointer; font-size: 17px; line-height: 1; padding: 6px 8px; opacity: 0.65; border-radius: 8px; }
.pw-toggle:hover { opacity: 1; }
.form-error { color: var(--danger); font-size: 13px; margin: 4px 2px 10px; }
.form-info { color: var(--neon-soft); font-size: 13px; margin: 4px 2px 10px; }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions .btn { flex: 1; }

.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 18px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 120; pointer-events: none; }
.toast { pointer-events: auto; background: #16233c; border: 1px solid var(--stroke-strong); color: var(--text); padding: 11px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 700; box-shadow: var(--shadow); animation: rise 0.2s ease; }
.toast.good { border-color: var(--stroke-strong); }
.toast.bad { border-color: rgba(255,93,108,0.5); color: #ffd7db; }

.badge-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 800; }
.badge-pill.demo { color: var(--gold-soft); background: rgba(255,210,63,0.1); border: 1px solid rgba(255,210,63,0.35); }
.badge-pill.pro { color: var(--neon-soft); background: rgba(55,242,163,0.1); border: 1px solid var(--stroke-strong); }

/* ── Paywall overlay ───────────────────────────────────────────────────────── */
/* z-index 90: above the game shell, below the modal-backdrop (100) so the login
   dialog opened from here renders ON TOP instead of behind. */
.paywall, .landing { position: fixed; inset: 0; z-index: 90; background: rgba(4,7,13,0.82); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px; }
.paywall .box, .landing .box { max-width: 460px; width: 100%; text-align: center; background: linear-gradient(180deg, #14213a, #0c1220); border: 1px solid var(--stroke-strong); border-radius: var(--r-lg); padding: 30px 24px; box-shadow: var(--shadow); }
.paywall .lock { font-size: 46px; }
.paywall h2, .landing h2 { font-size: 24px; margin: 10px 0 6px; }
.paywall p, .landing p { color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.paywall .actions, .landing .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* Landing / hero page (after logout, or for a returning logged-out device). */
.landing { background: radial-gradient(120% 90% at 80% -10%, rgba(20,33,58,0.95), rgba(4,7,13,0.96)); overflow-y: auto; padding: 24px 18px; place-items: center; }
.landing .l-theme { position: fixed; top: 16px; right: 16px; z-index: 2; }
.l-hero { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: center; width: 100%; max-width: 1040px; margin: auto; }
.l-art { order: -1; display: flex; justify-content: center; }
/* Rounded card shape with a soft edge-fade so the crop blends into the page in
   BOTH themes. Generous border-radius rounds the corners; two gently intersected
   linear masks feather only the outer few percent so the rounding stays visible. */
.l-hero-img { width: 100%; max-width: 250px; border-radius: 34px;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 5%, #000 94%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 5%, #000 94%, transparent 100%);
    mask-composite: intersect;
    filter: drop-shadow(0 14px 30px rgba(0,0,0,0.45)) drop-shadow(0 0 44px rgba(55,242,163,0.12)); }
.l-copy { text-align: center; }
.l-brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.landing .l-logo-tile { width: 60px; height: 60px; border-radius: 16px; overflow: hidden; box-shadow: 0 14px 34px -16px rgba(0,0,0,0.6); }
.landing .l-logo { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.13); }
.landing .l-name { font-weight: 900; font-size: 30px; letter-spacing: 0.5px; background: linear-gradient(90deg, var(--neon-soft), var(--gold-soft)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.l-headline { font-size: 26px; line-height: 1.2; font-weight: 900; margin: 16px 0 8px; color: var(--text); }
.l-sub { color: var(--muted); font-size: 14.5px; line-height: 1.55; max-width: 460px; margin: 0 auto; }
.l-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 22px; }
.l-chip { font-size: 12px; font-weight: 700; color: var(--text); background: rgba(255,255,255,0.05); border: 1px solid var(--stroke); border-radius: 999px; padding: 6px 12px; }
.l-actions { display: flex; flex-direction: column; gap: 10px; max-width: 380px; margin: 0 auto; }
.l-foot { text-align: center; margin: 26px auto 10px; font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; justify-content: center; align-items: center; }
.l-foot a { color: var(--muted); text-decoration: underline; }
.l-foot a:hover { color: var(--text); }
.l-foot-sep { opacity: 0.5; }
@media (min-width: 900px) {
    .l-hero { grid-template-columns: 1.05fr 0.95fr; gap: 40px; }
    .l-art { order: 1; }
    .l-hero-img { max-width: 300px; }
    .l-copy { text-align: left; }
    .l-brand { justify-content: flex-start; }
    .l-sub, .l-actions { margin-left: 0; }
    .l-chips { justify-content: flex-start; }
    .l-headline { font-size: 34px; }
}
:root[data-theme="light"] .l-chip { background: rgba(20,40,80,0.05); }
:root[data-theme="light"] .paywall, :root[data-theme="light"] .landing { background: rgba(30,45,70,0.5); }
:root[data-theme="light"] .landing { background: radial-gradient(120% 90% at 50% 0%, rgba(230,238,250,0.94), rgba(210,222,240,0.9)); }
:root[data-theme="light"] .paywall .box, :root[data-theme="light"] .landing .box { background: linear-gradient(180deg, #ffffff, #f2f6fc); }

/* Company-value sparkline (IPO & Press segment). */
.spark { width: 100%; height: 60px; display: block; }
.spark-line { stroke: var(--neon); stroke-width: 2; fill: none; vector-effect: non-scaling-stroke; }
.spark-fill { fill: rgba(55,242,163,0.12); stroke: none; }

/* Generated share image preview (📤 Fortschritt teilen). */
.share-preview { display: block; width: 100%; max-width: 340px; margin: 0 auto; border-radius: 18px; box-shadow: var(--shadow); }

/* KEL — the game's character, shown in onboarding, the paywall and the profile. */
.kel-banner { display: block; width: 100%; max-width: 320px; border-radius: 16px; margin: 2px auto 16px; box-shadow: 0 20px 44px -22px rgba(0,0,0,0.7); }
.kel-avatar { display: block; width: 92px; height: 92px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; margin: 0 auto; border: 2px solid var(--stroke-strong); box-shadow: 0 0 30px -8px var(--neon); }
.kel-celebrate { display: block; width: 200px; height: 200px; object-fit: cover; object-position: 50% 22%; margin: 0 auto 12px; border-radius: 26px; border: 2px solid var(--stroke-strong); box-shadow: 0 18px 40px -20px rgba(0,0,0,0.7), 0 0 34px -10px var(--neon); }
/* Framed KEL reaction portrait inside a modal body (surprised / sad / determined …). */
.kel-react { display: block; width: 128px; height: 128px; object-fit: cover; object-position: 50% 20%; margin: 2px auto 14px; border-radius: 22px; border: 2px solid var(--stroke-strong); box-shadow: 0 14px 32px -18px rgba(0,0,0,0.7), 0 0 26px -12px var(--neon); }
/* Toast carrying a small round KEL face. */
.toast-kel { display: flex; align-items: center; gap: 10px; }
.toast-face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; flex: 0 0 auto; border: 1.5px solid var(--stroke-strong); }

/* ── Automation: company health, managers, policies ─────────────────────────── */
.health { margin: 2px 0 4px; }
.health-top { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.health-val { font-weight: 900; }
.health-val.good, .health-bar > i.good { color: var(--neon-soft); }
.health-val.warn, .health-bar > i.warn { color: var(--gold-soft); }
.health-val.bad, .health-bar > i.bad { color: var(--danger); }
.health-bar { height: 9px; border-radius: 6px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 6px; }
.health-bar > i { display: block; height: 100%; border-radius: 6px; transition: width 0.4s ease; background: currentColor; }
.manager { transition: border-color 0.2s ease; }
.manager.on { border-color: var(--stroke-strong); box-shadow: 0 0 22px -12px var(--neon), var(--shadow); }
.mgr-head { display: flex; align-items: center; gap: 12px; }
.mgr-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--surface-2); border: 1px solid var(--stroke); flex: 0 0 auto; }
.policy-row { display: flex; gap: 6px; margin-top: 10px; }
.policy { flex: 1; padding: 8px 6px; border-radius: 10px; font-size: 12px; font-weight: 700; cursor: pointer;
    color: var(--muted); background: rgba(255,255,255,0.04); border: 1px solid var(--stroke); transition: all 0.15s ease; }
.policy.on { color: #06251a; background: var(--neon); border-color: var(--neon); }

/* Side-hustle running footer: label + live remaining-time countdown. */
.sh-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.sh-rem { font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.cele-thr { text-align: center; font-size: 24px; font-weight: 900; color: var(--gold-soft); }
.cele-unlocks { margin-top: 12px; text-align: center; font-weight: 800; color: var(--neon-soft); font-size: 13px; background: rgba(55,242,163,0.08); border: 1px solid var(--stroke-strong); border-radius: 12px; padding: 10px 12px; }

/* Locked wealth feature: gradient lock badge + progress toward the unlock value. */
.feature-lock { text-align: center; padding: 34px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.feature-lock .fl-badge { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: radial-gradient(circle at 50% 32%, rgba(55,242,163,0.20), rgba(255,255,255,0.02)); border: 1px solid var(--stroke-strong); box-shadow: 0 0 44px -12px var(--neon); }
.feature-lock .fl-title { font-weight: 900; font-size: 19px; }
.feature-lock .fl-blurb { font-size: 13px; max-width: 340px; line-height: 1.5; }
.feature-lock .fl-prog { width: 100%; max-width: 320px; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 4px; }
.feature-lock .fl-prog i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--neon), var(--neon-soft)); box-shadow: 0 0 14px -3px var(--neon); transition: width 0.4s ease; }
.feature-lock .fl-meta { width: 100%; max-width: 320px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.feature-lock .fl-pct { font-size: 12px; font-weight: 800; color: var(--gold-soft); }
:root[data-theme="light"] .feature-lock .fl-badge { background: radial-gradient(circle at 50% 32%, rgba(20,150,95,0.14), rgba(20,40,80,0.02)); }
:root[data-theme="light"] .feature-lock .fl-prog { background: rgba(20,40,80,0.10); }

/* profile rows */
.prow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; }
.prow + .prow { border-top: 1px solid var(--stroke); }
.prow .t { font-weight: 700; font-size: 14.5px; }
.prow .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.lb-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--stroke); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { width: 28px; font-weight: 900; color: var(--gold-soft); text-align: center; }
.lb-name { flex: 1; font-weight: 700; font-size: 14px; }
.lb-val { color: var(--neon-soft); font-weight: 800; font-size: 13.5px; }

.center-col { display: flex; flex-direction: column; gap: 10px; }
.spacer { height: 8px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.hidden { display: none !important; }

/* Splash */
#splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg-0); z-index: 500; transition: opacity 0.4s ease; }
#splash.gone { opacity: 0; pointer-events: none; }
#splash .s-logo { font-size: 60px; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
#splash .s-name { margin-top: 14px; font-weight: 900; font-size: 22px; background: linear-gradient(90deg, var(--neon-soft), var(--gold-soft)); -webkit-background-clip: text; background-clip: text; color: transparent; }

@media (min-width: 640px) {
    /* Fill the full viewport height — no floating card, no wasted space, no page scroll. */
    .app { height: 100dvh; margin: 0 auto; }
}

/* ── Full-game additions ─────────────────────────────────────────────────────── */
.stats .stat.cv .val { color: var(--text); font-size: 16px; }
.stat .val { font-size: 16px; }
.stat.cash .val { font-size: 17px; }
.goal { margin-top: 8px; font-size: 11.5px; color: var(--gold-soft); font-weight: 700; }
.goal.clickable { cursor: pointer; }
.goal.clickable:hover { filter: brightness(1.15); }

.cat-head { font-size: 11px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted-2); margin: 12px 4px 2px; }
.badge.sm { width: 42px; height: 42px; font-size: 21px; border-radius: 12px; }
.venture.skill .badge.sm { width: 38px; height: 38px; font-size: 18px; }

.btn-col { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.btn-col2 { display: flex; flex-direction: column; gap: 4px; }
.mini-btn { border: 1px solid var(--stroke); background: var(--surface); color: var(--text); border-radius: 9px; font-weight: 800; font-size: 12px; padding: 7px 10px; cursor: pointer; min-width: 44px; }
.mini-btn.buy { background: linear-gradient(135deg, var(--neon-soft), var(--neon)); color: #06251a; border: none; }
.mini-btn:active { transform: scale(0.96); }

.dots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.14); }
.dots i.on { background: var(--neon); }
.lock-tag { font-size: 11px; color: var(--gold-soft); font-weight: 700; }

.progress { height: 7px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 6px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--neon), var(--neon-soft)); border-radius: 4px; transition: width 0.4s linear; }
.learn-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--stroke); background: var(--surface); }

.side-hustle { padding: 14px; margin-bottom: 14px; }
.sh-title { font-weight: 800; font-size: 14px; margin-bottom: 10px; }
.gig-row { display: flex; gap: 8px; }
.gig { flex: 1; background: var(--surface-2); border: 1px solid var(--stroke); border-radius: 12px; padding: 10px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text); }
.gig:active { transform: scale(0.97); }

.seg-bar { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.seg-bar::-webkit-scrollbar { display: none; }
.seg { flex: none; border: 1px solid var(--stroke); background: var(--surface); color: var(--muted); font-weight: 800; font-size: 12.5px; padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.seg.active { background: var(--neon); color: #052018; border-color: transparent; box-shadow: 0 6px 16px -10px var(--neon); }

.kv-card { margin-bottom: 12px; }
.event-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--stroke); background: var(--surface); }

.prow-list { overflow: hidden; }
.prow.go { cursor: pointer; }
.prow.go:active { background: rgba(255,255,255,0.03); }
.chev { color: var(--muted-2); font-size: 20px; font-weight: 400; }
/* Accordion caret: points down, flips up when its panel is open. */
.chev.caret { font-size: 22px; line-height: 1; transition: transform 0.2s ease; }
.help-head.open .chev.caret { transform: rotate(180deg); }

.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ach { background: var(--surface); border: 1px solid var(--stroke); border-radius: 14px; padding: 12px 8px; text-align: center; opacity: 0.5; }
.ach.got { opacity: 1; }
.ach.got.common { border-color: rgba(150,170,200,0.5); }
.ach.got.rare { border-color: rgba(90,170,255,0.6); box-shadow: 0 0 16px -6px rgba(90,170,255,0.5); }
.ach.got.epic { border-color: rgba(190,120,255,0.6); box-shadow: 0 0 16px -6px rgba(190,120,255,0.5); }
.ach.got.legendary { border-color: var(--gold); box-shadow: 0 0 18px -5px rgba(255,210,63,0.6); }
.ach-ic { font-size: 26px; }
.ach-nm { font-size: 10.5px; font-weight: 700; margin-top: 5px; line-height: 1.2; }
.ach-r { font-size: 10px; color: var(--muted); font-weight: 700; margin-top: 3px; letter-spacing: 0.3px; }
.ach-date { font-size: 9px; color: var(--neon-soft); margin-top: 3px; font-weight: 700; }
.ach-desc { font-size: 9px; color: var(--muted); margin-top: 3px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.progress.sm { height: 5px; margin-top: 6px; }
/* Profile stats grid */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card { background: var(--surface); border: 1px solid var(--stroke); border-radius: 14px; padding: 14px 10px; text-align: center; }
.stat-card .sc-ic { font-size: 22px; }
.stat-card .sc-val { font-weight: 900; font-size: 16px; margin-top: 4px; }
.stat-card .sc-lbl { font-size: 10px; color: var(--muted); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.4px; }
@media (min-width: 980px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }

.ms { padding: 14px; opacity: 0.6; }
.ms.reached { opacity: 1; border-color: var(--stroke-strong); }
.ms-h { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.ms-date { margin-left: auto; font-size: 11px; color: var(--neon-soft); font-weight: 700; white-space: nowrap; }
.ms-ic { color: var(--neon-soft); }
.ms-thr { color: var(--gold-soft); font-weight: 800; font-size: 13px; margin: 4px 0; }
.ms-f { font-size: 12px; color: var(--neon-soft); margin-bottom: 4px; }
.ms-why { line-height: 1.4; }

.help { overflow: hidden; }
.help-head { display: flex; align-items: center; justify-content: space-between; padding: 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.help-body { padding: 0 14px 14px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.pre { white-space: pre-wrap; line-height: 1.55; }
.hintbox { margin-top: 14px; padding: 12px; border-radius: var(--r-sm); background: rgba(55,242,163,0.08); border: 1px solid var(--stroke-strong); color: var(--neon-soft); font-size: 13px; }

.sheet-bd { align-items: flex-end; padding: 0; }
.sheet { width: 100%; max-width: var(--max-w); margin: 0 auto; background: linear-gradient(180deg, #101a2e, #0a1120); border-top-left-radius: 24px; border-top-right-radius: 24px; max-height: 90dvh; display: flex; flex-direction: column; animation: rise 0.28s ease; border: 1px solid var(--stroke); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 12px; border-bottom: 1px solid var(--stroke); }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-x { background: var(--surface); border: 1px solid var(--stroke); color: var(--text); width: 34px; height: 34px; border-radius: 50%; font-size: 15px; cursor: pointer; }
.sheet-body { overflow-y: auto; padding: 16px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); }

.gig-list { display: flex; flex-direction: column; gap: 8px; }
.gig-wide { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--stroke); border-radius: 12px; padding: 11px 14px; cursor: pointer; color: var(--text); }
.gig-wide:active { transform: scale(0.99); }

/* ══════════════════════════════════════════════════════════════════════════════
   Premium pass v2 — real logo, richer palette, desktop wide layout, hover polish
   ══════════════════════════════════════════════════════════════════════════════ */

/* logo image (replaces emoji) */
/* The logo PNG bakes in its own rounded tile + transparent padding, so a box-shadow
   would frame the padded box (a pale halo). A drop-shadow follows the tile's alpha. */
.brand .logo-img { width: 34px; height: 34px; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.35)) drop-shadow(0 0 9px rgba(55,242,163,0.28)); }
.brand .name { font-size: 18px; letter-spacing: 0.3px; }
#splash .s-logo-tile { width: 104px; height: 104px; border-radius: 26px; overflow: hidden; margin: 0 auto; box-shadow: 0 0 60px -8px var(--neon); animation: bob 1.6s ease-in-out infinite; }
#splash .s-logo-img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.13); }

/* richer ambient backdrop + subtle vignette */
body {
    background:
        radial-gradient(1200px 760px at 12% -12%, rgba(55, 242, 163, 0.16), transparent 60%),
        radial-gradient(1000px 720px at 112% 6%, rgba(255, 210, 63, 0.12), transparent 55%),
        radial-gradient(1200px 1000px at 50% 128%, rgba(70, 120, 255, 0.13), transparent 60%),
        radial-gradient(900px 900px at 88% 96%, rgba(55, 242, 163, 0.06), transparent 60%),
        #04070d;
    background-attachment: fixed;
}

/* KPI cards: glassy with a top light seam */
.stat { position: relative; overflow: hidden; background: linear-gradient(165deg, rgba(34,50,80,0.66), rgba(16,26,44,0.72)); }
.stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent); }
.stat.cv .val { background: linear-gradient(90deg, #fff, var(--neon-soft)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* cards a touch deeper + rounded, with soft depth */
.card, .venture, .learn-row, .event-row, .gig-wide, .gig { box-shadow: 0 12px 30px -20px rgba(0,0,0,0.8); }

/* buttons: crisper gradients + glow */
.buy-btn { box-shadow: 0 8px 18px -12px rgba(55,242,163,0.7); }
.btn.gold, .seg.active, .amount-toggle button.active { box-shadow: 0 10px 22px -13px rgba(255,210,63,0.7); }

/* nicer scrollbar-less section rhythm */
.section-title { color: var(--muted); }

/* ── DESKTOP: use the full width — left rail + multi-column content ─────────── */
@media (min-width: 980px) {
    body { align-items: flex-start; }
    .app {
        max-width: 1340px;
        height: 100dvh;
        margin: 0 auto;
        display: grid;
        grid-template-columns: 252px 1fr;
        grid-template-rows: auto 1fr;
        overflow: hidden;
        border-left: 1px solid var(--stroke);
        border-right: 1px solid var(--stroke);
    }
    .topbar { grid-column: 1 / -1; grid-row: 1; padding: 20px 26px 16px; }
    .brand { font-size: 20px; }
    .brand .logo-img { width: 40px; height: 40px; }
    .brand .name { font-size: 22px; }
    .stats { gap: 14px; }
    .stat { padding: 14px 18px; }
    .stat .val { font-size: 22px; }
    .stat.cash .val, .stat.rps .val { font-size: 22px; }

    .nav {
        grid-column: 1; grid-row: 2;
        position: static; height: auto; width: auto;
        flex-direction: column; align-items: stretch; justify-content: flex-start;
        padding: 18px 14px; gap: 6px;
        border-top: none; border-right: 1px solid var(--stroke);
        background: linear-gradient(180deg, rgba(12,19,33,0.55), rgba(8,12,20,0.15));
        backdrop-filter: none;
    }
    .nav-btn { flex: none; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 14px 16px; border-radius: 14px; font-size: 15px; font-weight: 700; color: var(--muted); }
    .nav-btn:hover { background: rgba(255,255,255,0.04); color: var(--text); }
    .nav-btn .ic { font-size: 22px; }
    .nav-btn.active { background: linear-gradient(90deg, rgba(55,242,163,0.16), rgba(255,210,63,0.04)); color: var(--neon-soft); }
    .nav-btn.active::after { content: ""; top: auto; left: 5px; width: 3.5px; height: 24px; border-radius: 3px; }

    .content { grid-column: 2; grid-row: 2; padding: 22px 28px 30px; }
    .content .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(370px, 1fr)); gap: 12px; align-content: start; }
    .content .list > .cat-head { grid-column: 1 / -1; }
    .side-hustle, .toolbar, .seg-bar, .hero { max-width: 1000px; }
    .gig-list { max-width: 1000px; }

    /* hover affordances */
    .venture, .card.upgrade, .gig-wide, .prow.go, .help-head, .ach.got, .seg { transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease, filter .15s ease; }
    .venture:hover, .gig-wide:hover, .prow.go:hover, .ach.got:hover { transform: translateY(-1px); border-color: var(--stroke-strong); box-shadow: 0 6px 16px -12px rgba(0,0,0,0.45); }
    :root[data-theme="light"] .venture:hover, :root[data-theme="light"] .gig-wide:hover, :root[data-theme="light"] .prow.go:hover, :root[data-theme="light"] .ach.got:hover { box-shadow: 0 6px 14px -12px rgba(20,40,80,0.28); }
    .buy-btn:hover:not(:disabled), .btn:hover:not(:disabled), .mini-btn:hover:not(:disabled) { filter: brightness(1.07); }

    /* sheets become a large centered modal */
    .sheet-bd { align-items: center; padding: 26px; }
    .sheet { max-width: 920px; border-radius: 24px; max-height: 86dvh; }
    .ach-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1280px) {
    .content .list { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }
    .ach-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ══════════════════════════════════════════════════════════════════════════════
   UX pass v3 — disabled buttons, spinner, requires-link + jump highlight,
   theme toggle, and a full light theme.
   ══════════════════════════════════════════════════════════════════════════════ */

/* disabled buttons must not keep their colored glow (looked "weird") */
.buy-btn:disabled, .btn:disabled, .mini-btn:disabled { box-shadow: none !important; filter: none; }

/* inline loading spinner (inherits button text color) */
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(127,127,127,0.35); border-top-color: currentColor; border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* clickable "Requires: <skill>" links */
.req-link { color: var(--neon-soft); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.req-link:hover { color: var(--neon); }

/* jump-to-skill highlight — a subtle brand-colored ring that fades (professional) */
.venture.hl { animation: hlpulse 2s ease; }
@keyframes hlpulse {
    0%   { box-shadow: 0 0 0 0 rgba(55,242,163,0); border-color: var(--stroke); }
    10%  { box-shadow: 0 0 0 3px rgba(55,242,163,0.42), 0 0 30px -4px rgba(55,242,163,0.5); border-color: var(--stroke-strong); }
    60%  { box-shadow: 0 0 0 3px rgba(55,242,163,0.32), 0 0 26px -4px rgba(55,242,163,0.42); border-color: var(--stroke-strong); }
    100% { box-shadow: 0 0 0 0 rgba(55,242,163,0); border-color: var(--stroke); }
}

/* theme toggle button (top-right, like the desktop app's sun/moon) */
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; flex: none; border-radius: 12px; border: 1px solid var(--stroke); background: var(--surface); color: var(--text); font-size: 17px; cursor: pointer; display: grid; place-items: center; transition: filter .15s ease, border-color .15s ease, transform .06s ease; }
.icon-btn:hover { border-color: var(--stroke-strong); filter: brightness(1.08); }
.icon-btn:active { transform: scale(0.94); }

/* ── LIGHT THEME ─────────────────────────────────────────────────────────────── */
:root[data-theme="light"] {
    --bg-0: #e9edf5;
    --surface: rgba(255,255,255,0.92);
    --surface-2: #eef2f9;
    --stroke: rgba(20,40,80,0.12);
    --stroke-strong: rgba(16,150,105,0.5);
    --neon: #10a86c;
    --neon-soft: #0a7a4e;
    --gold: #c98f00;
    --gold-soft: #85610a;
    --danger: #e23b4e;
    --text: #10192a;
    --muted: #51617a;
    --muted-2: #64728c;
    --shadow: 0 14px 30px -20px rgba(20,40,80,0.28);
    --glow: 0 0 18px -6px rgba(16,168,108,0.5);
}
:root[data-theme="light"] body {
    background:
        radial-gradient(1100px 700px at 12% -12%, rgba(16,168,108,0.12), transparent 60%),
        radial-gradient(1000px 720px at 112% 6%, rgba(201,143,0,0.10), transparent 55%),
        radial-gradient(1200px 1000px at 50% 128%, rgba(70,120,255,0.09), transparent 60%),
        #e9edf5;
}
:root[data-theme="light"] .app { background: linear-gradient(180deg, #ffffff, #f4f7fc); }
:root[data-theme="light"] .topbar { background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.7)); }
:root[data-theme="light"] .stat { background: linear-gradient(165deg, #ffffff, #eef3fa); }
:root[data-theme="light"] .stat.cv .val { color: var(--text); -webkit-text-fill-color: var(--text); background: none; }
:root[data-theme="light"] .nav { background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(240,244,250,0.98)); }
:root[data-theme="light"] .modal, :root[data-theme="light"] .sheet { background: linear-gradient(180deg, #ffffff, #f4f7fc); }
:root[data-theme="light"] .modal-backdrop { background: rgba(30,45,70,0.32); }
:root[data-theme="light"] .toast { background: #ffffff; color: var(--text); }
:root[data-theme="light"] .paywall { background: rgba(30,45,70,0.5); }
:root[data-theme="light"] .paywall .box { background: linear-gradient(180deg, #ffffff, #f2f6fc); }
:root[data-theme="light"] .input { background: #ffffff; }
:root[data-theme="light"] .demo-strip .bar, :root[data-theme="light"] .progress { background: rgba(20,40,80,0.10); }
:root[data-theme="light"] .seg.active { background: var(--neon-soft); color: #ffffff; box-shadow: 0 6px 16px -10px var(--neon-soft); }
:root[data-theme="light"] .dots i { background: rgba(20,40,80,0.15); }
:root[data-theme="light"] .lvl { background: rgba(20,40,80,0.06); }
:root[data-theme="light"] .buy-btn:disabled, :root[data-theme="light"] .btn:disabled { background: rgba(20,40,80,0.07); color: var(--muted-2); }
:root[data-theme="light"] .card, :root[data-theme="light"] .venture, :root[data-theme="light"] .learn-row, :root[data-theme="light"] .event-row, :root[data-theme="light"] .gig-wide, :root[data-theme="light"] .gig { box-shadow: 0 10px 26px -20px rgba(20,40,80,0.35); }
