*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:         #f4efe4;   /* demo1 "Warm Parchment" background */
    --surface2:   #ffffff;
    --border:     #d4d0c8;
    --border2:    #dedad2;
    --text:       #1a1a1a;
    --text-dim:   #707068;
    --text-faint: #a8a89e;
    --ink:        #1a1a1a;
    --ink-dim:    #888880;
    --accent:     #7a6848;
    --accent-dim: #c0b498;
    /* 10% accent pop - Dusty Blue (Ghibli sky); the cool pop against the parchment 60% */
    --accretion:    #4a82a8;
    --accretion-hi: #3d6f92;
    --accretion-dim: #a9c4d6;   /* faint dusty-blue - affordable-card border + progress-bar track */
    --cursor:     url(assets/cursors/needle.png?v=63) 3 3, auto;
}

/* The custom needle cursor everywhere - never the default OS arrow/hand. */
html, body { cursor: var(--cursor); }
button, label, input, select, textarea, a,
.upgrade-card, .acc-head, .stat-pop-row, .vol-val,
#observatory, #accretion-btn, #mass-upgrades-btn, #show-completed, #show-completed-wrap {
    cursor: var(--cursor) !important;
}
/* Themed text selection (parchment/gold), not browser blue. */
::selection { background: rgba(122,104,72,0.28); color: var(--ink); }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Georgia', 'Times New Roman', serif;
    height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

#app { display: flex; flex-direction: column; height: 100vh; }

#header {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 24px;
    background: var(--bg);
    flex-shrink: 0;
    position: relative;
    z-index: 106;            /* above the pause overlay (z105) so header controls stay usable while paused */
}

#header-right { display: flex; justify-content: flex-end; margin-left: auto; }

#dust-hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border2);
    flex-shrink: 0;
    pointer-events: none;
}

#mute-btn {
    background: none; border: 1px solid var(--border); color: var(--text-faint);
    border-radius: 2px; padding: 4px 10px; font-size: 12px; cursor: pointer;
    font-family: 'Segoe UI', sans-serif; transition: color 0.15s, border-color 0.15s; margin-right: 6px;
}
#mute-btn:hover { color: var(--text-dim); border-color: var(--border2); }
#mute-btn.muted { color: var(--text-faint); opacity: 0.45; }

#pause-btn {
    background: none; border: 1px solid var(--border); color: var(--text-faint);
    border-radius: 2px; padding: 4px 9px; font-size: 11px; line-height: 1; cursor: pointer;
    letter-spacing: 1px; font-family: 'Segoe UI', sans-serif;
    transition: color 0.15s, border-color 0.15s; margin-right: 6px;
}
#pause-btn:hover { color: var(--text-dim); border-color: var(--border2); }
#pause-btn.paused { color: var(--accretion); border-color: var(--accretion); }

/* Pause overlay - covers everything, dims the frozen game, shows PAUSED. Click anywhere to resume. */
#pause-overlay {
    display: none; position: fixed; inset: 0; z-index: 105;
    background: rgba(244, 240, 232, 0.55);
    align-items: center; justify-content: center; cursor: pointer;
}
#pause-overlay.show { display: flex; }
#pause-overlay span {
    font-family: 'Georgia', serif; font-size: 30px; letter-spacing: 0.32em;
    color: var(--text-dim); padding-left: 0.32em;
    border: 1px solid var(--border2); border-radius: 3px; padding: 14px 26px;
    background: rgba(244, 240, 232, 0.7);
}

#settings-wrap { position: relative; display: inline-flex; align-items: center; margin-right: 6px; }
#settings-btn {
    background: none; border: 1px solid var(--border); color: var(--text-faint);
    border-radius: 2px; padding: 4px 9px; font-size: 13px; line-height: 1; cursor: pointer;
    font-family: 'Segoe UI', sans-serif; transition: color 0.15s, border-color 0.15s;
}
#settings-btn:hover { color: var(--text-dim); border-color: var(--border2); }

#settings-panel {
    display: none; position: absolute; top: calc(100% + 8px); right: 0;
    width: 226px; background: var(--surface2); border: 1px solid var(--border);
    padding: 14px 16px; z-index: 100; box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
#settings-panel.open { display: block; }

.settings-label {
    font-size: 8px; letter-spacing: 0.28em; color: var(--text-faint);
    font-family: 'Segoe UI', sans-serif; border-bottom: 1px solid var(--border2);
    padding-bottom: 5px; margin-bottom: 12px;
}
.settings-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.settings-row:last-child { margin-bottom: 0; }
.settings-name { font-size: 11px; color: var(--text-dim); font-family: 'Segoe UI', sans-serif; width: 46px; flex-shrink: 0; }
.settings-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); height: 2px; outline: none; }
.vol-val { font-size: 10px; color: var(--text-faint); font-family: 'Segoe UI', sans-serif; width: 32px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; outline: none; cursor: text; }

#reset-btn {
    background: none; border: 1px solid var(--border); color: var(--text-faint);
    border-radius: 2px; padding: 4px 10px; font-size: 9px; letter-spacing: 0.12em;
    cursor: pointer; font-family: 'Segoe UI', sans-serif; transition: color 0.15s, border-color 0.15s;
}
#reset-btn:hover { color: #8a3030; border-color: #c09090; }

#main { display: flex; flex: 1; overflow: hidden; }

#left-col {
    width: 308px; flex-shrink: 0; padding: 22px 16px;
    display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
/* Stardust HUD + MAIN upgrades live at the TOP of the left column; the observatory floats at the
   bottom-left below them (see #observatory). MAIN sizes to its content and scrolls if it ever needs to. */
#main-upgrades { flex: 0 1 auto; min-height: 0; overflow-y: auto; }

.col-label {
    font-size: 8px; font-weight: 400; letter-spacing: 0.28em; color: var(--text-faint);
    margin-bottom: 8px; font-family: 'Segoe UI', sans-serif;
    border-bottom: 1px solid var(--border2); padding-bottom: 5px;
}

#dust-display { font-size: 46px; font-weight: 400; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; font-family: 'Optima','Candara','Century Gothic',sans-serif; letter-spacing: 0.01em; }
#dust-icon  { font-size: 30px; }

#sky-section { flex: 1; position: relative; min-width: 0; }
/* NOTE: a <canvas> is a replaced element - inset:0 alone does NOT stretch it; without an explicit
   CSS size it displays at its intrinsic (attribute) size, which is dpr-scaled by the JS. On Retina
   (dpr 2) that made every full-window overlay draw at 2x position (wish picker off-screen right,
   vortex hold hit-test missing the visible disc). Every overlay canvas MUST carry width/height 100%. */
/* Vortex event overlay - full window, above the app but below the comet/observatory; press/hold is a window handler */
#vortex-layer { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
/* Comet overlay - full window, above the panels, never blocks clicks (catch is a window handler) */
#comet-layer { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }
#sky { display: block; width: 100%; height: 100%; cursor: url(assets/cursors/needle.png?v=63) 3 3, default; }

#right-col { width: 308px; flex-shrink: 0; padding: 22px 16px; display: flex; flex-direction: column; min-height: 0; }
#upgrades-list { flex: 1; min-height: 0; overflow-y: auto; }

/* "Hide completed" toggle - pinned at the bottom-right of the panel */
#upg-controls { display: flex; justify-content: flex-end; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border2); flex-shrink: 0; }
#show-completed-wrap {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    font-family: 'Segoe UI', sans-serif; font-size: 12px; letter-spacing: 0.04em; font-weight: 600;
    color: var(--text); transition: color 0.12s;
}
#show-completed-wrap:hover { color: var(--ink); }
#show-completed { accent-color: var(--ink); cursor: pointer; width: 15px; height: 15px; }

/* Accordion sections (multi-open) */
.acc { margin-bottom: 4px; }
.acc-head {
    display: flex; justify-content: space-between; align-items: center; cursor: pointer;
    font-family: 'Segoe UI', sans-serif; font-size: 9px; letter-spacing: 0.22em; color: var(--text-dim);
    border-bottom: 1px solid var(--border2); padding: 9px 8px; margin-bottom: 10px;
    border-radius: 3px;
    transition: color 0.12s, background 0.12s;
}
/* Clear "this is a collapsible header" affordance: highlighted row + bigger accent chevron on hover. */
.acc-head:hover { color: var(--ink); background: rgba(122,104,72,0.08); }
.acc-head:hover .acc-arrow { color: var(--accent); }
.acc-label { display: inline-flex; align-items: center; gap: 9px; }
.acc-arrow { display: inline-block; transition: transform 0.2s, color 0.12s; font-size: 15px; color: var(--accent); line-height: 1; }
.acc.open .acc-arrow { transform: rotate(90deg); }
.acc-count { color: var(--accent-dim); font-weight: 700; font-variant-numeric: tabular-nums; }
.acc-body { display: none; }
.acc.open .acc-body { display: block; }


/* Observatory - draggable floating stats panel, default BOTTOM-LEFT (bottom-anchored so it grows
   UPWARD with more metrics; bottom:125px clears the fixed prestige buttons below it). Floating means
   its hover popups aren't clipped by any overflow container. */
#observatory {
    position: fixed; bottom: 20px; left: 16px;
    background: rgba(244,240,232,0.92); padding: 16px 16px 12px;
    z-index: 50; cursor: grab; min-width: 262px; user-select: none;
    transition: background 0.15s;
}
#observatory::before {
    content: ''; display: block;
    width: 29px; height: 3px; border-radius: 2px;
    background: transparent; margin: 0 auto 10px;
    transition: background 0.15s;
}
#observatory:hover { background: rgba(244,240,232,0.98); }
#observatory:hover::before { background: var(--accent-dim); }
#observatory:active { cursor: grabbing; }

/* Accretion - a SPECIAL accentuated card at the bottom of the MAIN upgrades (shown by hud.js when
   claimable). Dusty-blue tint + accent border + soft glow so it stands out as the prestige action. */
#accretion-btn.accretion-card {
    display: none;   /* shown by hud.js when an Accretion is claimable */
    text-align: center; cursor: pointer; user-select: none;
    margin: 8px 0 10px; padding: 14px 18px; border-radius: 13px;
    background: rgba(74,130,168,0.10); border: 2px solid var(--accretion); color: var(--accretion);
    font-family: 'Optima','Candara','Century Gothic',sans-serif; font-size: 15px; font-weight: 700; letter-spacing: 0.10em;
    box-shadow: 0 3px 14px rgba(74,130,168,0.22);
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
#accretion-btn.accretion-card:hover { background: rgba(74,130,168,0.18); box-shadow: 0 5px 18px rgba(74,130,168,0.34); }
#accretion-btn.accretion-card:active { transform: translateY(1px); }
/* progress bar (the thin "how close to accreting" cue) - hidden when claimable, shown in the muted progress state */
#accretion-btn .acc-card-prog { display: none; height: 4px; margin: 9px 2px -1px; background: rgba(74,130,168,0.16); border-radius: 3px; overflow: hidden; }
#accretion-btn .acc-card-prog > i { display: block; height: 100%; width: 0; background: var(--accretion); border-radius: 3px; transition: width 0.3s ease; }
/* progress state: nonintrusive - muted, no glow, not interactive */
#accretion-btn.accretion-card.progress { cursor: default; pointer-events: none; background: rgba(120,108,86,0.06); border-color: rgba(74,130,168,0.30); color: rgba(74,130,168,0.6); box-shadow: none; padding: 11px 18px 9px; font-size: 13px; letter-spacing: 0.08em; }
#accretion-btn.accretion-card.progress .acc-card-prog { display: block; }

/* Mass Upgrades - a smaller secondary card just below it (shown after the first Accretion). */
#mass-upgrades-btn.mass-upg-card {
    display: none;
    text-align: center; cursor: pointer; user-select: none;
    margin-bottom: 10px; padding: 9px 16px; border-radius: 11px;
    background: transparent; border: 1.5px solid rgba(74,130,168,0.5); color: var(--accretion);
    font-family: 'Optima','Candara','Century Gothic',sans-serif; font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em;
    transition: background 0.15s, border-color 0.15s;
}
#mass-upgrades-btn.mass-upg-card:hover { background: rgba(74,130,168,0.08); border-color: var(--accretion); }
#mass-upgrades-btn:active { transform: translateY(1px); }

/* Demo-3 "A" layout: name|cost on top, a dusty-blue level progress bar + count along the bottom. */
.upgrade-card {
    position: relative; overflow: hidden;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 13px;
    padding: 12px 16px 11px;  /* compact; title centres above the bar (see .upg-name line-height) */
    margin-bottom: 10px; cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.upgrade-card:hover:not(.is-maxed) { background: #fbfcfd; border-color: var(--accretion-dim); }
.upgrade-card.can-afford { border-color: var(--accretion-dim); }
.upgrade-card.can-afford:hover { border-color: var(--accretion); }
/* Completed: stay greyed (even on hover). We dim only the FACE (.upg-top/.upg-botrow),
   NOT the card - so the description popup keeps full opacity and isn't trapped in a
   faded stacking context behind sibling cards. */
.upgrade-card.is-maxed { cursor: default; background: #f6f4ee; border-color: var(--border2); }
.upgrade-card.is-maxed .upg-top,
.upgrade-card.is-maxed .upg-botrow { opacity: 0.4; }

/* Identity upgrades (mutually-exclusive dust paths): a VERY faint cosmic tint marks them apart,
   and they are HOLD-to-buy (the card vibrates while held). */
.upgrade-card.upg-identity { background: #f7f4fb; border-color: #e4def1; }
.upgrade-card.upg-identity:hover:not(.is-maxed):not(.upg-locked) { background: #faf8fe; border-color: #c3b8e0; }
.upgrade-card.upg-identity.can-afford { border-color: #c3b8e0; }
.upgrade-card.upg-identity.can-afford:hover { border-color: #9d8fc9; }
.upgrade-card.upg-identity.is-maxed { background: #f1edf8; border-color: #cabfe4; }   /* the chosen path */
.upgrade-card.upg-identity.upg-locked { cursor: default; background: #f3f1f6; }
.upgrade-card.upg-identity.upg-locked .upg-top,
.upgrade-card.upg-identity.upg-locked .upg-botrow { opacity: 0.42; }
.upgrade-card.upg-identity.holding { animation: upg-vibrate 0.07s linear infinite; border-color: #9d8fc9; }
@keyframes upg-vibrate {
    0%   { transform: translate(0, 0); }
    20%  { transform: translate(-1.4px, 0.8px); }
    40%  { transform: translate(1.3px, -1px); }
    60%  { transform: translate(-1px, -1.3px); }
    80%  { transform: translate(1.2px, 1px); }
    100% { transform: translate(0, 0); }
}
/* Identity lock-in hold bar: sweeps 0 -> 1 across the card's bottom over the 750ms hold (transition set
   inline in wireIdentityHold), snaps back on release. Clipped to the rounded corners by overflow:hidden. */
.upgrade-card .upg-hold {
    position: absolute; left: 0; bottom: 0; height: 4px; width: 100%;
    background: #9d8fc9; transform-origin: left; transform: scaleX(0); pointer-events: none;
}

/* ===== Tutorial overlay (Minimal Frost): light dim + soft-lifted spotlight + pulsing dot + pill tooltip ===== */
#tutorial { position: fixed; inset: 0; z-index: 200; display: none; }   /* covers everything = game frozen */
#tutorial .tut-hole {
    position: fixed; pointer-events: none; border-radius: 13px;
    box-shadow: 0 0 0 9999px rgba(70,72,84,0.34), 0 8px 26px 2px rgba(60,70,110,0.25);
    border: 1px solid rgba(255,255,255,0.7);
}
#tutorial .tut-dot {
    position: fixed; width: 11px; height: 11px; border-radius: 50%;
    background: var(--accretion); pointer-events: none; animation: tut-dot 1.3s ease-in-out infinite;
}
@keyframes tut-dot { 0%,100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.5); opacity: 0.35; } }
#tutorial .tut-dim {   /* centered notices dim the whole screen (no spotlight hole) */
    position: fixed; inset: 0; background: rgba(70,72,84,0.34);
}
#tutorial .tut-pop {   /* the callout box: the MESSAGE only - the confirm button sits below it */
    position: fixed; pointer-events: auto; max-width: 520px;
    background: rgba(255,255,255,0.97); border: 1px solid #e1e4ea; border-radius: 11px; padding: 18px 26px;
    box-shadow: 0 8px 26px -8px rgba(40,50,70,0.35); backdrop-filter: blur(2px);
}
#tutorial .tut-body {
    font-family: 'Nunito','Segoe UI',sans-serif; font-weight: 400; font-size: 16.5px; line-height: 1.55;
    color: #33373e; text-align: center;
}
#tutorial .tut-ok {    /* fixed-positioned by JS: right below the callout, centered on it */
    position: fixed; pointer-events: auto;
    font-family: 'Nunito','Segoe UI',sans-serif; font-weight: 800; font-size: 15px; cursor: pointer;
    background: rgba(255,255,255,0.97); color: #33506a; border: 1px solid #d6dde6; padding: 8px 30px; border-radius: 20px;
    box-shadow: 0 6px 18px -6px rgba(40,50,70,0.35);
}
#tutorial .tut-ok:hover { background: #e2e8f0; }

/* Newly-unlocked card: a simple yellow highlight that flashes twice, then clears
   (the card's `animationend` handler removes .upg-new once it's transparent again). */
.upgrade-card.upg-new::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: rgba(240,200,40,0.6);
    /* two slow, smooth swells - ease-in-out on each segment makes it glow rather than blink */
    animation: upg-flash 2.2s ease-in-out forwards;
}
@keyframes upg-flash {
    0%   { opacity: 0; }
    25%  { opacity: 1; }   /* first swell, peaks gently */
    50%  { opacity: 0; }
    75%  { opacity: 1; }   /* second swell */
    100% { opacity: 0; }
}

/* The name|cost row is a fixed-height zone that flex-centres its content - so the title sits
   centred between the card top and the progress bar regardless of Baloo 2's tall line metrics. */
.upg-top  { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 10px; transform: translateY(3px); }  /* nudge down - Baloo 2's tall ascenders read optically high */
.upg-name { font-family: 'Baloo 2', sans-serif; font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.15; }
.upg-cost { font-size: 15px; color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; flex-shrink: 0; white-space: nowrap; line-height: 1.15; }
.upg-cost.maxed { color: var(--text-faint); font-weight: 700; }
/* Bottom row: full-width dusty-blue level progress bar + the level count at its right end. */
.upg-botrow { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.upg-bar { flex: 1; height: 5px; border-radius: 4px; background: rgba(74,130,168,0.14); overflow: hidden; }
.upg-bar > i { display: block; height: 100%; border-radius: 4px; background: var(--accretion); width: 0; transition: width 0.18s ease; }
.upg-level { flex: none; font-size: 11px; font-weight: 700; color: var(--text-faint); font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }

/* Afterglow buff: while the 60s comet window is live the card lights warm-gold + a drain bar
   along its bottom edge empties; goes burnt-orange and flashes in the final ~18%. */
.upg-drain { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
    background: #c8922f; transform-origin: left; transform: scaleX(0); pointer-events: none; }
.upgrade-card.afterglow-on { border-color: #c8922f; background: #fffaf0;
    box-shadow: 0 0 0 1px #c8922f, 0 0 13px rgba(200,146,47,0.32); }
.upgrade-card.afterglow-on.afterglow-low { border-color: #bf5a2c;
    box-shadow: 0 0 0 1px #bf5a2c, 0 0 13px rgba(191,90,44,0.40); animation: afterglow-flash 1s infinite; }
.upgrade-card.afterglow-on.afterglow-low .upg-drain { background: #bf5a2c; }
@keyframes afterglow-flash { 0%, 100% { opacity: 1; } 50% { opacity: 0.62; } }

/* Description popup - a single shared element, JS-positioned to the LEFT of the hovered
   card (fixed, so it escapes the right column's overflow clip and hides nothing in the list). */
#upg-pop {
    display: none;
    position: fixed;
    max-width: 346px;                    /* +20% again (240 → 288 → 346) */
    background: rgba(26,26,26,0.82);     /* slightly transparent - maintained */
    backdrop-filter: blur(1.5px);
    color: var(--bg);
    font-size: 17.3px;                   /* +20% again (12 → 14.4 → 17.3) */
    line-height: 1.5;
    padding: 15.6px 19.2px;              /* +20% again (11/13 → 13/16 → 15.6/19.2) */
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 6px 22px rgba(0,0,0,0.2);
    z-index: 200;
    pointer-events: none;
}
#upg-pop::after {           /* little arrow on the right edge, pointing at the card */
    content: '';
    position: absolute;
    left: 100%; top: 50%; transform: translateY(-50%);
    border: 8.4px solid transparent;     /* +20% again (6 → 7 → 8.4) */
    border-left-color: rgba(26,26,26,0.82);
}
/* Two areas in the popup: flavor "description" on top, the actual "Effect" below. */
#upg-pop .upg-pop-flavor { text-align: center;
    font-style: italic; opacity: 0.72; font-size: 0.82em; line-height: 1.45;
    margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(244,240,232,0.16);
}
#upg-pop .upg-pop-fn  { font-size: 0.9em; }
/* Now / Next bonus rows under the effect text */
#upg-pop .upg-pop-stats {
    margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(244,240,232,0.16);
    display: flex; flex-direction: column; gap: 3px; font-size: 0.86em;
}
#upg-pop .upg-pop-stats:first-child { margin-top: 0; padding-top: 0; border-top: none; }   /* no divider when it's the only content */
#upg-pop .upg-pop-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
#upg-pop .upg-pop-k { opacity: 0.55; font-weight: 800; font-size: 0.8em; letter-spacing: 0.09em; text-transform: uppercase; }
#upg-pop .upg-pop-v { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

/* Soft modern font (Nunito) across the upgrade UI - cost/level/accordion/popup/toggle.
   (.upg-name is excluded so its Baloo 2 rounded font applies - the Demo-3 name treatment.) */
#upgrades-list, .upgrade-card, .upg-cost, .upg-level,
.acc-head, .acc-label, #upg-pop, #acc-pop, #show-completed-wrap {
    font-family: 'Nunito','Segoe UI',sans-serif !important;
}

.stat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 6px 0; border-bottom: 1px solid var(--border2); font-size: 13px; font-family: 'Nunito', 'Segoe UI', sans-serif; }
.stat-label { color: var(--text-dim); flex: 1; }
.stat-val   { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Stat rows with a formula popup on hover (single line, extends right) */
.stat-pop-row { position: relative; cursor: help; }
.stat-pop {
    display: none; position: absolute; left: 0; bottom: calc(100% + 6px);
    background: #3c352b; color: #f4f0e8; font-size: 13px; line-height: 1.4;
    padding: 9px 14px; white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,0.16);
    z-index: 200; pointer-events: none; letter-spacing: 0.02em;
}
.stat-pop b { color: #d8c8a4; font-weight: 600; }
.stat-pop-row:hover .stat-pop { display: block; }

/* Cosmic info - hover tooltip (#cosmo-tip, follows cursor) + click card (#cosmo-card, pinned center) */
#cosmo-tip, #cosmo-card {
    display: none; position: absolute; z-index: 80;
    color: #f4f0e8; font-family: 'Segoe UI', sans-serif; line-height: 1.55; letter-spacing: 0.02em;
}
#cosmo-tip {
    background: rgba(44,38,32,0.96); padding: 13px 16px; min-width: 200px; max-width: 270px;
    font-size: 12.5px; box-shadow: 0 6px 22px rgba(0,0,0,0.28); pointer-events: none;
}
#cosmo-card {
    background: rgba(44,38,32,0.85); padding: 30px 39px 29px; min-width: 290px; max-width: 450px;
    font-size: 20px; box-shadow: 0 14px 50px rgba(0,0,0,0.4); pointer-events: auto;
    /* width + min-height are set once by JS (setUniformCardSize) so every body's card
       is the SAME size, matched to the longest description (empty space is fine). */
}
.cosmo-close {
    position: absolute; top: 9px; right: 10px;
    width: 40px; height: 40px; border-radius: 50%; padding: 0 0 3px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.07); border: none; color: #c2bbac; cursor: pointer;
    font-size: 30px; line-height: 1;
    font-family: 'Segoe UI', sans-serif; transition: background 0.14s, color 0.14s, transform 0.1s;
}
.cosmo-close:hover  { background: rgba(255,255,255,0.16); color: #fff; }
.cosmo-close:active { transform: scale(0.9); }
.cosmo-title {
    font-family: 'Nunito','Segoe UI',sans-serif; font-weight: 700;
    color: #e8dcc0; margin-bottom: 9px; padding: 0 20px 6px 0; letter-spacing: 0.01em;
    border-bottom: 1px solid rgba(216,200,164,0.25);
}
#cosmo-tip  .cosmo-title { font-size: 14px; }
#cosmo-card .cosmo-title { font-size: 21px; }
/* Comet hover label - just the word, no rows/border. Shrink the box to fit it. */
.cosmo-solo {
    font-family: 'Optima','Candara','Century Gothic',sans-serif; font-size: 14px;
    color: #e8dcc0; letter-spacing: 0.06em; white-space: nowrap;
}
#cosmo-tip:has(.cosmo-solo) { min-width: 0; padding: 8px 13px; }
.tip-row { display: flex; justify-content: space-between; gap: 18px; padding: 2px 0; }
.tip-l   { color: #b8b0a2; }
.tip-v   { color: #f4f0e8; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tip-note { margin-top: 10px; font-size: 12px; font-style: italic; color: #b0a894; line-height: 1.5; }
#cosmo-card .tip-note { font-size: 16px; margin-top: 14px; }
/* Maw card: the concise pulse-income breakdown line under the rows */
.tip-calc { margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 11px; color: #9a927f; line-height: 1.45; font-variant-numeric: tabular-nums; }
#cosmo-card .tip-calc { font-size: 13px; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); }

/* ===== Accretion (prestige) Mass page - opaque (hides the game) + same looping stars ===== */
#accretion-screen {
    display: none; position: fixed; inset: 0; z-index: 120;
    background: #f4f0e8;                       /* opaque: nothing of the game shows behind it */
    flex-direction: column; align-items: center;
    font-family: 'Nunito','Segoe UI',sans-serif; color: #1a1a1a;
}
#accretion-screen.show { display: flex; }
/* Browse mode (opened from the Mass Upgrades button): translucent so the still-running game shows
   faintly behind, and no star canvas (the real sky is what shows through). */
#accretion-screen.browse { background: rgba(244,240,232,0.8); }
#accretion-screen.browse #acc-stars { display: none; }
#acc-stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }   /* background stars */
/* keep all UI above the star canvas */
.acc-masshdr, .acc-tabs, .acc-stage { position: relative; z-index: 1; }
.acc-return {
    position: absolute; bottom: 140px; left: 50%; transform: translateX(-50%);   /* 10px lower than before (was 150px) */
    z-index: 5;   /* above .acc-stage (z1) - its box overlaps the button and was eating the clicks */
    background: var(--accretion); color: #f6f3ec; border: none;
    padding: 18px 51px; border-radius: 11px; font: 800 21px 'Nunito'; letter-spacing: 0.06em; cursor: pointer;   /* 15% larger */
    box-shadow: 0 6px 20px rgba(74,130,168,0.38); transition: background 0.15s;
}
.acc-return:hover { background: var(--accretion-hi); }

.acc-undo {
    display: none; position: absolute; top: 20px; right: 24px; z-index: 5;
    background: rgba(244,240,232,0.92); border: 1.5px solid var(--accretion); color: var(--accretion);
    padding: 9px 20px; border-radius: 8px; font: 800 13.5px 'Nunito'; letter-spacing: 0.04em; cursor: pointer;
    transition: background 0.15s;
}
.acc-undo:hover { background: #fff; }

.acc-masshdr { margin-top: 18px; display: flex; align-items: center; gap: 13px; }
.acc-masshdr svg { display: block; width: 42px; height: 42px; }
.acc-masshdr .num { font-size: 42px; font-weight: 800; line-height: 1; }
.acc-masshdr .lbl { font-size: 11px; font-weight: 800; letter-spacing: 0.34em; color: #9a8f78; text-transform: uppercase; }

.acc-tabs { margin-top: 14px; display: flex; gap: 5px; background: #ece6d8; padding: 4px; border-radius: 11px; }
.acc-tab { padding: 9px 20px; border-radius: 8px; font: 800 11px 'Nunito'; letter-spacing: 0.14em; text-transform: uppercase; color: #8a7f6c; cursor: pointer; border: none; background: transparent; transition: all 0.12s; }
.acc-tab:hover { color: #1a1a1a; }
.acc-tab.on { background: #f4f0e8; color: #1a1a1a; box-shadow: 0 1px 4px rgba(0,0,0,0.12); }

/* tree starts at the TOP (below the header row), fills downward - no vertical centering.
   overflow-y: the 5-tier rail runs ~900px tall - on short laptop screens the lower tiers
   were clipped with no way to reach them (built on a huge monitor, never showed there). */
.acc-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; width: 100%; padding-top: 34px; overflow-y: auto; min-height: 0; }

.acc-tree { display: flex; flex-direction: column; align-items: center; width: 100%; padding-bottom: 40px; }

/* ===== Uniform minimal Mass-upgrade card (every state is the SAME size - only colour changes) ===== */
.acc-node { position: relative; width: 208px; height: 116px; box-sizing: border-box; display: flex; flex-direction: column;
            align-items: center; justify-content: center; text-align: center; background: #f4f0e8; border: 2px solid #d8cdb5; border-radius: 12px; padding: 12px 16px; }
.acc-nm { font-size: 15px; font-weight: 700; color: #6b6150; line-height: 1.18; }

/* round corner badge - sits on the top-right rounded corner, looks pinned on top of the button */
.acc-badge { position: absolute; top: -10px; right: -10px; min-width: 30px; height: 30px; border-radius: 16px; padding: 0 6px;
             box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; z-index: 4; line-height: 1;
             font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
             background: #fbf8f1; border: 2px solid #cdbfa0; color: #8a7a55; box-shadow: 0 2px 6px rgba(60,45,25,0.22); }
.acc-badge.ok   { border-color: #a8853a; color: #8a6f2e; background: #fff; }
.acc-badge.done { border-color: #a8853a; color: #a8853a; background: #fff; font-size: 14px; }
.acc-badge.lock { border-color: #ddd3bd; color: #b3a98f; }
.acc-badge.soon { border-color: #ddd3bd; color: #b3a98f; font-size: 9px; font-style: italic; font-weight: 700; }
.acc-badge.cost { left: -10px; right: auto; border-color: #cdbfa0; color: #8a7a55; }       /* cost on the top-LEFT corner */
.acc-badge.cost.ok { border-color: #a8853a; color: #8a6f2e; background: #fff; }
.acc-ndesc { margin-top: 5px; font-size: 12px; font-weight: 600; color: #7a7059; line-height: 1.28; }
.acc-ndesc.muted { color: #b3a98f; font-style: italic; }
.acc-ncost { margin-top: auto; font-size: 12px; font-weight: 800; color: #b0a589; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 4px; }
.acc-ncost.ok { color: #a8853a; } .acc-ncost.done { color: #9a8f78; }
.acc-bar { width: 100%; margin-top: 9px; height: 5px; background: #e6ddca; border-radius: 3px; overflow: hidden; }
.acc-bar i { display: block; height: 100%; background: #a8853a; border-radius: 3px; }
.acc-lock { opacity: 0.85; }
.acc-node.avail { border-color: #a8853a; } .acc-node.avail .acc-nm { color: #1a1a1a; }
.acc-node.up    { border-color: #a8853a; background: #faf2e1; } .acc-node.up .acc-nm { color: #1a1a1a; }
.acc-node.max   { background: #a8853a; border-color: #a8853a; }
.acc-node.max .acc-nm, .acc-node.max .acc-ndesc, .acc-node.max .acc-ncost { color: #fbf8f1; }
.acc-node.max .acc-bar { background: rgba(255,255,255,0.30); } .acc-node.max .acc-bar i { background: #fbf8f1; }
.acc-node.next  { border-style: dashed; border-color: #cdbfa0; opacity: 0.8; }
.acc-node.next .acc-nm { color: #8a8071; } .acc-node.next .acc-ndesc { color: #9a8f78; } .acc-node.next .acc-ncost { color: #b0a589; }
.acc-node.locked { border-style: dashed; border-color: #ddd3bd; background: #f0ebe0; opacity: 0.74; }
.acc-node.locked .acc-nm { color: #a99f88; }
.acc-nlock { display: inline-flex; }
.acc-nlock .acc-lock { width: 26px; height: 26px; opacity: 0.5; }   /* sealed-tier name hidden behind a lock */
.acc-node.buy { cursor: pointer; transition: transform 0.1s, box-shadow 0.1s; }
.acc-node.buy:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(168,133,58,0.22); }

/* hover popup - the detailed "math" (kept off the card to keep it minimal & fixed-size) */
#acc-pop { position: fixed; z-index: 130; max-width: 234px; background: rgba(251,248,241,0.98); border: 1px solid #e0d7c6;
           border-radius: 10px; padding: 11px 13px; box-shadow: 0 8px 26px -8px rgba(60,45,25,0.4); pointer-events: none; opacity: 0; transition: opacity 0.12s; }
#acc-pop.show { opacity: 1; }
.acc-pop-t { font-size: 14px; font-weight: 800; color: #6b5a2e; }
.acc-pop-f { font-size: 11.5px; font-style: italic; color: #a99f88; margin: 2px 0 7px; line-height: 1.35; }
.acc-pop-lv { font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: #b5a98c; margin-bottom: 4px; }
.acc-pop-d { font-size: 12.5px; color: #5a5040; line-height: 1.4; }
.acc-pop-d b { color: #8a6f2e; }
.acc-pop-next { font-size: 12px; color: #8a6f2e; font-weight: 700; margin-top: 5px; }

/* ===== Branching Rail: the Singularity spine + per-tier branches ===== */
.acc-railwrap { margin-left: max(12px, calc(50% - 634px)); width: fit-content; max-width: 100%; }   /* the SPINE is pinned at the 3-card-baseline position (gate 208 + gap 100 + half of 3x208+2x14 cards); wider rows grow RIGHT, never re-centering the tree */
.acc-spinehdr { width: 208px; text-align: center; margin-bottom: 8px; }
.acc-spinename { display: block; font-size: 15px; font-weight: 800; letter-spacing: 0.12em; color: #4a3d60; text-shadow: 0 1px 7px rgba(74,58,100,0.32); }
.acc-spinesub { display: block; font-size: 9px; color: #b5a98c; font-style: italic; margin-top: 1px; line-height: 1.25; }
/* 4 cols: [spine 208][gap 100][cards auto][right spacer 308 = spine+gap] -> cards stay dead-centre, spine sits 100px to its left (clearly separated from the upgrade tree) */
.acc-rail { display: grid; grid-template-columns: 208px 100px auto 0; align-items: stretch; }   /* right spacer column collapsed - centering no longer depends on it */
.acc-gatecell { position: relative; display: flex; justify-content: center; align-items: center; padding: 10px 0; }
.acc-gatecell.line::before { content: ''; position: absolute; top: 0; bottom: 0; width: 3px; background: #b0a3c8; }
.acc-gatecell.line.first::before { top: 50%; }    /* rail starts AT the first connected gate - no line above */
.acc-gatecell.line.last::before  { bottom: 50%; }  /* and stops at the last reached/next gate - no line into sealed tiers */
/* spine gate box = EXACT same size as a Mass-upgrade card (208 x 116); its own MUTED VIOLET colour so the two trees read as different */
.acc-gate { position: relative; z-index: 2; width: 208px; height: 116px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: #f4f0e8; border: 2px solid #8076a0; border-radius: 12px; padding: 10px 12px; text-align: center; }
.acc-gtier { font-size: 9.5px; letter-spacing: 0.13em; text-transform: uppercase; font-weight: 800; color: #b5a98c; }
.acc-gorb { font-size: 15px; font-weight: 800; color: #6b6150; margin: 0; }
.acc-gfoot { font-size: 12px; font-weight: 800; color: #b0a589; }
.acc-gate.done { background: #6e6189; border-color: #564a6e; box-shadow: inset 0 2px 5px rgba(35,28,52,0.36); }
.acc-gate.done .acc-gtier, .acc-gate.done .acc-gorb, .acc-gate.done .acc-gfoot { color: #fbf8f1; }
.acc-gate.avail { border-color: #8076a0; box-shadow: 0 0 0 4px rgba(128,118,160,0.18); }
.acc-gate.avail .acc-gorb { color: #1a1a1a; }
.acc-gfoot.ok { color: #fbf8f1; background: #a8853a; border-radius: 6px; padding: 2px 0; }
.acc-gate.locked { border-style: dashed; border-color: #d8cdb5; background: #f0ebe0; }
.acc-gate.locked .acc-gorb { color: #aaa08a; }
.acc-gate.buy { cursor: pointer; transition: transform 0.1s, box-shadow 0.1s; }
.acc-gate.buy:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(128,118,160,0.3); }
.acc-branch { position: relative; align-self: center; height: 100%; }
.acc-branch::after { content: ''; position: absolute; top: 50%; left: -2px; right: 0; height: 2px; background: #b0a3c8; transform: translateY(-50%); }
.acc-branch.noline::after { display: none; }   /* sealed tiers: no connector */
.acc-tiernodes { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 10px 0; min-height: 70px; }
.acc-sealed { font-size: 12px; color: #c1b79f; font-style: italic; letter-spacing: 0.04em; padding-left: 4px; }

/* Absorption animation overlay canvas (Implosion & Rebirth) */
#accretion-fx { display: none; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 110; pointer-events: none; }

/* Accretion confirmation modal - themed (Nunito + parchment), not an OS warning box.
   Top-level fixed (shown over the live game directly from the Accretion button). */
.acc-confirm { display: none; position: fixed; inset: 0; z-index: 130; background: rgba(26,22,18,0.32); align-items: center; justify-content: center; font-family: 'Nunito','Segoe UI',sans-serif; }
.acc-confirm.show { display: flex; }
/* V4 "ledger": warm rounded card, centred, minimal - show, don't tell. */
.acc-confirm-box {
    position: relative;
    background: linear-gradient(180deg,#fbf8f1,#f3eee2); border: 1px solid rgba(120,108,86,0.16); border-radius: 20px;
    width: 360px; max-width: 90%; padding: 26px 26px 22px; text-align: center;
    box-shadow: 0 22px 60px -18px rgba(40,32,22,0.5), 0 2px 0 rgba(255,255,255,0.6) inset;
    font-family: 'Nunito','Segoe UI',sans-serif;
}
.acc-sentence { font-size: 18px; font-weight: 900; color: #1a1a1a; letter-spacing: 0.035em; text-transform: uppercase; margin: 2px 0 0; }
/* the explanation now sits UNDER the ledger, centred, two clean lines */
.acc-explain { font-size: 13px; line-height: 1.55; color: #6b6150; margin: 14px auto 2px; max-width: none; font-weight: 600; text-align: center; }
/* leave-confirm: a big dominant title with a small note under it */
.acc-confirm-title { font-size: 27px; font-weight: 900; color: #1a1a1a; letter-spacing: 0.01em; line-height: 1.12; margin: 2px 0 0; }
.acc-confirm-body { font-size: 13px; line-height: 1.5; color: #6b6150; margin: 12px auto 0; max-width: 280px; }
.acc-confirm-body p { margin: 0; }
/* leave-confirm: wider box so the note fits on ONE line */
#acc-leave-confirm .acc-confirm-box { width: 470px; }
#acc-leave-confirm .acc-confirm-body { max-width: none; font-size: 14px; white-space: nowrap; }
.acc-star { color: #a8853a; font-weight: 900; }
.acc-up { vertical-align: -2px; color: #6b6150; }
/* ledger: Resets ⟶ Mass gained */
.acc-ledger { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; margin: 18px 0 4px; }
.acc-col { padding: 13px 11px; border-radius: 13px; display: flex; flex-direction: column; }
.acc-col.lose { background: rgba(120,108,86,0.06); border: 1px solid rgba(120,108,86,0.13); }
.acc-col.keep { background: rgba(74,130,168,0.08); border: 1px solid rgba(74,130,168,0.22); }
.acc-colh { font-size: 9.5px; letter-spacing: 0.2em; font-weight: 800; text-transform: uppercase; color: #8a8071; margin-bottom: 9px; }
.acc-col.keep .acc-colh { color: var(--accretion); }
.acc-colbody { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.acc-it { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 700; color: #5a5346; margin: 6px 0; }
.acc-orb { width: 40px; height: 40px; border-radius: 50%; margin: 2px auto 6px; position: relative;
    background: radial-gradient(circle at 34% 30%,#86b4d4 0%,#5a90b6 38%,#4a82a8 62%,#34607f 100%);
    box-shadow: 0 0 0 1px rgba(52,96,127,0.4), 0 4px 16px rgba(74,130,168,0.45), 0 0 22px rgba(74,130,168,0.35); }
.acc-orb::after { content:""; position:absolute; top:16%; left:22%; width:30%; height:24%; border-radius:50%; background:rgba(255,255,255,0.55); filter:blur(1px); }
.acc-amt { font-size: 26px; font-weight: 900; color: var(--accretion); line-height: 1; }
.acc-arrowmid { font-size: 22px; color: var(--accretion); align-self: center; }
/* next-Mass progress */
.acc-next2 { margin-top: 16px; text-align: left; }
.acc-nextrow { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.acc-nextt { font-size: 10px; letter-spacing: 0.22em; font-weight: 800; color: #8a8071; text-transform: uppercase; }
.acc-nextv { font-size: 12px; font-weight: 800; color: #5a5346; }
.acc-bar { height: 8px; border-radius: 6px; background: rgba(120,108,86,0.13); overflow: hidden; }
.acc-bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, rgba(168,133,58,0.55), #a8853a); }
.acc-mutehint { margin-top: 14px; font-size: 12px; font-style: italic; color: var(--accretion); }
/* actions - vertical: Collapse on top, a quiet "Not yet" under it */
.acc-confirm-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.acc-btn-go { position: relative; overflow: hidden; width: 100%; background: var(--accretion); border: none; color: #f6f3ec; border-radius: 12px; padding: 14px; font: 900 14.5px 'Nunito'; letter-spacing: 0.06em; cursor: pointer; box-shadow: 0 6px 18px -4px rgba(74,130,168,0.5); transition: background 0.15s; user-select: none; touch-action: none; }
.acc-btn-go:hover { background: var(--accretion-hi); }
.acc-go-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.acc-go-label { position: relative; z-index: 1; }
/* "Skip animation" - appears in the confirm body only after the first Accretion; checked = skip */
/* stack = box + the skip option below it (OUTSIDE the box); fixed width so the skip aligns to the box's right edge */
.acc-confirm-stack { display: flex; flex-direction: column; width: 360px; max-width: 92vw; }
.acc-confirm-stack > .acc-confirm-box { width: 100%; max-width: none; }
/* top-left, OUTSIDE + above the box, on the dim backdrop -> bright text + strong shadow so it stands out */
.acc-skip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px 6px; font-size: 12px; font-weight: 800; color: #ffffff; text-shadow: 0 1px 4px rgba(0,0,0,0.85), 0 0 2px rgba(0,0,0,0.55); cursor: pointer; }
.acc-skip input { width: 14px; height: 14px; accent-color: var(--accretion); cursor: pointer; }
/* secondary action - clearly a button, just quieter than the primary (not a hidden text link) */
.acc-btn-ghost { width: 100%; background: #fbf8f1; border: 1.5px solid #ddd3bd; color: #6b6150; border-radius: 11px; padding: 11px; font: 800 13px 'Nunito'; letter-spacing: 0.04em; cursor: pointer; transition: border-color 0.12s, color 0.12s, background 0.12s; }
.acc-btn-ghost:hover { border-color: #b5a98c; color: #1a1a1a; background: #fff; }

/* ===== Front page ("The Slow Zoom") - shown on load + via the settings FRONT PAGE button ===== */
#frontpage { position: fixed; inset: 0; z-index: 300; background: #0b0d12; display: none; }
#frontpage.show { display: block; }
#front-stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.front-credit {
    position: absolute; top: 20px; right: 26px; z-index: 1;
    color: rgba(232,226,210,0.55); font-family: Georgia, serif; font-style: italic;
    font-size: 13px; letter-spacing: 0.08em;
}
.front-mid {
    position: absolute; inset: 0; z-index: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.front-title {
    color: #e8e2d2; font-family: Georgia, serif; font-weight: 400;
    font-size: 34px; letter-spacing: 0.55em; text-indent: 0.55em; margin: 0;
    opacity: 0;
}
#frontpage.show .front-title { animation: front-title-in 2.4s 0.5s forwards ease-out; }
@keyframes front-title-in { to { opacity: 1; letter-spacing: 0.34em; text-indent: 0.34em; } }
#front-start {
    margin-top: 46px; background: none; border: 1px solid rgba(232,226,210,0.4); color: #e8e2d2;
    font-family: Georgia, serif; font-size: 15px; letter-spacing: 0.2em; padding: 12px 46px;
    cursor: pointer; transition: all 0.25s; opacity: 0;
}
#frontpage.show #front-start { animation: front-fade 1.6s 2.1s forwards; }
@keyframes front-fade { to { opacity: 1; } }
#front-start:hover { border-color: #c9a24a; color: #c9a24a; box-shadow: 0 0 24px rgba(201,162,74,0.2); }

/* the settings MENU button back to the front page */
#front-page-btn {
    width: 100%; margin-top: 6px; background: none; border: 1px solid var(--border);
    color: var(--text-faint); border-radius: 2px; padding: 6px 0;
    font-size: 10px; letter-spacing: 0.12em; cursor: pointer;
    font-family: 'Segoe UI', sans-serif; transition: all 0.12s;
}
#front-page-btn:hover { color: var(--text-dim); border-color: var(--border2); }

/* the front page is dark, so the ink needle cursor vanishes there - swap in the light needle */
#frontpage, #frontpage canvas { cursor: url(assets/cursors/needle-light.png?v=1) 3 3, default !important; }
#frontpage button { cursor: url(assets/cursors/needle-light.png?v=1) 3 3, pointer !important; }

/* Vortex lock: while a vortex feeds, stardust cannot be spent - every card reads blocked */
.vortex-lock .upgrade-card { opacity: 0.45; filter: grayscale(0.55); pointer-events: none; }
.vortex-lock .upgrade-card.can-afford { border-color: var(--border); }

/* Falling Star Wish overlay - above the comet layer; clickable only while the picker is up */
#wish-layer { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 65; pointer-events: none; cursor: var(--cursor); }

/* Small-window hint: shown while the window is too cramped (main.js updateSizeHint) */
#size-hint {
    display: none; position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 95;
    background: #fffdf8; border: 1px solid var(--accretion-dim); border-radius: 6px;
    padding: 8px 18px; font-family: 'Nunito','Segoe UI',sans-serif; font-size: 12.5px; color: #33506a;
    box-shadow: 0 4px 14px rgba(40,50,70,0.18); pointer-events: none; white-space: nowrap;
}
#size-hint.show { display: block; }
