:root {
  --ui-scale: 1;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-2xs: calc(9.5px * var(--ui-scale));
  --fs-xs: calc(10.5px * var(--ui-scale));
  --fs-s: calc(11.5px * var(--ui-scale));
  --fs-m: calc(13px * var(--ui-scale));
  --fs-l: calc(15px * var(--ui-scale));
  --fs-xl: calc(18px * var(--ui-scale));
  --fs-2xl: calc(22px * var(--ui-scale));
  --fs-3xl: calc(30px * var(--ui-scale));
  --fs-logo: calc(34px * var(--ui-scale));
  --fs-logo2: calc(40px * var(--ui-scale));
  --fw-body: 650;
  --fw-bold: 800;
  --fw-black: 900;
  --lh: 1.35;
  --gap-2xs: 2px;
  --gap-xs: 4px;
  --gap-s: 6px;
  --gap-m: 10px;
  --gap-l: 14px;
  --gap-xl: 20px;
  --gutter: 14px;
  --r-xs: 6px;
  --r-s: 9px;
  --r-m: 13px;
  --r-l: 18px;
  --r-xl: 24px;
  --r-pill: 999px;
  --ctl-h: 34px;
  --ctl-h-s: 28px;
  --ctl-h-l: 44px;
  --icon: 18px;
  --icon-s: 14px;
  --icon-l: 24px;
  --topbar-h: 48px;
  --tabs-h: 58px;
  --tabs-mid: 54px;
  --toolbar-h: 64px;
  --play-top-h: 52px;
  --sheet-max: 440px;
  --card-pad: 14px;
  --border: 1px;
  --blur: 14px;
  --shadow: 0 10px 30px rgba(5, 2, 12, 0.45);
  --shadow-s: 0 3px 10px rgba(5, 2, 12, 0.35);
  --glow-accent: 0 0 18px rgba(255, 154, 60, 0.45);
  --t-fast: 140ms;
  --t-med: 240ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --coin-size: 13px;
  --gem-size: 14px;
  --dot: 7px;
  --node: 52px;
  --thumb: 56px;
  --hero-h: 34vh;
  --hero-max: 280px;
  --rail-btn: 38px;
  --ring-w: 3px;
  --bar-h: 6px;
  --bd-gutter: 16px;
  --bd-pad: 6px;
  --bd-radius: 16px;
  --bd-wall: 3px;
  --bd-candle-h: 9px;
  --bd-candle-gap: 18px;
  --bd-candle-label: 40px;
  --bd-float: 20px;
  --bd-small: 12px;
  --bd-particle: 4px;
  --bd-max: 620px;
  --bd-text-stroke: rgba(10, 4, 22, 0.92);
  --bd-glint: #ffffff;
  --bd-ember: #ffb347;
  --bd-seed: #ffe9b0;
  --bd-leaf: #6aa84f;
}

:root.lc {
  --ctl-h: 44px;
  --ctl-h-s: 38px;
  --icon: 22px;
  --tabs-h: 66px;
  --toolbar-h: 76px;
  --node: 60px;
  --rail-btn: 46px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-m);
  font-weight: var(--fw-body);
  line-height: var(--lh);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#page {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: background var(--t-med);
}

body:not([data-page='home']) #page {
  background: var(--page-dim);
}

.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  animation: fade-in var(--t-med) var(--ease);
}

body.tabbed .page {
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + var(--gap-s));
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-y;
}

.scroll::-webkit-scrollbar {
  display: none;
}

.page-body {
  flex: 1;
  min-height: 0;
  padding: var(--gap-s) var(--gutter) var(--gap-xl);
  display: flex;
  flex-direction: column;
  gap: var(--gap-m);
}

.ic {
  width: var(--icon);
  height: var(--icon);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ic-fill {
  fill: currentColor;
  stroke-width: 1.2;
}

.coin {
  display: inline-block;
  flex: none;
  width: var(--coin-size);
  height: var(--coin-size);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--coin-hi), var(--coin) 55%, var(--coin-edge));
  box-shadow: inset 0 -1.5px 0 var(--coin-edge);
}

.gem {
  width: var(--gem-size);
  height: var(--gem-size);
  flex: none;
}

.gem-a {
  fill: var(--gem);
  stroke: var(--gem-edge);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.gem-b {
  fill: none;
  stroke: var(--gem-edge);
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.gem.big {
  width: calc(var(--gem-size) * 2.4);
  height: calc(var(--gem-size) * 2.4);
}

.st {
  width: var(--icon-s);
  height: var(--icon-s);
  fill: var(--star-off);
  stroke: none;
}

.st.on {
  fill: var(--star);
}

.dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 0 2px var(--bg-1);
}

.muted {
  color: var(--ink-2);
}

.small {
  font-size: var(--fs-s);
}

.center {
  text-align: center;
}

.label {
  font-size: var(--fs-s);
  font-weight: var(--fw-bold);
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--gap-s);
}

.section {
  font-size: var(--fs-s);
  font-weight: var(--fw-black);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.card {
  position: relative;
  background: var(--card);
  border: var(--border) solid var(--line);
  border-radius: var(--r-l);
  padding: var(--card-pad);
  box-shadow: var(--shadow-s);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}

.card h3 {
  font-size: var(--fs-l);
  font-weight: var(--fw-black);
  display: flex;
  align-items: center;
  gap: var(--gap-s);
}

.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-s);
  min-width: 0;
}

.row2 {
  display: flex;
  gap: var(--gap-s);
}

.row2 > * {
  flex: 1;
  min-width: 0;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-s);
  min-height: var(--ctl-h);
  padding: 0 var(--gap-l);
  border-radius: var(--r-pill);
  background: var(--btn);
  border: var(--border) solid var(--line);
  font-size: var(--fs-m);
  font-weight: var(--fw-bold);
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}

.btn:active:not(:disabled) {
  transform: scale(0.96);
}

.btn.wide {
  display: flex;
  width: 100%;
  margin-top: var(--gap-s);
}

.btn.small {
  min-height: var(--ctl-h-s);
  padding: 0 var(--gap-m);
  font-size: var(--fs-s);
}

.btn.primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: var(--glow-accent);
  font-weight: var(--fw-black);
}

.btn.gold {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: var(--gold-ink);
  border-color: transparent;
  font-weight: var(--fw-black);
}

.btn.ad {
  background: var(--ad);
  color: var(--ad-ink);
  border-color: transparent;
  font-weight: var(--fw-black);
}

.btn.ghost {
  background: transparent;
}

.btn .price {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xs);
  margin-left: auto;
  padding-left: var(--gap-s);
  font-weight: var(--fw-black);
}

.btn.wide .price {
  margin-left: var(--gap-s);
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--ctl-h);
  height: var(--ctl-h);
  border-radius: 50%;
  background: var(--btn);
  border: var(--border) solid var(--line);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-xs);
  min-height: var(--ctl-h-s);
  color: var(--ink-2);
  font-weight: var(--fw-bold);
  font-size: var(--fs-s);
  align-self: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xs);
  height: var(--ctl-h-s);
  padding: 0 var(--gap-m);
  border-radius: var(--r-pill);
  background: var(--pill);
  border: var(--border) solid var(--line);
  font-weight: var(--fw-black);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pill .plus {
  display: inline-grid;
  place-items: center;
  width: calc(var(--ctl-h-s) - 12px);
  height: calc(var(--ctl-h-s) - 12px);
  margin-right: calc(var(--gap-xs) * -1);
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-style: normal;
  font-size: var(--fs-s);
  line-height: 1;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-2xs);
  padding: var(--gap-2xs) var(--gap-s);
  border-radius: var(--r-pill);
  background: var(--chip);
  font-size: var(--fs-s);
  font-weight: var(--fw-black);
  white-space: nowrap;
}

.chip .ic {
  width: var(--icon-s);
  height: var(--icon-s);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap-xs);
  margin-top: var(--gap-m);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-2xs);
  padding: var(--gap-2xs) var(--gap-s);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-black);
  background: var(--chip);
  color: var(--ink-2);
  white-space: nowrap;
}

.tag .ic {
  width: var(--icon-s);
  height: var(--icon-s);
}

.tag.on {
  color: var(--good);
}

.tag.gold {
  background: var(--gold-soft);
  color: var(--gold-hi);
}

.ok {
  display: inline-grid;
  place-items: center;
  color: var(--good);
}

.bar {
  position: relative;
  height: var(--bar-h);
  border-radius: var(--r-pill);
  background: var(--track);
  overflow: hidden;
}

.bar i {
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(var(--f, 0));
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  transition: transform var(--t-med) var(--ease);
}

.seg {
  display: flex;
  gap: var(--gap-2xs);
  padding: var(--gap-2xs);
  border-radius: var(--r-pill);
  background: var(--seg-bg);
  border: var(--border) solid var(--line);
  margin-top: var(--gap-xs);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}

.seg button {
  flex: 1;
  min-width: 0;
  min-height: var(--ctl-h-s);
  padding: 0 var(--gap-xs);
  border-radius: var(--r-pill);
  font-size: var(--fs-s);
  font-weight: var(--fw-bold);
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seg button.on {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: var(--fw-black);
}

.seg.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--r-m);
}

.seg.grid2 button {
  border-radius: var(--r-s);
}

.seg.tabs4 {
  margin: var(--gap-xs) var(--gutter) 0;
}

.seg.sub {
  background: transparent;
}

.input {
  width: 100%;
  min-height: var(--ctl-h-l);
  padding: 0 var(--gap-l);
  margin-top: var(--gap-m);
  border-radius: var(--r-m);
  border: var(--border) solid var(--line);
  background: var(--pill);
  font-size: var(--fs-l);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  user-select: text;
  -webkit-user-select: text;
}

#report-reason {
  color-scheme: dark;
  color: var(--ink);
  background: var(--bg-1);
  font-family: inherit;
}

.err {
  color: var(--bad);
  font-size: var(--fs-s);
  font-weight: var(--fw-bold);
  margin-top: var(--gap-s);
}

.okmsg {
  color: var(--good);
  font-size: var(--fs-s);
  font-weight: var(--fw-bold);
  margin-top: var(--gap-s);
}

.note {
  margin-top: var(--gap-s);
  font-size: var(--fs-s);
  color: var(--ink-2);
}

.topbar {
  display: flex;
  align-items: center;
  gap: var(--gap-s);
  height: var(--topbar-h);
  padding: 0 var(--gutter);
  flex: none;
}

.lvl {
  position: relative;
  width: var(--ctl-h);
  height: var(--ctl-h);
  flex: none;
  display: grid;
  place-items: center;
}

.lvl svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: var(--pill);
  stroke: var(--track);
  stroke-width: var(--ring-w);
}

.ring {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: var(--ring-w);
  stroke-linecap: round;
  transition: stroke-dashoffset var(--t-med) var(--ease);
}

.lvl b {
  position: relative;
  font-size: var(--fs-s);
  font-weight: var(--fw-black);
}

.wallet {
  display: flex;
  gap: var(--gap-s);
  margin-left: auto;
  min-width: 0;
}

.tabs {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(env(safe-area-inset-bottom) + var(--gap-s));
  height: var(--tabs-h);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-radius: var(--r-xl);
  background: var(--tabs-bg);
  border: var(--border) solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  z-index: 5;
}

.tab {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-2xs);
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
}

.tab span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab.on {
  color: var(--ink);
}

.tab.on .ic {
  color: var(--accent-2);
}

.tab.mid .ic {
  width: calc(var(--icon) * 1.15);
  height: calc(var(--icon) * 1.15);
  padding: 6px;
  box-sizing: content-box;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  margin-top: calc(var(--gap-l) * -1);
  box-shadow: var(--glow-accent);
}

.tab.mid.on .ic {
  color: var(--accent-ink);
}

.tab .dot {
  right: calc(50% - 16px);
  top: 6px;
}

.home {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--gutter) var(--gap-s);
  gap: var(--gap-s);
}

.event-chip {
  display: flex;
  align-items: center;
  gap: var(--gap-s);
  max-width: 100%;
  padding: var(--gap-xs) var(--gap-m) var(--gap-xs) var(--gap-xs);
  border-radius: var(--r-pill);
  background: var(--event-bg);
  border: var(--border) solid var(--event-edge);
  font-size: var(--fs-s);
}

.event-chip > .ic {
  width: calc(var(--ctl-h-s) - 4px);
  height: calc(var(--ctl-h-s) - 4px);
  padding: 4px;
  border-radius: 50%;
  background: var(--event-edge);
  color: var(--accent-ink);
}

.event-chip span {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
  text-align: left;
}

.event-chip b {
  font-weight: var(--fw-black);
  white-space: nowrap;
}

.event-chip small {
  color: var(--ink-2);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.event-chip em {
  font-style: normal;
  font-weight: var(--fw-black);
  color: var(--accent-2);
  padding-left: var(--gap-xs);
}

.hero {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
  text-align: center;
  font-weight: var(--fw-black);
  letter-spacing: -0.01em;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}

.logo span {
  font-size: var(--fs-logo);
  color: var(--ink);
}

.logo em {
  font-style: normal;
  font-size: var(--fs-logo2);
  background: linear-gradient(180deg, var(--accent-2), var(--accent) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lantern {
  width: min(var(--hero-max), 62vw, var(--hero-h));
  aspect-ratio: 1;
  flex: none;
  max-height: calc(100% - var(--fs-logo) * 2.4);
  cursor: pointer;
  transition: transform 80ms linear;
}

.rail {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
}

.rail.left {
  left: 0;
}

.rail.right {
  right: 0;
}

.rail-btn {
  position: relative;
  width: var(--rail-btn);
  height: var(--rail-btn);
  display: grid;
  place-items: center;
  border-radius: var(--r-m);
  background: var(--card);
  border: var(--border) solid var(--line);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}

.rail-btn.offer {
  color: var(--accent-2);
  border-color: var(--accent);
}

.rail-btn.vip {
  color: var(--vip);
}

.cta {
  position: relative;
  width: min(100%, 360px);
  min-height: calc(var(--ctl-h-l) + 14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  box-shadow: var(--glow-accent), var(--shadow-s);
  transition: transform var(--t-fast) var(--ease);
  animation: cta-breathe 3.2s ease-in-out infinite;
}

.cta:active {
  transform: scale(0.97);
}

@keyframes cta-breathe {
  50% {
    box-shadow: 0 0 28px rgba(255, 154, 60, 0.6), var(--shadow-s);
  }
}

.cta-main {
  display: flex;
  align-items: center;
  gap: var(--gap-s);
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
}

.cta small {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  opacity: 0.8;
}

.modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-s);
  width: min(100%, 360px);
}

.mode-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-2xs);
  min-width: 0;
  padding: var(--gap-m) var(--gap-xs);
  border-radius: var(--r-l);
  background: var(--card);
  border: var(--border) solid var(--line);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}

.mode-tile > .ic {
  width: var(--icon-l);
  height: var(--icon-l);
  color: var(--accent-2);
}

.mode-rush > .ic {
  color: var(--rush);
}

.mode-zen > .ic {
  color: var(--good);
}

.mode-tile b {
  font-size: var(--fs-m);
  font-weight: var(--fw-black);
  line-height: 1.12;
  text-align: center;
  max-width: 100%;
}

.mode-tile small {
  font-size: var(--fs-xs);
  color: var(--ink-2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-tile .ok {
  position: absolute;
  top: var(--gap-xs);
  right: var(--gap-xs);
}

.mode-tile .ok .ic {
  width: var(--icon-s);
  height: var(--icon-s);
}

.page-head {
  display: flex;
  align-items: center;
  gap: var(--gap-m);
  height: var(--topbar-h);
  padding: 0 var(--gutter);
  flex: none;
}

.page-head h2 {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.levels-scroll {
  flex: 1;
  min-height: 0;
  padding: 0 var(--gutter) var(--gap-xl);
}

.chapter h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--gap-l) 0 var(--gap-s);
  font-size: var(--fs-s);
  font-weight: var(--fw-black);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.chapter h3 span {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-2xs);
}

.nodes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gap-s);
}

.node {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-2xs);
  border-radius: var(--r-m);
  background: var(--card);
  border: var(--border) solid var(--line);
  font-size: var(--fs-l);
  font-weight: var(--fw-black);
}

.node.cur {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  box-shadow: var(--glow-accent);
}

.node.boss {
  border-color: var(--gold);
}

.node.locked {
  opacity: 0.5;
}

.node.locked .ic {
  width: var(--icon-s);
  height: var(--icon-s);
}

.ns {
  display: flex;
  gap: 1px;
}

.ns .st {
  width: 9px;
  height: 9px;
}

.node.cur .st {
  fill: var(--accent-ink);
  opacity: 0.35;
}

.node.cur .st.on {
  opacity: 1;
}

.board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-2xs);
}

.board li {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--gap-m);
  min-height: var(--ctl-h);
  padding: 0 var(--gap-m);
  border-radius: var(--r-s);
  background: var(--row);
  font-variant-numeric: tabular-nums;
}

.board-score {
  display: flex;
  align-items: center;
  gap: var(--gap-m);
  min-height: var(--ctl-h);
}

.board-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-xs);
  padding-bottom: var(--gap-xs);
}

.board-actions .btn { min-width: 0; white-space: normal; }
.hidden-player { display: flex; align-items: center; gap: var(--gap-s); padding: var(--gap-xs) 0; }
.hidden-player .moderation-name { flex: 1; min-width: 0; }
.moderation-name { overflow-wrap: anywhere; }

.board li.me {
  background: var(--row-me);
  border: var(--border) solid var(--accent);
}

.board .rk {
  width: 28px;
  font-weight: var(--fw-black);
  color: var(--ink-2);
}

.board .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-card {
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
}

.week {
  display: flex;
  justify-content: space-between;
  gap: var(--gap-xs);
}

.week span {
  flex: 1;
  display: grid;
  place-items: center;
  height: var(--ctl-h-s);
  border-radius: var(--r-s);
  background: var(--pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-black);
  color: var(--ink-3);
}

.week span.on {
  background: var(--accent);
  color: var(--accent-ink);
}

.week span.today {
  outline: 2px solid var(--accent-2);
}

.quests {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
}

.quest,
.ach {
  display: flex;
  align-items: center;
  gap: var(--gap-m);
  padding: var(--gap-m) var(--gap-m);
  border-radius: var(--r-m);
  background: var(--card);
  border: var(--border) solid var(--line);
}

.quest.done:not(.claimed),
.ach.ready {
  border-color: var(--accent);
}

.quest.claimed {
  opacity: 0.6;
}

.q-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-2xs);
}

.q-main b {
  font-size: var(--fs-m);
  font-weight: var(--fw-bold);
}

.q-main small {
  font-size: var(--fs-xs);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.q-side {
  flex: none;
  display: flex;
  align-items: center;
}

.rw {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--gap-2xs);
}

.tiers {
  display: flex;
  gap: 1px;
}

.bonus {
  display: flex;
  align-items: center;
  gap: var(--gap-m);
  padding: var(--gap-m);
}

.bonus > span:first-of-type {
  flex: 1;
  min-width: 0;
  font-weight: var(--fw-bold);
}

.bonus.ready {
  border-color: var(--accent);
}

.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--gap-xs);
  margin-top: var(--gap-s);
}

.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-2xs);
  padding: var(--gap-xs) 0;
  border-radius: var(--r-s);
  background: var(--pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-black);
  min-width: 0;
}

.cal-day small {
  font-size: var(--fs-2xs);
  color: var(--ink-3);
}

.cal-day .ic {
  width: var(--icon-s);
  height: var(--icon-s);
}

.cal-day.got {
  opacity: 0.45;
}

.cal-day.today {
  background: var(--accent);
  color: var(--accent-ink);
}

.cal-day.today small {
  color: var(--accent-ink);
}

.cal.big {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: var(--gap-m) 0;
}

.cal.big .cal-day {
  padding: var(--gap-s) var(--gap-2xs);
}

.cal.big .chip {
  background: none;
  padding: 0;
}

.streak-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--gap-s) var(--gap-m);
}

.streak-num {
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
}

.streak-num .ic {
  width: var(--icon-l);
  height: var(--icon-l);
  color: var(--accent);
}

.streak-num b {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-black);
}

.streak-num span {
  font-size: var(--fs-s);
  color: var(--ink-2);
}

.streak-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--gap-s);
}

.streak-card p {
  grid-column: 1 / -1;
}

.shop-body {
  padding-top: var(--gap-m);
}

.offer {
  display: flex;
  align-items: center;
  gap: var(--gap-m);
}

.offer-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: calc(var(--ctl-h) + 6px);
  height: calc(var(--ctl-h) + 6px);
  border-radius: var(--r-m);
  background: var(--pill);
  color: var(--accent-2);
}

.offer.vip .offer-ic {
  color: var(--vip);
}

.offer-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.offer-body b {
  font-weight: var(--fw-black);
}

.offer-body small {
  font-size: var(--fs-xs);
  color: var(--ink-2);
}

.packs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-s);
}

.pack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-xs);
  padding: var(--gap-l) var(--gap-s) var(--gap-m);
  border-radius: var(--r-l);
  background: var(--card);
  border: var(--border) solid var(--line);
}

.pack b {
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
}

.pack em {
  position: absolute;
  top: calc(var(--gap-s) * -1);
  padding: var(--gap-2xs) var(--gap-s);
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-style: normal;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-black);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.pack.popular,
.pack.best {
  border-color: var(--accent);
}

.boosts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
}

.boost-row {
  display: flex;
  align-items: center;
  gap: var(--gap-m);
}

.boost-row > .ic {
  width: var(--icon-l);
  height: var(--icon-l);
  color: var(--accent-2);
}

.boost-row > div:first-of-type {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.boost-row small {
  font-size: var(--fs-xs);
  color: var(--ink-2);
}

.boost-row .have {
  color: var(--accent-2);
  font-weight: var(--fw-bold);
}

.buy2 {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
}

.items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-s);
}

.item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-xs);
  padding: var(--gap-s) var(--gap-xs) var(--gap-m);
  border-radius: var(--r-l);
  background: var(--card);
  border: var(--border) solid var(--line);
  min-width: 0;
  text-align: center;
}

.item.eq {
  border-color: var(--good);
}

.item b {
  font-size: var(--fs-s);
  font-weight: var(--fw-black);
  line-height: 1.15;
  max-width: 100%;
}

.item .tag {
  max-width: 100%;
  white-space: normal;
  justify-content: center;
  line-height: 1.15;
  border-radius: var(--r-s);
}

.thumb {
  display: grid;
  place-items: center;
  width: var(--thumb);
  height: var(--thumb);
}

.thumb canvas {
  width: 100%;
  height: 100%;
}

.pass-head {
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
}

.tierbar {
  display: flex;
  align-items: center;
  gap: var(--gap-m);
}

.tierbar .bar {
  flex: 1;
}

.tierbar small {
  font-size: var(--fs-xs);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.pt-n {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-black);
}

.pt-n.big {
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--fs-m);
}

.pt-cols {
  display: grid;
  grid-template-columns: 26px 1fr 1fr;
  gap: var(--gap-s);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-align: center;
}

.pt-cols .prem {
  color: var(--gold-hi);
}

.pt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
}

.pt-row {
  display: grid;
  grid-template-columns: 26px 1fr 1fr;
  align-items: center;
  gap: var(--gap-s);
}

.pt-row.reached .pt-n {
  background: var(--accent);
  color: var(--accent-ink);
}

.pt-cell {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--gap-2xs);
  min-height: var(--ctl-h);
  padding: var(--gap-xs);
  border-radius: var(--r-m);
  background: var(--card);
  border: var(--border) solid var(--line);
}

.pt-cell .chip {
  background: none;
  padding: 0;
}

.pt-cell.prem {
  background: var(--gold-soft);
}

.pt-cell.locked {
  opacity: 0.55;
}

.pt-cell.can {
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}

.pt-cell.got {
  opacity: 0.5;
}

.pt-cell .ok {
  position: absolute;
  right: var(--gap-xs);
}

.profile {
  display: flex;
  align-items: center;
  gap: var(--gap-m);
}

.avatar {
  width: 58px;
  height: 58px;
  flex: none;
  border-radius: 50%;
  background: var(--pill);
}

.mini-lantern {
  width: 100%;
  height: 100%;
}

.prof-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-2xs);
}

.name-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xs);
  font-size: var(--fs-l);
  font-weight: var(--fw-black);
  text-align: left;
  max-width: 100%;
}

.name-btn .ic {
  width: var(--icon-s);
  height: var(--icon-s);
  color: var(--ink-3);
}

.prof-main small {
  font-size: var(--fs-xs);
  color: var(--ink-2);
}

.stats-grid,
.stats3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-s);
}

.stats-grid > div,
.stats3 > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-2xs);
  padding: var(--gap-s) var(--gap-2xs);
  border-radius: var(--r-m);
  background: var(--card);
  border: var(--border) solid var(--line);
  min-width: 0;
}

.stats-grid .ic,
.stats3 .ic {
  width: var(--icon-s);
  height: var(--icon-s);
  color: var(--accent-2);
}

.stats-grid b,
.stats3 b {
  font-size: var(--fs-l);
  font-weight: var(--fw-black);
  font-variant-numeric: tabular-nums;
}

.stats-grid span,
.stats3 span {
  font-size: var(--fs-2xs);
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.15;
  text-align: center;
  max-width: 100%;
}

.stats3 {
  margin-top: var(--gap-m);
}

.stats3 > div {
  background: var(--pill);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-l);
  background: var(--card);
  border: var(--border) solid var(--line);
  overflow: hidden;
}

.list li + li {
  border-top: var(--border) solid var(--line);
}

.list-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--gap-m);
  width: 100%;
  min-height: calc(var(--ctl-h) + 8px);
  padding: 0 var(--gap-l);
  text-align: left;
  font-weight: var(--fw-bold);
}

.list-btn > span {
  flex: 1;
  min-width: 0;
}

.list-btn small {
  color: var(--ink-2);
  font-size: var(--fs-s);
  white-space: nowrap;
}

.list-btn .chev {
  width: var(--icon-s);
  height: var(--icon-s);
  color: var(--ink-3);
}

.list-btn .dot {
  position: static;
  margin-left: auto;
}

.list-btn.on {
  color: var(--accent-2);
}

.list-btn.danger {
  color: var(--bad);
}

.list-btn.game img {
  width: 40px;
  height: 40px;
  border-radius: var(--r-s);
}

.list-btn.game span {
  display: flex;
  flex-direction: column;
}

.list-btn.game small {
  white-space: normal;
}

.play-top {
  display: flex;
  align-items: center;
  gap: var(--gap-m);
  height: var(--play-top-h);
  padding: 0 var(--gutter);
  flex: none;
}

.play-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.play-title b {
  font-size: var(--fs-l);
  font-weight: var(--fw-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-title span {
  font-size: var(--fs-xs);
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  flex: none;
}

.play-stat {
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
  font-variant-numeric: tabular-nums;
}

.combo {
  font-size: var(--fs-xs);
  font-weight: var(--fw-black);
  color: var(--accent-2);
  min-height: 1.2em;
  letter-spacing: 0.04em;
}

.combo.pop {
  animation: pop 0.28s var(--ease-back);
}

@keyframes pop {
  from {
    transform: scale(1.5);
  }
}

.play-area {
  position: relative;
  flex: 1;
  min-height: 0;
}

#board {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.banner {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-2xs);
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
  transition: opacity var(--t-med), transform var(--t-med) var(--ease-back);
}

.banner.in {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.banner b {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-black);
  text-shadow: 0 2px 0 var(--bg-0), 0 0 18px var(--bg-0);
}

.banner span {
  font-size: var(--fs-s);
  font-weight: var(--fw-bold);
  color: var(--accent-2);
  text-shadow: 0 1px 0 var(--bg-0), 0 0 12px var(--bg-0);
}

.banner.gold b {
  color: var(--gold-hi);
}

.coach {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: var(--gap-xs);
  display: flex;
  align-items: center;
  gap: var(--gap-m);
  padding: var(--gap-m) var(--gap-l);
  border-radius: var(--r-l);
  background: var(--coach);
  border: var(--border) solid var(--accent);
  box-shadow: var(--shadow);
  animation: fade-in var(--t-med) var(--ease);
  z-index: 2;
}

.coach p {
  flex: 1;
  min-width: 0;
  font-weight: var(--fw-bold);
}

.toolbar {
  display: flex;
  justify-content: center;
  gap: var(--gap-s);
  height: var(--toolbar-h);
  padding: var(--gap-xs) var(--gutter) calc(env(safe-area-inset-bottom) + var(--gap-s));
  flex: none;
}

.tool {
  position: relative;
  flex: 1;
  max-width: 88px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-2xs);
  border-radius: var(--r-l);
  background: var(--card);
  border: var(--border) solid var(--line);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}

.tool:active {
  transform: scale(0.94);
}

.tool .tl {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  color: var(--ink-2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 var(--gap-xs);
}

.tool.on {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.tool.on .tl {
  color: var(--accent-ink);
}

.tool.dim {
  opacity: 0.55;
}

.tool .badge {
  position: absolute;
  top: var(--gap-xs);
  right: var(--gap-xs);
  min-width: 18px;
  height: 18px;
  padding: 0 var(--gap-xs);
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-style: normal;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-black);
}

#layers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.veil {
  position: absolute;
  inset: 0;
  background: var(--veil);
  opacity: 0;
  pointer-events: auto;
  transition: opacity var(--t-med);
}

.veil.in {
  opacity: 1;
}

.layer {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: var(--sheet-max);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  transition: transform var(--t-med) var(--ease), opacity var(--t-med);
}

.layer.sheet {
  bottom: 0;
  padding: 0 var(--gap-s) calc(env(safe-area-inset-bottom) + var(--gap-s));
  max-height: calc(100% - env(safe-area-inset-top) - 30px);
  transform: translateY(100%);
}

.layer.modal {
  top: 50%;
  padding: 0 var(--gutter);
  max-height: calc(100% - env(safe-area-inset-top) - 40px);
  transform: translateY(-46%) scale(0.94);
  opacity: 0;
}

.layer.sheet.in {
  transform: translateY(0);
}

.layer.modal.in {
  transform: translateY(-50%);
  opacity: 1;
}

.layer.out {
  opacity: 0;
  pointer-events: none;
}

.layer > .card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--sheet);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: var(--gap-xl) var(--gap-l) var(--gap-l);
}

.layer > .card.tall {
  max-height: 100%;
  overflow: hidden;
}

/* Loading, empty and populated boards keep the same tab hit targets. */
#s-leaderboard.sheet {
  height: calc(100% - env(safe-area-inset-top) - 30px);
}

#s-leaderboard > .card {
  flex: 1;
}

#s-leaderboard > .card > :not(.scroll) {
  flex-shrink: 0;
}

.layer > .card > .scroll {
  min-height: 0;
  flex: 1;
  margin: var(--gap-s) calc(var(--gap-xs) * -1) 0;
  padding: 0 var(--gap-xs);
}

.layer > .card.center {
  align-items: stretch;
  text-align: center;
}

.sh-head {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
  text-align: center;
  margin-bottom: var(--gap-xs);
}

.sh-head h2 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
}

.sh-head p {
  font-size: var(--fs-s);
}

.card h4 {
  margin: var(--gap-l) 0 var(--gap-xs);
  font-size: var(--fs-xs);
  font-weight: var(--fw-black);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.toggles {
  display: flex;
  flex-direction: column;
  gap: var(--gap-2xs);
  margin-top: var(--gap-s);
}

.toggle {
  display: flex;
  align-items: center;
  gap: var(--gap-m);
  min-height: var(--ctl-h);
  padding: 0 var(--gap-xs);
  text-align: left;
  font-weight: var(--fw-bold);
}

.toggle span {
  flex: 1;
  min-width: 0;
}

.toggle i {
  position: relative;
  width: 36px;
  height: 20px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--track);
  transition: background var(--t-fast);
}

.toggle i::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform var(--t-fast) var(--ease);
}

.toggle.on i {
  background: var(--accent);
}

.toggle.on i::after {
  transform: translateX(16px);
}

.result h2 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-black);
  text-align: center;
}

.result .tag {
  align-self: center;
  margin-top: var(--gap-xs);
}

.stars.big {
  display: flex;
  justify-content: center;
  gap: var(--gap-s);
  margin: calc(var(--gap-xl) * -1) 0 var(--gap-s);
}

.stars.big .st {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
  animation: star-in 0.5s var(--ease-back) both;
}

.stars.big .s2 {
  width: 50px;
  height: 50px;
  margin-top: -10px;
  animation-delay: 0.15s;
}

.stars.big .s3 {
  animation-delay: 0.3s;
}

@keyframes star-in {
  from {
    transform: scale(0) rotate(-40deg);
    opacity: 0;
  }
}

.score-big {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-black);
  text-align: center;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

.big-ic {
  display: grid;
  place-items: center;
  color: var(--accent);
  margin-bottom: var(--gap-s);
}

.big-ic .ic {
  width: 44px;
  height: 44px;
}

.have {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-xs);
  color: var(--accent-2);
  font-weight: var(--fw-bold);
}

.rules {
  list-style: none;
  margin: var(--gap-s) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-m);
}

.rules li {
  display: flex;
  align-items: center;
  gap: var(--gap-m);
}

.rules p {
  flex: 1;
  min-width: 0;
}

.rule-art {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: var(--r-s);
  background-color: var(--pill);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.rule-one {
  background-image: var(--rule-one);
}

.rule-touch {
  background-image: var(--rule-touch);
}

.rule-mark {
  background-image: var(--rule-mark);
}

.rule-candle {
  background-image: var(--rule-candle);
}

.rule-combo {
  background-image: var(--rule-combo);
}

.perks {
  list-style: none;
  margin: var(--gap-m) 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
}

.perks li {
  display: flex;
  align-items: center;
  gap: var(--gap-m);
  font-weight: var(--fw-bold);
}

.perks .ic {
  color: var(--vip);
}

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-s);
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-2xs);
  padding: var(--gap-l) var(--gap-s) var(--gap-m);
  border-radius: var(--r-l);
  background: var(--pill);
  border: 2px solid var(--line);
}

.plan.best {
  border-color: var(--vip);
}

.plan em {
  position: absolute;
  top: -9px;
  padding: 1px var(--gap-s);
  border-radius: var(--r-pill);
  background: var(--vip);
  color: var(--accent-ink);
  font-style: normal;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-black);
  white-space: nowrap;
}

.plan b {
  font-weight: var(--fw-black);
}

.plan span {
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
}

.plan small {
  font-size: var(--fs-xs);
  color: var(--ink-2);
}

.legal {
  margin-top: var(--gap-m);
  font-size: var(--fs-2xs);
  color: var(--ink-3);
  text-align: center;
}

.starter-art {
  display: grid;
  place-items: center;
}

.starter-art .thumb {
  width: 96px;
  height: 96px;
}

.code-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-m);
  margin: var(--gap-m) 0 var(--gap-xs);
  padding: var(--gap-m);
  border-radius: var(--r-m);
  background: var(--pill);
  border: 1px dashed var(--accent);
}

.code-box b {
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
  letter-spacing: 0.08em;
  user-select: text;
  -webkit-user-select: text;
}

.inrow {
  display: flex;
  align-items: center;
  gap: var(--gap-s);
}

.inrow .input {
  margin-top: var(--gap-xs);
  min-height: var(--ctl-h);
  font-size: var(--fs-m);
}

.inrow .btn {
  margin-top: var(--gap-xs);
}

.ev-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--gap-s);
}

.ev-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
}

.ev-row {
  display: flex;
  align-items: center;
  gap: var(--gap-m);
  min-height: var(--ctl-h);
  padding: var(--gap-xs) var(--gap-m);
  border-radius: var(--r-m);
  background: var(--pill);
}

.ev-row .rw {
  flex: 1;
  align-items: flex-start;
}

.ev-row.can {
  border: var(--border) solid var(--accent);
}

.ev-row.got {
  opacity: 0.5;
}

.ev-at {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-2xs);
  min-width: 52px;
  font-weight: var(--fw-black);
}

.ev-at .ic {
  width: var(--icon-s);
  height: var(--icon-s);
  color: var(--accent-2);
}

.games {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + var(--topbar-h) + var(--gap-s));
  transform: translate(-50%, -10px);
  display: flex;
  align-items: center;
  gap: var(--gap-s);
  max-width: calc(100% - var(--gutter) * 2);
  padding: var(--gap-s) var(--gap-l);
  border-radius: var(--r-pill);
  background: var(--sheet);
  border: var(--border) solid var(--line);
  box-shadow: var(--shadow);
  font-size: var(--fs-s);
  font-weight: var(--fw-bold);
  opacity: 0;
  transition: opacity var(--t-med), transform var(--t-med) var(--ease);
  pointer-events: none;
  z-index: 20;
}

.toast .ic {
  color: var(--accent-2);
  width: var(--icon-s);
  height: var(--icon-s);
}

.toast.in {
  opacity: 1;
  transform: translate(-50%, 0);
}

.spinner {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 3px solid var(--track);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
}

body.loading .spinner {
  opacity: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.rm *,
.rm *::before,
.rm *::after {
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 1ms !important;
}

.legal-page {
  overflow: auto;
  user-select: text;
  -webkit-user-select: text;
  background: var(--bg-1);
}

.legal-page main {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--gap-xl) var(--gutter) 60px;
  font-size: var(--fs-l);
  line-height: 1.55;
}

.legal-page h1 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-black);
  margin-bottom: var(--gap-s);
}

.legal-page h2 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
  margin: var(--gap-xl) 0 var(--gap-s);
}

.legal-page p,
.legal-page li {
  color: var(--ink-2);
  margin: var(--gap-s) 0;
}

.legal-page a {
  color: var(--accent-2);
}

.legal-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-m);
}

.legal-page td,
.legal-page th {
  border: 1px solid var(--line);
  padding: var(--gap-s);
  text-align: left;
  vertical-align: top;
}
