:root {
  --ink: #e8f1f5;
  --muted: #8fa6b3;
  --panel: rgba(12, 28, 40, .94);
  --panel2: #0a1824;
  --line: rgba(120, 190, 220, .18);
  --gold: #f2c94c;
  --gold2: #e2a92b;
  --cyan: #4fd1e8;
  --red: #ff4545;
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
:root { --app-h: 100vh; }
@supports (height: 100dvh) { :root { --app-h: 100dvh; } }
html, body { margin: 0; height: 100%; height: var(--app-h); background: #02070b; color: var(--ink); font-family: var(--font); overflow: hidden;
  -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
#view { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; height: var(--app-h); display: block; touch-action: none; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .28s; z-index: 5; }
#fade.on { opacity: 1; }

#loading { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 50% 40%, #0b3346 0%, #03101a 60%, #01060a 100%); transition: opacity .5s; }
#loading.gone { opacity: 0; pointer-events: none; }
#loading .brand { font-weight: 900; font-size: 22px; color: var(--gold); letter-spacing: .02em; }
#loading .sub { margin-top: 6px; color: var(--muted); font-size: 13px; }

.hud { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 10;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.chip { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); background: rgba(6, 20, 32, .85);
  border-radius: 12px; padding: 7px 12px; text-align: left; }
.chip-title { font-weight: 900; color: var(--gold); font-size: 14px; }
.chip-sub { font-size: 12px; color: var(--ink); opacity: .85; }
.hud-right { display: flex; gap: 8px; align-items: center; }
.hud-left { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
/* the daily rewards tab, top left */
.dailybtn { position: relative; display: flex; align-items: center; gap: 5px; height: 36px; padding: 0 11px 0 8px; border-radius: 12px;
  border: 1px solid #b8891c; background: linear-gradient(180deg, #3a2a06, #1d1503); color: var(--gold); font-weight: 900;
  font-size: 12px; white-space: nowrap; box-shadow: 0 0 0 1px rgba(242, 201, 76, .15) inset; }
.dailybtn .dgift { font-size: 17px; line-height: 1; }
.dailybtn .ddot { display: none; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%;
  background: #ff4d4d; border: 2px solid #1d1503; }
.dailybtn.ready { background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #1b1400; border-color: #ffe9a3;
  box-shadow: 0 2px 0 #9a6f10, 0 0 14px rgba(242, 201, 76, .45); animation: dailyGlow 2.4s ease-in-out infinite; }
.dailybtn.ready .ddot { display: block; }
@keyframes dailyGlow { 50% { box-shadow: 0 2px 0 #9a6f10, 0 0 22px rgba(242, 201, 76, .8); } }
.pill { border: 1px solid var(--line); background: rgba(6, 20, 32, .85); border-radius: 999px; padding: 8px 12px; font-size: 12px;
  font-weight: 800; color: var(--cyan); white-space: nowrap; }
.round { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(6, 20, 32, .85); font-size: 15px; }

.walk { position: fixed; z-index: 9; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom));
  display: flex; gap: 120px; }
.walk button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: rgba(6, 20, 32, .7);
  font-size: 16px; color: var(--cyan); }

.dock { position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: max(10px, env(safe-area-inset-bottom));
  display: flex; gap: 4px; padding: 5px; background: rgba(8, 22, 34, .92); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.dock button { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent;
  border-radius: 11px; padding: 6px 10px; min-width: 60px; font-size: 11px; font-weight: 800; color: var(--ink); }
.dock button .ic { font-size: 16px; line-height: 20px; }
.dock button .ic.red { color: var(--red); font-weight: 900; font-size: 13px; letter-spacing: -.02em; }
.dock button.active { background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #1b1400; }
.dock button.active .ic.red { color: #8a0000; }

#caption { position: fixed; z-index: 8; left: 0; right: 0; top: 22%; text-align: center; font-weight: 900; font-size: 26px;
  color: var(--red); text-shadow: 0 0 18px rgba(255, 30, 30, .6); opacity: 0; transition: opacity .4s; pointer-events: none;
  letter-spacing: .04em; }
#caption.on { opacity: 1; }
#toast { position: fixed; z-index: 30; left: 50%; top: 76px; transform: translate(-50%, -10px); max-width: min(92vw, 420px);
  background: rgba(8, 22, 34, .96); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 14px;
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

.sheet { position: fixed; z-index: 20; top: 10px; right: 10px; bottom: 10px; width: min(380px, calc(100vw - 20px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px; overflow-y: auto;
  transform: translateX(110%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); backdrop-filter: blur(6px); }
.sheet.open { transform: none; }
/* a closed card is also hidden, so no edge of it can peek out above the bottom buttons (it slides by its own height,
   which is less than its distance from the bottom on short cards) */
.sheet:not(.open) { visibility: hidden; transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s; }
@media (max-width: 640px) {
  .sheet { top: auto; left: 8px; right: 8px; width: auto; max-height: 78vh; max-height: calc(var(--app-h) * .78); bottom: 8px; transform: translateY(calc(110% + 100px + env(safe-area-inset-bottom))); border-radius: 18px; }
  .walk { gap: 90px; }
  .dock button { min-width: 54px; padding: 6px 6px; }
}
.close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: #102536; }
.kicker { font-size: 11px; font-weight: 900; letter-spacing: .14em; color: var(--gold); text-transform: uppercase; }
.sheet h2 { margin: 6px 0 8px; font-size: 26px; font-weight: 900; line-height: 1.1; }
.sheet p { margin: 0 0 12px; color: #c4d4dc; font-size: 14px; line-height: 1.45; }
.note { background: rgba(242, 201, 76, .1); border: 1px solid rgba(242, 201, 76, .3); color: #f6e3a0; border-radius: 10px;
  padding: 9px 11px; font-size: 13px; margin-bottom: 12px; }
.note.red { background: rgba(255, 60, 60, .1); border-color: rgba(255, 60, 60, .35); color: #ffb3b3; }
.field { display: flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; margin-bottom: 12px; }
.field:focus-within { border-color: var(--cyan); }
.field span { color: var(--muted); font-weight: 800; }
.field input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 16px;
  padding: 13px 0; }
.label { font-size: 12px; font-weight: 800; color: var(--muted); margin: 4px 0 6px; }
.zones { display: grid; gap: 6px; margin-bottom: 14px; }
.zone { display: flex; justify-content: space-between; align-items: center; text-align: left; border: 1px solid var(--line);
  background: var(--panel2); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 800; }
.zone small { font-weight: 600; color: var(--muted); font-size: 12px; }
.zone.on { border-color: var(--gold); background: rgba(242, 201, 76, .12); }
.zone.danger.on { border-color: var(--red); background: rgba(255, 60, 60, .12); }
.btn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 14px; font-weight: 900; font-size: 16px; text-align: center;
  background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #1b1400; box-shadow: 0 3px 0 var(--gold2); text-decoration: none; }
.btn:disabled { opacity: .6; }
.btn.ghost { background: #10283a; color: var(--ink); box-shadow: none; border: 1px solid var(--line); margin-top: 8px; }
.btn.red { background: linear-gradient(180deg, #ff6b6b, #d92b2b); color: #fff; box-shadow: 0 3px 0 #8f1010; }
.fine { font-size: 12px; color: var(--muted); margin-top: 10px; }
.err { color: #ff9b9b; font-size: 13px; min-height: 18px; margin: -6px 0 8px; }
.big { font-size: 44px; font-weight: 900; color: var(--gold); line-height: 1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.stat { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 11px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.bar { height: 10px; background: #0a1a26; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); margin: 8px 0 4px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--gold)); border-radius: 99px; min-width: 4px; }
.miles { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.miles li { display: flex; gap: 10px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font-size: 14px; }
.miles li b { color: var(--cyan); min-width: 64px; font-variant-numeric: tabular-nums; }
.miles li.done { border-color: rgba(79, 209, 232, .5); }
.miles li.done::after { content: "✓"; margin-left: auto; color: var(--cyan); font-weight: 900; }
.row { display: flex; gap: 8px; }
.row .btn { flex: 1; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.quick button { border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 10px; font-weight: 800; font-size: 13px; }
a { color: var(--cyan); }

/* ---------- v2: dock, lift, shop, checkout ---------- */
.pill.coin { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 15px; font-weight: 900; padding: 4px 4px 4px 8px; }
.pill.coin .cdot { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2a8, #f2c94c 55%, #c9951c);
  box-shadow: inset 0 0 0 2px #e2a92b; }
.pill.coin .cplus { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(180deg, #ffe07a, var(--gold));
  color: #1b1400; font-size: 19px; line-height: 1; box-shadow: 0 2px 0 #9a6f10; }
.pill.coin:active .cplus { transform: translateY(1px); box-shadow: 0 1px 0 #9a6f10; }
.dock { gap: 2px; padding: 6px; border-radius: 18px; background: rgba(28, 30, 70, .94); border-color: rgba(140, 140, 255, .18); }
.dock button { min-width: 64px; padding: 7px 10px; gap: 3px; border-radius: 13px; }
.dock button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock button.active { background: linear-gradient(180deg, #ffe680, #f0c93a); color: #1b1400; box-shadow: 0 2px 0 #c89b1c; }
.backlink { border: 0; background: none; color: var(--muted); font-weight: 800; font-size: 15px; padding: 0 0 10px; }
.price { font-size: 30px; font-weight: 900; color: var(--gold); margin: 4px 0 14px; }
.or { text-align: center; font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  margin: 14px 0; display: flex; gap: 10px; align-items: center; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#express { margin-bottom: 4px; }
#payEl { min-height: 60px; margin-bottom: 10px; }
#payBtn { margin-top: 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: 4px; margin: 10px 0 6px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 9px; font-weight: 900; font-size: 14px; color: var(--muted); }
.seg button.on { background: #18374b; color: var(--ink); }
.coinbar { display: flex; justify-content: space-between; align-items: center; font-size: 15px; color: var(--gold); }
.linkbtn { border: 0; background: none; color: var(--cyan); font-weight: 800; font-size: 13px; text-decoration: underline; }
.items { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.item { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left;
  border: 1px solid var(--line); background: var(--panel2); border-radius: 12px; padding: 9px 10px; }
.item .sw { grid-row: span 2; font-size: 22px; width: 30px; text-align: center; }
.item .sw.dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); }
.item .sw.galaxy { background: radial-gradient(circle at 30% 30%, #fff 0 1px, transparent 2px), linear-gradient(135deg, #1a0b3d, #3b1d6e, #0d2a5c); }
.item .sw.rainbow { background: conic-gradient(red, orange, yellow, lime, cyan, blue, magenta, red); }
.item .nm { font-size: 13px; font-weight: 800; line-height: 1.2; }
.item .act { font-size: 12px; font-weight: 900; color: var(--gold); }
.item.on { border-color: var(--cyan); background: rgba(79, 209, 232, .1); }
.item.on .act { color: var(--cyan); }
.item.poor .act { color: var(--muted); }
.packs { display: grid; gap: 8px; margin-top: 8px; }
.pack { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); background: var(--panel2);
  border-radius: 14px; padding: 14px; font-size: 16px; color: var(--gold); }
.pack s { color: var(--muted); font-size: 13px; margin-left: 4px; }
.pack .pr { background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #1b1400; border-radius: 10px; padding: 7px 12px; font-size: 14px; }
.lift { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 16px; }
.lcard { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 1px solid rgba(140, 140, 255, .15);
  background: #23255a; border-radius: 14px; padding: 16px 14px; min-height: 76px; }
.lcard b { font-size: 15px; font-weight: 900; }
.lcard span { font-size: 12px; color: #b9bfd8; }
.lcard.feat { grid-column: 1 / -1; background: linear-gradient(180deg, #1f2a22, #17201c); border-color: rgba(242, 201, 76, .5); }
.lcard.feat b { color: var(--gold); }
.lcard.red { background: #3a1018; border-color: rgba(255, 69, 69, .45); }
.lcard.red b { color: #ff8f8f; }
.goform { display: flex; gap: 8px; }
.goform input { flex: 1; min-width: 0; background: #0b0d2a; border: 1px solid rgba(140, 140, 255, .2); border-radius: 12px; color: var(--ink);
  font: inherit; font-size: 16px; padding: 12px 14px; outline: 0; }
.goform input:focus { border-color: var(--gold); }
.goform .btn { width: auto; padding: 12px 18px; }
.board { display: grid; gap: 6px; margin-bottom: 12px; }
.rank { display: grid; grid-template-columns: 26px 1fr; text-align: left; border: 1px solid var(--line); background: var(--panel2);
  border-radius: 12px; padding: 9px 12px; }
.rank i { grid-row: span 2; font-style: normal; font-weight: 900; color: var(--gold); align-self: center; }
.rank b { font-size: 14px; }
.rank span { font-size: 12px; color: var(--muted); }

[hidden] { display: none !important; }
@media (max-width: 640px) {
  .sheet { bottom: calc(78px + env(safe-area-inset-bottom)); max-height: calc(100vh - 150px); max-height: calc(var(--app-h) - 150px - env(safe-area-inset-top)); }
}
.dock button span { white-space: nowrap; }

/* ---------- v3: games ---------- */
.dock button { position: relative; }
.dock .dot { position: absolute; top: 4px; right: 14px; width: 9px; height: 9px; border-radius: 50%; background: #ff5a4f;
  box-shadow: 0 0 0 2px rgba(28, 30, 70, .94); }
.gcards { display: grid; gap: 12px; margin: 14px 0; }
.gcard { position: relative; display: grid; grid-template-columns: 104px 1fr; gap: 12px; align-items: center; text-align: left;
  border: 1px solid rgba(140, 160, 200, .2); background: #26323f; border-radius: 16px; padding: 14px 12px; }
.gcard canvas { width: 104px; height: 74px; border-radius: 10px; }
.gbody { display: flex; flex-direction: column; gap: 4px; }
.gbody b { font-size: 17px; font-weight: 900; }
.gbody > span { font-size: 13px; color: #c4d4dc; line-height: 1.35; }
.gmeta { display: flex; gap: 10px; font-size: 12px; font-weight: 800; }
.gmeta em { font-style: normal; color: var(--gold); }
.gmeta i { font-style: normal; color: var(--muted); }
.newtag { position: absolute; top: -9px; left: 12px; background: #ff5a4f; color: #fff; font-size: 11px; font-weight: 900;
  letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; }
.daily { background: #172028; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.drow { display: flex; justify-content: space-between; font-size: 14px; }

.game { position: fixed; inset: 0; z-index: 40; background: rgba(1, 6, 10, .82); display: grid; place-items: center; padding: 10px;
  backdrop-filter: blur(4px); }
.game-box { position: relative; width: min(460px, 100%); height: min(720px, 100%); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.game-top { display: flex; justify-content: space-between; align-items: flex-start; }
.game-top .close { position: static; }
.game-title { font-size: 22px; font-weight: 900; }
.game-hud { display: flex; justify-content: space-between; font-weight: 900; font-size: 14px; margin: 10px 0 6px; color: var(--gold); }
.game-hud .g-extra { color: #ff8f8f; }
.game-hud .g-time { color: var(--cyan); font-variant-numeric: tabular-nums; }
.game-bar { height: 6px; background: #0a1a26; border-radius: 9px; overflow: hidden; margin-bottom: 10px; }
.game-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--cyan), var(--gold)); }
.game-stage { position: relative; flex: 1; min-height: 0; border-radius: 12px; overflow: hidden; touch-action: none; }
.game-stage canvas { display: block; }
.game-card { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 24px;
  background: rgba(6, 18, 28, .88); text-align: center; }
.game-card h3 { margin: 0; font-size: 24px; font-weight: 900; }
.game-card p { margin: 0; color: #c4d4dc; font-size: 14px; line-height: 1.45; }
.game-card .big { margin: 0; }
.game-card .earned { color: var(--gold); font-weight: 900; font-size: 22px; }

/* ---------- v4: supply depot, rarity, offers, coupons ---------- */
:root { --rare: #4f8ff7; --epic: #b06cff; }
.shophead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.shophead h2 { margin: 2px 0 0; }
.coinbtn { display: flex; flex-direction: column; align-items: flex-end; border: 1px solid rgba(242, 201, 76, .4); background: rgba(242, 201, 76, .08);
  border-radius: 12px; padding: 6px 12px; line-height: 1.1; }
.coinbtn b { color: var(--gold); font-size: 18px; }
.coinbtn b::before { content: "🪙 "; font-size: 14px; }
.coinbtn span { font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.cchip { display: inline-flex; gap: 6px; align-items: center; background: linear-gradient(90deg, #ff8a3d, #ff4f8b); color: #fff; font-weight: 900;
  font-size: 12px; border-radius: 999px; padding: 4px 10px; margin: 2px 0 8px; }
.cchip small { opacity: .85; font-weight: 800; }
.cbanner { display: flex; gap: 10px; background: rgba(255, 120, 80, .1); border: 1px dashed rgba(255, 140, 90, .5); border-radius: 12px;
  padding: 10px 12px; font-size: 13px; color: #ffd9c4; margin-bottom: 12px; }
.cbanner > span { font-size: 20px; }
.cbanner b { color: #fff; }
.sechead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 18px; }
.sechead b { color: var(--ink); font-size: 14px; }
.sechead b { white-space: nowrap; }
.sechead span { font-weight: 700; font-size: 11px; text-align: right; }
.offer, .bundle { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border-radius: 14px;
  padding: 16px 12px 12px; margin-top: 12px; border: 1px solid var(--line); background: var(--panel2); }
.offer:disabled { opacity: .5; }
.offer.gold { background: linear-gradient(135deg, #3a2a05, #1d1604); border-color: rgba(242, 201, 76, .55); }
.offer.red { background: linear-gradient(135deg, #3d0c12, #1e0609); border-color: rgba(255, 90, 90, .5); }
.offer.navy { background: linear-gradient(135deg, #0d1b3d, #071022); border-color: rgba(242, 201, 76, .45); }
.offer.slate { background: linear-gradient(135deg, #1f2a3d, #0f1622); border-color: rgba(200, 215, 235, .3); }
.offer.plain, .bundle { padding-top: 12px; }
.otag { position: absolute; top: -9px; left: 12px; background: var(--gold); color: #1b1400; font-size: 10px; font-weight: 900; letter-spacing: .08em;
  border-radius: 999px; padding: 2px 8px; }
.offer.red .otag { background: #ff5a5a; color: #fff; }
.offer.slate .otag { background: #c8d7eb; color: #0f1622; }
.offer.owned .otag { background: var(--cyan); color: #032029; }
.obody { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.obody b { font-size: 15px; }
.obody > span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.orow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mini { border: 0; border-radius: 9px; padding: 6px 10px; font-size: 12px; font-weight: 900; background: var(--gold); color: #1b1400; }
.mini.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.ocost { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.ocost b { background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #1b1400; border-radius: 10px; padding: 7px 10px; font-size: 14px; }
.ocost b small { font-size: 11px; }
.ocost s { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.ominis, .bminis { display: grid; grid-template-columns: repeat(2, 26px); gap: 3px; flex: none; }
.ominis .art, .bminis .art { width: 26px; height: 26px; border-radius: 7px; }
.ominis .emo, .bminis .emo { font-size: 15px; }
.bcost { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.bcost b { color: var(--gold); font-size: 15px; }
.bcost em { font-style: normal; font-size: 10px; font-weight: 900; background: #1f8f5a; color: #fff; border-radius: 999px; padding: 2px 7px; }
.bundle .obody s { color: var(--muted); }

.art { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: #0f2434; border: 1px solid var(--line); overflow: hidden; }
.art.big { width: 96px; height: 96px; border-radius: 20px; }
.art.rare { border-color: var(--rare); box-shadow: inset 0 0 12px rgba(79, 143, 247, .35); }
.art.epic { border-color: var(--epic); box-shadow: inset 0 0 14px rgba(176, 108, 255, .45); }
.art .emo { font-size: 24px; line-height: 1; }
.art.big .emo { font-size: 54px; }
.art .sw { width: 70%; height: 70%; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); }
.art .sw.galaxy { background: radial-gradient(circle at 30% 30%, #fff 0 1px, transparent 2px), linear-gradient(135deg, #1a0b3d, #3b1d6e, #0d2a5c); }
.art .sw.biolum { background: radial-gradient(circle at 30% 40%, #7fffd4 0 2px, transparent 3px), radial-gradient(circle at 65% 65%, #4fd1e8 0 2px, transparent 3px), #04161f; }
.art .sw.rainbow { background: conic-gradient(red, orange, yellow, lime, cyan, blue, magenta, red); }
.rtag { position: absolute; top: 6px; right: 6px; font-size: 9px; font-weight: 900; letter-spacing: .08em; border-radius: 6px; padding: 2px 5px; color: #fff; z-index: 1; }
.rtag.rare { background: var(--rare); }
.rtag.epic { background: var(--epic); }

.cats { display: flex; gap: 6px; overflow-x: auto; margin: 4px 0 6px; padding-bottom: 2px; scrollbar-width: none; }
.cats button { flex: none; border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 7px 13px; font-weight: 900; font-size: 13px; color: var(--muted); }
.cats button.on { background: var(--ink); color: #071018; border-color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel2);
  border-radius: 12px; padding: 12px 6px 10px; text-align: center; }
.tile b { font-size: 12px; line-height: 1.2; }
.tile .tp { font-size: 12px; font-weight: 900; color: var(--gold); }
.tile.rare { border-color: rgba(79, 143, 247, .6); background: linear-gradient(180deg, rgba(79, 143, 247, .14), var(--panel2)); }
.tile.epic { border-color: rgba(176, 108, 255, .7); background: linear-gradient(180deg, rgba(176, 108, 255, .18), var(--panel2)); }
.tile.on { border-color: var(--cyan); }
.tile.on .tp { color: var(--cyan); }
.itemhero { position: relative; display: grid; place-items: center; padding: 18px; border-radius: 16px; background: var(--panel2); margin-bottom: 12px; border: 1px solid var(--line); }
.itemhero.rare { background: radial-gradient(circle, rgba(79, 143, 247, .25), var(--panel2) 70%); border-color: var(--rare); }
.itemhero.epic { background: radial-gradient(circle, rgba(176, 108, 255, .3), var(--panel2) 70%); border-color: var(--epic); }
.itemhero .rtag { font-size: 11px; top: 10px; right: 10px; }
.ctoggle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 800; background: rgba(255, 120, 80, .1);
  border: 1px dashed rgba(255, 140, 90, .5); border-radius: 10px; padding: 9px 10px; margin-bottom: 10px; }
.ctoggle input { width: 18px; height: 18px; accent-color: #ff7a4d; }
.ctoggle s { color: var(--muted); }
.ctoggle b { color: var(--gold); }
.price .was, .price small { font-size: 16px; color: var(--muted); font-weight: 800; }
.blist { display: grid; gap: 6px; margin: 8px 0 12px; }
.bl { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 6px 6px; }
.bl b { flex: 1; font-size: 13px; }
.bl span { font-size: 12px; font-weight: 900; color: var(--gold); }
.bl .art { width: 34px; height: 34px; }
.bl .art .emo { font-size: 19px; }
.pack > span:first-child { font-weight: 800; }

.dropwrap { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(0, 6, 12, .7); padding: 20px;
  animation: dropIn .25s ease-out; }
.dropcard { width: min(340px, 100%); background: #0c1c28; border: 1px solid var(--line); border-radius: 22px; padding: 22px 18px 16px; text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6); animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1); }
.dropcard .dk { font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 14px; }
.dropcard h3 { margin: 14px 0 4px; font-size: 20px; }
.dropcard p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.ticket { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 170px; padding: 16px 24px;
  border-radius: 14px; background: linear-gradient(135deg, #ff8a3d, #ff4f8b); color: #fff; transform: rotate(-4deg);
  box-shadow: 0 8px 24px rgba(255, 90, 120, .35); }
.ticket::before, .ticket::after { content: ""; position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: #0c1c28; }
.ticket::before { left: -9px; }
.ticket::after { right: -9px; }
.ticket span { font-size: 20px; }
.ticket b { font-size: 44px; line-height: 1; font-weight: 900; }
.ticket small { font-size: 14px; font-weight: 900; letter-spacing: .2em; }
.ticket.coins { background: linear-gradient(135deg, #ffe07a, #e2a92b); color: #1b1400; }
.ticket.item { background: none; box-shadow: none; transform: none; padding: 0; }
.ticket.item::before, .ticket.item::after { display: none; }
@keyframes dropIn { from { opacity: 0; } }
@keyframes popIn { from { transform: scale(.7); opacity: 0; } }

@media (max-width: 420px) {
  .chip-title { white-space: nowrap; }
  #crewPill .crewWord { display: none; }
  .hud, .hud-right { gap: 5px; }
  .chip { padding: 6px 9px; }
  .hud-left { flex-direction: column; gap: 5px; }
  .dailybtn { height: 32px; padding: 0 8px 0 6px; font-size: 11px; }
  .dailybtn .dgift { font-size: 15px; }
  .pill { padding: 7px 9px; }
  .round { width: 32px; height: 32px; }
  .chip-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
  .pill.coin { font-size: 14px; gap: 6px; padding: 3px 3px 3px 7px; }
  .pill.coin .cdot { width: 16px; height: 16px; }
  .pill.coin .cplus { width: 23px; height: 23px; font-size: 17px; }
}

/* ---------- v5: your-bunk card and panel ---------- */
.mycard { position: fixed; z-index: 9; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 18px; min-width: 250px; padding: 9px 9px 9px 18px; border-radius: 18px;
  background: rgba(8, 18, 34, .92); border: 1px solid var(--line); box-shadow: 0 8px 26px rgba(0, 0, 0, .45); text-align: left; }
.mycard .mct { flex: 1; display: flex; flex-direction: column; line-height: 1.15; }
.mycard .mct b { font-size: 18px; color: #fff; }
.mycard .mct small { font-size: 13px; color: var(--muted); font-weight: 800; }
.mcopen { background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #1b1400; font-weight: 900; font-size: 16px;
  border-radius: 13px; padding: 11px 20px; box-shadow: 0 3px 0 #9a6f10; }
.mycard:active .mcopen { transform: translateY(2px); box-shadow: 0 1px 0 #9a6f10; }

.handle { color: var(--muted); font-weight: 800; margin: -4px 0 12px; }
.stylebox { background: #1a2a3c; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.stylebox .sthead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stylebox .sthead b { font-size: 15px; }
.stylebox .sthead span { font-size: 12px; font-weight: 900; color: var(--gold); }
.stylebox small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.stylebox .bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); margin-top: 10px; overflow: hidden; }
.stylebox .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--gold)); border-radius: 6px; }
.stylebox .sthow { margin-top: 8px; font-size: 11px; opacity: .8; }
.stylebox.lv2 { border-color: rgba(79, 209, 232, .45); }
.stylebox.lv3 { border-color: rgba(176, 108, 255, .55); }
.stylebox.lv4 { border-color: rgba(242, 201, 76, .6); }

.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mbtn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 14px; padding: 10px 12px;
  font-weight: 900; font-size: 14px; text-align: center; line-height: 1.2; border: 1px solid transparent; }
.mbtn svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mbtn em { font-style: normal; font-size: 11px; font-weight: 900; color: var(--gold); }
.mbtn.gold { background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #1b1400; box-shadow: 0 3px 0 #9a6f10; min-height: 66px; }
.mbtn.navy { background: #22264f; color: #fff; }
.mbtn.line { background: transparent; border-color: var(--line); color: var(--ink); }
.mbtn.wide { grid-column: span 2; }
.mbtn:active { transform: translateY(1px); }

.settings { margin-top: 16px; }
.settings summary { cursor: pointer; font-size: 13px; font-weight: 900; color: var(--muted); list-style: none; padding: 4px 0; }
.settings summary::before { content: "▸ "; }
.settings[open] summary::before { content: "▾ "; }
.srow { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 12px 2px; border: 0;
  border-bottom: 1px solid var(--line); background: none; color: var(--ink); font-size: 14px; font-weight: 700; text-align: left; text-decoration: none; }
.srow i { font-style: normal; color: var(--muted); }
.srow input { width: 20px; height: 20px; accent-color: var(--gold); }
.srow.danger { color: #ff9b9b; }

.drow2 { margin: 14px 0 4px; }
.dlabel { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dlabel b { font-size: 14px; }
.dchips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.dchip { flex: none; width: 82px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel2); font-size: 11px; font-weight: 800; text-align: center; line-height: 1.15; }
.dchip.on { border-color: var(--cyan); background: rgba(79, 209, 232, .12); }
.dchip.rare:not(.on) { border-color: rgba(79, 143, 247, .5); }
.dchip.epic:not(.on) { border-color: rgba(176, 108, 255, .6); }
.dchip.more { border-style: dashed; color: var(--gold); }
.dchip.more .art { font-size: 22px; color: var(--gold); }

.linkbox { display: flex; gap: 6px; margin: 4px 0 10px; }
.linkbox input { flex: 1; min-width: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px;
  color: var(--ink); font: inherit; font-size: 13px; }

.npieces { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.np { position: relative; min-height: 70px; border-radius: 10px; border: 1px dashed var(--line); background: rgba(255, 255, 255, .02);
  display: grid; place-items: center; color: var(--muted); font-weight: 900; }
.np.got { grid-column: span 4; min-height: 0; place-items: stretch; border-style: solid; border-color: rgba(230, 210, 160, .35);
  background: #e9dfc4; color: #2c2416; padding: 10px 12px 10px 36px; transform: rotate(-.4deg); }
.np.got:nth-child(even) { transform: rotate(.5deg); }
.np.got span { position: absolute; left: 11px; top: 10px; font-size: 12px; color: #8a7a55; }
.np.got p { margin: 0; font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-size: 15px; line-height: 1.35; }
.thanks .ticket { min-width: 150px; }
.thanks .ticket span { font-size: 34px; }
.thanks p.thx { font-size: 13px; margin-top: -8px; }
.thanks h3 { font-size: 24px; }
.ticket.note { background: linear-gradient(135deg, #efe4c6, #c9b483); color: #2c2416; }

@media (max-width: 420px) {
  .mycard { min-width: 0; width: calc(100vw - 24px); }
}

/* ---------- v6: mythic, legendary, exotic + collection book ---------- */
:root { --mythic: #ff3b3b; --legendary: #f2c94c; --exo: linear-gradient(90deg, #ff4f8b, #ffb34d, #5cff9d, #4fd1e8, #b06cff, #ff4f8b); }
@keyframes exo { to { background-position: 200% 0; } }
.rtag.mythic { background: var(--mythic); }
.rtag.legendary { background: var(--legendary); color: #1b1400; }
.rtag.exotic { background: var(--exo); background-size: 200% 100%; animation: exo 3s linear infinite; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.art.mythic { border-color: var(--mythic); box-shadow: inset 0 0 14px rgba(255, 59, 59, .5); }
.art.legendary { border-color: var(--legendary); box-shadow: inset 0 0 16px rgba(242, 201, 76, .55); }
.art.exotic { border-color: transparent; box-shadow: inset 0 0 16px rgba(176, 108, 255, .6), 0 0 0 2px #b06cff; }
.tile.mythic { border-color: rgba(255, 59, 59, .75); background: linear-gradient(180deg, rgba(255, 59, 59, .2), var(--panel2)); }
.tile.legendary { border-color: rgba(242, 201, 76, .8); background: linear-gradient(180deg, rgba(242, 201, 76, .22), var(--panel2)); }
.tile.exotic { border-color: transparent; background: linear-gradient(var(--panel2), var(--panel2)) padding-box, var(--exo) border-box;
  background-size: 100% 100%, 200% 100%; animation: exo 3s linear infinite; border: 2px solid transparent; }
.itemhero.mythic { background: radial-gradient(circle, rgba(255, 59, 59, .3), var(--panel2) 70%); border-color: var(--mythic); }
.itemhero.legendary { background: radial-gradient(circle, rgba(242, 201, 76, .32), var(--panel2) 70%); border-color: var(--legendary); }
.itemhero.exotic { background: radial-gradient(circle, rgba(176, 108, 255, .35), rgba(79, 209, 232, .12) 45%, var(--panel2) 75%); border-color: #b06cff; }
.dchip.mythic:not(.on) { border-color: rgba(255, 59, 59, .6); }
.dchip.legendary:not(.on) { border-color: rgba(242, 201, 76, .7); }
.dchip.exotic:not(.on) { border-color: #b06cff; }
.rname { font-weight: 900; text-transform: capitalize; }
.rname.common { color: #c9d6dd; }
.rname.rare { color: var(--rare); }
.rname.epic { color: var(--epic); }
.rname.mythic { color: var(--mythic); }
.rname.legendary { color: var(--legendary); }
.rname.exotic { background: var(--exo); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: exo 3s linear infinite; }
.art .sw.magma { background: radial-gradient(circle at 30% 40%, #ff7a1f 0 3px, transparent 5px), radial-gradient(circle at 70% 60%, #ff3b1f 0 3px, transparent 5px), #2a0603; }
.art .sw.goldleaf { background: linear-gradient(135deg, #8a6210, #ffe28a 45%, #c9971f 60%, #8a6210); }
.art .sw.aurora { background: linear-gradient(160deg, #05141a 10%, #3cffaa 40%, #b45aff 70%, #05141a 95%); }
.offer.exotic { background: radial-gradient(circle at 15% 50%, rgba(176, 108, 255, .35), transparent 60%), #0d0820;
  border: 2px solid transparent; background-clip: padding-box; box-shadow: 0 0 0 2px #b06cff, 0 0 24px rgba(176, 108, 255, .35); }
.offer.exotic .otag { background: var(--exo); background-size: 200% 100%; animation: exo 3s linear infinite; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }

.bset { border: 1px solid var(--line); border-radius: 14px; background: var(--panel2); padding: 12px; margin-top: 10px; }
.bset.rare { border-color: rgba(79, 143, 247, .35); }
.bset.epic { border-color: rgba(176, 108, 255, .4); }
.bset.mythic { border-color: rgba(255, 59, 59, .45); }
.bset.legendary { border-color: rgba(242, 201, 76, .5); }
.bset.exotic { border-color: #b06cff; }
.bset.ready { box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(242, 201, 76, .3); }
.bset.claimed { opacity: .75; }
.bshead { display: flex; align-items: baseline; gap: 8px; }
.bshead b { flex: 1; font-size: 15px; }
.bshead .rname { font-size: 11px; }
.bshead em { font-style: normal; font-weight: 900; color: var(--muted); font-size: 13px; }
.bitems { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.bi { border: 0; background: none; padding: 0; }
.bi .art { width: 44px; height: 44px; }
.bi:not(.have) .art { background: #0a141c; filter: saturate(.6); }
.bi .q { font-weight: 900; color: rgba(255, 255, 255, .35); font-size: 18px; }
.bsfoot { display: flex; justify-content: flex-end; font-size: 12px; font-weight: 800; color: var(--muted); }
.bsfoot .ok { color: #5cd68a; }

/* ---------- v7: the cabin (decorate inside) ---------- */
#roomUI[hidden] { display: none; }
#roomUI .rout { position: fixed; z-index: 11; left: 10px; top: calc(max(10px, env(safe-area-inset-top)) + 58px);
  border: 1px solid var(--line); background: rgba(8, 22, 34, .92); border-radius: 12px; padding: 8px 12px; font-weight: 900; font-size: 13px; }
#roomUI .rpanel { position: fixed; z-index: 11; left: 50%; transform: translateX(-50%); bottom: calc(max(10px, env(safe-area-inset-bottom)) + 66px);
  width: min(560px, calc(100vw - 16px)); display: flex; flex-direction: column; gap: 6px; align-items: center; }
#roomUI .rsel { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; background: rgba(8, 22, 34, .95);
  border: 1px solid var(--line); border-radius: 14px; max-width: 100%; }
#roomUI .rsel b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 4px; }
#roomUI .rsel button { border: 0; border-radius: 10px; padding: 7px 11px; font-weight: 900; font-size: 13px; white-space: nowrap; }
#roomUI .rsel .ry { background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #1b1400; }
#roomUI .rsel .rw { background: #fff; color: #0a1824; }
#roomUI .rtabs { display: flex; gap: 4px; padding: 4px; background: rgba(8, 22, 34, .92); border: 1px solid var(--line); border-radius: 12px; width: 100%; }
#roomUI .rtabs button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 7px 4px; font-weight: 800; font-size: 13px; color: var(--muted); }
#roomUI .rtabs button.on { background: #fff; color: #0a1824; }
#roomUI .rtray { display: flex; gap: 6px; overflow-x: auto; padding: 6px; width: 100%; background: rgba(8, 22, 34, .92);
  border: 1px solid var(--line); border-radius: 14px; scrollbar-width: thin; }
#roomUI .rtile { flex: 0 0 auto; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px;
  border: 2px solid transparent; border-radius: 12px; background: var(--panel2); position: relative; }
#roomUI .rtile span:last-child { font-size: 10.5px; font-weight: 800; line-height: 1.15; text-align: center; color: #c4d4dc; }
#roomUI .rtile.on { border-color: var(--gold); background: #1a2a1c; }
#roomUI .rtile.placed::after { content: '✓'; position: absolute; top: 3px; right: 5px; font-size: 11px; font-weight: 900; color: #5cd68a; }
#roomUI .rtile.more .art { background: #1f2a14; }
#roomUI .rnone { align-self: center; padding: 0 8px; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  #roomUI .rtile { width: 66px; }
  #roomUI .rtile .art { width: 38px; height: 38px; }
  #roomUI .rtabs button { font-size: 12px; padding: 6px 2px; }
}

/* ---------- v8: top cabins, map, visiting ---------- */
.seg.seg3 { grid-template-columns: 1fr 1fr 1fr; margin-bottom: 10px; }
.toplist { display: grid; gap: 6px; margin-bottom: 12px; }
.trow { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; }
.trow.me { border-color: var(--gold); }
.trow > i { font-style: normal; font-weight: 900; width: 20px; text-align: center; color: var(--muted); }
.trow > i.p1 { color: var(--gold); } .trow > i.p2 { color: #d6e2ea; } .trow > i.p3 { color: #e0a060; }
.tav { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; flex: none;
  background: linear-gradient(135deg, #3b1d6e, #5a2a9a); }
.tname { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tname b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tname small { font-size: 11.5px; color: var(--muted); }
.trow .mini { flex: none; background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #1b1400; border: 0; }
.mfind { display: flex; gap: 6px; margin-bottom: 8px; }
.mfind input { flex: 1; min-width: 0; background: #04101a; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); padding: 10px 12px; font: inherit; }
.mlev { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mgrid2 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 10px; }
.mcell { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; min-width: 0; border-radius: 9px;
  background: #0b1a26; border: 1px solid var(--line); }
.mcell b { font-size: 12px; } .mcell small { font-size: 9.5px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcell.taken { background: #1d2150; border-color: rgba(140, 150, 255, .3); }
.mcell.gold { background: #4a3a08; border-color: var(--gold); } .mcell.gold small { color: var(--gold); }
.mcell.mine { box-shadow: 0 0 0 2px var(--cyan); }
.mcell.found { box-shadow: 0 0 0 2px #fff; }
#roomUI .rvisit { position: fixed; z-index: 11; left: 50%; transform: translateX(-50%); bottom: calc(max(10px, env(safe-area-inset-bottom)) + 66px);
  width: min(460px, calc(100vw - 16px)); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
  background: rgba(8, 22, 34, .95); border: 1px solid var(--line); border-radius: 16px; }
#roomUI .rvisit[hidden], #roomUI .rpanel[hidden] { display: none; }
.rvwho { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rvwho b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rvwho span { font-size: 11.5px; color: var(--muted); }
.rvstars { font-weight: 900; color: var(--gold); white-space: nowrap; }
.rvstar { border: 0; border-radius: 11px; padding: 9px 14px; font-weight: 900; background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #1b1400; white-space: nowrap; }
.rvstar.on { background: #2a3550; color: var(--gold); }

/* language picker */
.langs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 4px; }
.lang { padding: 14px 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: inherit; font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.lang.on { border-color: #f2c94c; background: rgba(242,201,76,.14); color: #f2c94c; }
.kicker .langlink { float: right; border: 0; background: rgba(255,255,255,.08); color: inherit; font: inherit; font-size: 12px; letter-spacing: 0; text-transform: none; padding: 3px 9px; border-radius: 999px; cursor: pointer; margin-right: 40px; margin-top: -3px; }

/* ---------- daily check-in, while you were away ---------- */
.dailybox { background: #172028; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.dailybox .btn { margin-top: 10px; }
.days { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 10px; }
.dday { border: 1px solid var(--line); border-radius: 10px; padding: 6px 2px; text-align: center; background: var(--panel2); }
.dday small { display: block; font-size: 10px; color: var(--muted); }
.dday b { font-size: 14px; color: var(--gold); }
.dday.got { opacity: .45; }
.dday.now { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.dday { position: relative; }
.dday b { display: block; margin-top: 2px; }
/* day 7: a full-width gold banner under days 1 to 6 */
.dday.big { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px;
  background: linear-gradient(120deg, #2a1d03, #5a420c 45%, #2a1d03); border-color: #d9a92a; }
.dday.big small { font-size: 12px; color: #ffe07a; font-weight: 800; }
.dday.big b { color: var(--gold); font-size: 17px; margin: 0; }
.dday .dleg { font-size: 24px; line-height: 1; }
.dday em { font-style: normal; font-size: 13px; font-weight: 800; color: #ffe07a; }
.dday.now { background: linear-gradient(180deg, #4a3608, #241a04); animation: dailyGlow 2.4s ease-in-out infinite; }
.dday.next { border-style: dashed; border-color: var(--gold); }
.dday .dgem { display: block; font-size: 15px; line-height: 1.1; margin-top: 3px; }
.dday .rname { display: block; font-size: 9px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dday.ditem.epic { border-color: var(--epic); background: linear-gradient(180deg, color-mix(in srgb, var(--epic) 22%, var(--panel2)), var(--panel2)); }
.dday.ditem.mythic { border-color: var(--mythic); background: linear-gradient(180deg, color-mix(in srgb, var(--mythic) 22%, var(--panel2)), var(--panel2)); }
.dday.ditem.now { box-shadow: 0 0 0 1px var(--gold) inset; border-color: var(--gold); }
.dprize.epic { border-color: var(--epic); background: linear-gradient(160deg, color-mix(in srgb, var(--epic) 25%, #111), #111); }
.dprize.mythic { border-color: var(--mythic); background: linear-gradient(160deg, color-mix(in srgb, var(--mythic) 25%, #111), #111); }
.dday .dtick { position: absolute; top: 2px; right: 4px; font-style: normal; font-size: 10px; color: #7be38f; }
.btn.gold { background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #1b1400; box-shadow: 0 3px 0 #9a6f10; }
.dprize { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px; border-radius: 12px;
  border: 1px solid #b8891c; background: linear-gradient(160deg, #3a2a06, #1d1503); }
.dprize > div { display: flex; flex-direction: column; gap: 2px; }
.dprize b { color: var(--gold); font-size: 15px; }
.dprize span { font-size: 12px; color: var(--muted); }
.awayrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 6px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.awayrow .mini { flex: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row2 .btn { margin-top: 0; }

/* ---------- share card ---------- */
.shareprev { display: grid; place-items: center; min-height: 160px; margin: 8px 0; }
.shareprev img { width: min(100%, 260px); border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }

/* ---------- weekly boards ---------- */
.wkscore { margin-left: auto; color: var(--gold); font-weight: 900; }

/* ---------- 404 logs, reports, settings links, seasons ---------- */
.logbody { white-space: pre-line; }
.logcard { background: var(--panel2); border: 1px solid rgba(255, 69, 69, .3); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.logcard .logbody { margin: 6px 0 0; color: var(--ink); }
.tarea { width: 100%; background: #0b0d2a; border: 1px solid rgba(140, 140, 255, .2); border-radius: 12px; color: var(--ink);
  padding: 10px 12px; font: inherit; resize: vertical; margin-bottom: 10px; }
.srow.legal { justify-content: flex-start; gap: 18px; font-size: 13px; }
.srow.legal a { color: var(--muted); }
.fine a { color: var(--cyan); }
.sechead.season b { color: #9fe8ff; }
.rvrep { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 11px; padding: 8px 11px; font-weight: 900; }

/* ---------- chests ---------- */
.chests { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.chest { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px; border-radius: 14px;
  border: 1px solid var(--line); color: var(--ink); text-align: center; }
.chest.crate { background: linear-gradient(170deg, #2b2214, #15110a); border-color: #8a6a3a; }
.chest.abyss { background: linear-gradient(170deg, #2a1546, #0c0718); border-color: var(--epic); box-shadow: 0 0 16px rgba(176, 108, 255, .25); }
.chest .cicon { font-size: 34px; line-height: 1.1; }
.chest b { font-size: 14px; }
.chest .codds { font-size: 10px; line-height: 1.35; color: var(--muted); }
.chest .cprice { margin-top: 4px; padding: 5px 12px; border-radius: 999px; font-weight: 900; font-size: 13px; color: #1b1400;
  background: linear-gradient(180deg, #ffe07a, var(--gold)); }
.chestbox { display: flex; align-items: center; justify-content: center; min-height: 170px; margin: 6px 0 4px; border-radius: 16px;
  border: 1px solid var(--line); background: radial-gradient(circle at 50% 45%, #1d2c3a, #0a141d 70%); }
.chestbox.abyss { background: radial-gradient(circle at 50% 45%, #3a1f63, #0c0718 70%); }
.chestbox.crate { background: radial-gradient(circle at 50% 45%, #3a2d18, #120e08 70%); }
.cbig { font-size: 76px; line-height: 1; }
.cbig.shake { animation: chestShake 1.3s ease-in both; }
@keyframes chestShake {
  0% { transform: scale(1) rotate(0); } 15% { transform: rotate(-8deg); } 30% { transform: rotate(8deg); }
  45% { transform: rotate(-12deg) scale(1.05); } 60% { transform: rotate(12deg) scale(1.1); } 75% { transform: rotate(-6deg) scale(1.2); }
  100% { transform: scale(1.5); opacity: 0; filter: brightness(3); } }
.creveal { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 16px 10px; text-align: center; animation: popIn .45s ease-out; }
.creveal .rname { font-size: 13px; }
.creveal b { font-size: 18px; }
.creveal > span:last-child { font-size: 12px; color: var(--muted); }
.creveal.legendary .art, .creveal.mythic .art, .creveal.exotic .art { box-shadow: 0 0 30px rgba(242, 201, 76, .55); }
.creveal.mythic .art { box-shadow: 0 0 30px rgba(255, 59, 59, .55); }
.creveal.exotic .art { box-shadow: 0 0 34px rgba(176, 108, 255, .8); }
.oddsrows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.oddsrows > div { display: grid; grid-template-columns: 80px 1fr 46px; align-items: center; gap: 8px; font-size: 13px; }
.oddsrows b { text-align: right; }
.obar { height: 8px; border-radius: 99px; background: #0f1d29; overflow: hidden; }
.obar i { display: block; height: 100%; border-radius: 99px; }
.obar i.rare { background: var(--rare); } .obar i.epic { background: var(--epic); } .obar i.mythic { background: var(--mythic); }
.obar i.legendary { background: var(--legendary); } .obar i.exotic { background: var(--exo); }
.dodds { margin-top: 6px; }
.dday.ditem.rare { border-color: var(--rare); background: linear-gradient(180deg, color-mix(in srgb, var(--rare) 22%, var(--panel2)), var(--panel2)); }
.dprize.rare { border-color: var(--rare); background: linear-gradient(160deg, color-mix(in srgb, var(--rare) 25%, #111), #111); }
.dday.ditem.now { box-shadow: 0 0 0 1px var(--gold) inset; border-color: var(--gold); }

/* ---------- crew goals ---------- */
#crewPill { position: relative; }
#crewPill.ready::after { content: ''; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: #ff4d4d; border: 2px solid #06141f; }
.goalnext { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid #b8891c;
  background: linear-gradient(135deg, #3a2a05, #1d1604); }
.goalnext .cicon { font-size: 36px; }
.goalnext div { display: flex; flex-direction: column; gap: 2px; }
.goalnext b { color: var(--gold); font-size: 16px; }
.goalnext span { font-size: 12px; color: var(--muted); }
.goals { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.goal { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); }
.goal .cicon { font-size: 22px; }
.goal .gtx { flex: 1; display: flex; flex-direction: column; }
.goal .gtx small { font-size: 11px; color: var(--muted); }
.goal em { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
.goal.hit { border-color: rgba(242, 201, 76, .5); }

/* ---------- live feed ---------- */
#feed { position: fixed; z-index: 9; left: 50%; top: calc(max(10px, env(safe-area-inset-top)) + 50px); transform: translate(-50%, -6px);
  max-width: min(440px, calc(100vw - 230px)); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(6, 20, 32, .88); color: var(--ink); font-size: 12px; line-height: 1.3; opacity: 0;
  transition: opacity .4s, transform .4s; text-align: center; }
#feed.on { opacity: 1; transform: translate(-50%, 0); }
#feed[hidden] { display: none; }
#feed b { color: var(--gold); }
@media (max-width: 420px) {
  #feed { top: calc(max(10px, env(safe-area-inset-top)) + 96px); max-width: calc(100vw - 20px); }
}

/* ---------- decks ---------- */
.seg.seg4 { grid-template-columns: repeat(4, 1fr); margin-bottom: 10px; }
.seg.seg4 button { font-size: 13px; padding: 9px 4px; }
.deckme { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; padding: 10px 12px; margin: 8px 0; border-radius: 14px;
  border: 1px solid var(--cyan); background: #0d2735; font-size: 12px; color: var(--muted); }
.deckme b { grid-column: 1 / -1; color: var(--ink); font-size: 15px; }

/* ---------- visiting: badges, reactions, gift ---------- */
#roomUI .rvisit { flex-wrap: wrap; row-gap: 6px; }
.rvrow2 { flex-basis: 100%; display: flex; align-items: center; gap: 6px; }
.rvbadges { font-size: 16px; letter-spacing: 1px; }
.rvreacts { flex: 1; display: flex; gap: 4px; }
.rvr { border: 1px solid var(--line); background: #10283a; border-radius: 10px; padding: 4px 7px; font-size: 16px; line-height: 1;
  display: flex; align-items: center; gap: 3px; }
.rvr small { font-size: 10px; font-weight: 900; color: var(--muted); }
.rvr.on { border-color: var(--gold); background: #3a2a05; }
.rvr:disabled { opacity: .7; }
.rvgift { border: 0; border-radius: 10px; padding: 7px 10px; font-weight: 900; font-size: 12px; white-space: nowrap;
  background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #1b1400; }

/* ---------- badges ---------- */
.badges { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 8px; border-radius: 14px; text-align: center;
  border: 1px solid var(--line); background: var(--panel2); color: var(--ink); opacity: .45; }
.badge.got { opacity: 1; border-color: rgba(242, 201, 76, .5); }
.badge.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: #2a2006; }
.badge .bemo { font-size: 30px; line-height: 1.1; }
.badge b { font-size: 13px; }
.badge small { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.badge em { font-style: normal; font-size: 10px; font-weight: 900; color: var(--gold); }

/* ---------- season pass ---------- */
.offer.pass { background: linear-gradient(135deg, #0e2b4a, #071526); border-color: #9fe8ff; }
.offer.pass .otag { background: linear-gradient(90deg, #9fe8ff, #ffffff); color: #071526; }
.ptiers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.ptier { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--panel2); font-size: 12px; opacity: .55; min-height: 40px; }
.ptier > i { font-style: normal; font-weight: 900; width: 20px; color: var(--muted); }
.ptier .plab { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.ptier .plab .art { width: 26px; height: 26px; flex: none; }
.ptier em { font-style: normal; font-size: 11px; font-weight: 900; color: var(--gold); }
.ptier.open { opacity: 1; border-color: rgba(159, 232, 255, .5); }
.ptier.got { opacity: .6; }
.ptier.final { grid-column: 1 / -1; border-color: var(--legendary); background: linear-gradient(120deg, #2a1d03, #4a3608 50%, #2a1d03); }

/* ---------- chests you were given, pity ---------- */
.chest .cpity { font-size: 9.5px; color: var(--muted); line-height: 1.3; }
.chest .cprice.free { background: linear-gradient(180deg, #7be38f, #2fae4f); color: #04210c; }
.steps { margin: 8px 0 10px 18px; padding: 0; line-height: 1.7; }
.gnext { margin: 6px 2px 12px; }

/* 13+ confirmation before the first purchase */
.agechk { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 12px; font-size: 14px; line-height: 1.4; cursor: pointer; }
.agechk input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: #f2c94c; }

/* short phone screens (browser bars showing, small phones, landscape): tighter cards, and the main button of the
   check-in card stays in view instead of hiding below the fold */
@media (max-width: 640px) and (max-height: 700px) {
  .sheet { padding: 16px 14px; }
  .sheet h2 { font-size: 22px; margin: 4px 0 6px; }
  .sheet p { font-size: 13px; margin-bottom: 8px; }
  .sheet .note { padding: 8px 10px; font-size: 13px; }
  .zones { gap: 4px; margin-bottom: 10px; }
  .zone { padding-top: 8px; padding-bottom: 8px; }
}
@media (orientation: portrait) {
  #boardForm #claimBtn { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -10px 18px var(--panel); }
}

/* Arabic (right to left): keep number pairs like "1 / 100,000" in reading order */
[dir="rtl"] #crewPill, [dir="rtl"] .coins, [dir="rtl"] .pill { direction: ltr; unicode-bidi: isolate; }
