/* six7 — a deliberately dark, single-theme game UI (deep ink background, candy accents,
   gold for stars/levels, electric aqua→violet for EXP).
   Layout: one centred column (max 1100px) of stacked sections; game view is a fixed full-screen stage. */
:root {
  color-scheme: dark;
  --bg: #120e26;
  --bg2: #1a1436;
  --panel: #221b45;
  --panel2: #2b2357;
  --line: #3a3170;
  --line-soft: #ffffff14;
  --text: #f6f3ff;
  --muted: #a99fd6;
  --faint: #6f66a3;
  --accent: #ff4d8d;
  --accent2: #ff9a3d;
  --gold: #ffcf4a;
  --gold2: #ff9f1c;
  --xp1: #5ee7ff;
  --xp2: #8b7bff;
  --good: #3ddc97;
  --bad: #ff5a5f;
  --paper: #ffffff;
  --ink: #231f33;
  --unfilled: #e8e5ef;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow: 0 18px 40px -18px #000c;
  --display: 'Fredoka', ui-rounded, system-ui, sans-serif;
  --body: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --grad-accent: linear-gradient(135deg, #ff4d8d 0%, #ff9a3d 100%);
  --grad-xp: linear-gradient(90deg, #5ee7ff 0%, #8b7bff 60%, #ff7ad9 100%);
  --grad-gold: linear-gradient(160deg, #fff1a8 0%, #ffcf4a 45%, #ff9f1c 100%);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(900px 520px at 50% -120px, #3b2a85 0%, transparent 70%), var(--bg);
  background-attachment: fixed;
  color: var(--text); font-family: var(--body); font-size: 15px;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
.ico { width: 22px; height: 22px; flex: none; }
:focus-visible { outline: 3px solid var(--xp1); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--panel2); color: var(--text); font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: .2px;
  cursor: pointer; user-select: none; transition: transform .12s, filter .2s, box-shadow .2s;
}
.btn:active { transform: scale(.95); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--grad-accent); box-shadow: 0 10px 24px -10px #ff4d8dcc, inset 0 1px 0 #ffffff55; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover { background: #ffffff0a; }
.btn.big { min-height: 54px; font-size: 18px; padding: 0 28px; }
.btn.wide { width: 100%; }
.btn .ico { width: 20px; height: 20px; }
.iconbtn {
  position: relative; width: 44px; height: 44px; border-radius: 14px; border: 0; display: grid; place-items: center;
  background: var(--panel); color: var(--text); cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-soft); transition: transform .12s, background .2s;
}
.iconbtn:hover { background: var(--panel2); }
.iconbtn:active { transform: scale(.92); }
.iconbtn.light { background: #fffffff2; color: var(--ink); box-shadow: 0 6px 16px -6px #0005; }
.iconbtn .dot { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px; background: var(--grad-gold); color: #4a2a00; font: 700 11px/20px var(--display); text-align: center; box-shadow: 0 0 0 3px var(--bg); }
.iconbtn .dot:empty { display: none; }
.pillbtn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 14px; border: 0; background: var(--grad-accent); color: #fff; font: 600 14px var(--display); cursor: pointer; box-shadow: 0 8px 20px -10px #ff4d8dcc; }
.pillbtn .ico { width: 18px; height: 18px; }
.btn.share { background: linear-gradient(135deg, #5ee7ff 0%, #8b7bff 100%); color: #120e26; box-shadow: 0 10px 24px -10px #8b7bffcc, inset 0 1px 0 #ffffff66; }
.btn.share:hover { filter: brightness(1.06); }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 8px 0; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: linear-gradient(var(--bg) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 38px; height: 38px; filter: drop-shadow(0 6px 14px #ff4d8d66); }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -1px; line-height: 1; }
.wordmark b { font-weight: 700; background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent; margin-left: 1px; }
.top-actions { display: flex; gap: 10px; }
.page-title { font-size: 20px; font-weight: 600; }
.topbar-spacer { width: 44px; }
.lib-inner { max-width: 1100px; margin: 0 auto; padding-bottom: 60px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 26px; }

/* ---------- level badge ---------- */
.lvl-badge {
  --s: 52px; width: var(--s); height: var(--s); flex: none; display: grid; place-items: center; position: relative;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: var(--grad-gold); color: #5a3200; font: 700 calc(var(--s) * .42)/1 var(--display);
  filter: drop-shadow(0 4px 10px #ffb30066);
}
.lvl-badge::before { content: ''; position: absolute; inset: 4px; clip-path: inherit; background: linear-gradient(160deg, #ffe680, #ffb52e); z-index: -1; }
.lvl-badge span { text-shadow: 0 1px 0 #fff8; }
.lvl-badge.huge { --s: 150px; }

/* ---------- player card ---------- */
.player {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center;
  padding: 18px 20px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, #2c2163 0%, #22194a 60%, #1d173f 100%);
  box-shadow: var(--shadow), inset 0 1px 0 #ffffff14; position: relative; overflow: hidden;
}
.player::after { content: ''; position: absolute; right: -60px; top: -80px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(#8b7bff44, transparent 70%); pointer-events: none; }
.player .lvl-badge { --s: 64px; grid-row: span 2; }
.player-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.player-title { font-family: var(--display); font-size: 21px; font-weight: 600; }
.player-title small { display: block; font: 700 11px var(--body); letter-spacing: 1.4px; color: var(--muted); text-transform: uppercase; }
.player-stats { display: flex; gap: 14px; font-weight: 700; color: var(--muted); font-size: 14px; }
.player-stats span { display: inline-flex; align-items: center; gap: 4px; }
.player-stats .ico { width: 17px; height: 17px; }
.player-stats .st { color: var(--gold); }
.player-stats .tr { color: var(--xp1); }

/* EXP bar (shared) */
.xp-track { position: relative; height: 18px; border-radius: 10px; background: #0d0a20; box-shadow: inset 0 2px 4px #0008, inset 0 0 0 1px #ffffff10; overflow: hidden; }
.xp-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 10px; background: var(--grad-xp); box-shadow: 0 0 16px #8b7bffaa; }
.xp-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, #ffffff88 45%, transparent 60%); background-size: 220% 100%; animation: sheen 2.2s linear infinite; border-radius: inherit; }
@keyframes sheen { from { background-position: 160% 0; } to { background-position: -60% 0; } }
.xp-text { position: absolute; inset: 0; display: grid; place-items: center; font: 700 11px var(--display); letter-spacing: .5px; color: #fff; text-shadow: 0 1px 2px #0009; font-variant-numeric: tabular-nums; }

/* ---------- continue card ---------- */
.continue { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; padding: 14px; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow); cursor: pointer; transition: transform .2s; }
.continue:hover { transform: translateY(-2px); }
.continue img { width: 112px; height: 112px; object-fit: contain; border-radius: var(--r-md); background: var(--paper); }
.continue .eyebrow { color: var(--accent); }
.continue h3 { font-size: 20px; margin: 2px 0 8px; }
.continue .bar { height: 8px; border-radius: 4px; background: #0d0a20; overflow: hidden; margin-bottom: 10px; }
.continue .bar i { display: block; height: 100%; background: var(--good); border-radius: 4px; }
.continue .btn { min-height: 38px; font-size: 15px; padding: 0 16px; }
.eyebrow { font: 800 11px var(--body); letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }

/* ---------- pack nav + sections ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: -12px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--panel); color: var(--text); border-radius: 999px; padding: 9px 14px; cursor: pointer; font-weight: 700; box-shadow: inset 0 0 0 1px var(--line-soft); }
.chip .ico { width: 17px; height: 17px; color: var(--muted); }
.chip:hover { background: var(--panel2); }
.packs { display: flex; flex-direction: column; gap: 30px; }
.pack { scroll-margin-top: 80px; }
.pack-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pack-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--pc, var(--panel2)); color: #fff; box-shadow: 0 8px 18px -8px var(--pc, #000); }
.pack-icon .ico { width: 24px; height: 24px; }
.pack-head .txt { flex: 1; min-width: 0; }
.pack-head h2 { font-size: 22px; font-weight: 600; }
.pack-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.pack-prog { flex: none; text-align: right; font-weight: 800; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pack-prog b { display: block; font: 600 20px var(--display); color: var(--text); }
.pack.complete .pack-prog b { color: var(--good); }

/* horizontal carousel of cards */
.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 210px); gap: 14px; overflow-x: auto; padding: 4px 2px 12px; margin: -4px -2px 0; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.row-scroll > * { scroll-snap-align: start; }

.card { position: relative; border-radius: var(--r-md); background: var(--panel); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s; }
.card:hover { transform: translateY(-3px); }
.thumb { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: var(--paper); cursor: pointer; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: #0002; }
.thumb .prog i { display: block; height: 100%; background: var(--good); }
.badge-pill { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; font: 700 12px var(--display); letter-spacing: .4px; box-shadow: 0 4px 10px -4px #0006; }
.badge-pill.new { background: var(--grad-accent); color: #fff; }
.badge-pill.prog { background: var(--good); color: #063a26; }
.badge-pill.done { background: #fff; color: var(--ink); display: inline-flex; align-items: center; gap: 4px; }
.badge-pill.done .ico { width: 14px; height: 14px; color: var(--good); }
.meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.meta h3 { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.stars { display: inline-flex; gap: 1px; color: #ffffff22; }
.stars .ico { width: 15px; height: 15px; }
.stars .on { color: var(--gold); }
.lvl { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #ffffff12; color: var(--text); font-weight: 800; }
.lvl.easy { background: #3ddc9726; color: #8ff0c4; } .lvl.medium { background: #5ee7ff22; color: #9eefff; } .lvl.hard { background: #ff9a3d26; color: #ffc690; } .lvl.expert { background: #ff4d8d2e; color: #ff9fc1; }
.more { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.mini { width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #120e26b3; color: #fff; cursor: pointer; opacity: .8; backdrop-filter: blur(4px); }
.mini .ico { width: 16px; height: 16px; }
.mini:hover { opacity: 1; }
.mini.arm { width: auto; padding: 0 10px; border-radius: 999px; background: var(--bad); opacity: 1; font-weight: 800; font-size: 12px; }
/* locked */
.card.locked .thumb img { filter: grayscale(1) blur(3px) opacity(.55); transform: scale(1.06); }
.card.locked .thumb { background: #d9d5e6; }
.lock-veil { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: #fff; text-align: center; padding: 12px; background: linear-gradient(180deg, #120e2633, #120e26b3); }
.lock-veil .lk { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #120e26cc; box-shadow: 0 0 0 3px #ffffff30; }
.lock-veil .lk .ico { width: 26px; height: 26px; }
.lock-veil span { font: 700 12.5px/1.3 var(--body); text-shadow: 0 1px 3px #000a; }
.card.locked .meta h3 { color: var(--muted); }
.card.shake { animation: shake .4s; }
.card.just-unlocked .thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, #ffffffaa 50%, transparent 70%); background-size: 250% 100%; animation: sheen 1.4s ease-out 3; }

/* make your own */
.make-own { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 22px; border-radius: var(--r-lg); background: var(--bg2); box-shadow: inset 0 0 0 1px var(--line-soft); }
.make-copy { flex: 1 1 260px; min-width: 0; }
.make-copy h2 { font-size: 20px; font-weight: 600; }
.make-copy p { margin: 4px 0 0; color: var(--muted); max-width: 52ch; }
.make-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- achievements view ---------- */
.ach-summary { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 18px 20px; border-radius: var(--r-lg); background: linear-gradient(135deg, #2c2163, #1d173f); box-shadow: var(--shadow); }
.ach-summary .big { font: 700 34px/1 var(--display); }
.ach-summary .big small { font-size: 16px; color: var(--muted); }
.ach-summary p { margin: 4px 0 10px; color: var(--muted); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.ach { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 14px; border-radius: var(--r-md); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-soft); }
.ach.got { background: linear-gradient(135deg, #2f2566, #241c4c); box-shadow: inset 0 0 0 1px #ffcf4a44; }
.ach h3 { font-size: 16px; font-weight: 600; }
.ach p { margin: 2px 0 8px; color: var(--muted); font-size: 13.5px; }
.ach .ach-foot { display: flex; align-items: center; gap: 10px; font: 700 12px var(--display); color: var(--muted); }
.ach .mini-bar { flex: 1; height: 7px; border-radius: 4px; background: #0d0a20; overflow: hidden; }
.ach .mini-bar i { display: block; height: 100%; background: var(--grad-xp); border-radius: 4px; }
.ach .xp-tag { color: var(--xp1); white-space: nowrap; }
.ach.got .xp-tag { color: var(--gold); }
/* medal */
.medal { --s: 58px; width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; flex: none; position: relative; color: #fff;
  background: radial-gradient(circle at 35% 30%, var(--m1), var(--m2) 70%); box-shadow: 0 6px 14px -6px var(--m2), inset 0 -4px 0 #0003, inset 0 3px 0 #fff6; }
.medal::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; box-shadow: inset 0 0 0 2px #ffffff55; }
.medal .ico { width: calc(var(--s) * .45); height: calc(var(--s) * .45); filter: drop-shadow(0 1px 1px #0006); }
.medal.bronze { --m1: #ffc59a; --m2: #c96a2b; }
.medal.silver { --m1: #f4f6ff; --m2: #8d97c7; }
.medal.gold { --m1: #fff1a8; --m2: #e59a00; }
.medal.off { --m1: #3a3266; --m2: #2a2350; color: #6f66a3; box-shadow: inset 0 0 0 2px #ffffff10; }
.medal.off::before { box-shadow: none; }

/* ---------- converter ---------- */
.drop { border: 2px dashed var(--line); border-radius: 24px; padding: 54px 20px; text-align: center; color: var(--muted); transition: background .2s, border-color .2s; }
.drop.over { background: #ffffff0d; border-color: var(--accent); }
.drop-art { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; background: var(--panel2); color: var(--xp1); }
.drop-art .ico { width: 36px; height: 36px; }
.drop p { max-width: 420px; margin: 14px auto 20px; line-height: 1.5; }
.drop b { color: var(--text); font-size: 18px; font-family: var(--display); font-weight: 600; }
.create { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.previews { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-width: 0; }
.previews figure { margin: 0; min-width: 0; }
.previews img, .out { width: 100%; border-radius: 14px; background: var(--paper); display: block; }
.out { min-height: 160px; transition: opacity .2s; }
.out.busy { opacity: .45; }
.out img { width: 100%; display: block; border-radius: 14px; }
figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; background: var(--panel); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 700; }
.seg button.on { background: var(--accent); color: #fff; }
.controls { background: var(--panel); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.controls label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 700; }
.controls label.check { flex-direction: row; align-items: center; gap: 8px; }
.controls output { color: var(--text); font-weight: 800; }
.controls input:not([type]), .controls select { min-height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 0 10px; font: inherit; }
.controls input[type=range] { accent-color: var(--accent); }
.stats { margin: 0; font-size: 14px; color: var(--muted); } .stats b { color: var(--text); } .warn { color: var(--gold); }
.status { margin: 0; min-height: 1.2em; color: var(--gold); font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 760px) { .create { grid-template-columns: 1fr; } }

/* ---------- game ---------- */
body[data-view=game] { overflow: hidden; position: fixed; inset: 0; }
#view-game { position: fixed; inset: 0; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
.hud { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding-block: 10px 6px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
.hud-score { min-width: 0; }
.score { font: 700 30px/1 var(--display); font-variant-numeric: tabular-nums; }
#g-pace { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
#g-pace.up { color: var(--good); } #g-pace.down { color: #ff9ea1; }
.hud-combo { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 78px; }
.mult { font: 700 26px/1 var(--display); transition: transform .2s; }
.mult[data-m="2"] { color: var(--xp1); } .mult[data-m="3"] { color: var(--good); } .mult[data-m="4"] { color: var(--gold); }
.mult[data-m="5"] { color: var(--accent); animation: throb .5s infinite alternate; }
@keyframes throb { to { transform: scale(1.15); text-shadow: 0 0 16px currentColor; } }
.cbar { width: 100%; height: 6px; border-radius: 3px; background: #ffffff1a; overflow: hidden; }
.cbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); transform-origin: left; transform: scaleX(0); }
.hud-best { text-align: right; line-height: 1.15; } .hud-best small { color: var(--muted); font: 800 10px var(--body); letter-spacing: 1.4px; display: block; } .hud-best b { font: 600 17px var(--display); color: var(--gold); }
.progress { height: 5px; background: #ffffff12; margin-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px)); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--good); transition: width .4s; border-radius: 3px; }

#g-stage { flex: 1; position: relative; margin: 8px max(12px, env(safe-area-inset-left, 0px)) 6px max(12px, env(safe-area-inset-right, 0px)); border-radius: 20px; overflow: hidden; background: #f4f1fb; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 0 0 1px #ffffff14, 0 14px 40px -12px #000c; transition: box-shadow .3s; }
#g-svg { width: 100%; height: 100%; display: block; }
#g-svg .r { fill: var(--unfilled); fill-rule: evenodd; clip-rule: evenodd; stroke: var(--ink); stroke-linejoin: round; cursor: pointer; transition: fill .2s; }
#g-svg .r.gold { stroke: #f0a500; stroke-width: calc(var(--lw) * 3.2); paint-order: stroke; animation: gold 1s infinite alternate ease-in-out; }
@keyframes gold { from { fill: var(--unfilled); stroke: #ffcc33; } to { fill: #fff3c4; stroke: #e08a00; } }
#g-svg .r.target { fill: #cfc4ff; }
#g-svg .r.bad { fill: #ff8f93 !important; }
#g-svg .r.flash { animation: flash .4s 3 alternate; }
@keyframes flash { from { fill: var(--unfilled); } to { fill: #c9bdff; } }
#g-svg .det { fill: var(--ink); fill-rule: evenodd; pointer-events: none; }
#g-svg text { fill: #6f6790; text-anchor: middle; dominant-baseline: central; font-family: var(--display); font-weight: 600; pointer-events: none; }
.zoom { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
body.fever #g-stage { box-shadow: 0 0 0 3px var(--accent), 0 0 40px 4px #ff4d8daa; animation: feverglow .6s infinite alternate; }
@keyframes feverglow { to { box-shadow: 0 0 0 3px var(--gold), 0 0 60px 10px #ffd23faa; } }
body.fever .cbar i { background: linear-gradient(90deg, #ff4d8d, #b388ff, #4cc9f0); }

/* colour ring */
#ring { position: absolute; width: 0; height: 0; z-index: 5; pointer-events: none; }
#ring .opt {
  position: absolute; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); border: 3px solid #fff; box-shadow: 0 6px 16px -4px #000a, inset 0 0 0 1px #0002;
  transform: translate(0, 0) scale(.2); opacity: 0; pointer-events: auto; cursor: pointer;
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1) var(--d), opacity .12s var(--d);
}
#ring .opt span { font: 700 20px/1 var(--display); pointer-events: none; text-shadow: 0 1px 2px #0003; }
#ring.open .opt { transform: translate(var(--x), var(--y)) scale(1); opacity: 1; }
#ring.open .opt.hot { transform: translate(calc(var(--x) * 1.12), calc(var(--y) * 1.12)) scale(1.3); border-color: var(--gold); box-shadow: 0 0 0 4px #ffd23f88, 0 10px 24px -4px #000c; z-index: 2; transition-delay: 0s; }
/* the number to match: a black diamond, so it can't be mistaken for a round colour button */
#ring .ring-num { position: absolute; width: 60px; height: 60px; transform: translate(-50%, calc(var(--y) - 50%)); display: grid; place-items: center; color: #fff; font: 700 22px var(--display); pointer-events: none; filter: drop-shadow(0 6px 8px #0009); animation: pop .2s cubic-bezier(.3, 1.6, .5, 1); }
#ring .ring-num::before { content: ''; position: absolute; inset: 9px; background: var(--ink); border: 3px solid var(--gold); border-radius: 6px; transform: rotate(45deg); }
#ring .ring-num span { position: relative; }
@keyframes pop { from { transform: translate(-50%, calc(var(--y) - 50%)) scale(.3); } }

/* colour key */
#g-legend { display: flex; gap: 8px; overflow-x: auto; padding-block: 6px 10px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)); scrollbar-width: none; }
#g-legend::-webkit-scrollbar { display: none; }
.sw { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 3px solid #ffffff30; background: var(--c); font: 700 16px var(--display); cursor: pointer; position: relative; transition: transform .2s, opacity .3s; }
.sw:active { transform: scale(.9); }
.sw.done { opacity: .35; }
.sw.done::after { content: '✓'; position: absolute; inset: -3px; display: grid; place-items: center; border-radius: 50%; background: #120e26b0; color: var(--good); font-size: 22px; }
.sw.done span { visibility: hidden; }
.sw.pop { animation: swpop .5s; }
@keyframes swpop { 40% { transform: scale(1.4); opacity: 1; } }

.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.bump { animation: bump .3s; }
@keyframes bump { 40% { transform: scale(1.025); } }

/* floating texts + banner */
.float { position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, -50%); font: 700 26px var(--display); color: #fff; text-shadow: 0 2px 0 #0006, 0 0 12px #0005; animation: floatup 1.1s ease-out forwards; white-space: nowrap; }
.float.m2 { color: #8fefff; } .float.m3 { color: #7dffc4; font-size: 30px; } .float.m4 { color: var(--gold); font-size: 34px; } .float.m5 { color: #ff7eb0; font-size: 38px; }
.float.tag { font-size: 18px; color: var(--gold); }
.float.gold { font-size: 28px; color: var(--gold); text-shadow: 0 0 18px #ffb300, 0 2px 0 #0007; }
.float.bad { color: var(--bad); font-size: 22px; }
.float.small { font-size: 16px; color: #ffb3b5; }
.float.xp { font-size: 30px; background: var(--grad-xp); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 0 10px #8b7bffcc); }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
#banner { position: fixed; left: 50%; top: 32%; z-index: 60; pointer-events: none; transform: translate(-50%, -50%); font: 700 clamp(30px, 9vw, 64px) var(--display); white-space: nowrap; opacity: 0; color: #fff; text-shadow: 0 4px 0 #0005, 0 0 30px #ff4d8d; }
#banner.show { animation: banner 1.5s cubic-bezier(.2, 1.4, .4, 1) forwards; }
#banner.m2 { text-shadow: 0 4px 0 #0005, 0 0 30px #4cc9f0; } #banner.m3 { text-shadow: 0 4px 0 #0005, 0 0 30px #3ddc97; }
#banner.m4 { color: var(--gold); } #banner.m5, #banner.fever { color: #ff7eb0; }
#banner.best { color: var(--gold); text-shadow: 0 4px 0 #0006, 0 0 40px #ffb300; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-6deg); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(2deg); } 30% { transform: translate(-50%, -50%) scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -80%) scale(1); } }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

/* ---------- toasts (achievements) ---------- */
#toasts { position: fixed; z-index: 74; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 12px); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100% - 32px)); pointer-events: none; }
.toast { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; border-radius: 18px; background: linear-gradient(135deg, #2f2566f2, #1d173ff2); box-shadow: 0 16px 36px -12px #000, inset 0 0 0 1px #ffcf4a55; backdrop-filter: blur(8px); position: relative; overflow: hidden; animation: toastIn .55s cubic-bezier(.2, 1.4, .4, 1) both; }
.toast.out { animation: toastOut .35s ease-in forwards; }
.toast::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, #ffffff40 50%, transparent 70%); background-size: 250% 100%; animation: sheen 1.6s ease-out .3s 2; }
.toast .medal { --s: 46px; }
.toast small { display: block; font: 800 10.5px var(--body); letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold); }
.toast b { font: 600 16px var(--display); }
.toast .xp-tag { font: 700 15px var(--display); background: var(--grad-xp); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-30px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-20px) scale(.95); } }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); background: #0b0819d9; backdrop-filter: blur(6px); animation: fade .25s; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(440px, 100%); background: linear-gradient(180deg, #2a2156, #1d173f); border-radius: 28px; padding: 24px; text-align: center; box-shadow: 0 40px 80px -30px #000, inset 0 1px 0 #ffffff1a; animation: rise .4s cubic-bezier(.2, 1.3, .4, 1); margin: auto; }
@keyframes rise { from { transform: translateY(30px) scale(.94); opacity: 0; } }
.sheet h2 { font-size: 28px; font-weight: 600; }
.intro-art { width: 132px; height: 132px; margin: -4px auto 14px; border-radius: 24px; background: var(--paper); overflow: hidden; box-shadow: 0 12px 30px -12px #000; }
.intro-art img { width: 100%; height: 100%; object-fit: contain; }
.intro-meta { margin: 4px 0 14px; color: var(--muted); font-weight: 700; font-size: 14px; }
.how { list-style: none; text-align: left; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.how li { display: flex; align-items: center; gap: 12px; }
.how-n { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--panel2); font: 700 15px var(--display); color: var(--xp1); }
.how-n.gold { background: #ffcf4a22; color: var(--gold); }
.how-n .ico { width: 18px; height: 18px; }
.goldtxt { color: var(--gold); }
.ibest { color: var(--gold); font-weight: 800; margin: 0 0 16px; }

/* end screen */
.sheet.end { padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.end-top h2 { font-size: 26px; margin-top: 2px; }
.stars-big { display: flex; justify-content: center; gap: 4px; }
.stars-big i { display: inline-block; color: #ffffff1c; }
.stars-big i .ico { width: 46px; height: 46px; }
.stars-big i:nth-child(2) .ico { width: 58px; height: 58px; transform: translateY(-8px); }
.stars-big i.on { color: var(--gold); animation: star .55s var(--d) backwards cubic-bezier(.3, 1.8, .5, 1); filter: drop-shadow(0 0 12px #ffb300aa); }
@keyframes star { from { transform: scale(0) rotate(-90deg); } }
.end-art { width: 150px; height: 150px; margin: 0 auto; border-radius: 22px; overflow: hidden; background: var(--paper); box-shadow: 0 14px 30px -14px #000, 0 0 0 4px #ffffff14; }
.end-art img { width: 100%; height: 100%; object-fit: contain; }
.end-score b { display: block; font: 700 52px/1.05 var(--display); font-variant-numeric: tabular-nums; }
#e-msg { margin: 4px 0 0; color: var(--muted); font-weight: 700; } #e-msg.best { color: var(--gold); font-size: 17px; }
.rows { text-align: left; background: #0000002e; border-radius: 16px; padding: 4px 14px; }
.rows div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #ffffff10; font-weight: 700; }
.rows div:last-child { border: 0; } .rows .sub { color: var(--muted); font-size: 14px; }
.rows b { font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }

/* EXP panel — the star of the end screen */
.xp-panel { position: relative; padding: 16px 16px 18px; border-radius: 20px; background: radial-gradient(120% 140% at 50% 0%, #3b2f8f 0%, #201a48 70%); box-shadow: inset 0 0 0 1px #8b7bff55, 0 0 0 0 #8b7bff00; opacity: 0; transform: translateY(10px) scale(.97); transition: opacity .4s, transform .5s cubic-bezier(.2, 1.4, .4, 1), box-shadow .6s; overflow: hidden; }
.xp-panel.show { opacity: 1; transform: none; box-shadow: inset 0 0 0 1px #8b7bff88, 0 0 40px -6px #8b7bffaa; }
.xp-panel::before { content: ''; position: absolute; left: 50%; top: -60%; width: 160%; aspect-ratio: 1; transform: translateX(-50%); background: conic-gradient(from 0deg, transparent 0 20deg, #8b7bff22 20deg 40deg, transparent 40deg 70deg, #5ee7ff1c 70deg 90deg, transparent 90deg 130deg, #ff7ad91c 130deg 150deg, transparent 150deg 200deg, #8b7bff22 200deg 220deg, transparent 220deg 280deg, #5ee7ff1c 280deg 300deg, transparent 300deg); animation: spin 14s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: translateX(-50%) rotate(360deg); } }
.xp-panel > * { position: relative; }
.xp-gain { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.xp-plus { font: 700 54px/1 var(--display); background: var(--grad-xp); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 14px #8b7bffbb); font-variant-numeric: tabular-nums; }
.xp-unit { font: 700 22px var(--display); color: var(--xp1); letter-spacing: 1px; }
.xp-plus.pulse { animation: xppulse .35s; }
@keyframes xppulse { 50% { transform: scale(1.12); } }
.xp-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 14px; min-height: 28px; }
.xp-chip { padding: 4px 10px; border-radius: 999px; background: #ffffff12; font-weight: 800; font-size: 12.5px; color: var(--muted); animation: chipIn .4s cubic-bezier(.2, 1.5, .4, 1) both; }
.xp-chip b { color: var(--xp1); font-family: var(--display); font-weight: 600; margin-right: 3px; }
.xp-chip.achc b { color: var(--gold); }
@keyframes chipIn { from { opacity: 0; transform: translateY(8px) scale(.8); } }
.lvl-row { display: flex; align-items: center; gap: 10px; }
.lvl-row .lvl-badge { --s: 46px; }
.lvl-row .xp-track { flex: 1; height: 22px; border-radius: 12px; }
.lvl-row .xp-fill { border-radius: 12px; }
.lvl-row .lvl-badge.bump { animation: badgeBump .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes badgeBump { 40% { transform: scale(1.35) rotate(8deg); } }

/* unlock reveal */
.unlock { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; text-align: left; padding: 12px; border-radius: 18px; background: linear-gradient(135deg, #1f4a3f, #1a2f45); box-shadow: inset 0 0 0 1px #3ddc9766, 0 0 30px -10px #3ddc97aa; animation: unlockIn .7s cubic-bezier(.2, 1.4, .4, 1); position: relative; overflow: hidden; }
.unlock::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, #ffffff40 50%, transparent 70%); background-size: 250% 100%; animation: sheen 1.5s ease-out .4s 2; pointer-events: none; }
.unlock .uimg { width: 84px; height: 84px; border-radius: 14px; background: var(--paper); overflow: hidden; position: relative; }
.unlock .uimg img { width: 100%; height: 100%; object-fit: contain; }
.unlock .eyebrow { color: var(--good); display: inline-flex; align-items: center; gap: 5px; }
.unlock .eyebrow .ico { width: 15px; height: 15px; }
.unlock b { display: block; font: 600 19px var(--display); margin: 2px 0 6px; }
.unlock .btn { min-height: 36px; font-size: 14px; padding: 0 14px; }
@keyframes unlockIn { from { opacity: 0; transform: scale(.85) translateY(10px); } }
/* achievements earned on the end screen */
.ach-earned { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.ach-earned .ae { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: #ffcf4a14; box-shadow: inset 0 0 0 1px #ffcf4a44; animation: unlockIn .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.ach-earned .medal { --s: 44px; }
.ach-earned small { display: block; color: var(--gold); font: 800 10.5px var(--body); letter-spacing: 1.3px; text-transform: uppercase; }
.ach-earned b { font: 600 16px var(--display); }
.ach-earned .xp-tag { font: 700 15px var(--display); color: var(--gold); }
.end-actions { display: flex; flex-direction: column; gap: 10px; }
.end-actions .row { justify-content: center; }
.end-actions .row .btn { flex: 1; }

/* level up overlay */
.levelup { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, #3b2f8fee, #0b0819f2 70%); animation: fade .3s; overflow: hidden; }
.lu-rays { position: absolute; left: 50%; top: 45%; width: 220vmax; height: 220vmax; transform: translate(-50%, -50%); background: repeating-conic-gradient(from 0deg, #ffcf4a26 0 8deg, transparent 8deg 20deg); animation: luspin 18s linear infinite; mask-image: radial-gradient(circle, #000 0, transparent 45%); -webkit-mask-image: radial-gradient(circle, #000 0, transparent 45%); }
@keyframes luspin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.lu-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 20px; }
.lu-label { font: 700 clamp(40px, 12vw, 72px)/1 var(--display); letter-spacing: 1px; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #7a4300) drop-shadow(0 0 24px #ffb300aa); animation: luLabel .8s cubic-bezier(.2, 1.6, .4, 1) both; }
.levelup .lvl-badge.huge { animation: luBadge 1s cubic-bezier(.2, 1.5, .4, 1) .15s both; filter: drop-shadow(0 0 40px #ffb300cc); }
.lu-title { font: 600 24px var(--display); color: #fff; animation: luLabel .6s .5s both; }
.lu-title small { display: block; font: 800 12px var(--body); letter-spacing: 1.6px; color: var(--muted); text-transform: uppercase; }
.levelup .btn { animation: luLabel .5s .8s both; }
@keyframes luLabel { from { opacity: 0; transform: scale(.4); } }
@keyframes luBadge { from { opacity: 0; transform: scale(0) rotate(-180deg); } }

@media (max-width: 480px) {
  .score { font-size: 24px; }
  .mult { font-size: 22px; }
  .hud { gap: 8px; }
  .wordmark { font-size: 21px; }
  .player { padding: 16px; }
  .player .lvl-badge { --s: 56px; }
  .row-scroll { grid-auto-columns: 44vw; }
  .end-score b { font-size: 44px; }
  .xp-plus { font-size: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- coins ---------- */
.coinico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; filter: drop-shadow(0 1px 1px #0005); }
.coin-pill { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px 0 10px; border-radius: 14px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #3a2a10, #2a1d0a); box-shadow: inset 0 0 0 1.5px #ffcf4a66, 0 6px 16px -8px #ffb30088; color: var(--gold); font: 700 17px var(--display); font-variant-numeric: tabular-nums; }
.coin-pill .coinico { width: 24px; height: 24px; }
.coin-pill.bump, .bal.bump { animation: coinbump .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes coinbump { 40% { transform: scale(1.18); } }
.flycoin { position: fixed; z-index: 90; width: 26px; height: 26px; margin: -13px 0 0 -13px; pointer-events: none; will-change: transform; }
.flycoin .coinico { width: 26px; height: 26px; }
.coin-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--gold) !important; background: none !important; -webkit-text-fill-color: currentColor; }
.toast .xp-tag.coin-tag { background: none; color: var(--gold); }

/* coin payout panel (replaces the old EXP look) */
.xp-panel { background: radial-gradient(120% 140% at 50% 0%, #5a4210 0%, #2a1f0c 55%, #1d173f 100%); box-shadow: inset 0 0 0 1px #ffcf4a55; }
.xp-panel.show { box-shadow: inset 0 0 0 1px #ffcf4a99, 0 0 44px -6px #ffb300aa; }
.xp-panel::before { background: conic-gradient(from 0deg, transparent 0 20deg, #ffcf4a22 20deg 40deg, transparent 40deg 70deg, #fff1a81c 70deg 90deg, transparent 90deg 130deg, #ff9f1c22 130deg 150deg, transparent 150deg 200deg, #ffcf4a22 200deg 220deg, transparent 220deg 280deg, #fff1a81c 280deg 300deg, transparent 300deg); }
.xp-gain { align-items: center; }
.coin-big .coinico { width: 50px; height: 50px; animation: coinspin 2.4s ease-in-out infinite; }
@keyframes coinspin { 0%, 70%, 100% { transform: rotateY(0); } 85% { transform: rotateY(180deg); } }
.xp-plus { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 14px #ffb300bb); }
.xp-unit { color: var(--gold); text-transform: uppercase; font-size: 18px; }
.xp-chip b { color: var(--gold); }
.lvl-row .xp-fill { background: linear-gradient(90deg, #5ee7ff, #8b7bff); }
.bal-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 8px 12px; border-radius: 12px; background: #0000003a; font-weight: 800; color: var(--muted); }
.bal { display: inline-flex; align-items: center; gap: 6px; font: 700 22px var(--display); color: var(--gold); font-variant-numeric: tabular-nums; }
.bal .coinico { width: 26px; height: 26px; }

/* buy buttons + locked cards */
.btn.gold { background: var(--grad-gold); color: #4a2a00; box-shadow: 0 10px 24px -10px #ffb300cc, inset 0 1px 0 #fff8; }
.btn.gold:hover { filter: brightness(1.06); }
.btn.gold .coinico { width: 22px; height: 22px; }
.lock-veil .price { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px; background: #120e26d9; color: var(--gold); font: 700 17px var(--display); box-shadow: inset 0 0 0 1.5px #ffcf4a66; }
.lock-veil .price .coinico { width: 20px; height: 20px; }
.lock-veil .price.dim { opacity: .7; font-size: 14px; }
.lock-veil .buy-cta { font: 700 12.5px var(--body); }
.lock-veil.buy.can .price { background: var(--grad-gold); color: #4a2a00; box-shadow: 0 0 22px #ffb30099; animation: pricepulse 1.6s ease-in-out infinite; }
@keyframes pricepulse { 50% { transform: scale(1.07); } }
.card.locked .thumb { cursor: pointer; }
.card.armed .lock-veil { background: linear-gradient(180deg, #ffcf4a33, #120e26cc); }
.card.armed .buy-cta { color: var(--gold); font-size: 14px; }
.unlock .uimg .ulock { position: absolute; inset: 0; display: grid; place-items: center; background: #120e2666; color: #fff; }
.unlock .uimg img { filter: grayscale(.6) blur(1.5px); }
.unlock.can { background: linear-gradient(135deg, #4a3510, #2a2046); box-shadow: inset 0 0 0 1px #ffcf4a77, 0 0 30px -10px #ffb300aa; }
.unlock .eyebrow { color: var(--gold); }
.unlock .need { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 13.5px; color: var(--muted); }
.unlock .btn.gold { min-height: 40px; font-size: 14.5px; padding: 0 14px; }
@media (max-width: 480px) { .coin-pill { padding: 0 10px 0 8px; font-size: 15px; } .top-actions { gap: 8px; } .wordmark { font-size: 24px; } }

/* ---------- daily spin ---------- */
.daily-card { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 16px 12px 12px; border: 0; border-radius: var(--r-lg); cursor: pointer; text-align: left; color: var(--text);
  background: linear-gradient(135deg, #3a2a10, #2a2046); box-shadow: var(--shadow), inset 0 0 0 1px #ffcf4a33; font: inherit; transition: transform .2s; }
.daily-card:hover { transform: translateY(-2px); }
.daily-card.ready { box-shadow: var(--shadow), inset 0 0 0 1.5px #ffcf4a99, 0 0 30px -8px #ffb300aa; }
.dc-wheel svg { width: 58px; height: 58px; display: block; filter: drop-shadow(0 4px 10px #0008); }
.daily-card.ready .dc-wheel svg { animation: dcspin 6s linear infinite; }
@keyframes dcspin { to { transform: rotate(360deg); } }
.dc-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dc-txt b { font: 600 17px var(--display); }
.dc-streak { display: inline-flex; align-items: center; gap: 4px; color: #ffb36b; font-weight: 800; font-size: 13px; }
.dc-streak .ico { width: 15px; height: 15px; }
.daily-card .btn { min-height: 42px; padding: 0 20px; animation: pricepulse 1.4s ease-in-out infinite; }

.daily { position: fixed; inset: 0; z-index: 72; display: grid; place-items: center; overflow-y: auto; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  background: radial-gradient(circle at 50% 40%, #4a2f8fee, #0b0819f5 70%); animation: fade .3s; }
.d-inner { position: relative; width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; margin: auto; }
.d-x { position: absolute; top: 0; right: 0; }
.d-title { font: 700 clamp(34px, 10vw, 46px)/1 var(--display); letter-spacing: 1px; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #7a4300) drop-shadow(0 0 20px #ffb30088); margin-top: 6px; }
.d-sub { margin: 0; color: var(--muted); font-weight: 700; }
.d-streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: 100%; }
.sd { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; background: #ffffff0d; color: var(--faint); }
.sd b { font: 700 15px var(--display); }
.sd span { font: 800 11px var(--body); }
.sd.on { background: #ff9a3d26; color: #ffc690; }
.sd.cur { background: var(--grad-gold); color: #4a2a00; box-shadow: 0 0 18px #ffb30088; transform: scale(1.06); }
.wheel-wrap { position: relative; width: min(330px, 86vw); aspect-ratio: 1; margin-top: 10px; }
#wheel-holder, .wheel-svg { width: 100%; height: 100%; display: block; }
.wheel-svg { filter: drop-shadow(0 18px 30px #000a); }
.wheel-svg .wl { font: 700 22px var(--display); paint-order: stroke; stroke: #0004; stroke-width: 3px; }
.wheel-svg .wl.small { font-size: 11px; letter-spacing: 1px; stroke-width: 0; }
.bulb { fill: #fff6c8; }
.bulb.b1 { animation: bulb 0.9s steps(1) infinite; }
.bulb.b2 { animation: bulb 0.9s steps(1) infinite .45s; }
@keyframes bulb { 0% { fill: #fff6c8; filter: drop-shadow(0 0 4px #ffd23f); } 50% { fill: #8a6a20; filter: none; } }
.d-pointer { position: absolute; left: 50%; top: -14px; z-index: 2; width: 34px; height: 44px; transform: translateX(-50%); transform-origin: 50% 20%;
  background: var(--grad-gold); clip-path: polygon(50% 100%, 0 0, 100% 0); filter: drop-shadow(0 4px 4px #0008); }
.d-pointer.flick { animation: flick .12s ease-out; }
@keyframes flick { 40% { transform: translateX(-50%) rotate(-14deg); } }
.d-hub { position: absolute; left: 50%; top: 50%; width: 27%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #fff1a8, #ffc83a 55%, #d98400); color: #4a2a00; font: 700 clamp(16px, 5vw, 22px) var(--display); letter-spacing: .5px;
  box-shadow: 0 6px 0 #8a5000, 0 10px 24px #000a, inset 0 2px 0 #fff8; transition: transform .1s; }
.d-hub:not(:disabled) { animation: hubpulse 1.2s ease-in-out infinite; }
@keyframes hubpulse { 50% { box-shadow: 0 6px 0 #8a5000, 0 0 30px 6px #ffcf4aaa, inset 0 2px 0 #fff8; } }
.d-hub:active:not(:disabled) { transform: translate(-50%, -46%); box-shadow: 0 2px 0 #8a5000, 0 6px 16px #000a; }
.d-hub:disabled { cursor: default; filter: saturate(.6) brightness(.85); }
.d-note { margin: 0; color: var(--muted); font-weight: 700; font-size: 14px; }
.d-result { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: unlockIn .5s cubic-bezier(.2, 1.4, .4, 1); }
.dr-prize { display: flex; align-items: center; gap: 10px; }
.dr-prize .coinico { width: 52px; height: 52px; animation: coinspin 2.4s ease-in-out infinite; }
.dr-prize b { font: 700 58px/1 var(--display); background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px #ffb300bb); font-variant-numeric: tabular-nums; }
.dr-mult { margin: 0; color: #ffc690; font-weight: 800; }
.d-odds { color: var(--faint); font-size: 12.5px; font-weight: 700; }
.d-odds summary { cursor: pointer; }
.d-odds div { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin-top: 6px; }
.d-inner.won .wheel-wrap { width: min(230px, 60vw); transition: width .4s; }
.d-inner.won .d-note, .d-inner.won .d-odds { display: none; }
.d-inner.won .d-streak { display: none; }

/* picture loading */
.g-loading { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #f4f1fb; color: var(--ink); text-align: center; padding: 20px; }
.g-loading p { margin: 0; font: 600 16px var(--display); max-width: 30ch; }
.g-loading .btn { display: none; color: var(--ink); box-shadow: inset 0 0 0 2px #0002; }
.g-loading.err .btn { display: inline-flex; }
.g-loading.err .spinner { display: none; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid #8b7bff33; border-top-color: #ff4d8d; animation: spinr .8s linear infinite; }
@keyframes spinr { to { transform: rotate(360deg); } }

/* Find button */
.iconbtn.find { position: relative; }
.find-badge { position: absolute; top: -8px; left: -10px; display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px; border-radius: 999px; background: var(--ink); color: #fff; font: 700 11px var(--display); white-space: nowrap; box-shadow: 0 2px 6px #0005; }
.find-badge .coinico { width: 13px; height: 13px; }
.iconbtn.find.urgent { background: var(--grad-gold); color: #4a2a00; animation: findpulse 1.2s ease-in-out infinite; }
.iconbtn.find.urgent .find-badge { background: var(--good); color: #063a26; }
@keyframes findpulse { 50% { box-shadow: 0 0 0 6px #ffcf4a55, 0 6px 16px -6px #0005; } }
#g-svg .r.hint { animation: hintpulse .5s ease-in-out 5 alternate; stroke: #ff4d8d; stroke-width: calc(var(--lw) * 4); paint-order: stroke; }
@keyframes hintpulse { from { fill: var(--unfilled); } to { fill: #ffd6e6; } }

/* first-game tutorial */
.coach { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.coach-bubble { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 12px 16px; border-radius: 16px;
  background: var(--ink); color: #fff; font: 600 15.5px/1.35 var(--body); text-align: center; box-shadow: 0 10px 24px -8px #000a; animation: unlockIn .4s cubic-bezier(.2, 1.4, .4, 1); }
.coach-bubble b { color: var(--gold); }
.coach-dot { position: absolute; width: 0; height: 0; }
.coach-dot::before, .coach-dot::after { content: ''; position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%; }
.coach-dot::before { background: #ff4d8d55; border: 3px solid #ff4d8d; }
.coach-dot.hold::before { animation: holdpulse 1.1s ease-in-out infinite; }
.coach-dot.hold::after { border: 3px solid #ff4d8d; animation: holdring 1.1s ease-out infinite; }
@keyframes holdpulse { 50% { transform: scale(.8); background: #ff4d8d99; } }
@keyframes holdring { from { transform: scale(.8); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.coach-dot.swipe::before { background: #fff; border-color: var(--gold); width: 30px; height: 30px; left: -15px; top: -15px; box-shadow: 0 0 16px var(--gold); animation: swipedot 1.4s cubic-bezier(.5, 0, .3, 1) infinite; }
@keyframes swipedot { 0%, 15% { transform: translate(0, 0); opacity: 1; } 75% { transform: translate(var(--dx), var(--dy)); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
#ring .opt.coach { box-shadow: 0 0 0 5px var(--gold), 0 0 26px 6px #ffcf4acc; animation: optcoach .7s ease-in-out infinite alternate; }
@keyframes optcoach { to { box-shadow: 0 0 0 8px var(--gold), 0 0 34px 10px #ffcf4aee; } }

/* ---------- profile & settings ---------- */
.iconbtn.signed { box-shadow: inset 0 0 0 2px var(--good); }
.me-dot { background: var(--grad-accent) !important; color: #fff !important; }
.sheet.me { position: relative; text-align: left; display: flex; flex-direction: column; gap: 14px; padding-top: 26px; }
.sheet.me h2 { font-size: 24px; padding-right: 48px; }
.me-p { margin: 0; color: var(--muted); line-height: 1.45; }
.me-p b { color: var(--text); }
.perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.perks li { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.perks .ico { color: var(--good); }
.me-form { display: flex; flex-direction: column; gap: 10px; }
.me-form input { min-height: 50px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); padding: 0 14px; font: 600 17px var(--body); }
.me-form input:focus { outline: none; border-color: var(--xp1); }
#me-code { font: 700 26px var(--display); letter-spacing: 8px; text-align: center; }
.me-msg { margin: 0; min-height: 1em; color: #ff9ea1; font-weight: 700; font-size: 14px; }
.me-msg:empty { display: none; }
.me-head { display: flex; align-items: center; gap: 12px; padding-right: 48px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--grad-accent); font: 700 22px var(--display); }
.me-head b { display: block; word-break: break-all; }
.sync { display: inline-flex; align-items: center; gap: 5px; color: var(--good); font-weight: 700; font-size: 13.5px; }
.sync .ico { width: 16px; height: 16px; }
.sync.syncing { color: var(--muted); } .sync.error { color: #ff9ea1; }
.picks { display: flex; flex-direction: column; gap: 10px; }
.pick { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 14px; border-radius: 16px; border: 0; background: var(--panel2); color: var(--text); cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line); }
.pick:hover { box-shadow: inset 0 0 0 2px var(--xp1); }
.pick b { font: 600 17px var(--display); } .pick span { color: var(--muted); font-weight: 700; font-size: 14px; }
.me-set { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line-soft); font-weight: 700; }
.me-set > span { display: inline-flex; align-items: center; gap: 8px; }
.switch { width: 52px; height: 30px; border-radius: 15px; border: 0; padding: 3px; background: #ffffff22; cursor: pointer; transition: background .2s; }
.switch i { display: block; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--good); } .switch.on i { transform: translateX(22px); }
.me-link { color: var(--muted); font-size: 13.5px; font-weight: 700; align-self: flex-start; }
.save-nudge { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 16px; background: #5ee7ff14; box-shadow: inset 0 0 0 1px #5ee7ff44; }
.save-nudge .sn-ico { color: var(--xp1); display: grid; }
.save-nudge b { display: block; font: 600 15.5px var(--display); }
.save-nudge div span { color: var(--muted); font-size: 13px; font-weight: 700; }
.save-nudge .btn { min-height: 38px; padding: 0 14px; font-size: 14px; }
.sheet.me { gap: 16px; }
.perks { margin-bottom: 4px; }
.me-set { margin-top: 4px; }
.sync { align-items: flex-start; }
.sync .ico { margin-top: 2px; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; line-height: 1.45; }
.steps b { color: var(--gold); }
.me-p.small { font-size: 13.5px; }
.code-alt summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: 14px; }
.code-alt .me-form { margin-top: 10px; }
.pillbtn { white-space: nowrap; }
@media (max-width: 480px) { .pillbtn { width: 44px; padding: 0; justify-content: center; } .pillbtn .pill-txt { display: none; } }
