:root {
  --bg: #050b18; --panel: #0c1730f2; --panel-solid: #0c1730; --raised: #16264a; --line: #2a3d63; --ink: #f6f7fc; --muted: #a3b2cd;
  --gold: #f2c35b; --gold-deep: #c99a48; --amber: #ffd36a; --red: #ff6b6b; --green: #8ee0b8; --rare: #6fb8ff; --epic: #d48cff;
  --font: 'Avenir Next', 'Nunito Sans', 'Helvetica Neue', sans-serif;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
input, textarea, select, #sheet-body p, #sheet-body h2 { -webkit-user-select: text; user-select: text; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--font); overscroll-behavior: none; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; transition: transform 140ms var(--ease), background 140ms, border-color 140ms, opacity 140ms; }
button:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
a { color: var(--amber); }
h2, p { margin: 0; }
svg { width: 20px; height: 20px; flex: none; }

#view { position: fixed; inset: 0; background: #06102a; } /* the lobby still behind the name box comes from posterHead() in src/posters.js */
.game-canvas { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.stick { position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; border: 2px solid #ffffff33; background: radial-gradient(#ffffff10, #ffffff05); pointer-events: none; z-index: 3; }
.stick i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; border-radius: 50%; background: #ffffffcc; box-shadow: 0 4px 18px #0007; }

/* ---------- HUD ---------- */
.hud-top { position: fixed; top: calc(var(--safe-t) + 10px); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; z-index: 5; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.where { display: flex; flex-direction: column; align-items: flex-start; padding: 8px 14px 9px; border-radius: 14px; background: #08122acc; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid #ffffff14; text-align: left; max-width: 62vw; }
.where b { font-size: 15px; font-weight: 800; letter-spacing: .02em; color: var(--amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.where span { font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.coins { display: flex; align-items: center; gap: 7px; height: 42px; padding: 0 6px 0 10px; border-radius: 21px; background: #08122acc; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid #f2c35b55; font-weight: 800; font-variant-numeric: tabular-nums; }
.coins b { font-size: 15px; min-width: 2ch; }
.coins i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(#ffe08a, #f0b843); color: #3a2506; font-style: normal; font-size: 19px; font-weight: 900; line-height: 1; }
.coins.spend { animation: spend 450ms var(--ease); }
@keyframes spend { 30% { transform: scale(.92); border-color: var(--gold); } }

.nav { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 10px); transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; border-radius: 20px; background: #08122ad9; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid #ffffff14; z-index: 6; box-shadow: 0 10px 30px #0008; }
.nav-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 74px; padding: 8px 8px 7px; border-radius: 15px; color: #dfe6f5; font-size: 11.5px; font-weight: 700; }
.nav-btn:hover { background: #ffffff0d; }
.nav-btn.hot { background: linear-gradient(#ffdf87, #f2c35b); color: #33220a; }
.nav-btn .dot { position: absolute; top: 6px; right: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #08122a; }
body[data-mode="ride"] .nav, body[data-mode="loading"] .nav { opacity: 0; pointer-events: none; }

.prompt { position: fixed; left: 50%; bottom: calc(var(--safe-b) + var(--nav-h) + 26px); transform: translate(-50%, 16px); display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 24px); padding: 8px 8px 8px 16px; border-radius: 18px; background: #08122ae6; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid #f2c35b44; box-shadow: 0 12px 30px #0009; opacity: 0; pointer-events: none; transition: opacity 180ms, transform 240ms var(--ease); z-index: 5; cursor: pointer; }
.prompt.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.prompt > svg { width: 24px; height: 24px; color: var(--amber); margin-right: -4px; }
.prompt > span { display: flex; flex-direction: column; min-width: 0; }
.prompt > span b { font-size: 15px; font-weight: 800; white-space: nowrap; }
.prompt > span small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.room-card { display: flex; align-items: center; gap: 8px; }
.room-card > div { display: flex; flex-direction: column; margin-right: 6px; min-width: 0; }
.room-card > div b { font-size: 15px; }
.room-card > div span { font-size: 12px; color: var(--muted); white-space: nowrap; }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 13px; background: linear-gradient(#ffdf87, #f2c35b); color: #33220a; font-size: 14px; font-weight: 800; white-space: nowrap; text-decoration: none; }
.chip svg { width: 17px; height: 17px; }
.chip.done { background: #ffffff; color: #0c1730; }

/* ---------- sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 10; }
.sheet-backdrop { position: absolute; inset: 0; background: linear-gradient(#0000 35%, #000a); opacity: 0; transition: opacity 220ms; }
.sheet.in .sheet-backdrop { opacity: 1; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: min(82vh, 760px); overflow: auto; padding: 22px 20px calc(var(--safe-b) + 22px); border-radius: 24px 24px 0 0; background: var(--panel); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid #f2c35b55; box-shadow: 0 -20px 50px #0009; transform: translateY(100%); transition: transform 320ms var(--ease); overscroll-behavior: contain; }
.sheet.in .sheet-panel { transform: none; }
.sheet-panel::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #ffffff30; }
.sheet-x { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #ffffff12; z-index: 2; }
@media (min-width: 900px) {
  .sheet-panel { left: auto; top: 12px; right: 12px; bottom: 12px; width: 420px; max-height: none; border-radius: 22px; border: 1px solid #f2c35b44; transform: translateX(110%); }
  .sheet-backdrop { background: linear-gradient(90deg, #0000 50%, #0007); }
  .sheet-panel::before { display: none; }
  .sheet.k-shop .sheet-panel { width: 520px; }
  .prompt { bottom: calc(var(--nav-h) + 30px); }
}
#sheet-body h2 { font-size: 25px; font-weight: 800; line-height: 1.15; letter-spacing: -.015em; padding-right: 40px; overflow-wrap: anywhere; }
#sheet-body h2 em { color: var(--amber); font-style: normal; }
.eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.eyebrow.red, .sheet.k-red .eyebrow { color: var(--red); }
.sub { margin-top: 8px; color: #c4cee2; font-size: 14px; }
.who { margin-top: 4px; font-weight: 700; color: #dfe6f5; }
.tier { color: var(--amber); font-weight: 800; }
.fine { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.55; }
.row { display: flex; gap: 8px; margin-top: 8px; }
.row > * { flex: 1; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; margin-top: 10px; padding: 12px 16px; border-radius: 14px; background: var(--raised); border: 1px solid #ffffff14; font-size: 15px; font-weight: 700; text-decoration: none; color: var(--ink); text-align: center; }
.btn small { font-weight: 800; color: var(--amber); }
.btn.primary { background: linear-gradient(#ffdf87, #f2c35b); color: #33220a; border-color: #ffe7a8; box-shadow: 0 3px 0 #8a5d16, inset 0 1px #fff6; }
.btn.primary small { color: #6b4708; }
.btn.gold { background: linear-gradient(135deg, #ffe9a6, #f2c35b 45%, #d99a2b); color: #2e1d05; font-weight: 800; box-shadow: 0 3px 0 #7a4f0e, 0 0 28px #f2c35b44; }
.btn.danger { background: #3a0f16; border-color: #ff6b6b88; color: #ffc4c4; }
.btn.ghost { background: transparent; border-color: #ffffff24; }
.btn.small { min-height: 42px; font-size: 13.5px; }
.btn .coin-price svg { width: 18px; height: 18px; }
.coin-price { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; font-weight: 800; }
.back { display: inline-flex; align-items: center; gap: 4px; margin: -6px 0 8px -6px; padding: 6px; font-weight: 700; color: var(--muted); }
.field { position: relative; margin-top: 14px; }
.field input, .field select { width: 100%; height: 50px; padding: 12px 14px; border-radius: 13px; border: 1px solid #3a4f76; background: #050d20; font-size: 16px; appearance: none; }
.field.at input { padding-left: 32px; }
.field.at::before { content: "@"; position: absolute; left: 14px; top: 13px; color: var(--muted); font-weight: 700; }
.hint { min-height: 18px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.hint.bad { color: var(--red); }
.link { color: var(--amber); text-decoration: underline; font-weight: 700; }
.inline-form { display: flex; gap: 8px; margin-top: 14px; }
.inline-form input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 13px; border: 1px solid #3a4f76; background: #050d20; font-size: 16px; }
.inline-form .btn { width: auto; margin: 0; min-height: 46px; padding: 0 18px; }
.invite-note { margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: #f2c35b1c; color: var(--amber); font-weight: 700; font-size: 14px; }
details.more { margin-top: 14px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 700; padding: 6px 0; }
.question { margin-top: 14px; padding: 12px; border-radius: 14px; background: #ffffff0a; }
.question p { font-weight: 700; }
.question .btn.on { background: var(--gold); color: #2e1d05; }
.question small { display: block; margin-top: 6px; color: var(--muted); }
.style-meter { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #ffffff0a; border: 1px solid #f2c35b2a; }
.style-meter div { display: flex; flex-direction: column; }
.style-meter b { font-size: 14px; }
.style-meter span { font-size: 12.5px; color: var(--muted); }
.style-meter i { display: block; height: 6px; margin-top: 9px; border-radius: 3px; background: linear-gradient(90deg, var(--gold) var(--p), #ffffff18 var(--p)); }
.knock-line { min-height: 22px; margin-top: 12px; color: #ffb3b3; font-weight: 700; }

/* elevator */
.lift { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.lift-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 70px; padding: 12px 14px; border-radius: 16px; background: var(--raised); border: 1px solid #ffffff14; text-align: left; }
.lift-btn b { font-size: 15px; font-weight: 800; }
.lift-btn span { font-size: 12px; color: var(--muted); }
.lift-btn.luxe { grid-column: span 2; background: linear-gradient(135deg, #1e2b26, #0f1a17); border-color: #c9a36299; }
.lift-btn.luxe b { color: #f5d998; }
.lift-btn.mine { border-color: var(--gold); }
.lift-btn.red { background: #2a0d14; border-color: #ff6b6b66; }
.lift-btn.red b { color: #ff9c9c; }

/* tabs */
.tabs { display: flex; gap: 4px; margin-top: 16px; padding: 4px; border-radius: 14px; background: #ffffff0d; overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: 1; min-height: 38px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tabs button[aria-selected="true"] { background: #fff; color: #0c1730; }
.tabs.small { margin-top: 8px; }
.tabs.small button { min-height: 32px; font-size: 12.5px; }

/* shop */
.shop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-right: 44px; }
.wallet { display: flex; flex-direction: column; align-items: flex-end; padding: 6px 12px; border-radius: 14px; background: #f2c35b1a; border: 1px solid #f2c35b55; }
.wallet svg { display: none; }
.wallet b { font-size: 18px; font-weight: 900; color: var(--amber); font-variant-numeric: tabular-nums; }
.wallet span { font-size: 11px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .08em; }
.daily-strip { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 12px; padding: 11px 14px; border-radius: 14px; background: linear-gradient(90deg, #f2c35b30, #f2c35b10); border: 1px solid #f2c35b66; color: #ffe7a8; font-weight: 700; text-align: left; }
.shop-goal { margin-top: 10px; font-size: 13px; color: var(--muted); }
.shop-goal b { color: var(--ink); }
.rotation-head { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 2px 2px; }
.rotation-head b { font-size: 15px; }
.rotation-head span { font-size: 12.5px; color: var(--muted); }
.rotation-head time { color: var(--amber); font-weight: 800; font-variant-numeric: tabular-nums; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 10px; }
.item { position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 6px 6px 9px; border-radius: 16px; background: linear-gradient(#1a2c52, #111f3d); border: 1px solid #ffffff12; text-align: center; overflow: hidden; }
.item.rare { border-color: #6fb8ff66; background: linear-gradient(#183a63, #10213f); }
.item.epic { border-color: #d48cff77; background: linear-gradient(#3a2160, #161a3d); box-shadow: inset 0 0 24px #d48cff22; }
.item.owned { opacity: .8; }
.item .thumb { display: block; aspect-ratio: 1; border-radius: 11px; background: radial-gradient(circle at 50% 60%, #ffffff16, #0000 70%); }
.item .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.item .thumb img:not([src]) { visibility: hidden; }
.item b { margin-top: 4px; font-size: 12.5px; font-weight: 700; line-height: 1.2; min-height: 2.4em; display: flex; align-items: center; justify-content: center; }
.item .price { margin-top: 4px; font-size: 13px; color: var(--amber); display: flex; justify-content: center; }
.item .price svg { width: 15px; height: 15px; }
.rarity { position: absolute; top: 7px; left: 7px; padding: 2px 7px; border-radius: 7px; font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; background: var(--rare); color: #04213f; }
.epic > .rarity, .item-hero.epic .rarity { background: var(--epic); color: #2b0a3f; }
.have { position: absolute; top: 7px; right: 7px; font-size: 11px; font-weight: 900; padding: 2px 6px; border-radius: 7px; background: #ffffff22; }
.item-hero { position: relative; margin: 4px auto 10px; width: min(240px, 70vw); aspect-ratio: 1; border-radius: 22px; background: radial-gradient(circle at 50% 55%, #2a4372, #0c1730 72%); }
.item-hero.epic { background: radial-gradient(circle at 50% 55%, #5b3594, #120d2b 72%); }
.item-hero.rare { background: radial-gradient(circle at 50% 55%, #22528a, #0c1730 72%); }
.item-hero img { width: 100%; height: 100%; object-fit: contain; }
.item-hero .rarity { top: 12px; left: 12px; }
.bought { text-align: center; padding-top: 6px; }
.bought img { width: 150px; height: 150px; object-fit: contain; animation: pop 600ms var(--ease); }
.bought img:not([src]) { visibility: hidden; }
.bought h2 { padding-right: 0 !important; }
@keyframes pop { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } }

/* coins */
.double { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px; border-radius: 14px; background: linear-gradient(90deg, #f2c35b33, #f2c35b0d); border: 1px solid #f2c35b77; color: #ffe7a8; font-size: 13.5px; }
.double svg { color: var(--amber); }
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.pack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 10px 12px; border-radius: 18px; background: linear-gradient(#1a2c52, #111f3d); border: 1px solid #ffffff16; }
.pack[aria-checked="true"] { border: 2px solid var(--gold); box-shadow: 0 0 26px #f2c35b33; background: linear-gradient(#2a3a62, #16244a); }
.pack .tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 2px 9px; border-radius: 8px; background: var(--gold); color: #2e1d05; font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.pack-coins { display: flex; align-items: center; gap: 6px; }
.pack-coins svg { width: 26px; height: 26px; }
.pack-coins b { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.pack s, .pack small { font-size: 12px; color: var(--muted); }
.pack-price { margin-top: 8px; padding: 6px 14px; border-radius: 10px; background: #fff; color: #0c1730; font-weight: 900; font-size: 15px; }
.pay-row { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.wallet-slot { min-height: 52px; border-radius: 14px; }
.wallet-slot.loading { background: linear-gradient(90deg, #ffffff10, #ffffff22, #ffffff10); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pay-row .btn { margin-top: 0; }
.btn.outside { justify-content: flex-start; gap: 12px; min-height: 58px; background: #fff; color: #000; text-align: left; }
.btn.outside svg { width: 26px; height: 26px; }
.btn.outside span { display: flex; flex-direction: column; font-size: 16px; font-weight: 800; }
.btn.outside small { font-size: 12px; font-weight: 600; color: #555; }
.btn.card { background: transparent; border-color: #ffffff30; }
.btn.card b { margin: 0 4px; }
.daily { text-align: center; }
.daily > svg { width: 84px; height: 84px; margin: 4px auto 6px; display: block; filter: drop-shadow(0 6px 22px #f2c35b88); animation: pop 700ms var(--ease); }
.daily h2 { padding-right: 0 !important; }

/* board and map */
.ranks { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.ranks li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 14px; background: #ffffff0a; }
.ranks li.me { background: #f2c35b22; border: 1px solid #f2c35b66; }
.ranks .rank { width: 22px; text-align: center; font-weight: 900; color: var(--muted); }
.ranks li:nth-child(1) .rank { color: #ffd166; }
.ranks li:nth-child(2) .rank { color: #d9e2f2; }
.ranks li:nth-child(3) .rank { color: #e0a36a; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #2b4a8a, #5b2d6e); font-weight: 900; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.ranks .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ranks .info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranks .info small { color: var(--muted); font-size: 12px; }
.board-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px; border-radius: 14px; border: 1px dashed #f2c35b77; }
.board-cta .btn { width: auto; margin: 0; }
.map-head { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.map-head .chip { min-width: 44px; justify-content: center; background: var(--raised); color: var(--ink); font-size: 20px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px; margin-top: 10px; }
.map-cell { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 9px; background: #ffffff08; border: 1px solid #ffffff0d; min-width: 0; }
.map-cell b { font-size: 12px; font-variant-numeric: tabular-nums; }
.map-cell span { font-size: 10px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-cell.taken { background: #2a3d63; }
.map-cell.decorated { background: #3b3416; border-color: #f2c35b66; }
.map-cell.decorated span { color: var(--amber); }
.map-cell.fancy { background: linear-gradient(135deg, #8a6418, #4a3410); border-color: var(--gold); box-shadow: 0 0 12px #f2c35b44; }
.map-cell.fancy span { color: #fff3c8; }
.map-cell.mine { outline: 2px solid #fff; }
.map-cell.red { background: #3a0f16; border-color: #ff6b6b88; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; margin-top: 14px; }
.picker button { min-height: 42px; border-radius: 11px; background: var(--raised); font-weight: 800; font-size: 13px; }
.picker button[aria-pressed="true"] { background: var(--gold); color: #2e1d05; }
.price { margin-top: 6px; font-size: 28px; font-weight: 900; color: var(--amber); }
.share-preview { display: block; width: min(220px, 60vw); margin: 14px auto 4px; border-radius: 14px; box-shadow: 0 10px 30px #0008; }
.photo-pick { display: grid; place-items: center; width: 150px; height: 150px; margin: 16px auto 4px; border-radius: 18px; overflow: hidden; background: #ffffff0d; border: 3px solid var(--gold-deep); }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick svg { width: 44px; height: 44px; color: var(--muted); }
.btn.file { cursor: pointer; }
.intro h2 { font-size: 32px !important; }
.intro .btn.primary { margin-top: 18px; }

/* decorate */
.decor { position: fixed; left: 0; right: 0; bottom: calc(var(--safe-b) + var(--nav-h) + 18px); z-index: 5; padding: 0 12px; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.decor > * { pointer-events: auto; }
.decor-bar { display: flex; gap: 8px; }
.decor-bar .btn { margin: 0; width: auto; padding: 0 20px; min-height: 48px; }
.decor-tools { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 6px 6px 14px; border-radius: 16px; background: #08122ae6; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid #ffffff18; }
.decor-tools b, .decor-tools span { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.decor-tools span { color: var(--muted); }
.decor-tools .chip { min-height: 36px; padding: 0 11px; font-size: 13px; }
.decor .tabs { width: min(420px, 100%); background: #08122ae6; }
.tray { display: flex; gap: 6px; width: min(720px, 100%); margin-top: 8px; padding: 6px; overflow-x: auto; border-radius: 18px; background: #08122ae6; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid #ffffff14; scrollbar-width: none; }
.tray-item { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; width: 78px; padding: 4px 4px 6px; border-radius: 13px; background: #ffffff0a; }
.tray-item img { width: 62px; height: 62px; object-fit: contain; }
.tray-item img:not([src]) { visibility: hidden; }
.tray-item span { font-size: 10.5px; font-weight: 700; line-height: 1.15; text-align: center; color: #dfe6f5; }
.tray-item i { position: absolute; top: 4px; right: 4px; min-width: 18px; padding: 0 4px; border-radius: 9px; background: var(--gold); color: #2e1d05; font-size: 10.5px; font-weight: 900; font-style: normal; }
.tray-item.used { opacity: .4; }
.tray-item.on { outline: 2px solid var(--gold); }
.tray-item.more { justify-content: center; gap: 6px; color: var(--amber); }
.tray-item.more svg { width: 26px; height: 26px; }
.decor.saving .decor-tools::after { content: "Saving…"; font-size: 11px; color: var(--muted); padding-right: 6px; }
body[data-mode="room"] .prompt { bottom: calc(var(--safe-b) + var(--nav-h) + 26px); }
body[data-mode="room"]:has(#decor:not([hidden])) .prompt { display: none; }

/* effects */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.coin-fly { position: fixed; width: 26px; height: 26px; }
.coin-fly svg { width: 26px; height: 26px; filter: drop-shadow(0 2px 6px #0008); }
.coin-banner { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 26px; border-radius: 22px; background: #08122ae6; border: 1px solid var(--gold); box-shadow: 0 0 60px #f2c35b55; animation: banner 1.9s var(--ease) forwards; }
.coin-banner svg { width: 54px; height: 54px; }
.coin-banner b { font-size: 34px; font-weight: 900; color: var(--amber); }
.coin-banner span { font-size: 13px; font-weight: 800; color: #ffe7a8; letter-spacing: .06em; text-transform: uppercase; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.7); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); } 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -62%) scale(.96); } }
#curtain { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 360ms; z-index: 20; }
#curtain.on { opacity: 1; }
#blackout { position: fixed; inset: 0; z-index: 40; background: #000; animation: fadein 300ms forwards; }
#blackout.reveal { animation: fadeout 900ms forwards; }
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
body[data-knocks="5"] #view { filter: saturate(.4) brightness(.6) contrast(1.2); transition: filter 600ms; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #12224a, #050b18 70%); z-index: 50; transition: opacity 500ms 200ms; }
#loading div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
#loading b { font-size: 26px; font-weight: 900; color: var(--amber); letter-spacing: .02em; }
#loading span { color: var(--muted); font-weight: 600; animation: breathe 1.4s ease-in-out infinite; }
#loading.done { opacity: 0; pointer-events: none; }
#early { z-index: 55; }
@keyframes breathe { 50% { opacity: .4; } }
.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 72px); transform: translate(-50%, -14px); max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 14px; background: #ffffff; color: #0c1730; font-weight: 700; font-size: 14px; text-align: center; box-shadow: 0 12px 30px #0008; opacity: 0; pointer-events: none; transition: opacity 200ms, transform 260ms var(--ease); z-index: 60; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }
@media (max-width: 380px) { .nav-btn { min-width: 64px; font-size: 10.5px; } .where { max-width: 56vw; } }

/* resting thumbstick (touch only, walking places only) */
.stick-pad { position: fixed; left: 22px; bottom: calc(var(--safe-b) + var(--nav-h) + 34px); width: 96px; height: 96px; border-radius: 50%; border: 2px solid #ffffff2e; background: radial-gradient(#ffffff12, #ffffff05); pointer-events: none; z-index: 3; display: none; transition: opacity 200ms; }
.stick-pad i { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #ffffff55; }
.stick-pad.busy { opacity: 0; }
@media (pointer: coarse) { body[data-mode="floor"] .stick-pad, body[data-mode="lobby"] .stick-pad { display: block; } }
body.sheet-open .stick-pad { display: none !important; }

/* drops and limited editions */
.drop-hero { margin-top: 14px; padding: 14px 12px 12px; border-radius: 20px; background: radial-gradient(120% 90% at 50% 0%, #6b2bd9 0%, #2a1460 45%, #120b2e 100%); border: 1px solid #c58cff88; box-shadow: 0 0 40px #8b4dff33, inset 0 1px #ffffff22; }
.drop-tag { display: inline-block; padding: 3px 9px; border-radius: 8px; background: #ff3b6b; color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.drop-tag time { font-variant-numeric: tabular-nums; }
.drop-hero h3 { margin: 8px 0 2px; font-size: 26px; font-weight: 900; letter-spacing: -.01em; color: #fff; }
.drop-hero > p { font-size: 13px; color: #dccfff; }
.items.drop { grid-template-columns: repeat(2, 1fr); }
.item.limited { border-color: #ffd36a99; background: linear-gradient(#3d2a0d, #1c1330); box-shadow: inset 0 0 26px #ffd36a22; }
.item.limited > .rarity, .item-hero.limited .rarity { background: linear-gradient(90deg, #ffe08a, #ff9d4a); color: #3a1f00; }
.item-hero.limited { background: radial-gradient(circle at 50% 55%, #7a4a12, #160d2b 72%); }
.item.gone { opacity: .5; }
.stock { display: block; margin-top: 5px; font-size: 11px; font-weight: 800; color: #ffd8a8; }
.stock i { display: block; height: 4px; margin: 0 6px 3px; border-radius: 2px; background: linear-gradient(90deg, #ff9d4a var(--p), #ffffff1c var(--p)); }
.limited-line { margin-top: 10px; padding: 9px 12px; border-radius: 12px; background: #ffd36a1a; border: 1px solid #ffd36a55; color: #ffe7a8; font-size: 13px; }

/* coins */
.fast { margin-top: 14px; }
.fast-label, .packs-label { margin: 0 2px 7px; font-size: 12.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.packs-label { margin-top: 16px; }
.packs + .hint { min-height: 0; }
.pack.pick { border: 2px solid var(--gold); box-shadow: 0 0 26px #f2c35b33; }
.pack.busy { opacity: .6; }
.btn.outside { margin-top: 12px; }
.refer { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(90deg, #1f6b4a55, #1f6b4a18); border: 1px solid #8ee0b866; text-align: left; color: #d8ffec; }
.refer svg { width: 26px; height: 26px; color: var(--green); }
.refer span { display: flex; flex-direction: column; }
.refer b { font-size: 15px; }
.refer small { font-size: 12.5px; color: #b8e8d0; }

/* QA polish */
body[data-mode="ride"] .where, body[data-mode="ride"] .coins, body[data-mode="ride"] .prompt { pointer-events: none; }
.item-hero img:not([src]) { visibility: hidden; }
.decor-tools b, .decor-tools span { white-space: normal; line-height: 1.2; }
.prompt > span small { max-width: 52vw; }
.tray-item em { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); padding: 1px 6px; border-radius: 7px; background: #ffffff26; font-size: 9.5px; font-weight: 800; font-style: normal; color: #dfe6f5; }
body:has(.prompt.on) .stick-pad { opacity: 0; }
.sheet.k-shop .sheet-panel { min-height: min(82vh, 760px); }
@media (min-width: 900px) {
  .sheet.k-shop .sheet-panel { min-height: 0; }
  body.sheet-open .coins { margin-right: min(540px, 40vw); transition: margin 280ms var(--ease); }
}

/* Starter pack and bundles */
.starter { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; margin: 4px 0 12px; padding: 16px 14px 14px; border-radius: 18px; text-align: left; color: #fff6dc;
  background: linear-gradient(120deg, #6b4a12, #3a2508 60%, #22170a); border: 1px solid #ffd27a88; box-shadow: 0 0 0 1px #0006 inset, 0 10px 30px -12px #ffb34799; }
.starter-tag { position: absolute; top: -9px; left: 14px; padding: 2px 9px; border-radius: 9px; background: #ffcf5c; color: #2a1a00; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.starter-body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.starter-body b { font-size: 17px; }
.starter-body small { font-size: 12.5px; color: #ffe7b0; line-height: 1.3; }
.starter-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.starter-price s { font-size: 11px; color: #e8cf98aa; }
.starter-price b { font-size: 20px; color: #ffd27a; }
.bundles { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.bundle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px 8px 8px; border-radius: 16px; text-align: left; background: linear-gradient(90deg, #22346a, #142246); border: 1px solid #ffffff18; }
.bundle.owned { opacity: .55; }
.bundle-thumbs { display: grid; grid-template-columns: repeat(2, 30px); gap: 2px; flex: none; }
.bundle-thumbs img { width: 30px; height: 30px; object-fit: contain; border-radius: 7px; background: #ffffff10; }
.bundle-thumbs img:not([src]) { visibility: hidden; }
.bundle-thumbs.big { grid-template-columns: repeat(auto-fill, 64px); justify-content: center; gap: 6px; margin: 10px 0; }
.bundle-thumbs.big img { width: 64px; height: 64px; }
.bundle-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bundle-text b { font-size: 15px; }
.bundle-text small { font-size: 12px; color: #b9c6e8; }
.bundle-price { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; color: var(--amber); white-space: nowrap; }
.bundle-price em { font-style: normal; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 8px; background: #3ddc8a26; color: #8ff0bd; }
.bundle-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.bundle-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 12px; background: #ffffff0d; }
.bundle-row img { width: 40px; height: 40px; object-fit: contain; }
.bundle-row img:not([src]) { visibility: hidden; }
.bundle-row b { flex: 1; font-size: 14px; }
.bundle-row span { color: var(--amber); font-size: 13px; display: flex; }
.bundle-row.have span { color: #8ff0bd; }
.bundle-sum { text-align: center; color: #b9c6e8; font-size: 13px; margin: 0 0 8px; }
.starter.profile { background: linear-gradient(120deg, #3b1a6b, #1f0f3d 60%, #160a2b); border-color: #c79bff88; box-shadow: 0 0 0 1px #0006 inset, 0 10px 30px -12px #a26bff99; }
.starter.profile .starter-tag { background: #d6b4ff; color: #22073f; }
.starter.profile .starter-price b { color: #e2c8ff; }

/* Door editor */
.dslot { margin-top: 14px; }
.dslot-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dslot-head b { font-size: 14px; color: #dfe6f5; }
.chip.small { padding: 3px 10px; font-size: 12px; }
.dchips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.dchips::-webkit-scrollbar { display: none; }
.dchip { flex: none; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 6px 8px; border-radius: 14px; background: #ffffff0f; border: 1px solid #ffffff14; color: #fff; }
.dchip img { width: 60px; height: 60px; object-fit: contain; }
.dchip img:not([src]) { visibility: hidden; }
.dchip span { font-size: 11.5px; font-weight: 700; line-height: 1.15; text-align: center; min-height: 2.3em; display: flex; align-items: center; }
.dchip small { font-size: 11px; color: #b9c6e8; display: flex; align-items: center; gap: 2px; }
.dchip small svg { width: 12px; height: 12px; }
.dchip.on { border-color: var(--gold); background: #f2c35b1f; }
.dchip.on small { color: var(--gold); font-weight: 800; }
.dchip.shop small { color: var(--amber); }

/* Welcome / returning */
.welcome h2 { font-size: 26px; }
.welcome .btn { margin-top: 8px; }
.returning { margin: 4px 0 10px; padding: 8px 12px; border-radius: 12px; background: #f2c35b1a; border: 1px solid #f2c35b55; color: #ffe2a0; font-size: 13.5px; }
.bundle-price b { font-size: 16px; color: var(--amber); }
.bundle-price em s { color: #b9c6e8; font-weight: 600; }

/* "Your name in the next video": the top card on the shop's first tab */
.reel-offer { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; width: 100%; margin: 4px 0 12px; padding: 14px 16px; border-radius: 18px; text-align: left;
  background: radial-gradient(120% 140% at 0% 0%, #6b1f2a 0%, #2a1630 55%, #141a38 100%); border: 1px solid #ffcf6b55; box-shadow: 0 0 0 1px #00000040 inset, 0 10px 30px #0006; }
.reel-offer .reel-top { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.reel-offer .reel-sale { padding: 2px 8px; border-radius: 8px; background: #ff4d5e; color: #fff; }
.reel-offer .reel-left { color: #ffd98a; }
.reel-offer .reel-left b { color: #fff; font-size: 13px; }
.reel-offer .reel-title { grid-column: 1; font-size: 18px; line-height: 1.2; }
.reel-offer small { grid-column: 1; color: #e8dcff; opacity: .85; font-size: 12.5px; line-height: 1.35; }
.reel-offer .bundle-price { grid-column: 2; grid-row: 2 / span 2; align-self: center; font-size: 18px; }
.reel-offer[disabled] { opacity: .6; }
.suite-offer { background: radial-gradient(120% 140% at 0% 0%, #5a4313 0%, #2b2414 50%, #141a38 100%); border-color: #ffd98a66; }
.subtabs { display: flex; gap: 6px; overflow-x: auto; margin: 2px 0 10px; scrollbar-width: none; }
.subtabs button { flex: none; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #ffffff10; border: 1px solid #ffffff1c; color: #dfe6ff; }
.subtabs button[aria-pressed="true"] { background: #fff; color: #0b1430; }
.see-items { width: 100%; margin-top: 4px; }
