:root {
  --bg: #0b0c0e; --surface: #111215; --raise: #17181c; --line: rgba(255, 255, 255, .08); --line2: rgba(255, 255, 255, .14);
  --text: #ecebe6; --muted: #8d8c86; --faint: #5d5c58; --gold: #d9a94c; --red: #e5484d; --green: #4cc38a;
  --sans: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 14px/1.4 var(--sans);
  -webkit-font-smoothing: antialiased; overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ov { pointer-events: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
.hidden { display: none !important; }
#soundBtn .snd-off, body.muted #soundBtn .snd-on { display: none; } body.muted #soundBtn .snd-off { display: block; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.k, .eyebrow { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

/* ---------- top bar ---------- */
#top { position: fixed; top: calc(10px + var(--st)); left: 12px; right: 12px; display: flex; align-items: flex-start; justify-content: space-between; pointer-events: none; }
#top > * { pointer-events: auto; }
.mark { font-weight: 700; font-size: 15px; letter-spacing: .28em; display: flex; align-items: center; gap: 10px; padding-top: 9px; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.mark.big { font-size: 28px; padding: 0; }
.tag { font-size: 9.5px; letter-spacing: .12em; font-weight: 600; color: var(--muted); border: 1px solid var(--line2); border-radius: 3px; padding: 2px 5px; text-shadow: none; background: rgba(11, 12, 14, .7); }
.tag.live { color: var(--red); border-color: rgba(229, 72, 77, .5); }
.tag.pre { color: #f0c66e; border-color: rgba(240, 198, 110, .5); }
.hud { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.hud-cell { display: flex; flex-direction: column; align-items: flex-end; padding: 6px 12px 7px; min-width: 88px; }
.hud-cell + .hud-cell { border-left: 1px solid var(--line); }
.hud-cell .k { font-size: 9.5px; }
.hud-cell .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 500; margin-top: 1px; }
.hud-cell:active { background: var(--raise); }
.gold { color: var(--gold); }

#dock { position: fixed; right: 12px; top: calc(66px + var(--st)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
#dock button { width: 44px; height: 44px; display: grid; place-items: center; color: #c9c8c2; }
#dock button + button { border-top: 1px solid var(--line); }
#dock button:active { background: var(--raise); }

.conn { position: fixed; top: calc(66px + var(--st)); left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid rgba(229, 72, 77, .45); color: #f0b3b5; padding: 6px 12px; border-radius: 4px; font-size: 12px; letter-spacing: .04em; }

/* ---------- toasts ---------- */
#toasts { position: fixed; left: 12px; right: 68px; top: calc(66px + var(--st)); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; pointer-events: none; }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--line2); padding: 8px 12px; border-radius: 4px; font-size: 13px; max-width: 340px; animation: fade .18s ease-out; }
.toast.err { border-left-color: var(--red); }
.toast.good { border-left-color: var(--green); }
.toast.gold { border-left-color: var(--gold); }
@keyframes fade { from { opacity: 0; transform: translateX(-10px); } }

/* ---------- command bar (inside the bottom stack) ---------- */
.bar-ctx { display: flex; align-items: center; gap: 8px; height: 30px; font-size: 13px; white-space: nowrap; overflow: hidden; }
.bar-ctx .sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.bar-ctx .t { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.bar-ctx .m { color: var(--muted); font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.bar-ctx .hint[data-do] { cursor: pointer; pointer-events: auto; }
.bar-ctx .hint { margin-left: auto; flex: none; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--text); border: 1px solid var(--line2); border-radius: 3px; padding: 3px 6px; animation: breathe 2.4s ease-in-out infinite; }
.bar-ctx .dim { color: var(--muted); }
@keyframes breathe { 50% { border-color: rgba(255, 255, 255, .4); } }
.bar-ctl { display: flex; align-items: center; gap: 14px; }
.bar-val { display: flex; flex-direction: column; min-width: 58px; }
.bar-val.r { align-items: flex-end; min-width: 78px; }
.bar-val .k { font-size: 9.5px; }
.bar-val b { font-size: 16px; font-weight: 500; }
#bar input[type=range] { flex: 1; height: 44px; margin: 0; }

/* balance change ticks under the HUD */
.hud-cell { position: relative; }
.tick { position: absolute; right: 12px; top: 100%; font: 600 12px var(--mono); pointer-events: none; animation: tickup 1.4s ease-out forwards; }
.tick.up { color: var(--green); } .tick.down { color: var(--muted); }
@keyframes tickup { 0% { opacity: 0; transform: translateY(-6px); } 15% { opacity: 1; transform: translateY(4px); } 100% { opacity: 0; transform: translateY(18px); } }
.update { pointer-events: auto; cursor: pointer; border-left-color: var(--gold) !important; }

/* ---------- shared bits ---------- */
@keyframes rise { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; flex: none; }
.icon-btn svg { width: 14px; height: 14px; }
.lede { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.facts { display: flex; margin: 14px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts > div { flex: 1; padding: 9px 0; min-width: 0; }
.facts > div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.facts dt { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.amount { margin-top: 16px; }
.amount .top { display: flex; justify-content: space-between; align-items: baseline; }
.amount .big { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 500; letter-spacing: -.02em; margin-top: 2px; }
.amount .est { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 40px; background: transparent; margin: 4px 0 2px; touch-action: none; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--text) var(--p, 0%), rgba(255, 255, 255, .12) var(--p, 0%)); }
input[type=range]::-moz-range-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--text) var(--p, 0%), rgba(255, 255, 255, .12) var(--p, 0%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9.5px; border-radius: 50%; background: var(--text); border: 0; box-shadow: 0 0 0 6px rgba(236, 235, 230, .08); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--text); border: 0; }
.note { font-size: 12px; color: var(--muted); margin-top: 10px; }
input[type=text] { width: 100%; height: 44px; border-radius: 4px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); padding: 0 12px; font: inherit; font-size: 16px; -webkit-user-select: text; user-select: text; outline: none; }
input[type=text]:focus { border-color: rgba(255, 255, 255, .35); }
.field { margin-top: 14px; }
.field .k { display: block; margin-bottom: 6px; }

.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--bg); color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; transition: opacity .35s; z-index: 10; }
.boot.done { opacity: 0; pointer-events: none; }

/* customize */
#dock button.hi { color: #17120a; background: var(--gold); }
#dock button.hi:active { background: #c99a3f; }
.swatches { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin-top: 8px; }
.swatches button { aspect-ratio: 1; border-radius: 4px; border: 2px solid transparent; }
.swatches button.on { border-color: var(--text); }
.imgprev { width: 100%; aspect-ratio: 1; max-height: 220px; border-radius: 6px; border: 1px solid var(--line2); background: var(--bg) center / cover no-repeat; margin-top: 8px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.cost { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.burn { color: var(--red); font-size: 11.5px; margin-top: 8px; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- bottom stack: territory panel + commit bar ---------- */
#bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; background: var(--surface); border-top: 1px solid var(--line2);
  box-shadow: 0 -16px 40px rgba(0, 0, 0, .45); max-height: 62vh; }
/* centred: phones get a near-full-width card; desktops one long horizontal bar with the commit
   controls integrated on its last row */
@media (max-width: 759px) { #bottom { left: 8px; right: 8px; bottom: calc(8px + var(--sb) * .5); border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; }
  #bar { padding-bottom: calc(8px + var(--sb) * .5); } }
@media (min-width: 760px) {
  #bottom { left: 50%; right: auto; bottom: 14px; transform: translateX(-50%); width: min(1060px, calc(100vw - 132px)); max-height: 46vh; border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; }
  #panel { display: flex; flex-wrap: wrap; align-items: center; column-gap: 18px; row-gap: 10px; padding: 12px 16px; }
  #panel > * { margin-top: 0 !important; }
  #panel > .ph { flex: 0 0 210px; min-width: 0; }
  #panel > .facts { flex: 1 1 300px; margin: 0; border-top: 0; border-bottom: 0; border-left: 1px solid var(--line); padding-left: 14px; }
  #panel > .tiles { flex: 1 1 340px; }
  #panel > .tiles.five { flex: 1.4 1 440px; }
  #panel > .tiles.one { flex: 0 1 300px; }
  #panel > .lede, #panel > .note { flex: 1 1 280px; margin: 0; }
  #panel > .active, #panel > .amount, #panel > .list, #panel > .hint-line, #panel > .field { flex: 1 1 100%; }
  #bar { display: flex; align-items: center; gap: 18px; padding: 6px 16px 8px; }
  #bar .bar-ctx { flex: 1; min-width: 0; }
  #bar .bar-ctl { flex: 0 0 min(460px, 46%); }
}
#panel { padding: 14px 16px 10px; overflow-y: auto; touch-action: pan-y; }
#panel.pop { animation: rise .22s cubic-bezier(.2,.9,.25,1); }
#bar { padding: 8px 16px calc(10px + var(--sb)); border-top: 1px solid var(--line); background: #0e0f12; }
.ph { display: flex; align-items: center; gap: 10px; }
.ph .sw { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.ph .pt { flex: 1; min-width: 0; }
.ph .title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lede { line-height: 1.45; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-top: 12px; }
.tiles.one { grid-template-columns: 1fr; }
.tiles.five { grid-template-columns: repeat(5, 1fr); gap: 6px; }
@media (max-width: 420px) { .tiles.five .tile .tl { font-size: 12px; } .tiles.five .tile { min-height: 58px; padding: 8px 2px; } }
.tile { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left;
  min-height: 54px; padding: 9px 11px; border-radius: 7px; background: linear-gradient(180deg, #1d1f24, #16171b); border: 1px solid var(--line2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 2px 0 rgba(0, 0, 0, .35); color: var(--text); cursor: pointer; overflow: hidden; }
.tile svg { grid-row: 1 / span 2; width: 18px; height: 18px; color: #c9c8c2; }
.tile .tl { font-weight: 600; font-size: 13.5px; line-height: 1.15; }
.tile .ts { font-family: var(--mono); font-size: 10.5px; color: var(--muted); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiles.five .tile { grid-template-columns: 1fr; grid-template-rows: auto auto auto; justify-items: center; text-align: center; padding: 9px 4px; row-gap: 3px; }
.tiles.five .tile svg { grid-row: auto; }
.tile:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.tiles.one .tile:not(:disabled) { background: linear-gradient(180deg, #f2f1ec, #dcdbd5); color: #0b0c0e; border-color: transparent; }
.tiles.one .tile:not(:disabled) svg, .tiles.one .tile:not(:disabled) .ts { color: #45443f; }
.tile:disabled { opacity: .38; cursor: default; }
.tile.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.active { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.chip-row { display: flex; align-items: center; gap: 8px; height: 34px; padding-left: 10px; border: 1px solid var(--line); border-radius: 5px; font-size: 12.5px; }
.chip-row .sw { width: 8px; height: 8px; border-radius: 2px; }
.chip-row .num { color: var(--muted); margin-left: auto; }
.chip-row button { height: 100%; padding: 0 10px; border-left: 1px solid var(--line); color: var(--muted); display: grid; place-items: center; }
.chip-row button svg { width: 13px; height: 13px; }
.chip-row.gold { border-color: rgba(217, 169, 76, .45); color: #f0d79f; }
.chip-row.gold button { margin-left: auto; }
.hint-line { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 10px; padding: 9px 11px; border-radius: 6px; border: 1px solid rgba(143, 230, 255, .35);
  background: rgba(143, 230, 255, .07); color: #cdeff8; font-size: 13px; text-align: left; }
.hint-line svg { width: 16px; height: 16px; flex: none; }
.hint-line b { margin-left: auto; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.list { display: flex; flex-direction: column; margin-top: 10px; border-top: 1px solid var(--line); }
.li { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13.5px; }
.li svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.li .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .num { color: var(--muted); font-size: 12px; }
.li .rank { width: 20px; color: var(--faint); font-family: var(--mono); font-size: 12px; }
.li .sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.li.me .n { font-weight: 600; }
.mini { height: 30px; padding: 0 10px; border-radius: 4px; border: 1px solid var(--line2); font-size: 12px; color: var(--text); flex: none; }
.kv { display: flex; justify-content: space-between; align-items: baseline; height: 40px; border-bottom: 1px solid var(--line); }
.kv span { color: var(--muted); font-size: 13px; }
.rules { margin: 10px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rules li { padding: 10px 0; border-bottom: 1px solid var(--line); color: #bdbcb6; font-size: 13px; }
.rules b { color: var(--text); font-weight: 600; display: block; margin-bottom: 2px; }

/* ---------- side panel: slides in from the right, never covers the whole map ---------- */
#side { position: fixed; top: calc(60px + var(--st)); right: 66px; bottom: 16px; width: min(360px, calc(78vw - 60px)); background: rgba(17, 18, 21, .97);
  border: 1px solid var(--line2); border-radius: 10px; padding: 14px 14px 16px; overflow-y: auto; touch-action: pan-y; box-shadow: -12px 0 40px rgba(0, 0, 0, .45);
  transform: translateX(calc(100% + 80px)); transition: transform .28s cubic-bezier(.2,.9,.25,1); z-index: 5; }
#side.open { transform: none; }
@media (max-width: 759px) { #side { bottom: auto; max-height: calc(100vh - 60px - var(--st) - 210px); } }
#dock button.on, .hud-cell.on { background: var(--raise); color: var(--text); }
#dock button.hi.on { background: #c99a3f; }

/* ---------- radial wheel ---------- */
#wheel { position: fixed; width: 0; height: 0; z-index: 8; }
#wheel svg.ring { position: absolute; left: -104px; top: -104px; width: 208px; height: 208px; overflow: visible; filter: drop-shadow(0 10px 22px rgba(0,0,0,.55));
  animation: whOpen .32s cubic-bezier(.18,1.25,.4,1) both; }
@keyframes whOpen { from { transform: scale(.35) rotate(-28deg); opacity: 0; } }
#wheel.closing svg.ring { animation: whClose .16s ease-in both; }
@keyframes whClose { to { transform: scale(.7); opacity: 0; } }
.ws { cursor: pointer; transition: transform .14s cubic-bezier(.2,.9,.25,1); transform-origin: 104px 104px; }
.ws path.bg { fill: rgba(22, 24, 28, .94); stroke: rgba(255,255,255,.09); stroke-width: 1; transition: fill .14s; }
.ws .ic { fill: none; stroke: #dcdbd5; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: stroke .14s; }
.ws text { fill: #b9b8b2; font: 600 10px -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: .08em; text-anchor: middle; text-transform: uppercase; transition: fill .14s; }
.ws.on { transform: scale(1.06); }
.ws.on path.bg { fill: rgba(40, 43, 50, .98); }
.ws.on .ic, .ws.on text { stroke-opacity: 1; fill-opacity: 1; }
.ws[data-w=ally].on path.bg { fill: rgba(40, 110, 76, .96); } .ws[data-w=unally].on path.bg { fill: rgba(140, 42, 46, .96); } .ws[data-w=emoji].on path.bg { fill: rgba(150, 112, 40, .96); }
.ws.on text { fill: #fff; } .ws.on .ic { stroke: #fff; }
.ws.off { opacity: .32; pointer-events: none; }
.ws .ic, .ws text { animation: whIc .34s cubic-bezier(.2,.9,.25,1) both; }
.ws:nth-of-type(2) .ic, .ws:nth-of-type(2) text { animation-delay: .04s; } .ws:nth-of-type(3) .ic, .ws:nth-of-type(3) text { animation-delay: .08s; } .ws:nth-of-type(4) .ic, .ws:nth-of-type(4) text { animation-delay: .12s; }
@keyframes whIc { from { opacity: 0; } }
.wh-hub { pointer-events: none; }
.wh-hub circle.h { fill: rgba(12, 13, 16, .96); stroke: rgba(255,255,255,.12); }
.wh-name { position: absolute; left: 0; top: -124px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(11, 12, 14, .92); border: 1px solid var(--line2); border-radius: 99px; padding: 4px 10px; pointer-events: none; animation: fade .2s ease-out both; }
#emojiGrid { position: fixed; z-index: 9; display: grid; grid-template-columns: repeat(8, 44px); animation: gridIn .22s cubic-bezier(.2,.9,.25,1) both; transform-origin: 50% 100%; gap: 2px; padding: 8px; background: rgba(17, 18, 21, .97);
  border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: calc(100vw - 16px); }
#emojiGrid button { width: 44px; height: 44px; border-radius: 8px; background-image: url(/emoji.webp); background-repeat: no-repeat; transition: transform .12s, background-color .12s; }
#emojiGrid button:hover { transform: scale(1.18); }
@keyframes gridIn { from { transform: translateY(10px) scale(.92); opacity: 0; } }
#emojiGrid button:hover, #emojiGrid button:active { background-color: rgba(255,255,255,.08); }

/* ---------- alliance prompt ---------- */
#prompt { position: fixed; left: 50%; top: calc(66px + var(--st)); transform: translateX(-50%); z-index: 9; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
  background: var(--surface); border: 1px solid rgba(76, 195, 138, .5); border-radius: 8px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: calc(100vw - 24px); }
#prompt button { height: 34px; padding: 0 12px; border-radius: 5px; border: 1px solid var(--line2); font-weight: 600; font-size: 12.5px; }
#prompt button.yes { background: var(--text); color: #0b0c0e; border-color: transparent; }

/* ---------- event feed ---------- */
#feed { position: fixed; right: 12px; bottom: calc(var(--bottomH, 0px) + 26px); width: 280px; z-index: 4; display: flex; flex-direction: column-reverse; gap: 4px; pointer-events: none; }
#feedTick { display: none; }
#feedList { display: flex; flex-direction: column; gap: 4px; }
.fi { pointer-events: auto; display: block; width: 100%; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 5px 10px; border-radius: 6px; background: rgba(17, 18, 21, .9); border: 1px solid var(--line);
  font-size: 12px; color: #d8d7d1; text-align: left; transition: opacity .6s; animation: fade .2s ease-out; }
.fi .sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.fi .em { display: inline-block; vertical-align: middle; margin: -2px 6px 0 0; width: 22px; height: 22px; background-image: url(/emoji.webp); background-repeat: no-repeat; }
.fi b { font-weight: 600; color: var(--text); }
@media (max-width: 759px) {
  #feed { left: 12px; right: auto; width: auto; bottom: auto; top: calc(66px + var(--st)); flex-direction: column; align-items: flex-start; }
  #toasts { top: calc(104px + var(--st)); }
  body.feed-open #toasts { display: none; }
  #feedTick { display: block; line-height: 30px; pointer-events: auto; max-width: calc(100vw - 92px); height: 30px; padding: 0 10px; border-radius: 99px; background: rgba(17, 18, 21, .9);
    border: 1px solid var(--line); font-size: 11.5px; color: #d8d7d1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  #feed.collapsed #feedList { display: none; }
  #feedList { margin-top: 4px; width: min(300px, calc(100vw - 92px)); }
  #feedTick .em { display: inline-block; vertical-align: middle; margin: -2px 6px 0 0; width: 22px; height: 22px; background-image: url(/emoji.webp); background-repeat: no-repeat; }
}

/* ---------- incoming attack rows ---------- */
.chip-row.alert { border-color: rgba(229, 72, 77, .6); background: rgba(229, 72, 77, .08); color: #f6c9cb; animation: alertPulse 1.4s ease-in-out infinite; }
.chip-row.alert button { color: var(--text); font-weight: 600; }
@keyframes alertPulse { 50% { border-color: rgba(229, 72, 77, .95); } }
.chip-row .red { color: #ff7a7e; }
.chip-row button.defend { width: auto; padding: 0 10px; background: #e5484d; color: #fff; border-radius: 7px; font-weight: 650; font-size: 12px; white-space: nowrap; }
.chip-row button.defend:disabled { opacity: .45; }
.li .num.dim { color: var(--muted); min-width: 52px; }
.ally-tag { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #4cc38a; border: 1px solid rgba(76,195,138,.45); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.ally-sub { font-size: 10.5px; color: var(--muted); margin-left: 4px; }
.tile[data-do=placeConfirm]:not(:disabled) { background: linear-gradient(180deg, #6fe39a, #3fae6c); color: #07140c; border-color: transparent; }
.tile[data-do=placeConfirm]:not(:disabled) svg, .tile[data-do=placeConfirm]:not(:disabled) .ts { color: #0f3a22; }
.node-li { height: auto !important; padding-top: 7px; padding-bottom: 7px; align-items: center; }
.node-li .n small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- trips: convoys and troop crossings under way (above the control bar) ---------- */
#trips { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #0d0e11; }
.trip { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; height: 34px; font-size: 12.5px; }
.trip .what { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.trip .what svg { width: 15px; height: 15px; color: #8fe6ff; }
.trip .bar { position: relative; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; min-width: 60px; cursor: pointer; }
.trip .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #4fb7d6, #8fe6ff); transition: width .25s linear; }
.trip.back .bar i { background: linear-gradient(90deg, #8d8c86, #c9c8c2); }
.trip .eta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); min-width: 64px; text-align: right; }
.trip button.tb { height: 28px; padding: 0 12px; border-radius: 6px; background: #e5484d; color: #fff; font-weight: 650; font-size: 12px; white-space: nowrap; }
.trip button.tb:disabled { background: rgba(255,255,255,.08); color: var(--muted); }
.trip.front .bar i { background: linear-gradient(90deg, #3fae6c, #6fe39a); }
.trip.front .tb { background: rgba(255,255,255,.1); color: var(--text); border: 1px solid var(--line2); }
.trip.front .eta { min-width: 120px; }

/* =====================================================================
   Polish pass: top-left board, physical keys, preloader, effects,
   onboarding, leaderboard, rules
   ===================================================================== */

/* ---------- top-left: logo, CA, X, faint board stats ---------- */
#tl { display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
.tl-row { display: flex; align-items: center; gap: 6px; }
.tl-row .mark { padding-top: 0; margin-right: 4px; }
.chipbtn { height: 26px; min-width: 26px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 7px; color: #c9c8c2; text-decoration: none;
  background: linear-gradient(180deg, rgba(36,38,44,.92), rgba(20,21,25,.92)); border: 1px solid var(--line2); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 2px 0 rgba(0,0,0,.45);
  font: 700 10px/1 var(--sans); letter-spacing: .1em; transition: transform .08s, box-shadow .08s, color .2s; }
.chipbtn svg { width: 13px; height: 13px; }
.chipbtn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 0 rgba(0,0,0,.45); }
.chipbtn:hover { color: #fff; }
.chipbtn.done { color: var(--green); border-color: rgba(76,195,138,.5); }
.board { opacity: .78; pointer-events: none; text-shadow: 0 1px 10px rgba(0,0,0,.9); }
.board .k { font-size: 9px; letter-spacing: .16em; color: #9a9993; }
.board .bv { font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; color: #f4f2ea; }
.board .bv small { font-size: 10px; font-weight: 600; letter-spacing: .1em; color: var(--muted); margin-left: 5px; }
.board .bs { display: flex; gap: 10px; font-size: 10.5px; color: #8d8c86; margin-top: 2px; }
.board .bs b { color: #d8d6cf; font-weight: 600; }
.board .bs span:first-child b { color: var(--gold); }
@media (max-width: 759px) { .board .bv { font-size: 18px; } .board .bs { font-size: 9.5px; gap: 8px; } }
#toasts { top: calc(124px + var(--st)); }
@media (max-width: 759px) { #feed { top: calc(112px + var(--st)); } #toasts { top: calc(150px + var(--st)); } }

/* ---------- physical keys (all panel buttons) ---------- */
.tile { --c: #c9c8c2; background: linear-gradient(180deg, #262930 0%, #1b1d22 55%, #17181c 100%); border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.11), inset 0 -2px 0 rgba(0,0,0,.25), 0 4px 0 #08090b, 0 6px 14px rgba(0,0,0,.45);
  transition: transform .07s ease-out, box-shadow .07s ease-out, filter .15s; margin-bottom: 4px; }
.tile:hover:not(:disabled) { filter: brightness(1.12); }
.tile:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 -1px 0 rgba(0,0,0,.25), 0 1px 0 #08090b, 0 2px 6px rgba(0,0,0,.4); }
.tile svg { color: var(--c); }
.tiles.keys .tile { padding: 10px 4px 9px; }
.tiles.keys .tile svg { width: 30px; height: 30px; padding: 6px; border-radius: 9px; stroke-width: 1.8; color: var(--c);
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 8%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent), 0 0 14px color-mix(in srgb, var(--c) 22%, transparent); }
.tiles.keys .tile::before { content: ''; position: absolute; left: 10%; right: 10%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c) 70%, transparent), transparent); }
.tiles.keys .tile[data-k]::after { content: attr(data-k); position: absolute; top: 5px; right: 6px; font: 600 9px/1 var(--mono); color: #6f6e69; border: 1px solid rgba(255,255,255,.1); border-radius: 3px; padding: 2px 3px; }
@media (hover: none) { .tiles.keys .tile[data-k]::after { display: none; } }
.tiles.one .tile:not(:disabled) { background: linear-gradient(180deg, #fbfaf5, #e2e0d8 60%, #d3d1c8); box-shadow: inset 0 1px 0 #fff, 0 4px 0 #8f8d86, 0 7px 16px rgba(0,0,0,.45); }
.tiles.one .tile:active:not(:disabled) { box-shadow: inset 0 1px 0 #fff, 0 1px 0 #8f8d86, 0 2px 6px rgba(0,0,0,.4); }
.tile[data-do=placeConfirm]:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 0 #1f6b40, 0 7px 16px rgba(0,0,0,.45); }

/* ---------- preloader ---------- */
.boot { gap: 16px; background: radial-gradient(ellipse at 50% 40%, #15171c 0%, #0b0c0e 70%); }
.boot .mark.big { font-size: 34px; letter-spacing: .5em; padding-left: .5em; }
.boot .mark.big span { display: inline-block; animation: bootIn .7s cubic-bezier(.2,.9,.25,1.3) both; }
.boot .mark.big span:nth-child(2) { animation-delay: .1s; } .boot .mark.big span:nth-child(3) { animation-delay: .2s; }
@keyframes bootIn { from { opacity: 0; transform: translateY(14px) scale(.8); filter: blur(4px); } }
.boot-globe { position: relative; width: 92px; height: 92px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #23262d, #0d0e11 70%); box-shadow: 0 0 60px rgba(217,169,76,.12), inset -10px -12px 24px rgba(0,0,0,.6); }
.boot-globe i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(217,169,76,.28); transform: scaleX(.35); animation: spin 3.2s linear infinite; }
.boot-globe i:nth-child(2) { animation-delay: -1.06s; } .boot-globe i:nth-child(3) { animation-delay: -2.13s; }
.boot-globe b { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(217,169,76,.3); }
@keyframes spin { 0% { transform: scaleX(1); opacity: .1; } 50% { transform: scaleX(.02); opacity: .7; } 100% { transform: scaleX(-1); opacity: .1; } }
.boot-bar { width: min(240px, 60vw); height: 3px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 4%; border-radius: 2px; background: linear-gradient(90deg, #a8813a, #f0c66e); box-shadow: 0 0 10px rgba(240,198,110,.6); transition: width .25s ease-out; }
#bootMsg { font-size: 10.5px; letter-spacing: .18em; }
.boot-tip { min-height: 18px; font-size: 12px; letter-spacing: 0; text-transform: none; color: #77766f; opacity: 0; }
.boot-tip.in { animation: tipIn .5s ease-out forwards; }
@keyframes tipIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.boot.done { opacity: 0; transform: scale(1.04); transition: opacity .6s, transform .6s; }

/* ---------- effects: elimination / kill banners ---------- */
.fx-banner { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; pointer-events: none; }
.fx-banner .fb-in { text-align: center; animation: fbIn .55s cubic-bezier(.2,.9,.25,1.2) both; }
.fx-banner .fb-k { font: 800 11px var(--sans); letter-spacing: .4em; text-transform: uppercase; }
.fx-banner .fb-t { font: 800 clamp(26px, 6vw, 46px)/1.1 var(--sans); letter-spacing: -.01em; margin-top: 8px; text-shadow: 0 4px 30px rgba(0,0,0,.9); }
.fx-banner .fb-s { font-size: 15px; color: #d8d6cf; margin-top: 6px; }
.fx-banner.dead { background: radial-gradient(ellipse at center, rgba(80,8,10,.25) 0%, rgba(40,2,4,.82) 100%); pointer-events: auto; animation: deadBg .6s ease-out both; }
.fx-banner.dead .fb-k { color: #ff7a7e; }
.fx-banner.kill .fb-k { color: var(--gold); }
.fx-banner.kill .fb-in { background: rgba(11,12,14,.78); border: 1px solid rgba(217,169,76,.45); border-radius: 14px; padding: 16px 26px; box-shadow: 0 0 60px rgba(217,169,76,.25); }
.fx-banner.kill .fb-t { font-size: clamp(18px, 4vw, 28px); }
.fb-btn { margin-top: 22px; height: 48px; padding: 0 26px; border-radius: 10px; font-weight: 700; font-size: 15px; color: #0b0c0e;
  background: linear-gradient(180deg, #fbfaf5, #d3d1c8); box-shadow: inset 0 1px 0 #fff, 0 4px 0 #8f8d86, 0 8px 24px rgba(0,0,0,.5); }
.fb-btn:active { transform: translateY(3px); box-shadow: inset 0 1px 0 #fff, 0 1px 0 #8f8d86; }
@keyframes fbIn { from { opacity: 0; transform: scale(.7); filter: blur(6px); } }
@keyframes deadBg { from { opacity: 0; } }
body.shake canvas { animation: shake .55s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake { 10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(4px, -2px); } 30%, 50%, 70% { transform: translate(-6px, 3px); } 40%, 60% { transform: translate(6px, -3px); } }

/* ---------- onboarding ---------- */
.gift { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(217,169,76,.45);
  background: linear-gradient(100deg, rgba(217,169,76,.16), rgba(217,169,76,.04)); }
.gift svg { width: 30px; height: 30px; color: #f0c66e; flex: none; animation: giftBob 2.2s ease-in-out infinite; }
.gift b { display: block; color: #f6dca0; font-size: 14px; }
.gift span { font-size: 11.5px; color: #bda97a; }
@keyframes giftBob { 50% { transform: translateY(-2px) rotate(-4deg); } }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; padding: 0; }
.steps li { position: relative; padding: 10px 10px 9px; border-radius: 10px; background: #15161a; border: 1px solid var(--line); }
.steps li i { font: 700 11px/20px var(--mono); font-style: normal; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--text); color: #0b0c0e; }
.steps li:first-child { border-color: rgba(255,255,255,.3); animation: breathe 2.4s ease-in-out infinite; }
.steps li b { display: block; margin-top: 6px; font-size: 13px; }
.steps li span { font-size: 11px; color: var(--muted); }
@media (min-width: 760px) { #panel > .gift, #panel > .steps { flex: 1 1 380px; } }

/* ---------- leaderboard ---------- */
.lb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.lb-stats > div { padding: 8px 10px; border-radius: 8px; background: #15161a; border: 1px solid var(--line); }
.lb-stats .k { display: block; font-size: 9px; }
.lb-stats b { font-size: 15px; font-weight: 600; }
.seg { display: flex; margin-top: 12px; padding: 3px; border-radius: 9px; background: #0d0e11; border: 1px solid var(--line); }
.seg button { flex: 1; height: 30px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.seg button.on { color: var(--text); background: linear-gradient(180deg, #2a2d34, #1d1f24); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 0 rgba(0,0,0,.4); }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 6px; margin-top: 16px; }
.pod { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 0; min-width: 0; animation: rise .4s cubic-bezier(.2,.9,.25,1) both; }
.pod.p1 { animation-delay: .08s; } .pod.p3 { animation-delay: .14s; }
.pod .av { width: 40px; height: 40px; font-size: 17px; }
.pod.p1 .av { width: 52px; height: 52px; font-size: 22px; box-shadow: 0 0 0 2px #f0c66e, 0 0 24px rgba(240,198,110,.45); }
.pod .medal { position: absolute; top: 0; left: 50%; transform: translate(-50%, -40%); z-index: 1; width: 20px; height: 20px; border-radius: 50%; font: 800 11px/20px var(--mono); color: #0b0c0e; text-align: center;
  background: linear-gradient(180deg, #f8dc96, #c99a3f); box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.pod.p2 .medal { background: linear-gradient(180deg, #eceae4, #9c9a93); } .pod.p3 .medal { background: linear-gradient(180deg, #e6b48a, #9a6438); }
.pod.p1 .medal { top: -4px; }
.pod .pn { max-width: 100%; font-weight: 700; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .pv { font-size: 12px; color: #e8c372; }
.pod .pnode { font-size: 10px; color: var(--gold); }
.pod .plinth { display: block; width: 100%; margin-top: 6px; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, #23262d, #15161a); border: 1px solid var(--line); border-bottom: 0; height: 26px; }
.pod.p1 .plinth { height: 46px; background: linear-gradient(180deg, rgba(240,198,110,.28), #15161a); border-color: rgba(240,198,110,.35); }
.pod.p2 .plinth { height: 34px; }
.pod.me .pn { color: #fff; text-decoration: underline; text-decoration-color: var(--gold); }
.av { --c: #888; display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px; font: 800 12px var(--sans); color: #0b0c0e;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 100%, #fff 25%), var(--c)); box-shadow: inset 0 -2px 0 rgba(0,0,0,.25), 0 2px 8px color-mix(in srgb, var(--c) 35%, transparent); }
.lrs { display: flex; flex-direction: column; gap: 4px; margin-top: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.lr { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 42px; padding: 0 8px; border-radius: 8px; text-align: left; font-size: 13px; background: #131418; border: 1px solid transparent; }
.lr:hover { border-color: var(--line2); }
.lr.me { border-color: rgba(217,169,76,.5); background: rgba(217,169,76,.07); }
.lr .rank { width: 20px; color: var(--faint); font-family: var(--mono); font-size: 12px; text-align: right; }
.lr .n { position: relative; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-bottom: 6px; }
.lr .lb { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 2px; background: var(--c); opacity: .7; transition: width .5s ease-out; }
.lr .num { color: #d8d6cf; font-size: 12px; }
.lr .nd { color: var(--gold); font-size: 11px; }
.mv { font: 700 10px var(--mono); margin-left: 5px; } .mv.up { color: var(--green); } .mv.dn { color: #ff7a7e; }
.lr-sep { text-align: center; color: var(--faint); line-height: 14px; }

/* ---------- rules as cards ---------- */
.rflow { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #bdbcb6; flex-wrap: wrap; }
.rflow span { padding: 5px 8px; border-radius: 6px; background: #15161a; border: 1px solid var(--line); }
.rflow span.g { color: #0b0c0e; background: var(--gold); border-color: transparent; }
.rflow i { width: 10px; height: 1px; background: var(--line2); }
.rcards { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.rc { --c: #ccc; border-radius: 10px; background: #131418; border: 1px solid var(--line); overflow: hidden; }
.rc[open] { border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.rc summary { list-style: none; display: flex; align-items: center; gap: 11px; padding: 10px 11px; cursor: pointer; }
.rc summary::-webkit-details-marker { display: none; }
.rc .ri { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent); }
.rc .ri svg { width: 19px; height: 19px; }
.rc .rt b { display: block; font-size: 13.5px; }
.rc .rt span { display: block; font-size: 12px; color: #a7a6a0; line-height: 1.35; }
.rchips { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 11px 10px 56px; }
.rchips span { font: 600 10.5px var(--mono); padding: 3px 7px; border-radius: 5px; color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); }
.rc p { margin: 0; padding: 0 11px 11px 56px; font-size: 12px; color: #9a9993; line-height: 1.45; }
.gift span b { display: inline; color: #f6dca0; font-size: inherit; }
@media (max-width: 759px) {
  #top { gap: 8px; }
  #tl { min-width: 0; flex: 1 1 auto; }
  .tl-row { gap: 5px; }
  .tl-row .mark { font-size: 13px; letter-spacing: .2em; gap: 6px; margin-right: 0; }
  .chipbtn { height: 24px; min-width: 24px; padding: 0 6px; }
  .hud { flex: none; }
  .hud-cell { min-width: 0; padding: 5px 9px 6px; }
  .hud-cell .v { font-size: 14px; }
  .lb-stats .k { font-size: 8.5px; letter-spacing: .06em; }
  .lb-stats b { font-size: 13px; }
}
@media (max-width: 459px) {
  #modeBadge { display: none; }
  .board .k::after { content: ' · demo'; color: #6f6e69; }
  body.pre .board .k::after { content: ' · pre-launch'; color: #f0c66e; }
  body[data-mode=live] .board .k::after { content: ' · live'; color: #ff7a7e; }
}

/* ---------- hero: the first screen ---------- */
.hero { position: fixed; inset: 0; z-index: 12; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 45%, rgba(11,12,14,.35) 0%, rgba(11,12,14,.86) 75%); animation: fade .4s ease-out; }
body.hero-on #bottom, body.hero-on #feed, body.hero-on #dock { opacity: 0; pointer-events: none; }
.hero-card { width: min(440px, 100%); text-align: center; padding: 26px 22px 18px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(28,24,15,.96), rgba(14,15,18,.97)); border: 1px solid rgba(240,198,110,.4);
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 80px rgba(0,0,0,.7), 0 0 90px rgba(217,169,76,.18); animation: heroIn .55s cubic-bezier(.2,.9,.25,1.15) both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(24px) scale(.94); } }
.hero-k { font: 800 10.5px var(--sans); letter-spacing: .32em; text-transform: uppercase; color: #f0c66e; }
.hero-big { margin-top: 10px; line-height: 1; }
.hero-big b { display: block; font-size: clamp(52px, 15vw, 76px); font-weight: 800; letter-spacing: -.04em; color: #fff;
  background: linear-gradient(180deg, #fff6dc 0%, #f0c66e 60%, #b8862f 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 24px rgba(240,198,110,.35)); }
.hero-big span { display: block; margin-top: 6px; font: 800 15px var(--sans); letter-spacing: .28em; text-transform: uppercase; color: #ecebe6; }
.hero-goal { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; font-size: 15px; color: #d8d6cf; }
.hero-goal i { display: inline-grid; color: #f0c66e; } .hero-goal i svg { width: 18px; height: 18px; }
.hero-goal b { color: #fff; }
.hero-goal small { flex-basis: 100%; font-size: 11.5px; color: #8d8c86; }
.hero-cta { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 62px; margin-top: 20px; border-radius: 14px;
  font: 800 19px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: #1a1206;
  background: linear-gradient(180deg, #ffe39c 0%, #f0c66e 45%, #d29a35 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -3px 0 rgba(120,70,10,.35), 0 6px 0 #7a5218, 0 12px 30px rgba(217,169,76,.4); transition: transform .08s, box-shadow .08s; overflow: hidden; }
.hero-cta span { transition: transform .2s; }
.hero-cta:hover span { transform: translateX(4px); }
.hero-cta:active { transform: translateY(5px); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 1px 0 #7a5218, 0 4px 12px rgba(217,169,76,.3); }
.hero-cta::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); animation: shine 2.6s ease-in-out infinite; }
@keyframes shine { 0%, 40% { left: -60%; } 80%, 100% { left: 130%; } }
.hero-sub { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-size: 12.5px; color: #8d8c86; }
.hero-sub .hot { color: #ff8a8d; } .hero-sub .hot b { color: #fff; }
.hero-sub button { color: #a7a6a0; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- goal bar (after landing) ---------- */
body.side-open .goal { display: none; }
.goal { position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: calc(var(--bottomH, 0px) + 22px); z-index: 6; display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 24px); padding: 7px 8px 7px 10px; border-radius: 12px; background: rgba(20,17,10,.94); border: 1px solid rgba(240,198,110,.55);
  box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 0 24px rgba(240,198,110,.15); color: #ecebe6; animation: rise .35s cubic-bezier(.2,.9,.25,1) both; white-space: nowrap; }
.goal .gi { color: #f0c66e; display: grid; } .goal .gi svg { width: 20px; height: 20px; animation: giftBob 2.2s ease-in-out infinite; }
.goal .gt { display: flex; flex-direction: column; text-align: left; font-weight: 700; font-size: 13.5px; line-height: 1.1; }
.goal .gt small { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: #f0c66e; font-weight: 800; }
.goal .gs { font: 600 11.5px var(--mono); color: #e8c372; }
.goal b { padding: 7px 11px; border-radius: 8px; font-size: 12.5px; color: #1a1206; background: linear-gradient(180deg, #ffe39c, #d29a35); box-shadow: 0 2px 0 #7a5218; }
@media (max-width: 459px) { .goal .gs { display: none; } }

/* ---------- logo ---------- */
.mark .logo-m { width: 28px; height: 28px; display: block; filter: drop-shadow(0 2px 8px rgba(0,0,0,.7)); }
.mark .logo-w { height: 15px; display: block; filter: drop-shadow(0 1px 6px rgba(0,0,0,.8)); }
.tl-row .mark { gap: 7px; }
@media (max-width: 759px) { .mark .logo-m { width: 25px; height: 25px; } .mark .logo-w { height: 13px; } }
.boot-mark { width: 104px; height: 104px; animation: bootMark 2.4s ease-in-out infinite; filter: drop-shadow(0 0 40px rgba(217,169,76,.3)); }
@keyframes bootMark { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.06) rotate(90deg); } }
.boot-word { height: 34px; animation: bootIn .7s cubic-bezier(.2,.9,.25,1.3) .15s both; }

/* ---------- out of tokens ---------- */
.refill { position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; padding: 16px; background: rgba(6,7,8,.62); backdrop-filter: blur(2px); animation: fade .25s ease-out; }
.rf-card { position: relative; width: min(380px, 100%); text-align: center; padding: 24px 20px 18px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(28,24,15,.98), rgba(14,15,18,.98)); border: 1px solid rgba(240,198,110,.45);
  box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 70px rgba(217,169,76,.16); animation: heroIn .45s cubic-bezier(.2,.9,.25,1.15) both; }
.rf-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.rf-x:hover { color: var(--text); background: rgba(255,255,255,.06); }
.rf-ic { width: 54px; height: 54px; margin: 0 auto; display: grid; place-items: center; border-radius: 16px; color: #f0c66e;
  background: radial-gradient(circle at 50% 30%, rgba(240,198,110,.3), rgba(240,198,110,.06)); box-shadow: inset 0 0 0 1px rgba(240,198,110,.4); animation: giftBob 2.2s ease-in-out infinite; }
.rf-ic svg { width: 28px; height: 28px; }
.rf-k { margin-top: 12px; font: 800 10.5px var(--sans); letter-spacing: .3em; text-transform: uppercase; color: #ff8a8d; }
.rf-t { margin-top: 6px; font: 800 21px/1.2 var(--sans); color: #fff; }
.rf-p { margin: 10px 0 0; font-size: 13px; color: #a7a6a0; line-height: 1.45; }
.rf-steps { list-style: none; display: flex; justify-content: center; gap: 10px; margin: 14px 0 0; padding: 0; font-size: 12px; color: #bdbcb6; }
.rf-steps li { display: flex; align-items: center; gap: 5px; }
.rf-steps i { font: 700 10px/18px var(--mono); font-style: normal; width: 18px; height: 18px; border-radius: 50%; background: var(--text); color: #0b0c0e; }
.rf-buy { display: flex; align-items: center; justify-content: center; gap: 8px; height: 54px; margin-top: 16px; border-radius: 12px; text-decoration: none;
  font: 800 16px var(--sans); letter-spacing: .04em; color: #1a1206; background: linear-gradient(180deg, #ffe39c 0%, #f0c66e 45%, #d29a35 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 5px 0 #7a5218, 0 10px 26px rgba(217,169,76,.35); transition: transform .08s, box-shadow .08s; }
.rf-buy:active { transform: translateY(4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 1px 0 #7a5218; }
.rf-row { display: flex; gap: 8px; margin-top: 12px; }
.rf-sec { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 6px 8px; border-radius: 10px; color: var(--text);
  background: linear-gradient(180deg, #262930, #17181c); border: 1px solid rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 3px 0 #08090b; }
.rf-sec:active { transform: translateY(2px); box-shadow: 0 1px 0 #08090b; }
.rf-sec svg { width: 16px; height: 16px; color: #f0c66e; }
.rf-sec span { font-weight: 700; font-size: 13px; }
.rf-sec small { font-size: 10.5px; color: var(--muted); }
