/* Cashora - main stylesheet. Mobile-first, system fonts, no external assets. */

:root {
  --bg: #141129;
  --bg-2: #0f0c22;
  --panel: #1e1a3d;
  --panel-2: #272251;
  --line: #37316b;
  --text: #eeebff;
  --muted: #a29cd0;
  --gold: #ffc940;
  --gold-2: #f0a91c;
  --cyan: #3fd0e8;
  --danger: #ff5c6c;
  --ok: #43d98f;
  --c1: #ff6b5b; --c2: #ffb23f; --c3: #43d98f; --c4: #3fb8f0;
  --c5: #9d7bff; --c6: #ff5fa2; --c7: #2ed6c4; --c8: #f2d43d;
  --r: 14px;
  --r-sm: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 10px 30px rgba(5, 3, 20, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg-2); }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(120% 60% at 50% -10%, #2a2460 0%, var(--bg) 55%, var(--bg-2) 100%) fixed;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-top: var(--safe-t);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
}
body.page-game, body.page-error { padding-bottom: 0; }
img, svg { max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
.ico { flex: none; display: block; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: .82rem; margin: .6em 0 0; }
.empty { color: var(--muted); text-align: center; padding: 14px 6px; margin: 0; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 12px 14px 20px; }
.panel, .card {
  background: linear-gradient(180deg, rgba(39, 34, 81, .92), rgba(30, 26, 61, .92));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card { margin: 0 0 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2 { margin: 0; font-size: 1.02rem; }
.card-head form { margin: 0; }
.card-danger { border-color: rgba(255, 92, 108, .45); }
.sub-h { font-size: .95rem; margin: 14px 0 6px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(20, 17, 41, .88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(55, 49, 107, .6);
}
.topbar-title { font-size: 1.08rem; margin: 0; flex: 1; text-align: center; }
.topbar-spacer { width: 40px; flex: none; }
.brand-sm { display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; }
.brand-sm img { border-radius: 8px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: none;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); cursor: pointer; padding: 0;
  transition: transform .12s ease, background .15s ease;
}
.icon-btn:hover { background: var(--panel-2); text-decoration: none; }
.icon-btn:active { transform: scale(.94); }
.icon-btn.is-disabled { opacity: 0; pointer-events: none; }
.icon-flip .ico { transform: rotate(180deg); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--panel-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px;
  border: 0; border-radius: 14px;
  background: var(--btn-bg); color: var(--text);
  font: 700 1rem/1.1 var(--font); letter-spacing: .01em;
  cursor: pointer; text-decoration: none; user-select: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .28);
  transition: transform .1s ease, box-shadow .1s ease, filter .15s ease;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .28); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn-primary { --btn-bg: linear-gradient(180deg, #5fe0f2, #28a9c9); color: #07202a; }
.btn-gold { --btn-bg: linear-gradient(180deg, #ffd766, var(--gold-2)); color: #2b1b00; }
.btn-ghost { --btn-bg: rgba(255, 255, 255, .06); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:active { transform: scale(.98); }
.btn-danger { --btn-bg: linear-gradient(180deg, #ff7a88, #e0404f); color: #2a0006; }
.btn-block { display: flex; width: 100%; margin-top: 10px; }
.btn-sm { min-height: 36px; padding: 8px 14px; font-size: .88rem; border-radius: 11px; }
.btn-play {
  --btn-bg: linear-gradient(180deg, #ffd766 0%, #ffb43a 100%);
  color: #2b1b00; font-size: 1.45rem; min-height: 68px; width: 100%; max-width: 330px;
  border-radius: 20px; box-shadow: 0 6px 0 #b8740c, 0 16px 34px rgba(255, 185, 60, .25);
  flex-wrap: wrap; gap: 4px 12px;
}
.btn-play:active { box-shadow: 0 2px 0 #b8740c; transform: translateY(4px); }
.play-sub { flex-basis: 100%; font-size: .78rem; font-weight: 600; opacity: .75; text-align: center; margin-top: -4px; }
.btn-new { margin-top: 10px; min-height: 40px; font-size: .9rem; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: rgba(63, 208, 232, .12); color: var(--cyan); border: 1px solid rgba(63, 208, 232, .3);
  white-space: nowrap;
}
a.chip:hover { text-decoration: none; background: rgba(63, 208, 232, .2); }
.chip-btn-plain { cursor: pointer; font-family: var(--font); }
.badge { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; text-align: center; vertical-align: 2px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; font-style: normal; background: rgba(255, 255, 255, .08); color: var(--muted); white-space: nowrap; }
.tag-warn, .tag-claimed, .tag-pending_claim { background: rgba(255, 201, 64, .15); color: var(--gold); }
.tag-bad, .tag-rejected, .tag-expired { background: rgba(255, 92, 108, .14); color: #ff8b97; }
.tag-paid, .tag-approved { background: rgba(67, 217, 143, .15); color: var(--ok); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form-intro { color: var(--muted); margin: 0; }
.form-error { background: rgba(255, 92, 108, .12); border: 1px solid rgba(255, 92, 108, .4); color: #ffb3bb; border-radius: var(--r-sm); padding: 10px 12px; margin: 0; font-size: .9rem; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border-radius: 12px; border: 1px solid var(--line);
  background: #15122e; color: var(--text); font: 16px var(--font);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(63, 208, 232, .18); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--muted); }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--cyan); flex: none; }
.form-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .9rem; }
.auth { padding-top: 22px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 100; width: min(92vw, 420px); display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; font-size: .92rem; cursor: pointer; animation: toast-in .25s ease-out; }
.toast-success { border-color: rgba(67, 217, 143, .5); }
.toast-error { border-color: rgba(255, 92, 108, .6); }
.toast.is-leaving { opacity: 0; transform: translateY(-8px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- Bottom navigation ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--nav-h) + var(--safe-b)); padding: 0 4px var(--safe-b);
  background: rgba(17, 14, 36, .94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(55, 49, 107, .7);
}
.nav-item { flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 600; }
.nav-item:hover { text-decoration: none; color: var(--text); }
.nav-item.is-active { color: var(--gold); }
.nav-play .ico { width: 50px; height: 50px; padding: 12px; margin-top: -22px; border-radius: 16px; background: linear-gradient(180deg, #ffd766, #ffb43a); color: #2b1b00; box-shadow: 0 4px 0 #b8740c, 0 8px 20px rgba(255, 185, 60, .3); }

/* ---------- Home ---------- */
.hero { text-align: center; padding: 18px 0 8px; display: flex; flex-direction: column; align-items: center; }
.logo-blocks { display: flex; justify-content: center; gap: 4px; margin: 6px 0 10px; }
.lb {
  width: clamp(34px, 11vw, 48px); height: clamp(34px, 11vw, 48px);
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-weight: 900; font-size: clamp(1.1rem, 5.4vw, 1.6rem); color: rgba(20, 10, 30, .82);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .18), inset 0 3px 0 rgba(255, 255, 255, .35);
  animation: lb-drop .5s cubic-bezier(.3, 1.4, .5, 1) both;
}
.lb:nth-child(2) { animation-delay: .05s; } .lb:nth-child(3) { animation-delay: .1s; } .lb:nth-child(4) { animation-delay: .15s; }
.lb:nth-child(5) { animation-delay: .2s; } .lb:nth-child(6) { animation-delay: .25s; } .lb:nth-child(7) { animation-delay: .3s; }
@keyframes lb-drop { from { opacity: 0; transform: translateY(-18px) scale(.8); } }
.lb-1, .cell.c1, .pc.c1 { background: var(--c1); } .lb-2, .cell.c2, .pc.c2 { background: var(--c2); }
.lb-3, .cell.c3, .pc.c3 { background: var(--c3); } .lb-4, .cell.c4, .pc.c4 { background: var(--c4); }
.lb-5, .cell.c5, .pc.c5 { background: var(--c5); } .lb-6, .cell.c6, .pc.c6 { background: var(--c6); }
.lb-7, .cell.c7, .pc.c7 { background: var(--c7); } .lb-8, .cell.c8, .pc.c8 { background: var(--c8); }
.hero-sub { color: var(--muted); max-width: 320px; margin: 0 auto 18px; }

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 14px; }
.stat-strip-4 { grid-template-columns: repeat(4, 1fr); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; min-width: 0; }
.stat-v { font-size: 1.2rem; font-weight: 800; color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-l { font-size: .7rem; color: var(--muted); font-weight: 600; }

.signin-card { display: flex; gap: 12px; align-items: center; padding: 14px; margin: 0 0 14px; border-radius: var(--r); background: rgba(63, 208, 232, .1); border: 1px solid rgba(63, 208, 232, .35); color: var(--text); }
.signin-card:hover { text-decoration: none; background: rgba(63, 208, 232, .16); }
.signin-card .ico { color: var(--cyan); }
.signin-card span { display: flex; flex-direction: column; }
.signin-card small { color: var(--muted); }
.signin-card.is-gold { background: rgba(255, 201, 64, .1); border-color: rgba(255, 201, 64, .4); }
.signin-card.is-gold .ico { color: var(--gold); }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; }
.rank-list li:nth-child(even) { background: rgba(255, 255, 255, .03); }
.rank-list li.is-me { background: rgba(255, 201, 64, .12); outline: 1px solid rgba(255, 201, 64, .35); }
.rank-list-compact li { padding: 6px 8px; font-size: .92rem; }
.rk { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--panel-2); font-weight: 800; font-size: .85rem; font-variant-numeric: tabular-nums; }
.rank-list-compact .rk { width: 26px; height: 26px; font-size: .78rem; }
.rk-1 { background: linear-gradient(180deg, #ffe07a, #f0a91c); color: #2b1b00; }
.rk-2 { background: linear-gradient(180deg, #e9ecf5, #a9b0c6); color: #1b1d27; }
.rk-3 { background: linear-gradient(180deg, #ffb98a, #cf7440); color: #2a1100; }
.nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; display: flex; flex-direction: column; }
.nm small { color: var(--muted); font-weight: 500; font-size: .72rem; }
.sc { font-weight: 800; font-variant-numeric: tabular-nums; }
.pz { min-width: 58px; text-align: right; color: var(--gold); font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }
.rank-head { color: var(--muted); font-size: .72rem; font-weight: 700; background: none !important; padding-top: 0 !important; }
.rank-head .rk { background: none; height: auto; }

.menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
.menu-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 4px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: .74rem; font-weight: 700; }
.menu-tile:hover { text-decoration: none; background: var(--panel-2); }
.menu-tile .ico { color: var(--gold); }

.seo-copy { color: var(--muted); font-size: .86rem; padding: 4px 4px 0; }
.seo-copy h2 { color: var(--text); font-size: .95rem; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; padding: 10px 0 4px; font-size: .8rem; }
.legal-links a { color: var(--muted); }

/* ---------- Ads ---------- */
.ad-slot { position: relative; display: flex; flex-direction: column; align-items: center; margin: 0 auto 14px; max-width: 100%; }
.ad-slot iframe { border: 0; display: block; max-width: 100%; background: rgba(255, 255, 255, .03); border-radius: 6px; }
.ad-label { font-size: .62rem; color: var(--muted); letter-spacing: .04em; margin-bottom: 2px; }
.ad-slot-native iframe { width: 300px; height: 250px; }

/* ---------- Tabs / leaderboard ---------- */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.tab { text-align: center; padding: 9px 4px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: .86rem; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab.is-active { background: var(--panel-2); color: var(--gold); box-shadow: inset 0 0 0 1px var(--line); }
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.period-label { text-align: center; display: flex; flex-direction: column; }
.period-label small { color: var(--muted); font-size: .75rem; }
.my-rank { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--r); background: rgba(255, 201, 64, .1); border: 1px solid rgba(255, 201, 64, .35); }
.my-rank strong { font-size: 1.3rem; color: var(--gold); }
.my-rank-l { font-size: .74rem; font-weight: 700; color: var(--muted); width: 100%; }
.my-rank .btn { margin-left: auto; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-top: 12px; }
.pager > :last-child { justify-self: end; }
.pager-info { color: var(--muted); font-size: .82rem; }

/* ---------- Lists ---------- */
.kv-list, .game-list, .note-list, .prize-list, .mini-history, .toggle-list { list-style: none; margin: 0; padding: 0; }
.kv-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(55, 49, 107, .6); }
.kv-list li:last-child { border-bottom: 0; }
.kv-list li > span { display: flex; flex-direction: column; }
.kv-list small { color: var(--muted); font-weight: 500; }
.kv-list strong small { margin-left: 4px; }
.game-list li { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; padding: 9px 0; border-bottom: 1px solid rgba(55, 49, 107, .6); }
.game-list li:last-child { border-bottom: 0; }
.gl-score { grid-row: span 2; align-self: center; font-weight: 800; color: var(--gold); min-width: 60px; font-variant-numeric: tabular-nums; }
.gl-meta { font-size: .88rem; }
.gl-when { font-size: .75rem; color: var(--muted); }
.note-list li { padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; background: rgba(255, 255, 255, .03); }
.note-list li.is-unread { background: rgba(63, 208, 232, .08); box-shadow: inset 3px 0 0 var(--cyan); }
.note-list p { margin: 3px 0; font-size: .9rem; color: var(--muted); }
.note-list small { color: var(--muted); font-size: .72rem; }
.prize-item { padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); margin-bottom: 10px; }
.prize-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.prize-top > div { display: flex; flex-direction: column; }
.prize-top strong { font-size: 1.3rem; color: var(--gold); }
.prize-top span { font-size: .82rem; color: var(--muted); }
.prize-item .form { margin-top: 10px; }
.prize-tables { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 8px; }
.prize-table h3 { font-size: .92rem; margin: 0 0 6px; color: var(--gold); }
.prize-table ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 12px; }
.prize-table li { display: flex; justify-content: space-between; font-size: .84rem; padding: 3px 0; border-bottom: 1px dashed rgba(55, 49, 107, .7); }
.bullets { margin: 0; padding-left: 18px; color: var(--muted); font-size: .88rem; }
.bullets li { margin-bottom: 4px; }
.usage { margin: 10px 0 6px; }
.mini-history li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 7px 0; border-bottom: 1px solid rgba(55, 49, 107, .5); font-size: .86rem; }
.mini-history small { color: var(--muted); font-size: .72rem; }

.link-list { display: flex; flex-direction: column; }
.link-list a { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; border-bottom: 1px solid rgba(55, 49, 107, .6); color: var(--text); }
.link-list a:last-child { border-bottom: 0; }
.link-list a:hover { text-decoration: none; color: var(--gold); }
.link-list .ico { transform: rotate(180deg); color: var(--muted); }

/* ---------- Toggles ---------- */
.toggle-list li { border-bottom: 1px solid rgba(55, 49, 107, .6); }
.toggle-list li:last-child { border-bottom: 0; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; position: relative; }
.toggle > span { flex: 1; display: flex; flex-direction: column; }
.toggle small { color: var(--muted); font-size: .8rem; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle i { width: 50px; height: 30px; flex: none; border-radius: 999px; background: #3a3470; position: relative; transition: background .2s; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
.toggle input:checked + i { background: var(--ok); }
.toggle input:checked + i::after { transform: translateX(20px); }
.toggle input:focus-visible + i { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- Profile ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.profile-head h2 { margin: 0; font-size: 1.3rem; }
.profile-head p { margin: 0; }
.avatar { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 900; color: #2b1b00; background: linear-gradient(135deg, var(--gold), var(--c1)); flex: none; }

/* ---------- Legal ---------- */
.prose { font-size: .95rem; }
.prose h2 { font-size: 1.05rem; margin-top: 1.4em; color: var(--gold); }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 20px; margin: 0 0 .8em; }
.prose li { margin-bottom: .3em; }
.legal-index { margin-top: 14px; display: flex; flex-direction: column; padding: 6px 16px; }
.legal-index a { padding: 11px 0; border-bottom: 1px solid rgba(55, 49, 107, .6); color: var(--text); }
.legal-index a:last-child { border-bottom: 0; }
.legal-index a[aria-current="page"] { color: var(--gold); font-weight: 700; }

/* ---------- Error screens ---------- */
.error-screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.error-code { font-size: 5rem; font-weight: 900; line-height: 1; margin-bottom: 12px; background: linear-gradient(180deg, var(--gold), var(--c1)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-screen p { color: var(--muted); max-width: 340px; }
.debug-error { max-width: min(92vw, 720px); white-space: pre-wrap; word-break: break-word; text-align: left; font: 12.5px/1.5 ui-monospace, Menlo, Consolas, monospace; background: #0b0a18; border: 1px solid var(--danger); color: #ffc2c8; padding: 12px 14px; border-radius: 10px; margin: 0 0 18px; }

/* =========================================================
   GAME SCREEN
   ========================================================= */
.page-game { overflow: hidden; overscroll-behavior: none; }
.game {
  --bs: min(92vw, 440px, 50vh);          /* board size, refined by game.js */
  --cell: calc(var(--bs) / 8);
  --ad-h: 0px;
  position: relative;
  height: 100vh; height: 100dvh;
  padding-top: var(--safe-t);
  display: flex; flex-direction: column; align-items: center;
  max-width: 560px; margin: 0 auto;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation;
}
.has-banner .game { --ad-h: 68px; }
body.page-game { padding-top: 0; }

.hud { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 4px; flex: none; }
.hud-brand { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 1rem; }
.hud-actions { display: flex; gap: 8px; }
#btnSound .i-off { display: none; }
#btnSound[aria-pressed="false"] .i-on { display: none; }
#btnSound[aria-pressed="false"] .i-off { display: block; }
#btnSound[aria-pressed="false"] { color: var(--muted); }

.scoreboard { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 14px 6px; flex: none; }
.score-main { display: flex; flex-direction: column; min-width: 0; }
.score-v { font-size: clamp(2rem, 9vw, 2.6rem); font-weight: 900; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 rgba(0, 0, 0, .3); transition: transform .15s; }
.score-v.is-bump { transform: scale(1.08); }
.score-l { font-size: .72rem; font-weight: 700; color: var(--muted); }
.score-side { display: flex; gap: 6px; }
.mini { display: flex; flex-direction: column; align-items: center; min-width: 56px; padding: 5px 8px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.mini-l { font-size: .62rem; color: var(--muted); font-weight: 700; }
.mini-v { font-size: .98rem; font-weight: 800; font-variant-numeric: tabular-nums; }
#best { color: var(--gold); }
.combo-box.is-on { border-color: var(--c6); background: rgba(255, 95, 162, .16); }
.combo-box.is-on .mini-v { color: var(--c6); }
.combo-box.is-pop { animation: combo-pop .35s ease-out; }
@keyframes combo-pop { 40% { transform: scale(1.18); } }

.stage { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; padding: 4px 0; }
.board-wrap { position: relative; width: var(--bs); height: var(--bs); }
.board {
  width: 100%; height: 100%;
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  gap: 3px; padding: 5px;
  border-radius: 16px;
  background: #100d25;
  border: 2px solid var(--line);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, .5), 0 12px 30px rgba(0, 0, 0, .35);
  touch-action: none;
}
.cell { border-radius: 6px; background: rgba(255, 255, 255, .045); position: relative; }
.cell.filled, .pc {
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2), inset 0 3px 0 rgba(255, 255, 255, .32);
}
.cell.ghost-ok { background: rgba(63, 208, 232, .35); box-shadow: inset 0 0 0 2px var(--cyan); }
.cell.ghost-ok.filled { box-shadow: inset 0 0 0 2px var(--cyan); }
.cell.ghost-bad { background: rgba(255, 92, 108, .28); box-shadow: inset 0 0 0 2px var(--danger); }
.cell.will-clear { filter: brightness(1.35); box-shadow: inset 0 0 0 2px #fff; }
.cell.will-clear:not(.filled) { background: rgba(255, 255, 255, .18); }
.cell.pop { animation: cell-pop .18s ease-out; }
@keyframes cell-pop { from { transform: scale(.7); } }
.cell.clearing { animation: cell-clear .38s ease-in forwards; z-index: 2; }
@keyframes cell-clear {
  0% { transform: scale(1); filter: brightness(1.6); }
  45% { transform: scale(1.12); filter: brightness(2); }
  100% { transform: scale(.2); opacity: 0; }
}
.board.is-shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.fx-pop {
  position: absolute; transform: translate(-50%, -50%);
  font-weight: 900; font-size: 1.4rem; color: #fff; white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .45), 0 0 16px rgba(255, 201, 64, .6);
  animation: fx-rise .9s ease-out forwards;
}
.fx-pop.is-big { font-size: 1.9rem; color: var(--gold); }
.fx-pop small { display: block; font-size: .8rem; text-align: center; color: var(--c6); }
@keyframes fx-rise { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 100% { opacity: 0; transform: translate(-50%, -140%) scale(1); } }

.board-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(16, 13, 37, .7); border-radius: 16px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tray-zone { flex: none; width: 100%; padding: 4px 10px 8px; }
.tray { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; height: calc(var(--cell) * 2.9 + 16px); min-height: 92px; max-height: 150px; }
.slot {
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(55, 49, 107, .55);
  cursor: grab; touch-action: none; position: relative;
  transition: background .15s, border-color .15s, opacity .15s;
}
.slot.is-empty { cursor: default; }
.slot.is-selected { border-color: var(--gold); background: rgba(255, 201, 64, .1); box-shadow: 0 0 0 2px rgba(255, 201, 64, .35); }
.slot.is-dragging .piece { opacity: .25; }
.slot.no-fit .piece { opacity: .35; filter: grayscale(.7); }
.slot.is-new .piece { animation: piece-in .28s cubic-bezier(.3, 1.5, .5, 1) both; }
.slot:nth-child(2).is-new .piece { animation-delay: .05s; }
.slot:nth-child(3).is-new .piece { animation-delay: .1s; }
@keyframes piece-in { from { opacity: 0; transform: scale(.4) translateY(10px); } }
.piece { --pc: calc(var(--cell) * .52); display: grid; gap: 2px; pointer-events: none; }
.pc { width: var(--pc); height: var(--pc); border-radius: 4px; }
.pc.e { background: transparent; box-shadow: none; }
.tray-tools { display: flex; justify-content: center; padding-top: 6px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid rgba(255, 201, 64, .4); background: rgba(255, 201, 64, .1); color: var(--gold);
  font: 700 .82rem var(--font); cursor: pointer;
}
.chip-btn small { font-weight: 600; color: var(--muted); font-size: .68rem; border-left: 1px solid rgba(255, 201, 64, .3); padding-left: 6px; }

.drag-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; display: grid; gap: 3px; will-change: transform; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .45)); }
.drag-ghost .pc { width: calc(var(--cell) - 3px); height: calc(var(--cell) - 3px); border-radius: 6px; }

.adbar { flex: none; width: 100%; min-height: 0; display: flex; justify-content: center; align-items: flex-end; padding-bottom: var(--safe-b); }
.has-banner .adbar { height: calc(var(--ad-h) + var(--safe-b)); background: rgba(10, 8, 26, .7); border-top: 1px solid rgba(55, 49, 107, .5); }
.adbar .ad-slot { margin: 0; height: var(--ad-h); justify-content: center; }
.adbar .ad-label { position: absolute; top: 1px; left: 6px; margin: 0; }

/* Overlays */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(8, 6, 20, .72);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  padding: 12px 12px calc(12px + var(--safe-b));
  animation: fade-in .2s ease-out;
}
@media (min-height: 640px) { .overlay { align-items: center; } }
@keyframes fade-in { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 400px; max-height: calc(100dvh - 24px); overflow-y: auto;
  padding: 20px 18px; border-radius: 22px;
  background: linear-gradient(180deg, #2c2659, #1d1940);
  border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  text-align: center; animation: sheet-in .28s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes sheet-in { from { transform: translateY(24px) scale(.97); opacity: 0; } }
.sheet h2 { font-size: 1.35rem; margin-bottom: 12px; }
.sheet .btn-block:first-of-type { margin-top: 14px; }
.sheet-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 4px; }
.sheet-over .sheet-stats { grid-template-columns: repeat(4, 1fr); }
.sheet-stats div { background: rgba(0, 0, 0, .2); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; }
.sheet-stats b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.sheet-stats span { font-size: .68rem; color: var(--muted); font-weight: 700; }
.final-score { display: flex; flex-direction: column; margin: 4px 0 8px; }
.final-score span { font-size: 3rem; font-weight: 900; line-height: 1.05; color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 4px 0 rgba(0, 0, 0, .3); }
.final-score small { color: var(--muted); font-weight: 700; font-size: .75rem; }
.new-best { display: inline-block; margin: 0 auto 8px; padding: 4px 12px; border-radius: 999px; background: var(--c6); color: #fff; font-weight: 800; font-size: .8rem; animation: combo-pop .6s ease-out 2; }
.sheet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.sheet-row .btn { min-height: 44px; font-size: .9rem; padding: 10px; }
.rw-what { font-size: 1.05rem; margin-bottom: 4px; }
.rw-what strong { color: var(--gold); }
.rw-steps { text-align: left; color: var(--muted); font-size: .88rem; padding-left: 22px; margin: 10px 0; }
.rw-steps li { margin-bottom: 4px; }
.rw-progress { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: .82rem; color: var(--muted); }
.rw-bar { flex: 1; height: 10px; border-radius: 99px; background: rgba(0, 0, 0, .3); overflow: hidden; }
.rw-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--c1)); transition: width .4s linear; }

.game-toast {
  position: fixed; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); z-index: 70;
  padding: 10px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line);
  font-weight: 700; font-size: .9rem; box-shadow: var(--shadow); max-width: 90vw; text-align: center;
  animation: toast-in .2s ease-out;
}

/* ---------- Responsive ---------- */
@media (max-width: 374px) {
  body { font-size: 14px; }
  .mini { min-width: 48px; padding: 4px 6px; }
  .stat-strip-4 .stat-v { font-size: 1rem; }
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .sheet-over .sheet-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .wrap { max-width: 640px; padding-top: 20px; }
  .prize-tables { grid-template-columns: 1fr 1fr; }
  .bottom-nav { left: 50%; right: auto; width: 520px; transform: translateX(-50%); border-radius: 20px 20px 0 0; border: 1px solid rgba(55, 49, 107, .7); border-bottom: 0; }
}
@media (min-width: 1024px) {
  .game { max-width: 620px; }
}
@media (max-height: 600px) and (orientation: landscape) {
  .scoreboard { padding-bottom: 2px; }
  .score-v { font-size: 1.6rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .spinner { animation-duration: 1.2s !important; animation-iteration-count: infinite !important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
.reduce-motion .spinner { animation-duration: 1.2s !important; animation-iteration-count: infinite !important; }
.reduce-motion .cell.clearing { animation: none !important; opacity: 0; }

/* ======================================================================
   v2: top bar tools, notifications, coins, avatars and cosmetics,
   home, missions, shop, prizes, profile additions
   ====================================================================== */
.topbar { gap: 8px; }
.topbar-title { flex: none; text-align: left; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.topbar-spacer { flex: 1; width: auto; }
.brand-sm { width: auto; min-width: 40px; gap: 8px; color: var(--text); }
.brand-sm:hover { text-decoration: none; }
.brand-word { font-weight: 800; font-size: 1.05rem; letter-spacing: .01em; }
.coin-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex: none; vertical-align: -2px;
  background: radial-gradient(circle at 35% 30%, #fff3b8 0 18%, #ffd34d 32%, #f0a81c 72%, #b97508 100%); box-shadow: inset 0 0 0 1.5px rgba(120, 70, 0, .35); }
.coin-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 9px; border-radius: 999px; background: rgba(255, 201, 64, .1);
  border: 1px solid rgba(255, 201, 64, .35); color: var(--gold); font-weight: 800; font-size: .9rem; font-variant-numeric: tabular-nums; }
.coin-pill:hover { text-decoration: none; background: rgba(255, 201, 64, .16); }
.coin-pill-lg { height: 32px; margin-top: 6px; }
.bell-btn { position: relative; }
.bell-badge { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger);
  color: #fff; font-size: .66rem; font-weight: 800; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.tb-avatar { display: flex; border-radius: 50%; }
.tb-avatar:hover { text-decoration: none; filter: brightness(1.1); }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--cyan); font: inherit; font-size: .86rem; font-weight: 700; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Notification panel */
.notif-panel { position: fixed; z-index: 60; top: calc(62px + var(--safe-t)); right: max(10px, calc((100vw - 560px) / 2 + 10px)); width: min(92vw, 380px);
  max-height: min(70vh, 520px); display: flex; flex-direction: column; background: #1b1738; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55); overflow: hidden; animation: pop-in .16s ease-out; }
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.notif-item { padding: 10px 10px 10px 14px; border-radius: 12px; position: relative; }
.notif-item + .notif-item { margin-top: 2px; }
.notif-item strong { display: block; font-size: .92rem; }
.notif-item p { margin: 3px 0; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.notif-item small { color: var(--muted); font-size: .72rem; opacity: .8; }
.notif-item.is-unread { background: rgba(63, 208, 232, .07); }
.notif-item.is-unread::before { content: ""; position: absolute; left: 4px; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }
.notif-empty { padding: 26px 10px; text-align: center; color: var(--muted); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* Avatars and frames */
.av { --av: 40px; position: relative; display: inline-flex; flex: none; width: var(--av); height: var(--av); border-radius: 50%; }
.av img, .av .av-i { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; }
.av .av-i { font-style: normal; font-weight: 800; font-size: calc(var(--av) * .42); color: #141129; }
.av-c1 { background: #FF6B5B; } .av-c2 { background: #FFB23F; } .av-c3 { background: #43D98F; } .av-c4 { background: #3FB8F0; }
.av-c5 { background: #9D7BFF; } .av-c6 { background: #FF5FA2; } .av-c7 { background: #2ED6C4; } .av-c8 { background: #F2D43D; }
.av[class*=" fr-"]::after { content: ""; position: absolute; inset: calc(var(--av) * -.09); border-radius: 50%; pointer-events: none;
  padding: calc(var(--av) * .065); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.fr-bronze::after { background: linear-gradient(135deg, #f0b27a, #9c5b28 55%, #e3a36b); }
.fr-silver::after { background: linear-gradient(135deg, #ffffff, #9aa3b5 50%, #e8ecf3); }
.fr-gold::after { background: linear-gradient(135deg, #fff1a8, #e2a414 45%, #ffd44d 70%, #b27a05); box-shadow: 0 0 10px rgba(255, 201, 64, .45); }
.fr-neon::after { background: #3FD0E8; box-shadow: 0 0 8px #3FD0E8, 0 0 18px rgba(63, 208, 232, .6); animation: fr-pulse 2s ease-in-out infinite; }
.fr-sakura::after { background: linear-gradient(135deg, #ffd1e6, #ff5fa2 55%, #ffb3d4); }
.fr-flame::after { background: conic-gradient(from 0deg, #ff3d2e, #ffb23f, #fff07a, #ff6b2b, #ff3d2e); box-shadow: 0 0 14px rgba(255, 110, 40, .6); animation: fr-spin 2.4s linear infinite; }
.fr-aurora::after { background: conic-gradient(#43D98F, #3FB8F0, #9D7BFF, #FF5FA2, #43D98F); box-shadow: 0 0 12px rgba(157, 123, 255, .5); animation: fr-spin 6s linear infinite; }
.fr-diamond::after { background: conic-gradient(#e8fbff, #8fe3ff, #ffffff, #5cc8f2, #e8fbff, #b6f0ff, #ffffff, #8fe3ff, #e8fbff);
  box-shadow: 0 0 12px rgba(160, 230, 255, .7), inset 0 0 6px #fff; animation: fr-spin 9s linear infinite; }
@keyframes fr-spin { to { transform: rotate(360deg); } }
@keyframes fr-pulse { 50% { box-shadow: 0 0 4px #3FD0E8, 0 0 10px rgba(63, 208, 232, .35); } }

/* Names and titles */
.pn { font-weight: 700; }
.pn-lg { font-size: 1.15rem; font-weight: 800; }
.nm-gold { color: #FFC940; text-shadow: 0 0 10px rgba(255, 201, 64, .35); }
.nm-ice { color: #9fe8ff; text-shadow: 0 0 8px rgba(120, 220, 255, .4); }
.nm-sunset, .nm-royal, .nm-rainbow { -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.nm-sunset { background-image: linear-gradient(90deg, #ffb23f, #ff6b5b, #ff5fa2); }
.nm-royal { background-image: linear-gradient(90deg, #b99bff, #ffd35a, #b99bff); }
.nm-neon { color: #fff; text-shadow: 0 0 4px #ff5fa2, 0 0 10px #ff5fa2, 0 0 18px rgba(255, 95, 162, .7); }
.nm-rainbow { background-image: linear-gradient(90deg, #ff6b5b, #ffb23f, #f2d43d, #43d98f, #3fb8f0, #9d7bff, #ff5fa2, #ff6b5b); background-size: 200% 100%; animation: nm-slide 4s linear infinite; }
@keyframes nm-slide { to { background-position: 200% 0; } }
.ptitle { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; font-size: .66rem; font-weight: 800; letter-spacing: .02em; vertical-align: 2px;
  color: #141129; background: linear-gradient(90deg, #FFC940, #ffdd7a); white-space: nowrap; }
.ptitle-lg { font-size: .85rem; padding: 4px 10px; margin: 0; vertical-align: 0; }
.reduce-motion .fr-flame::after, .reduce-motion .fr-aurora::after, .reduce-motion .fr-diamond::after, .reduce-motion .fr-neon::after, .reduce-motion .nm-rainbow { animation: none; }

/* Shared bits */
.chip-soft { background: rgba(255, 255, 255, .06); color: var(--muted); border-color: transparent; }
.chip-gold { background: rgba(255, 201, 64, .15); color: var(--gold); border-color: rgba(255, 201, 64, .4); }
.bar { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #3FD0E8, #43D98F); transition: width .4s ease; }
.center { text-align: center; }
.card-sub { margin: -4px 0 12px; color: var(--muted); font-size: .88rem; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head h2 .ico { color: var(--gold); }

/* Home */
.page-home .hero { padding-top: 10px; }
.btn-new { display: inline-block; margin-top: 12px; color: var(--muted); font-size: .88rem; font-weight: 700; min-height: 0; }
.stat-coins { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); }
.mission-card { display: block; color: var(--text); }
.mission-card:hover { text-decoration: none; border-color: rgba(63, 208, 232, .45); }
.mini-missions { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.mini-missions li { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; align-items: center; }
.mini-missions .bar { grid-column: 1 / -1; }
.mm-text { font-size: .9rem; font-weight: 600; }
.mm-reward, .m-reward { display: inline-flex; align-items: center; gap: 5px; color: var(--gold); font-weight: 800; font-size: .88rem; }
.mini-missions li.is-done .mm-text { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(67, 217, 143, .6); }
.mini-missions li.is-done .bar i, .mission.is-done .bar i { background: #43D98F; }
.signin-card > div { flex: 1; }
.signin-card p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.signin-ico { width: 44px; height: 44px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(255, 201, 64, .15); color: var(--gold); }
.podium { list-style: none; margin: 6px 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; text-align: center; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px 10px; border-radius: 16px; background: rgba(255, 255, 255, .04); position: relative; min-width: 0; }
.pod-1 { background: linear-gradient(180deg, rgba(255, 201, 64, .18), rgba(255, 201, 64, .04)); padding-top: 16px; }
.pod.is-me { box-shadow: inset 0 0 0 1.5px var(--cyan); }
.pod-rank { position: absolute; top: -9px; width: 22px; height: 22px; border-radius: 50%; font-size: .75rem; font-weight: 800; line-height: 22px; color: #141129; background: #b8c0d4; }
.pod-1 .pod-rank { background: var(--gold); } .pod-3 .pod-rank { background: #e0a06b; }
.pod-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.pod-score { font-weight: 800; font-variant-numeric: tabular-nums; }
.pod-prize { font-size: .78rem; font-weight: 800; color: var(--gold); }
.week-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-size: .85rem; color: var(--muted); }
.week-foot strong { color: var(--gold); }
.home-foot { margin-top: 18px; text-align: center; }
.home-foot p { color: var(--muted); font-size: .82rem; line-height: 1.55; max-width: 460px; margin: 0 auto 10px; }

/* Missions */
.mission-hero { display: flex; align-items: center; gap: 12px; padding: 16px; margin-bottom: 14px; border-radius: var(--r);
  background: linear-gradient(135deg, rgba(63, 208, 232, .16), rgba(157, 123, 255, .14)); border: 1px solid var(--line); }
.mission-hero > div { display: flex; flex-direction: column; flex: 1; }
.mh-l { color: var(--muted); font-size: .78rem; font-weight: 700; }
.mh-v { display: flex; align-items: center; gap: 7px; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.missions, .milestones { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mission, .ms { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid transparent; }
.m-ico { width: 38px; height: 38px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: rgba(63, 208, 232, .12); color: var(--cyan); }
.m-body, .ms-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.m-body strong, .ms-body strong { font-size: .92rem; }
.m-body small, .ms-body small { color: var(--muted); font-size: .76rem; }
.mission.is-done { border-color: rgba(67, 217, 143, .35); background: rgba(67, 217, 143, .07); }
.mission.is-done .m-ico { background: rgba(67, 217, 143, .18); color: #43D98F; }
.mission-bonus .m-ico { background: rgba(255, 201, 64, .15); color: var(--gold); }
.milestones { max-height: 560px; overflow-y: auto; padding-right: 2px; }
.ms-n { width: 32px; height: 32px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; background: rgba(255, 255, 255, .06); color: var(--muted); }
.ms.is-done { opacity: .7; }
.ms.is-done .ms-n { background: rgba(67, 217, 143, .18); color: #43D98F; }
.ms.is-done .m-reward { color: #43D98F; }
.ms.is-next { border-color: rgba(255, 201, 64, .5); background: rgba(255, 201, 64, .07); }
.ms.is-next .ms-n { background: var(--gold); color: #141129; }

/* Shop */
.shop-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; margin-bottom: 14px; border-radius: var(--r);
  background: radial-gradient(120% 140% at 0% 0%, rgba(255, 201, 64, .16), transparent 60%), var(--panel); border: 1px solid var(--line); }
.shop-me { display: flex; align-items: center; gap: 14px; min-width: 0; }
.shop-me small { color: var(--muted); font-size: .78rem; }
.shop-name { font-size: 1.05rem; margin-bottom: 2px; }
.shop-bal { display: flex; flex-direction: column; align-items: center; flex: none; }
.shop-bal strong { font-size: 1.3rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.shop-bal small { color: var(--muted); font-size: .72rem; }
.page-shop .tabs { grid-template-columns: repeat(3, 1fr); }
.unequip { text-align: right; margin: -4px 0 8px; }
.shop-grid { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 12px 12px; text-align: center; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.shop-item.is-equipped { border-color: rgba(67, 217, 143, .6); box-shadow: 0 0 0 1px rgba(67, 217, 143, .3) inset; }
.si-preview { height: 84px; display: flex; align-items: center; justify-content: center; }
.si-name { font-size: .92rem; }
.si-desc { color: var(--muted); font-size: .74rem; line-height: 1.35; min-height: 2.7em; }
.shop-item form { width: 100%; margin: 0; }
.shop-item .btn { gap: 6px; }
.btn.is-static { background: rgba(67, 217, 143, .14); color: #43D98F; border: 1px solid rgba(67, 217, 143, .4); cursor: default; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (min-width: 520px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }

/* Prizes page */
.prize-hero { position: relative; overflow: hidden; text-align: center; padding: 26px 18px 20px; margin-bottom: 14px; border-radius: 22px;
  background: linear-gradient(160deg, #2d2566, #1c1840 60%); border: 1px solid rgba(255, 201, 64, .3); }
.ph-glow { position: absolute; inset: -40% -20% auto; height: 200px; background: radial-gradient(closest-side, rgba(255, 201, 64, .28), transparent); pointer-events: none; }
.prize-hero .ico { color: var(--gold); position: relative; }
.prize-hero h2 { position: relative; margin: 8px 0 6px; font-size: 1.25rem; }
.prize-hero p { position: relative; margin: 0 auto 16px; max-width: 340px; color: var(--muted); font-size: .9rem; }
.ph-stats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ph-stats div { padding: 10px 4px; border-radius: 12px; background: rgba(0, 0, 0, .2); display: flex; flex-direction: column; }
.ph-stats b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.ph-stats span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.card-alert { border-color: rgba(255, 201, 64, .55); box-shadow: 0 0 0 1px rgba(255, 201, 64, .2) inset; }
.prize-amt { display: flex; flex-direction: column; }
.prize-amt strong { font-size: 1.25rem; color: var(--gold); }
.prize-amt span { color: var(--muted); font-size: .8rem; }
.pools { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
@media (min-width: 520px) { .pools { grid-template-columns: 1fr 1fr; } }
.pool { padding: 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.pool-top { display: flex; flex-direction: column; margin-bottom: 10px; }
.pool-l { color: var(--muted); font-size: .78rem; font-weight: 800; }
.pool-v { font-size: 1.8rem; font-weight: 900; color: var(--gold); line-height: 1.15; }
.pool-monthly .pool-v { color: #9fe8ff; }
.pool-sub { color: var(--muted); font-size: .78rem; }
.pool-tiers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pool-tiers li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: .9rem; }
.pool-tiers li.more { color: var(--muted); font-size: .8rem; font-weight: 600; padding-top: 4px; border-top: 1px dashed var(--line); }
.pool-me { margin: 12px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); font-size: .82rem; color: var(--muted); }
.pool-me.is-in { background: rgba(67, 217, 143, .12); color: #43D98F; font-weight: 700; }
.winners { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.winners li { display: flex; align-items: center; gap: 10px; }
.w-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.w-name small { color: var(--muted); font-size: .74rem; }
.w-amt { font-weight: 800; color: var(--gold); }
.rules summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 800; list-style: none; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 1.2rem; }
.rules[open] summary::after { content: "-"; }
.rules .bullets { margin-top: 12px; }

/* Profile additions */
.profile-head { display: flex; align-items: center; gap: 16px; }
.ph-info h2 { margin: 0 0 2px; font-size: 1.2rem; }
.ph-info p { margin: 0; }
.avatar-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.file-pick { position: relative; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 10px; border: 1px dashed var(--line); color: var(--muted); font-weight: 700; font-size: .86rem; cursor: pointer; max-width: 100%; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-pick:focus-within { outline: 2px solid var(--cyan); }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.ledger li span { display: flex; flex-direction: column; min-width: 0; }
.ledger small { color: var(--muted); font-size: .76rem; }
.ledger b { font-variant-numeric: tabular-nums; }
.ledger .plus { color: #43D98F; } .ledger .minus { color: var(--danger); }

/* Leaderboard rows with avatars */
.nm-rich { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px; min-width: 0; }
.nm-txt { display: flex; flex-direction: column; min-width: 0; }
.nm-txt > span:first-child, .nm-txt .pn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Game: coin refresh, music, missions on game over */
.chip-cost { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); font-weight: 800; }
.chip-left { color: var(--muted); }
#btnShuffle.is-poor { opacity: .6; }
.tray-coins { display: inline-flex; align-items: center; gap: 5px; color: var(--gold); font-weight: 800; font-size: .85rem; font-variant-numeric: tabular-nums; }
.tray-tools { display: flex; align-items: center; justify-content: center; gap: 12px; }
#btnMusic.is-off { opacity: .45; }
.over-missions { margin: 4px 0 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 201, 64, .1); border: 1px solid rgba(255, 201, 64, .35); text-align: left; }
.om-head { font-weight: 800; color: var(--gold); margin-bottom: 4px; }
.om-row { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; color: var(--text); padding: 2px 0; }
.om-row b { color: var(--gold); }

/* Ads */
.ad-slot-box { margin-top: 4px; }
.gam-slot { display: flex; align-items: center; justify-content: center; min-width: 1px; }

@media (max-width: 380px) {
  .coin-pill { padding: 0 9px 0 7px; font-size: .82rem; }
  .brand-word { display: none; }
}
.pod-empty { visibility: hidden; }

/* Ad sizing: .ad-fit holds the ad at its real size; app.js scales it down when the screen is narrower. */
.ad-fit { position: relative; overflow: hidden; flex: none; }
.ad-fit iframe, .ad-fit .gam-slot { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; }
