/* holders.town game UI. A toy-diorama town: warm white rounded cards, soft layered shadows, ink navy type, gold for money. */
:root {
  --ink: #22335C; --ink-2: #4E5B7A; --ink-3: #7A8399;
  --gold: #E8B23A; --gold-2: #F6D776; --gold-ink: #8F5F0B; --gold-tint: #FCF1D2;
  --cream: #F4EBDC; --paper: #FAF6EF; --card: #FFFFFF;
  --sage: #9DB8A0; --sage-ink: #3F6B4A; --sage-tint: #E3EDE1;
  --coral: #E9785A; --coral-ink: #B0432A; --coral-tint: #FBE3DA;
  --line: rgba(34, 51, 92, .12);
  --sh-1: 0 1px 2px rgba(34, 51, 92, .08), 0 3px 10px rgba(34, 51, 92, .08);
  --sh-2: 0 2px 4px rgba(34, 51, 92, .06), 0 10px 28px rgba(34, 51, 92, .14);
  --sh-3: 0 4px 10px rgba(34, 51, 92, .08), 0 24px 60px rgba(34, 51, 92, .22);
  --r: 16px;
  --f-d: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --f-b: 'Nunito', system-ui, sans-serif;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --out: cubic-bezier(.16, 1, .3, 1);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: var(--paper); color: var(--ink); font: 600 15px/1.4 var(--f-b); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
input, textarea, #chatLog, .ca, .desc { user-select: text; -webkit-user-select: text; }
::selection { background: var(--gold-2); color: var(--ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: rgba(34, 51, 92, .22) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: rgba(34, 51, 92, .2); border-radius: 8px; } ::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; opacity: .6; }
input, textarea { font: 600 15px var(--f-b); color: var(--ink); caret-color: var(--gold-ink); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
b, strong { font-weight: 800; }
kbd { font: 800 12px var(--f-b); color: var(--ink); background: var(--card); border-radius: 6px; padding: 1px 6px; box-shadow: inset 0 -2px 0 rgba(34, 51, 92, .14), 0 0 0 1px var(--line); }
img { -webkit-user-drag: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; background: var(--card); color: var(--ink); font: 700 15px var(--f-d); text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 0 0 1.5px var(--line), inset 0 -2px 0 rgba(34, 51, 92, .08), 0 2px 6px rgba(34, 51, 92, .08); transition: transform .35s var(--spring), box-shadow .2s, background .2s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: inset 0 0 0 1.5px rgba(34, 51, 92, .2), inset 0 -2px 0 rgba(34, 51, 92, .08), 0 6px 14px rgba(34, 51, 92, .12); }
.btn:active:not(:disabled), .ib:active, .dk:active, #pot:active, .coin-row:active, .wr-item:active { transform: scale(.94); transition-duration: .08s; }
.btn.gold, .btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: inset 0 -3px 0 rgba(143, 95, 11, .28), inset 0 1px 0 rgba(255, 255, 255, .6), 0 4px 14px rgba(232, 178, 58, .35); }
.btn.gold:hover:not(:disabled), .btn.primary:hover:not(:disabled) { box-shadow: inset 0 -3px 0 rgba(143, 95, 11, .28), inset 0 1px 0 rgba(255, 255, 255, .6), 0 8px 20px rgba(232, 178, 58, .45); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.small { height: 32px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.big { height: 54px; font-size: 19px; border-radius: 16px; }
.btn.wide { width: 100%; }
.btn img { width: 24px; height: 24px; object-fit: contain; }
.x { position: relative; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); transition: transform .3s var(--spring), background .2s; }
.x::before, .x::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 2.5px; border-radius: 2px; background: var(--ink); transform: translate(-50%, -50%) rotate(45deg); }
.x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.x:hover { background: var(--cream); transform: rotate(90deg); }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-2); }
.muted { color: var(--ink-2); font-weight: 600; } .small { font-size: 12px; }
.ldot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5FA36E; box-shadow: 0 0 0 0 rgba(95, 163, 110, .5); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(95, 163, 110, 0); } 100% { box-shadow: 0 0 0 0 rgba(95, 163, 110, 0); } }

/* ---------- 3D stage + world labels ---------- */
#stage { position: fixed; inset: 0; background: var(--paper); }
#game3d { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#game3d:active { cursor: grabbing; }
#labels { position: absolute; inset: 0; pointer-events: none; }
.nametag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 6px; border-radius: 999px; background: rgba(255, 255, 255, .88); color: var(--ink); font: 800 12px var(--f-b); white-space: nowrap; box-shadow: var(--sh-1); }
.nametag::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--gold)); flex: none; }
.nametag img { width: 18px; height: 18px; margin: -3px 0; }
.bubble { position: relative; background: var(--card); color: var(--ink); border-radius: 14px; padding: 6px 11px; font: 700 13px/1.3 var(--f-b); max-width: 200px; white-space: normal; text-align: center; overflow-wrap: anywhere; box-shadow: var(--sh-2); animation: bubbleIn .35s var(--spring); }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.bubble.emo { font-size: 26px; background: none; box-shadow: none; padding: 0; }
.bubble.emo::after { display: none; }
@keyframes bubbleIn { from { transform: scale(.6) translateY(6px); opacity: 0; } }
.floater { font: 700 20px var(--f-d); color: var(--sage-ink); text-shadow: 0 1px 0 #fff, 0 0 8px rgba(255, 255, 255, .9); white-space: nowrap; }
.floater.big { font-size: 30px; color: var(--gold-ink); }
.sign { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .94); color: var(--ink); border-radius: 10px; padding: 3px 10px; font: 700 13px var(--f-d); white-space: nowrap; box-shadow: var(--sh-1); }
.sign img { width: 22px; height: 22px; object-fit: contain; }
.sign.tower { background: linear-gradient(180deg, var(--gold-2), var(--gold)); font-size: 15px; padding: 5px 12px 5px 7px; border-radius: 12px; }
.sign.exit { background: var(--sage); color: var(--ink); letter-spacing: .08em; }
.want { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--ink); font: 700 13px var(--f-d); box-shadow: var(--sh-1); animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* ---------- login ---------- */
#login { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; overflow: auto; background: var(--cream) url(/art/sky.webp) center / cover; }
.login-card { width: min(440px, 100%); padding: 28px 26px 22px; border-radius: 28px; background: rgba(255, 255, 255, .94); box-shadow: var(--sh-3); text-align: center; animation: cardIn .7s var(--out); }
@keyframes cardIn { from { transform: translateY(18px) scale(.97); opacity: 0; } }
.wordmark { margin: 0 0 10px; font: 700 40px var(--f-d); }
.wordmark img { display: block; width: min(340px, 100%); height: auto; margin: 0 auto; }
.lede { margin: 0 auto 16px; max-width: 34ch; color: var(--ink-2); font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.lstats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 16px; font-size: 14px; color: var(--ink-2); }
.lstats > span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--paper); }
.lstats b { color: var(--ink); font: 700 15px var(--f-d); font-variant-numeric: tabular-nums; }
.lstats img { width: 22px; height: 22px; margin: -4px 0; }
#nameInput { display: block; width: 100%; height: 54px; margin-bottom: 10px; border: 2px solid var(--line); border-radius: 16px; background: var(--paper); text-align: center; font: 600 19px var(--f-d); transition: border-color .2s, box-shadow .2s; }
#nameInput:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(232, 178, 58, .2); }
#playBtn { width: 100%; }
.loadwrap { height: 8px; margin: 12px 0 0; border-radius: 8px; background: var(--cream); overflow: hidden; }
#loadBar { height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width .3s var(--out); }
#lRecent { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
#lRecent:empty { display: none; }
#lRecent a { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--paper); font-size: 13px; text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); }
#lRecent img, #lRecent i { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--gold-2); }
#lRecent span { color: var(--ink-2); }
.howto { margin-top: 16px; color: var(--ink-2); font-size: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; align-items: center; }
.howto kbd { margin-left: 4px; }
.lback { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--ink-2); }

/* ---------- HUD layout ---------- */
#hud { display: contents; }
#topbar { position: fixed; top: calc(12px + var(--sat)); left: 12px; z-index: 6; display: flex; align-items: center; gap: 8px; }
.brand img { display: block; width: 46px; height: 46px; border-radius: 14px; box-shadow: var(--sh-2); transition: transform .35s var(--spring); }
.brand:hover img { transform: rotate(-6deg) scale(1.05); }
.online { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 999px; background: rgba(255, 255, 255, .92); box-shadow: var(--sh-1); font-size: 14px; color: var(--ink-2); }
.online b { color: var(--ink); font: 700 16px var(--f-d); font-variant-numeric: tabular-nums; }

/* fee pot */
#potWrap { position: fixed; top: calc(14px + var(--sat)); left: 50%; transform: translateX(-50%); z-index: 7; }
#pot { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 16px 0 8px; border-radius: 22px; background: var(--card); box-shadow: var(--sh-2); text-align: left; transition: transform .35s var(--spring), box-shadow .2s; }
#pot:hover { transform: translateY(-1px); box-shadow: var(--sh-3); }
.pot-art { width: 62px; height: 62px; margin: -14px -2px -6px 0; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(34, 51, 92, .18)); transform-origin: 50% 90%; }
.pot-main { display: flex; flex-direction: column; line-height: 1.05; }
.pot-k { font-size: 12px; font-weight: 800; color: var(--ink-2); }
.pot-v { display: flex; align-items: baseline; gap: 4px; }
.pot-v b { font: 600 27px var(--f-d); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pot-v small { font: 700 13px var(--f-d); color: var(--gold-ink); }
.pot-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--line); }
.pot-time { font: 600 16px var(--f-d); font-variant-numeric: tabular-nums; }
.elig { padding: 2px 8px; border-radius: 999px; background: var(--cream); color: var(--ink-2); font-size: 11px; font-weight: 800; white-space: nowrap; }
.elig.ok { background: var(--sage-tint); color: var(--sage-ink); }
#pot.pulse { animation: potPulse .7s var(--spring); }
#pot.pulse .pot-art { animation: jarHop .7s var(--spring); }
@keyframes potPulse { 30% { box-shadow: var(--sh-2), 0 0 0 6px rgba(246, 215, 118, .55); } }
@keyframes jarHop { 30% { transform: scale(1.14, .9); } 60% { transform: scale(.95, 1.08) translateY(-3px); } }
#potDrawer { position: absolute; top: calc(100% + 10px); left: 50%; width: min(350px, calc(100vw - 24px)); transform: translateX(-50%); padding: 16px; animation: dropIn .35s var(--out); }
@keyframes dropIn { from { opacity: 0; transform: translate(-50%, -8px) scale(.97); } }
.pd-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.pd-h b { font: 600 18px var(--f-d); } .pd-h span { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lb li { display: grid; grid-template-columns: 26px 22px 1fr auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 12px; background: var(--paper); font-size: 14px; }
.lb li.me { background: var(--gold-tint); box-shadow: inset 0 0 0 1.5px var(--gold-2); }
.lb i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--card); font: 600 14px var(--f-d); font-style: normal; box-shadow: inset 0 0 0 1px var(--line); }
.lb li:first-child i { background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: none; }
.lb b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb span:last-child { font: 600 14px var(--f-d); font-variant-numeric: tabular-nums; }
.tb { display: inline-block; width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
.lb-empty { margin: 0; padding: 12px; border-radius: 12px; background: var(--paper); color: var(--ink-2); font-size: 14px; text-align: center; }
.pd-rule { margin: 10px 2px; color: var(--ink-2); font-size: 13px; }
.pd-last { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--gold-tint); font-size: 13px; text-decoration: none; }
.pd-last img { width: 30px; height: 30px; }
.pd-last span { flex: 1; } .pd-last em { font-style: normal; font-weight: 800; color: var(--gold-ink); }
.pd-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* top right: points, wallet, outfit, sound */
#topright { position: fixed; top: calc(12px + var(--sat)); right: 12px; z-index: 7; display: flex; align-items: center; gap: 8px; }
#ptsChip { position: relative; display: inline-flex; align-items: baseline; gap: 4px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--gold-tint); box-shadow: inset 0 0 0 1.5px var(--gold-2), var(--sh-1); line-height: 40px; font-size: 13px; color: var(--gold-ink); }
#ptsChip b { font: 600 20px var(--f-d); color: var(--ink); font-variant-numeric: tabular-nums; }
#ptsChip em { font-style: normal; font-weight: 800; color: var(--ink-2); margin-left: 2px; }
#walletBtn { height: 46px; padding: 0 16px 0 10px; border-radius: 16px; font-size: 15px; }
#walletBtn img { width: 30px; height: 30px; }
#walletBtn.on { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line), var(--sh-1); }
#walletBtn.busy { cursor: progress; }
#walletBtn.busy img { animation: wiggle .6s ease-in-out infinite; }
@keyframes wiggle { 50% { transform: rotate(-12deg); } }
.ib { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; background: var(--card); box-shadow: var(--sh-1); transition: transform .35s var(--spring), box-shadow .2s; }
.ib:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.ib img { width: 34px; height: 34px; object-fit: contain; }
#muteBtn.off img { filter: grayscale(1); opacity: .45; }
.pop { position: fixed; top: calc(70px + var(--sat)); right: 12px; z-index: 9; width: min(310px, calc(100vw - 24px)); padding: 16px; transform-origin: 85% 0; animation: popIn .35s var(--spring); }
@keyframes popIn { from { opacity: 0; transform: scale(.92) translateY(-6px); } }
.wc-tier { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 30%, #fff), #fff 80%); }
.wc-tier img { width: 64px; height: 64px; object-fit: contain; animation: bubbleIn .5s var(--spring); }
.wc-tier small { display: block; color: var(--ink-2); font-size: 12px; font-weight: 800; }
.wc-tier b { font: 600 26px var(--f-d); }
.wc-bal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.wc-bal div { padding: 8px 10px; border-radius: 12px; background: var(--paper); }
.wc-bal dt { font-size: 12px; color: var(--ink-2); font-weight: 800; }
.wc-bal dd { margin: 0; font: 600 20px var(--f-d); font-variant-numeric: tabular-nums; }
.wc-next { margin: 0 0 10px; font-size: 14px; }
.wc-next p { margin: 6px 0 0; }
.wc-bar { height: 10px; border-radius: 10px; background: var(--cream); overflow: hidden; }
.wc-bar i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width .8s var(--out); }
.wc-elig { margin: 0 0 10px; padding: 8px 10px; border-radius: 12px; background: var(--cream); color: var(--ink-2); font-size: 13px; }
.wc-elig.ok { background: var(--sage-tint); color: var(--sage-ink); }
.wc-err { margin: 0 0 10px; color: var(--coral-ink); font-size: 13px; }
.wc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.wc-foot a { color: var(--ink-2); }
#soundCard { width: 260px; display: grid; gap: 12px; }
.sc-head { display: flex; align-items: center; justify-content: space-between; }
.sc-head b { font: 600 18px var(--f-d); }
#soundCard label { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); font-weight: 700; }
#soundCard input[type=range] { width: 100%; accent-color: var(--gold); }
.tog { position: relative; width: 46px; height: 28px; border-radius: 14px; background: var(--cream); box-shadow: inset 0 0 0 1.5px var(--line); transition: background .2s; }
.tog i { position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .35s var(--spring); }
.tog[aria-checked=true] { background: var(--sage); }
.tog[aria-checked=true] i { transform: translateX(18px); }

/* minimap */
#right { position: fixed; top: calc(72px + var(--sat)); right: 12px; z-index: 5; }
#minimap { display: block; width: 150px; height: 150px; border-radius: 22px; border: 4px solid #fff; background: #CFDDBF; box-shadow: var(--sh-2); }
body.in-room #right, body.in-climb #right, body.in-climb #keys, body.in-climb #feed { display: none !important; }

/* chat */
#chat { position: fixed; left: 12px; bottom: calc(12px + var(--sab)); z-index: 6; width: 350px; display: flex; flex-direction: column; border-radius: var(--r); background: rgba(255, 255, 255, .94); box-shadow: var(--sh-2); overflow: hidden; }
#chatHead { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 6px 12px; }
#chatHead span { display: inline-flex; align-items: center; gap: 7px; font: 600 15px var(--f-d); }
#chatHead img { width: 26px; height: 26px; margin: -4px 0; }
#chatMin { width: 30px; height: 30px; border-radius: 10px; font: 700 18px/1 var(--f-d); color: var(--ink-2); }
#chatMin:hover { background: var(--paper); }
#chatHead[data-n]::after { content: attr(data-n); position: absolute; top: 2px; left: 30px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--coral); color: #fff; font: 800 11px/18px var(--f-b); text-align: center; animation: bubbleIn .3s var(--spring); }
#chatLog { height: 190px; overflow-y: auto; padding: 0 12px 4px; font-size: 14px; line-height: 1.4; }
#chatLog > div { margin: 3px 0; overflow-wrap: anywhere; }
#chatLog b { color: var(--ink); }
#chatLog b::before { content: ''; display: inline-block; width: 7px; height: 7px; margin: 0 4px 1px 0; border-radius: 50%; background: var(--c, var(--gold)); }
#chatLog .tb { width: 18px; height: 18px; margin: -3px 2px 0 0; }
#chatLog .ts { margin-right: 6px; color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
#chatLog .sys { padding: 4px 8px; border-radius: 10px; background: var(--paper); color: var(--ink-2); font-size: 13px; }
#chatLog .mention { padding: 2px 6px; margin-inline: -6px; border-radius: 8px; background: var(--gold-tint); }
.tkl { color: var(--ink); font-weight: 800; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.tkl:hover { background: var(--gold-tint); border-radius: 4px; }
#chatInput { margin: 6px 8px 8px; height: 40px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); transition: border-color .2s, box-shadow .2s; }
#chatInput:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 178, 58, .2); }
#chat.min { width: auto; }
#chat.min #chatLog, #chat.min #chatInput { display: none; }

/* dock */
#dock { position: fixed; left: 50%; bottom: calc(12px + var(--sab)); transform: translateX(-50%); z-index: 6; display: flex; align-items: flex-end; gap: 8px; transition: opacity .2s, transform .3s var(--out); }
#dock.phone-open { opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }
#emotes { display: flex; gap: 2px; padding: 4px; border-radius: 18px; background: rgba(255, 255, 255, .94); box-shadow: var(--sh-1); }
#emotes button { width: 40px; height: 40px; border-radius: 14px; font-size: 21px; transition: transform .35s var(--spring), background .2s; }
#emotes button:hover { background: var(--paper); transform: translateY(-3px) rotate(-6deg); }
#emotes button:active { transform: scale(.85); }
.dk { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; width: 70px; height: 70px; border-radius: 20px; background: var(--card); box-shadow: var(--sh-2); font: 700 12px var(--f-d); transition: transform .35s var(--spring), box-shadow .2s; }
.dk img { width: 44px; height: 44px; margin-top: -4px; object-fit: contain; transition: transform .35s var(--spring); }
.dk:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.dk:hover img { transform: scale(1.1) rotate(-4deg); }
#launchBtn { background: linear-gradient(180deg, #fff, var(--gold-tint)); }
#keys { position: fixed; left: 50%; bottom: calc(96px + var(--sab)); transform: translateX(-50%); z-index: 5; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .85); color: var(--ink-2); font-size: 12px; white-space: nowrap; box-shadow: var(--sh-1); transition: opacity 1s; pointer-events: none; }
#keys.fade { opacity: 0; }
#prompt { position: fixed; left: 50%; bottom: calc(100px + var(--sab)); transform: translateX(-50%); z-index: 8; display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border-radius: 999px; background: var(--card); box-shadow: var(--sh-2); font: 600 16px var(--f-d); cursor: pointer; white-space: nowrap; animation: promptIn .35s var(--spring); }
#prompt kbd { font: 700 16px var(--f-d); padding: 4px 11px; border-radius: 10px; background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: inset 0 -2px 0 rgba(143, 95, 11, .3); }
@keyframes promptIn { from { opacity: 0; transform: translate(-50%, 8px) scale(.9); } }
#joy { display: none; }

/* toasts, banner, feed */
#toasts { position: fixed; top: calc(96px + var(--sat)); left: 50%; transform: translateX(-50%); z-index: 15; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(420px, calc(100vw - 24px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 14px; background: var(--card); box-shadow: var(--sh-2); font-size: 15px; font-weight: 700; text-align: left; animation: toastIn .5s var(--spring), toastOut .35s ease-in 3.25s forwards; }
.toast::before { content: ''; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-tint); }
.toast.good::before { background: #5FA36E; box-shadow: 0 0 0 4px var(--sage-tint); }
.toast.bad::before { background: var(--coral); box-shadow: 0 0 0 4px var(--coral-tint); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) scale(.96); } }
#banner { position: fixed; top: calc(96px + var(--sat)); left: 50%; z-index: 14; transform: translate(-50%, -24px); opacity: 0; pointer-events: none; transition: opacity .3s, transform .45s var(--spring); }
#banner.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.bn { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border-radius: 18px; background: var(--card); box-shadow: var(--sh-3); cursor: pointer; }
.bn > img, .bn > i { width: 54px; height: 54px; border-radius: 14px; object-fit: cover; background: var(--gold-2); flex: none; }
.bn-k { font-size: 12px; font-weight: 800; color: var(--coral-ink); }
.bn-t { font: 600 21px var(--f-d); } .bn-t span { font: 600 14px var(--f-b); color: var(--ink-2); }
.bn-s { font-size: 12px; color: var(--ink-2); }
#feed { position: fixed; top: calc(238px + var(--sat)); right: 12px; z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; max-width: 280px; font-size: 12px; }
#feed .fi { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px 3px 3px; border-radius: 999px; background: rgba(255, 255, 255, .88); box-shadow: var(--sh-1); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform .3s var(--spring); }
#feed .fi:hover { transform: translateX(-3px); }
#feed .fi img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
#feed .fi.new { background: var(--gold-tint); animation: bubbleIn .4s var(--spring); }
#feed .fi:nth-child(n+3) { display: none; }
#feed .tk { color: var(--gold-ink); }

/* phone */
#phone { position: fixed; right: 16px; bottom: calc(16px + var(--sab)); z-index: 12; width: 380px; height: min(720px, calc(100dvh - 32px)); border: 9px solid #fff; border-radius: 42px; background: var(--paper); overflow: hidden; box-shadow: 0 0 0 1px var(--line), var(--sh-3); transform: translateY(calc(100% + 40px)) rotate(4deg); transition: transform .5s var(--spring); }
#phone.open { transform: none; }
#phone .notch { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 90px; height: 22px; border-radius: 12px; background: var(--ink); z-index: 2; }
#phoneBody { height: 100%; display: flex; flex-direction: column; }
.ph-status { display: flex; justify-content: space-between; padding: 8px 22px 2px; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ph-on { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.ph-on i { width: 7px; height: 7px; border-radius: 50%; background: #5FA36E; }
.ph-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 8px 18px; }
.ph-head .logo img { display: block; height: 24px; width: auto; }
.ph-scroll { flex: 1; overflow-y: auto; padding: 4px 14px 16px; }
.ph-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px 10px 0; border-top: 1px solid var(--line); background: var(--card); }
.ph-tabs button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0; border-radius: 14px; font-size: 11px; font-weight: 800; color: var(--ink-2); transition: background .2s, transform .3s var(--spring); }
.ph-tabs i { display: grid; place-items: center; width: 34px; height: 34px; }
.ph-tabs img { width: 32px; height: 32px; object-fit: contain; }
.ph-tabs .on { background: var(--gold-tint); color: var(--ink); }
.ph-tabs .on img { transform: scale(1.1); }
.ph-home { height: 22px; background: var(--card); cursor: pointer; display: grid; place-items: center; }
.ph-home::after { content: ''; width: 120px; height: 5px; border-radius: 3px; background: rgba(34, 51, 92, .3); }
.ph-title { margin: 6px 2px 10px; font: 600 19px var(--f-d); }
.coin-row { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 10px; padding: 10px; margin-bottom: 8px; border-radius: 14px; background: var(--card); box-shadow: var(--sh-1); cursor: pointer; transition: transform .3s var(--spring), box-shadow .2s; }
.coin-row:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.em { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--gold-tint); overflow: hidden; }
.em img { width: 100%; height: 100%; object-fit: cover; }
.em.big { width: 72px; height: 72px; border-radius: 18px; }
.info { min-width: 0; } .info > div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w { color: var(--ink); }
.pbar { height: 6px; margin-top: 5px; border-radius: 6px; background: var(--cream); overflow: hidden; }
.pbar > div { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.pbar.big { height: 10px; margin: 10px 0; }
.right { text-align: right; } .right b { font: 600 15px var(--f-d); font-variant-numeric: tabular-nums; }
.grad { padding: 1px 6px; border-radius: 999px; background: var(--sage-tint); color: var(--sage-ink); font-size: 11px; font-weight: 800; }
.back { margin: 2px 0 10px; padding: 6px 12px; border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 800; font-size: 13px; }
.coin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.coin-head .tk { font: 600 26px var(--f-d); }
.desc { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats > div { padding: 8px; border-radius: 12px; background: var(--card); box-shadow: var(--sh-1); }
.stats span { display: block; color: var(--ink-2); font-size: 11px; font-weight: 800; }
.stats b { font: 600 15px var(--f-d); font-variant-numeric: tabular-nums; }
.ca { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 0; padding: 9px 12px; border-radius: 12px; background: var(--cream); font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; cursor: copy; }
.ca span { flex: none; font: 800 12px var(--f-b); color: var(--gold-ink); }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.row-btns .btn { height: 34px; padding: 0 12px; font-size: 14px; }
.pad { padding: 24px 8px; text-align: center; }
#phoneBody svg { width: 20px; height: 20px; }
/* launcher */
.ph-lh { display: flex; align-items: center; gap: 8px; margin: 2px 0 2px; font: 600 23px var(--f-d); }
.ph-lh img { width: 40px; height: 40px; }
.sub { margin-bottom: 12px; color: var(--ink-2); font-size: 14px; }
.lgrid { display: grid; grid-template-columns: 112px 1fr; gap: 12px; }
.imgdrop { display: grid; place-items: center; width: 112px; height: 112px; border-radius: 18px; border: 2px dashed rgba(34, 51, 92, .25); background: var(--card); text-align: center; cursor: pointer; overflow: hidden; transition: border-color .2s, transform .3s var(--spring); }
.imgdrop:hover, .imgdrop.over { border-color: var(--gold); transform: rotate(-2deg); }
.imgdrop span { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-2); }
.imgdrop b { color: var(--ink); font-size: 13px; } .imgdrop small { font-size: 11px; }
.imgdrop.has { border-style: solid; border-color: transparent; box-shadow: var(--sh-1); }
.imgdrop img { width: 100%; height: 100%; object-fit: cover; }
.fields { display: flex; flex-direction: column; gap: 8px; }
#launchPane label { display: block; margin-bottom: 8px; color: var(--ink-2); font-size: 12px; font-weight: 800; }
#launchPane input, #launchPane textarea { display: block; width: 100%; height: 40px; margin-top: 3px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--card); transition: border-color .2s; }
#launchPane textarea { height: auto; padding: 8px 10px; resize: vertical; }
#launchPane input:focus, #launchPane textarea:focus { outline: none; border-color: var(--gold); }
.tkwrap { position: relative; } .tkwrap span { position: absolute; left: 11px; top: 50%; transform: translateY(-40%); color: var(--ink-2); font-weight: 800; }
.tkwrap input { padding-left: 22px !important; }
.lprev { margin: 10px 0; }
.lprev .coin-row { margin: 4px 0 0; cursor: default; }
details { margin: 4px 0 10px; } summary { cursor: pointer; font-size: 14px; font-weight: 800; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: '+'; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 6px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font: 700 14px var(--f-d); }
details[open] summary::before { content: '–'; }
#launchPane label em { display: flex; align-items: center; gap: 6px; font-style: normal; }
#launchPane label em svg, .ph-dev svg { width: 16px; height: 16px; }
.ph-dev { display: flex !important; align-items: center; gap: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.seg button { height: 34px; padding: 0 12px; border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 800; font-size: 14px; transition: transform .3s var(--spring); }
.seg button.on { background: var(--ink); color: #fff; box-shadow: none; }
.segin { display: flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 13px; font-weight: 800; }
#launchPane .segin input { width: 84px; height: 34px; margin: 0; }
.err { margin: 8px 0; padding: 9px 12px; border-radius: 12px; background: var(--coral-tint); color: var(--coral-ink); font-size: 14px; font-weight: 700; }
.step { display: flex; align-items: center; gap: 8px; margin: 8px 0; color: var(--ink-2); font-size: 14px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--cream); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fine { margin-top: 8px; color: var(--ink-2); font-size: 12px; text-align: center; }
.done { text-align: center; padding-top: 6px; }
.done h2 { margin: 6px 0 4px; font: 600 28px var(--f-d); }
.done .btn { margin: 4px 2px; }
.boom img { width: 110px; height: 110px; animation: launchUp 1.2s var(--spring); }
@keyframes launchUp { from { transform: translateY(40px) scale(.6) rotate(-10deg); opacity: 0; } }

/* ---------- wardrobe ---------- */
#wardrobe { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(34, 51, 92, .32); backdrop-filter: blur(3px); animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } }
.wr-card { display: grid; grid-template-columns: 1fr 1.15fr; width: min(900px, 100%); height: min(600px, 100%); border-radius: 26px; background: var(--card); box-shadow: var(--sh-3); overflow: hidden; animation: cardIn .5s var(--spring); }
.wr-left { position: relative; background: radial-gradient(circle at 50% 60%, #fff 0, var(--cream) 70%); }
#wrCanvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#wrCanvas:active { cursor: grabbing; }
.wr-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .85); color: var(--ink-2); font-size: 12px; font-weight: 800; }
.wr-right { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 20px; }
.wr-head { display: flex; align-items: center; justify-content: space-between; }
.wr-head h2 { margin: 0; font: 600 27px var(--f-d); }
.wr-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.wr-tabs button { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 800; font-size: 14px; transition: background .2s, transform .3s var(--spring); }
.wr-tabs button:hover { transform: translateY(-1px); }
.wr-tabs button.on { background: var(--ink); color: #fff; box-shadow: none; }
.wr-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); align-content: start; gap: 10px; padding: 4px; }
.wr-item { display: flex; flex-direction: column; gap: 6px; padding: 7px; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 2px var(--line); transition: transform .3s var(--spring), box-shadow .2s, background .2s; }
.wr-item:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 2px rgba(34, 51, 92, .22), var(--sh-1); }
.wr-item.on { background: var(--gold-tint); box-shadow: inset 0 0 0 2.5px var(--gold), 0 4px 12px rgba(232, 178, 58, .3); }
.wr-pic { display: grid; place-items: center; aspect-ratio: 1; border-radius: 11px; background: var(--paper); overflow: hidden; }
.wr-pic img, .wr-pic canvas { width: 100%; height: 100%; object-fit: contain; }
.wr-pic.art img { width: 72%; height: 72%; }
.wr-item b { font-size: 12px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch { width: 58%; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12), 0 2px 6px rgba(34, 51, 92, .15); }
.wr-pic i.none { position: relative; width: 40%; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--ink-3); }
.wr-pic i.none::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 3px; background: var(--ink-3); transform: rotate(45deg); }
.wr-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- minigames ---------- */
#gamesMenu { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; padding: 16px; background: rgba(34, 51, 92, .32); backdrop-filter: blur(3px); animation: fadeIn .25s; }
.gm-card { width: min(780px, 100%); max-height: 100%; overflow-y: auto; padding: 20px; border-radius: 26px; background: var(--card); box-shadow: var(--sh-3); animation: cardIn .45s var(--spring); }
.gm-head { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; margin-bottom: 14px; }
.gm-head b { font: 600 27px var(--f-d); }
.gm-head span { grid-row: 2; color: var(--ink-2); font-size: 14px; }
.gm-head .x { grid-row: 1 / 3; grid-column: 2; }
.gm-games { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gm-game { display: flex; flex-direction: column; padding-bottom: 14px; border-radius: 20px; background: var(--paper); overflow: hidden; }
.gm-art { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--cream); }
.gm-t { display: flex; align-items: center; gap: 8px; padding: 12px 14px 2px; font: 600 21px var(--f-d); }
.gm-live { padding: 2px 8px; border-radius: 999px; background: var(--coral); color: #fff; font: 800 11px var(--f-b); animation: live 2s infinite; }
.gm-game p { margin: 2px 14px 10px; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.gm-pts { margin: 0 14px 10px; padding: 7px 10px; border-radius: 12px; background: var(--gold-tint); color: var(--gold-ink); font-size: 13px; font-weight: 700; }
.gm-pts b { color: var(--ink); font: 600 15px var(--f-d); }
.gb { list-style: none; margin: 0 14px 12px; padding: 0; display: grid; gap: 4px; }
.gb li { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; background: var(--card); font-size: 14px; }
.gb i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); font: 600 13px var(--f-d); font-style: normal; }
.gb li:first-child i { background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
.gb b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb span { font: 600 14px var(--f-d); font-variant-numeric: tabular-nums; }
.gb-empty { margin: 0 14px 12px; color: var(--ink-2); font-size: 14px; }
.gm-go { margin: auto 14px 0; }
#pod, #climbHud { position: fixed; top: calc(72px + var(--sat)); left: 12px; z-index: 6; padding: 12px; border-radius: 20px; background: rgba(255, 255, 255, .96); box-shadow: var(--sh-2); animation: popIn .4s var(--spring); }
#pod { width: 310px; }
.pd-head { display: flex; justify-content: space-between; align-items: center; }
.pd-title { display: inline-flex; align-items: center; gap: 6px; font: 600 18px var(--f-d); }
.pd-title img { width: 30px; height: 30px; margin: -4px 0; }
b.g { color: var(--sage-ink); } b.r { color: var(--coral-ink); }
#pdRound { color: var(--ink-2); font-size: 12px; font-weight: 800; }
#pdCv { display: block; width: 100%; margin: 8px 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
#pod.idle #pdCv { display: none; }
#pdMsg { font: 600 20px var(--f-d); text-align: center; }
.pd-bar { height: 6px; margin: 6px 0; border-radius: 6px; background: var(--cream); overflow: hidden; }
.pd-bar i { display: block; height: 100%; border-radius: 6px; background: var(--gold); transition: width .2s linear; }
.pd-bar i.pick { background: var(--coral); }
.pd-pads { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pd-pad { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 12px; font-weight: 800; transition: transform .3s var(--spring), box-shadow .2s; }
.pd-pad b { font: 600 18px var(--f-d); }
.pd-pad.pump { background: var(--sage-tint); color: var(--sage-ink); }
.pd-pad.dump { background: var(--coral-tint); color: var(--coral-ink); }
.pd-pad.me { box-shadow: inset 0 0 0 2.5px currentColor; transform: scale(1.03); }
.pd-pad.win { animation: winPad .8s var(--spring); }
.pd-pad.pump.win { background: var(--sage); color: var(--ink); } .pd-pad.dump.win { background: var(--coral); color: #fff; }
@keyframes winPad { 40% { transform: scale(1.1); } }
#pdSub { margin-top: 6px; color: var(--ink-2); font-size: 13px; text-align: center; }
#pod.warn { box-shadow: var(--sh-2), 0 0 0 3px var(--coral); animation: nudge .5s ease-in-out infinite alternate; }
@keyframes nudge { to { transform: translateX(3px); } }
#climbHud { width: 250px; }
.cc-t { display: flex; align-items: center; gap: 6px; font: 600 16px var(--f-d); }
.cc-t img { width: 30px; height: 30px; margin: -4px 0; }
.cc-time { font: 600 38px/1.1 var(--f-d); font-variant-numeric: tabular-nums; }
.cc-time.wait { color: var(--ink-3); } .cc-time.done { color: var(--gold-ink); animation: winPad .8s var(--spring); }
.cc-row { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.cc-bar { height: 8px; margin: 8px 0; border-radius: 8px; background: var(--cream); overflow: hidden; }
.cc-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.cc-btns { display: flex; gap: 6px; }
.cc-hint { margin-top: 8px; color: var(--ink-2); font-size: 11px; }
#jumpBtn { display: none; }

/* ---------- overlays ---------- */
#fade { position: fixed; inset: 0; z-index: 50; background: var(--paper); opacity: 0; pointer-events: none; transition: opacity .22s; }
#fade.on { opacity: 1; }
#roomTag { position: fixed; top: calc(96px + var(--sat)); left: 50%; transform: translateX(-50%); z-index: 8; padding: 8px 16px; border-radius: 999px; background: var(--card); box-shadow: var(--sh-2); font-size: 14px; white-space: nowrap; animation: toastIn .5s var(--spring); }
.tap-ring { position: fixed; z-index: 4; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(232, 178, 58, .7); pointer-events: none; animation: ring .6s var(--out) forwards; }
@keyframes ring { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
#net { position: fixed; top: calc(12px + var(--sat)); left: 50%; transform: translateX(-50%); z-index: 60; padding: 8px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 800; box-shadow: var(--sh-2); }
#kicked { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(34, 51, 92, .4); }
#kicked > div { width: min(360px, 100%); padding: 24px; border-radius: 24px; background: var(--card); box-shadow: var(--sh-3); text-align: center; }
#kicked b { font: 600 20px var(--f-d); } #kicked p { color: var(--ink-2); }
#celebrate { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(34, 51, 92, .38); backdrop-filter: blur(3px); animation: fadeIn .3s; }
.cb-card { display: flex; flex-direction: column; align-items: center; width: min(380px, 100%); padding: 0 24px 22px; border-radius: 28px; background: var(--card); box-shadow: var(--sh-3); text-align: center; margin-top: 70px; }
#celebrate.show .cb-card { animation: celebIn .7s var(--spring); }
@keyframes celebIn { from { transform: scale(.6) translateY(40px); opacity: 0; } }
.cb-art { width: 170px; height: 170px; margin-top: -86px; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(34, 51, 92, .25)); animation: floaty 3s ease-in-out .7s infinite; }
.cb-art.tier { width: 150px; height: 150px; }
@keyframes floaty { 50% { transform: translateY(-6px) rotate(2deg); } }
.cb-card h2 { order: 1; margin: 6px 0 2px; font: 600 30px/1.1 var(--f-d); text-wrap: balance; }
.cb-card small { order: 2; color: var(--gold-ink); font-size: 14px; font-weight: 800; }
.cb-card p { order: 3; margin: 8px 0 0; color: var(--ink-2); font-size: 15px; text-wrap: pretty; }
.cb-link { order: 4; margin-top: 8px; font-weight: 800; font-size: 14px; }
.cb-card .btn { order: 5; width: 100%; margin-top: 18px; height: 48px; font-size: 17px; }

/* fx.js */
.fx-coin { position: fixed; left: 0; top: 0; z-index: 80; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 35% 30%, #FFF4C4 0 18%, var(--gold-2) 30%, var(--gold) 70%, #B9831C 100%); box-shadow: inset 0 0 0 2px rgba(143, 95, 11, .35), 0 2px 4px rgba(34, 51, 92, .25); }
.fx-plus { position: fixed; z-index: 80; pointer-events: none; font: 700 18px var(--f-d); color: var(--gold-ink); text-shadow: 0 1px 0 #fff, 0 0 6px #fff; white-space: nowrap; }
.fx-confetti { position: fixed; inset: 0; z-index: 75; width: 100vw; height: 100vh; pointer-events: none; }

/* ---------- touch + small screens ---------- */
@media (pointer: coarse) {
  #keys { display: none; }
  #joy { display: block; position: fixed; left: 22px; bottom: calc(86px + var(--sab)); z-index: 6; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .8), var(--sh-1); touch-action: none; }
  #joy i { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; background: #fff; box-shadow: var(--sh-2); }
  body.in-climb #jumpBtn { display: block; position: fixed; right: 22px; bottom: calc(96px + var(--sab)); z-index: 7; width: 104px; height: 104px; border-radius: 50%; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--ink); font: 700 22px var(--f-d); box-shadow: inset 0 -5px 0 rgba(143, 95, 11, .3), var(--sh-2); touch-action: none; }
  body.in-climb #jumpBtn:active { transform: scale(.92); }
}
@media (max-width: 720px) {
  #topbar { left: 10px; gap: 6px; }
  .brand img { width: 40px; height: 40px; border-radius: 12px; }
  .online { height: 32px; padding: 0 10px; font-size: 13px; }
  .online .lbl { display: none; }
  #topright { right: 10px; gap: 6px; }
  #walletBtn { width: 42px; height: 42px; padding: 0; border-radius: 14px; }
  #walletBtn span { display: none; }
  .ib { width: 42px; height: 42px; border-radius: 14px; }
  .ib img { width: 30px; height: 30px; }
  #ptsChip { height: 34px; padding: 0 10px; line-height: 34px; }
  #ptsChip > span { display: none; }
  #ptsChip b { font-size: 17px; }
  .pop { top: calc(60px + var(--sat)); right: 10px; }
  #potWrap { top: calc(62px + var(--sat)); left: 10px; transform: none; }
  #pot { height: 52px; gap: 6px; padding: 0 12px 0 4px; border-radius: 18px; }
  .pot-art { width: 50px; height: 50px; margin: -10px -2px -4px 0; }
  .pot-k { display: none; }
  .pot-v b { font-size: 21px; }
  .pot-side { padding-left: 8px; gap: 2px; }
  .pot-time { font-size: 14px; }
  .elig { font-size: 11px; padding: 1px 6px; }
  #potDrawer { left: 0; transform: none; width: calc(100vw - 20px); animation-name: dropInM; }
  @keyframes dropInM { from { opacity: 0; transform: translateY(-8px); } }
  #right { top: calc(62px + var(--sat)); right: 10px; }
  #minimap { width: 96px; height: 96px; border-radius: 18px; border-width: 3px; }
  #feed, #keys { display: none; }
  #toasts, #banner, #roomTag { top: calc(124px + var(--sat)); }
  #pod, #climbHud { top: calc(124px + var(--sat)); left: 10px; }
  #pod { width: 240px; padding: 10px; } #pdMsg { font-size: 17px; } .pd-pad { padding: 6px 10px; font-size: 13px; }
  #climbHud { width: 210px; padding: 10px; } .cc-time { font-size: 28px; } .cc-hint { display: none; }
  #chat { left: 10px; bottom: calc(10px + var(--sab)); width: calc(100vw - 20px); }
  #chat:not(.min) { bottom: calc(80px + var(--sab)); z-index: 9; }
  #chatLog { height: 140px; }
  #chat.min { width: auto; }
  #chat.min #chatHead { height: 52px; padding: 0 6px 0 12px; }
  #dock { left: auto; right: 10px; bottom: calc(10px + var(--sab)); transform: none; gap: 6px; }
  #dock.phone-open { transform: translateY(20px); }
  .dk { width: 56px; height: 56px; border-radius: 17px; }
  .dk img { width: 40px; height: 40px; margin: 0; }
  .dk span { display: none; }
  #emotes { position: fixed; right: 10px; bottom: calc(76px + var(--sab)); flex-direction: column; border-radius: 16px; }
  #emotes button { width: 38px; height: 38px; font-size: 19px; }
  body.in-climb #emotes { display: none; }
  #prompt { bottom: calc(80px + var(--sab)); }
  #phone { right: 0; bottom: 0; width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  #phone .notch { display: none; }
  .ph-status { padding-top: calc(8px + var(--sat)); }
  .wr-card { grid-template-columns: 1fr; grid-template-rows: 36% 1fr; height: 100%; border-radius: 22px; }
  .wr-right { padding: 14px; gap: 10px; }
  .wr-head h2 { font-size: 22px; }
  .wr-grid { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; }
  .gm-games { grid-template-columns: 1fr; }
  .gm-card { padding: 16px; }
  .gm-head b { font-size: 23px; }
  .gm-art { aspect-ratio: 21 / 9; }
  .login-card { padding: 22px 18px 18px; border-radius: 24px; }
}
@media (max-width: 380px) {
  .online { display: none; }
  .pot-side { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
