@font-face {
  font-family: Outfit;
  src: url(assets/fonts/outfit-var.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Cinzel;
  src: url(assets/fonts/cinzel-var.woff2) format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --bg0: #070a14;
  --bg1: #0d1326;
  --ink: #eef1fa;
  --ink-2: #b7c1dc;
  --ink-3: #7f8bab;
  --ink-4: #56617f;
  --gold: #e3b456;
  --gold-2: #f6d98f;
  --gold-deep: #a97a26;
  --teal: #62eadb;
  --coral: #ff7566;
  --violet: #a78bff;
  --glass: rgba(14, 19, 38, 0.64);
  --glass-2: rgba(22, 29, 56, 0.72);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Cinzel", "Times New Roman", serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --accent: var(--gold);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--font);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

body {
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button {
  font: inherit;
  color: inherit;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  touch-action: none;
  outline: none;
}

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse 75% 70% at 50% 48%, #03050c00 45%, #03050c8c);
}

#ui > * {
  pointer-events: none;
}

.interactive,
.interactive * {
  pointer-events: auto;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition:
    opacity 0.45s var(--ease-out),
    transform 0.55s var(--ease-out);
  transform: translateY(8px);
}

.screen.shown {
  opacity: 1;
  transform: none;
}

.screen.leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition-duration: 0.28s;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: var(--shadow);
}

.display {
  font-family: var(--display);
  letter-spacing: 0.08em;
}

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

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spacer {
  flex: 1;
}

.btn {
  pointer-events: auto;
  appearance: none;
  border: 1px solid var(--line-2);
  background: #ffffff0d;
  color: var(--ink);
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 550;
  font-size: 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    transform 0.18s var(--ease-spring),
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.btn:hover {
  background: #ffffff1a;
  border-color: #ffffff42;
}

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

.btn.primary {
  background: linear-gradient(180deg, #f6d68a, #d9a444 55%, #b98428);
  color: #20170a;
  border-color: #ffe296b3;
  box-shadow:
    0 8px 24px #e3b45647,
    inset 0 1px #ffffff8c;
  font-weight: 650;
}

.btn.primary:hover {
  box-shadow:
    0 10px 30px #e3b4566b,
    inset 0 1px #fff9;
}

.btn.big {
  padding: 16px 30px;
  font-size: 17px;
}

.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.icon-btn {
  pointer-events: auto;
  appearance: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff0b;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-2);
  transition:
    transform 0.16s var(--ease-spring),
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
  position: relative;
}

.icon-btn:hover {
  background: #ffffff17;
  color: var(--ink);
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

.icon-btn.on {
  color: #1c1406;
  background: linear-gradient(180deg, #f6d68a, #d7a246);
  border-color: #ffe296cc;
}

.icon-btn .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--teal);
  color: #05201c;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  background: #ffffff0a;
}

.chip.gold {
  color: var(--gold-2);
  border-color: #e3b45673;
  background: #e3b45614;
}

.game {
  padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) calc(12px + var(--safe-b))
    calc(12px + var(--safe-l));
  gap: 10px;
}

.hud-top {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}

.hud-top .title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hud-top .title .name {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-top .title .sub {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
}

.stat .v {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat .k {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.stat.warn .v {
  color: var(--coral);
}

.game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

#board-slot {
  flex: 1;
  min-height: 200px;
  pointer-events: none;
  position: relative;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.tools {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.tool {
  pointer-events: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  color: var(--ink-2);
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.16s var(--ease-spring);
  position: relative;
}

.tool:hover {
  background: #ffffff0f;
  color: var(--ink);
}

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

.tool svg {
  width: 24px;
  height: 24px;
}

.tool span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool.on {
  color: var(--gold-2);
}

.tool.on .pill {
  opacity: 1;
}

.tool .pill {
  position: absolute;
  top: 4px;
  right: calc(50% - 26px);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--gold);
  color: #1c1406;
  opacity: 0;
  transition: opacity 0.2s;
}

.tool .count {
  position: absolute;
  top: 2px;
  right: calc(50% - 24px);
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  background: var(--teal);
  color: #05201c;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.pad {
  display: grid;
  gap: 7px;
}

.pad.n9 {
  grid-template-columns: repeat(9, 1fr);
}

.pad.n6 {
  grid-template-columns: repeat(6, 1fr);
}

.pad.n4 {
  grid-template-columns: repeat(4, 1fr);
}

.pad.n5 {
  grid-template-columns: repeat(5, 1fr);
}

.key {
  pointer-events: auto;
  position: relative;
  aspect-ratio: 0.82;
  max-height: 76px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #28335c, #141a32);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.14s var(--ease-spring),
    background 0.2s,
    border-color 0.2s,
    opacity 0.3s;
  box-shadow:
    inset 0 1px #ffffff14,
    0 6px 16px #00000040;
}

.key:hover {
  border-color: #ffffff38;
}

.key:active {
  transform: scale(0.9);
}

.key .d {
  font-size: clamp(22px, 5.4vw, 30px);
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
}

.key .left {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 4px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.key.done {
  opacity: 0.28;
}

.key.done .left {
  visibility: hidden;
}

.key.hl {
  border-color: #e3b456cc;
  box-shadow:
    0 0 0 1px #e3b45680,
    0 6px 20px #e3b45640;
}

.notes-mode .key .d {
  font-size: clamp(15px, 3.6vw, 19px);
  color: var(--gold-2);
}

.notes-mode .key {
  background: linear-gradient(180deg, #40341a99, #1e180cb3);
  border-color: #e3b45640;
}

@media (min-aspect-ratio: 1/1) and (min-width: 760px) {
  .game-body {
    flex-direction: row;
    align-items: stretch;
  }

  .controls {
    width: min(38vw, 420px);
    max-width: none;
    margin: 0;
    justify-content: center;
  }

  .pad.n9,
  .pad.n6 {
    grid-template-columns: repeat(3, 1fr);
  }

  .pad.n4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .pad.n5 {
    grid-template-columns: repeat(3, 1fr);
  }

  .key {
    aspect-ratio: 1.25;
    max-height: 92px;
  }

  .key .d {
    font-size: 32px;
  }
}

.hint-card {
  pointer-events: auto;
  border-radius: var(--r-md);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  animation: rise 0.4s var(--ease-out);
}

.hint-card .h-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hint-card .h-title {
  font-weight: 650;
  font-size: 15px;
  color: var(--teal);
  letter-spacing: 0.02em;
}

.hint-card .h-rung {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.hint-card .h-rung i {
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: #ffffff24;
}

.hint-card .h-rung i.on {
  background: var(--teal);
}

.hint-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

.hint-card .h-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.hint-card .btn {
  padding: 8px 16px;
  font-size: 13px;
}

@keyframes rise {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.toast {
  position: absolute;
  left: 50%;
  top: calc(76px + var(--safe-t));
  transform: translate(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
  animation: toast 2.2s var(--ease-out) forwards;
  pointer-events: none;
}

@keyframes toast {
  0% {
    opacity: 0;
    transform: translate(-50%, -8px);
  }

  12% {
    opacity: 1;
    transform: translate(-50%);
  }

  80% {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translate(-50%, -6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen,
  .btn,
  .key,
  .tool,
  .icon-btn {
    transition: none !important;
    animation: none !important;
  }
}

.cube-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.cube-bar .segs {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: #ffffff0d;
  border: 1px solid var(--line);
}

.seg {
  pointer-events: auto;
  appearance: none;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}

.seg:hover {
  color: var(--ink);
}

.seg.on {
  background: #ffffff1f;
  color: var(--ink);
}

.seg.ax-x.on {
  background: #ff6b6b38;
  color: #ffb3b3;
}

.seg.ax-y.on {
  background: #6bf08f33;
  color: #b3f7c6;
}

.seg.ax-z.on {
  background: #6aa8ff38;
  color: #b8d4ff;
}

.seg.icon,
.seg.mini {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #ffffff0d;
}

.seg.icon svg,
.seg.mini svg {
  width: 18px;
  height: 18px;
}

.seg.mini.flip svg {
  transform: scaleX(-1);
}

.slice-step {
  display: flex;
  align-items: center;
  gap: 6px;
}

.slice-idx {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  min-width: 40px;
  text-align: center;
}

.page {
  padding: calc(14px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b))
    calc(16px + var(--safe-l));
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.14em;
}

.topbar .sub {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

.scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.scroll::-webkit-scrollbar {
  width: 6px;
}

.scroll::-webkit-scrollbar-thumb {
  background: #ffffff26;
  border-radius: 3px;
}

.wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.card {
  border-radius: var(--r-lg);
  padding: 18px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.h2 {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.08em;
  margin: 2px 0 0;
  font-weight: 600;
}

.lede {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
  margin: 6px 0 0;
}

.bar {
  height: 6px;
  border-radius: 3px;
  background: #ffffff14;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-2));
  transition: width 0.8s var(--ease-out);
}

.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--gold);
}

.stars svg {
  width: 16px;
  height: 16px;
}

.stars .off {
  color: #ffffff29;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.title-screen {
  align-items: center;
  justify-content: flex-start;
  padding: calc(18px + var(--safe-t)) 20px calc(24px + var(--safe-b));
}

.hero-slot {
  flex: 1;
  width: 100%;
  min-height: 140px;
}

.title-top {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: auto;
}

.logo-block {
  text-align: center;
  margin-top: 1vh;
}

.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(40px, 10vw, 104px);
  letter-spacing: 0.26em;
  margin: 0 0 0 0.26em;
  line-height: 1;
  background: linear-gradient(180deg, #fff6d8, #f2cf7c 45%, #b7862e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 24px rgba(227, 180, 86, 0.35));
}

.tagline {
  margin-top: 14px;
  font-size: clamp(11px, 2.6vw, 14px);
  font-weight: 400;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-left: 0.5em;
}

.menu {
  width: min(92vw, 440px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: auto;
}

.menu .btn.primary {
  width: 100%;
  padding: 18px 24px;
  flex-direction: column;
  gap: 2px;
  border-radius: 22px;
}

.menu .btn.primary .big {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.menu .btn.primary .small {
  font-size: 12.5px;
  font-weight: 550;
  opacity: 0.75;
  letter-spacing: 0.02em;
}

.menu-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tile-btn {
  pointer-events: auto;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 18px;
  padding: 14px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--ink);
  transition:
    transform 0.18s var(--ease-spring),
    border-color 0.2s,
    background 0.2s;
  position: relative;
}

.tile-btn:hover {
  border-color: #ffffff38;
  background: var(--glass-2);
}

.tile-btn:active {
  transform: scale(0.95);
}

.tile-btn svg {
  width: 26px;
  height: 26px;
  color: var(--gold-2);
}

.tile-btn .t {
  font-size: 13.5px;
  font-weight: 600;
}

.tile-btn .s {
  font-size: 11px;
  color: var(--ink-3);
}

.tile-btn .dot {
  position: absolute;
  top: 9px;
  right: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal);
}

.credit {
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.08em;
  text-align: center;
}

.flame {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ffb35c;
  font-weight: 700;
}

.flame svg {
  width: 15px;
  height: 15px;
}

.map-screen {
  justify-content: space-between;
}

.realm-panel {
  pointer-events: auto;
  width: min(100%, 560px);
  margin: 0 auto;
  border-radius: 22px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: rise 0.45s var(--ease-out);
}

.realm-panel .head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.realm-panel .rname {
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: 0.1em;
}

.realm-panel .skill {
  margin-left: auto;
}

.realm-panel .meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-2);
}

.realm-panel .meta .bar {
  flex: 1;
}

.realm-panel .actions {
  display: flex;
  gap: 8px;
}

.realm-panel .actions .btn {
  flex: 1;
}

.lock-note {
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  gap: 8px;
  align-items: center;
}

.lock-note svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.map-hint {
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

.modal-back {
  position: absolute;
  inset: 0;
  background: #04060e80;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  transition: opacity 0.25s;
  z-index: 20;
}

.modal-back.shown {
  opacity: 1;
}

.modal {
  width: min(94vw, 440px);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 26px;
  padding: 22px;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.35s var(--ease-out);
}

.modal-back.shown .modal {
  transform: none;
}

.modal.wide {
  width: min(94vw, 620px);
}

.lvl-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.lvl-name {
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: 0.08em;
  margin: 4px 0 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.lvl-teach {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: #ffffff0d;
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}

.lvl-teach svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex: none;
}

.lvl-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.lvl-stats .s {
  background: #ffffff0a;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  text-align: center;
}

.lvl-stats .s .v {
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.lvl-stats .s .k {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-top: 2px;
}

.lvl-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.lvl-actions .btn {
  flex: 1;
}

.big-stars {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 6px 0 2px;
}

.big-stars svg {
  width: 34px;
  height: 34px;
  color: #ffffff1f;
  transition:
    color 0.3s,
    transform 0.4s var(--ease-spring);
}

.big-stars svg.on {
  color: var(--gold);
  filter: drop-shadow(0 0 12px rgba(227, 180, 86, 0.6));
}

.big-stars svg.pop {
  animation: starpop 0.55s var(--ease-spring);
}

@keyframes starpop {
  0% {
    transform: scale(0.2) rotate(-40deg);
  }

  70% {
    transform: scale(1.25) rotate(8deg);
  }

  to {
    transform: scale(1) rotate(0);
  }
}

.star-rules {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
  margin-top: 8px;
}

.results {
  text-align: center;
}

.results .r-title {
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.12em;
  margin: 2px 0;
}

.results .r-sub {
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.feats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.feat {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: #62eadb1a;
  color: var(--teal);
  border: 1px solid rgba(98, 234, 219, 0.3);
}

.recap {
  margin-top: 14px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  background: #ffffff0a;
  border: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.recap b {
  color: var(--ink);
}

.delta {
  font-weight: 700;
}

.delta.up {
  color: #7ee0a8;
}

.delta.down {
  color: #ffab8a;
}

.next-goal {
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-3);
}

.daily-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.daily-card {
  pointer-events: auto;
  border-radius: 22px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-spring),
    border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.daily-card:hover {
  border-color: #ffffff38;
}

.daily-card:active {
  transform: scale(0.98);
}

.daily-card .kind {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.daily-card .name {
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: 0.06em;
}

.daily-card .desc {
  font-size: 13px;
  color: var(--ink-3);
}

.daily-card .done {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--teal);
  font-weight: 600;
}

.daily-card .glyph {
  position: absolute;
  right: -10px;
  bottom: -18px;
  width: 110px;
  height: 110px;
  color: #ffffff0d;
}

.streak-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.streak-big {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: #ffb35c;
  display: flex;
  align-items: center;
  gap: 8px;
}

.streak-big svg {
  width: 34px;
  height: 34px;
}

.cal {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 4px;
  flex: 1;
  min-width: 220px;
}

.cal i {
  aspect-ratio: 1;
  border-radius: 4px;
  background: #ffffff0f;
}

.cal i.on {
  background: linear-gradient(180deg, #ffcf7a, #e39b3c);
}

.cal i.today {
  outline: 1.5px solid rgba(255, 255, 255, 0.5);
  outline-offset: 1px;
}

.rest {
  font-size: 12.5px;
  color: var(--ink-3);
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 18px 4px 8px;
}

.list {
  border-radius: 20px;
  overflow: hidden;
}

.item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  pointer-events: auto;
}

.item:last-child {
  border-bottom: 0;
}

.item .l {
  flex: 1;
  min-width: 0;
}

.item .l .t {
  font-size: 15px;
  font-weight: 550;
}

.item .l .d {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
  line-height: 1.4;
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: #ffffff1f;
  border: 0;
  cursor: pointer;
  transition: background 0.2s;
  flex: none;
}

.switch:after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.22s var(--ease-spring);
  box-shadow: 0 2px 6px #0000004d;
}

.switch.on {
  background: var(--gold);
}

.switch.on:after {
  transform: translate(20px);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 140px;
  height: 4px;
  border-radius: 2px;
  background: #ffffff26;
  outline: none;
  pointer-events: auto;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold-2);
  cursor: pointer;
  box-shadow: 0 2px 8px #00000059;
}

.seg-group {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: #ffffff0f;
  border: 1px solid var(--line);
  flex-wrap: wrap;
}

.seg-group .seg {
  padding: 7px 12px;
}

.seg-group .seg.on {
  background: #e3b45633;
  color: var(--gold-2);
}

.tech-card {
  pointer-events: auto;
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    transform 0.18s var(--ease-spring);
}

.tech-card:hover {
  border-color: #ffffff38;
}

.tech-card:active {
  transform: scale(0.98);
}

.tech-card .tn {
  font-weight: 650;
  font-size: 15px;
}

.tech-card .td {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.45;
}

.tech-card .status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tech-card.mastered .status {
  color: var(--gold-2);
}

.tech-card.learned .status {
  color: var(--teal);
}

.tech-card.new .status {
  color: var(--ink-3);
}

.tech-card.locked {
  opacity: 0.45;
}

.drill-card {
  pointer-events: auto;
  border-radius: 22px;
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    transform 0.18s var(--ease-spring);
}

.drill-card:hover {
  border-color: #ffffff38;
}

.drill-card .ic {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #ffffff0f;
  flex: none;
}

.drill-card .ic svg {
  width: 26px;
  height: 26px;
}

.drill-card .dn {
  font-weight: 650;
  font-size: 16px;
}

.drill-card .dd {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
  line-height: 1.4;
}

.drill-card .pb {
  margin-left: auto;
  text-align: right;
  font-size: 12px;
  color: var(--ink-3);
  flex: none;
}

.drill-card .pb b {
  display: block;
  font-size: 18px;
  color: var(--ink);
}

.radar-wrap {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 18px;
  align-items: center;
}

@media (max-width: 700px) {
  .radar-wrap {
    grid-template-columns: 1fr;
  }
}

.skill-row {
  display: grid;
  grid-template-columns: 110px 1fr 70px;
  gap: 10px;
  align-items: center;
  font-size: 13.5px;
  padding: 6px 0;
}

.skill-row .v {
  text-align: right;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.skill-row .v small {
  display: block;
  font-weight: 500;
  font-size: 10.5px;
  color: var(--ink-4);
}

.ach {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: #ffffff0a;
  border: 1px solid var(--line);
}

.ach .ai {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #e3b45624;
  color: var(--gold-2);
  flex: none;
}

.ach .ai svg {
  width: 20px;
  height: 20px;
}

.ach.locked {
  opacity: 0.4;
}

.ach.locked .ai {
  background: #ffffff0f;
  color: var(--ink-3);
}

.ach .an {
  font-weight: 600;
  font-size: 14px;
}

.ach .ad {
  font-size: 12px;
  color: var(--ink-3);
}

.science {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.6;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px dashed var(--line-2);
}

.coach {
  position: absolute;
  left: 50%;
  transform: translate(-50%);
  top: calc(76px + var(--safe-t));
  z-index: 12;
  pointer-events: auto;
  width: min(92vw, 460px);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: rise 0.4s var(--ease-out);
}

.coach .ci {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #e3b45629;
  color: var(--gold-2);
  flex: none;
}

.coach .ci svg {
  width: 19px;
  height: 19px;
}

.coach .ct {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.coach .ct b {
  color: var(--gold-2);
}

.coach .cx {
  margin-left: auto;
  flex: none;
}

.stuck {
  position: absolute;
  right: calc(14px + var(--safe-r));
  top: calc(70px + var(--safe-t));
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  pointer-events: auto;
  cursor: pointer;
  animation: rise 0.4s var(--ease-out);
  color: var(--ink-2);
}

.peek-btn {
  pointer-events: auto;
}

.glimpse-timer {
  position: absolute;
  left: 50%;
  transform: translate(-50%);
  top: calc(64px + var(--safe-t));
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.1em;
  padding: 8px 16px;
  border-radius: 999px;
  z-index: 5;
}

.sweep-btn {
  position: absolute;
  left: 50%;
  transform: translate(-50%);
  bottom: calc(100% + 8px);
  z-index: 6;
  animation: rise 0.35s var(--ease-out);
  white-space: nowrap;
}

.controls {
  position: relative;
}

html.reduce-motion *,
html.reduce-motion *:before,
html.reduce-motion *:after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

.lens {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lens-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lens-tabs {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: #ffffff0d;
  border: 1px solid var(--line);
}

.lens-title {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.lens-grid {
  display: grid;
  gap: 4px;
  padding: 7px;
  border-radius: 16px;
  background: #080b16b8;
  border: 1px solid var(--line-2);
  width: 100%;
  max-width: min(100%, 33vh);
  margin: 0 auto;
  aspect-ratio: 1;
}

.lens[data-axis="1"] .lens-grid {
  box-shadow:
    0 0 0 1px #009e7359,
    0 10px 30px #00000059;
}

.lens[data-axis="2"] .lens-grid {
  box-shadow:
    0 0 0 1px #0072b273,
    0 10px 30px #00000059;
}

.lens[data-axis="0"] .lens-grid {
  box-shadow:
    0 0 0 1px #d55e0073,
    0 10px 30px #00000059;
}

.lc {
  position: relative;
  border: 0;
  border-radius: 9px;
  background: #1a2240;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  min-height: 0;
  transition:
    background 0.12s,
    box-shadow 0.12s;
  font: inherit;
}

.lc .lv {
  font-size: clamp(18px, 4.6vh, 30px);
  font-weight: 560;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.lc.given {
  background: #e6dfcc;
  color: #161c33;
}

.lc.player .lv {
  color: #7ff3e4;
  text-shadow: 0 0 12px rgba(111, 240, 223, 0.45);
}

.lc.wrong .lv {
  color: #ff8a4c;
}

.lc.br {
  margin-right: 3px;
}

.lc.bb {
  margin-bottom: 3px;
}

.lc.line-x {
  background: #3a2a2c;
}

.lc.line-y {
  background: #1f3a33;
}

.lc.line-z {
  background: #1d3050;
}

.lc.given.line-x {
  background: #ecd5c6;
}

.lc.given.line-y {
  background: #d7e6d6;
}

.lc.given.line-z {
  background: #d4ddeb;
}

.lc.same {
  box-shadow: inset 0 0 0 2px #ffcc55bf;
}

.lc.sel {
  box-shadow:
    inset 0 0 0 2.5px #ffb347,
    0 0 16px #ffb34773;
  background: #3b2e1c;
}

.lc.given.sel {
  background: #f3e2bf;
}

.lc.conflict {
  background: #3d2319;
}

.lc .lbang {
  display: none;
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 11px;
  font-weight: 800;
  color: #ff8a4c;
}

.lc.conflict .lbang {
  display: block;
}

.lc.conflict .lv {
  color: #ff8a4c;
}

.ln {
  position: absolute;
  inset: 12%;
  display: none;
  grid-template-columns: repeat(3, 1fr);
}

.ln.n2 {
  grid-template-columns: repeat(2, 1fr);
}

.lc:not(.given):not(.player):not(.wrong) .ln {
  display: grid;
}

.ln i {
  font-style: normal;
  font-size: clamp(8px, 1.5vh, 12px);
  color: transparent;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.ln i.on {
  color: #aab8dc;
}

.ln i.hi {
  color: #ffd57a;
}

.lens-strip {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.lthumb {
  pointer-events: auto;
  border: 1px solid var(--line);
  background: #ffffff0a;
  border-radius: 9px;
  padding: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  width: 38px;
}

.lthumb.on {
  border-color: #e3b456cc;
  background: #e3b4561a;
}

.lthumb b {
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 600;
}

.lmini {
  display: grid;
  gap: 1px;
  width: 28px;
  aspect-ratio: 1;
}

.lmini i {
  background: #ffffff14;
  border-radius: 1px;
}

.lmini i.g {
  background: #e6dfcc;
}

.lmini i.p {
  background: #5fd8c9;
}

.lmini i.s {
  background: #ffb347;
}

.cube-mini-bar {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.cube-mini-bar .seg.icon {
  width: 32px;
  height: 32px;
}

.lens-title {
  display: none;
}

.controls.is3d {
  gap: 8px;
}

.controls.is3d .tools .tool {
  padding: 5px 4px;
}

.controls.is3d .key {
  max-height: 58px;
  aspect-ratio: 1.15;
}

@media (max-aspect-ratio: 1/1) {
  .controls.is3d .pad.n4,
  .controls.is3d .pad.n5,
  .controls.is3d .pad.n6 {
    grid-template-columns: repeat(var(--nkeys, 6), 1fr);
  }
}

@media (min-aspect-ratio: 1/1) and (min-width: 760px) {
  .lens-grid {
    max-width: min(100%, 38vh);
  }

  .controls.is3d .pad.n4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .controls.is3d .pad.n5 {
    grid-template-columns: repeat(5, 1fr);
  }

  .controls.is3d .pad.n6 {
    grid-template-columns: repeat(6, 1fr);
  }

  .controls.is3d .pad.n9 {
    grid-template-columns: repeat(5, 1fr);
  }

  .controls.is3d .key {
    aspect-ratio: 1.1;
    max-height: 64px;
  }

  .controls.is3d .key .d {
    font-size: 26px;
  }
}

.hint-card .h-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hint-card .h-foot .muted {
  font-size: 11.5px;
}

.hint-card .h-foot .h-actions {
  margin-left: auto;
}

#boot {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: radial-gradient(ellipse at 50% 40%, #121a38, #04060e 70%);
  display: grid;
  place-content: center;
  gap: 22px;
  transition: opacity 0.8s var(--ease-out);
}

#boot.gone {
  opacity: 0;
  pointer-events: none;
}

.boot-logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(32px, 8vw, 64px);
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  background: linear-gradient(180deg, #fff6d8, #f2cf7c 50%, #b7862e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.boot-bar {
  width: 180px;
  height: 2px;
  margin: 0 auto;
  background: #ffffff14;
  border-radius: 1px;
  overflow: hidden;
}

.boot-bar i {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, #f2cf7c, transparent);
  animation: bootbar 1.1s ease-in-out infinite;
}

@keyframes bootbar {
  0% {
    transform: translate(-100%);
  }

  to {
    transform: translate(250%);
  }
}

.toast.ach {
  border-color: #e3b45680;
  color: var(--gold-2);
}

.realm-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.realm-label {
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  font-family: var(--display);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #080b168c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: opacity 0.3s;
}

.realm-label svg {
  width: 12px;
  height: 12px;
}

.realm-label.locked {
  color: var(--ink-3);
}

.realm-label .dotc {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.drill-screen {
  gap: 10px;
}

.drill-status {
  display: flex;
  gap: 6px;
}

.drill-prompt {
  text-align: center;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink-2);
  min-height: 24px;
  padding: 0 10px;
}

.drill-prompt b {
  color: var(--ink);
}

.drill-slot {
  flex: 1;
  min-height: 220px;
}

.drill-screen.no3d .drill-slot {
  display: none;
}

.drill-panel {
  width: min(100%, 560px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

.drill-screen.no3d .drill-panel {
  flex: 1;
  justify-content: center;
}

.drill-tip {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
  align-items: center;
  line-height: 1.45;
}

.drill-tip svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--gold-2);
}

.scan-digit {
  font-size: 60px;
  font-weight: 600;
  text-align: center;
  color: var(--teal);
  text-shadow: 0 0 24px rgba(98, 234, 219, 0.5);
  line-height: 1;
}

.cage-card {
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cage-sum {
  font-size: 34px;
  font-weight: 700;
  color: var(--gold-2);
  line-height: 1;
}

.cage-cells {
  display: flex;
  gap: 6px;
  padding: 8px;
  border: 2px dashed rgba(233, 207, 142, 0.7);
  border-radius: 14px;
}

.cage-cell {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: #1a2240;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 600;
}

.cage-cell.known {
  background: #e6dfcc;
  color: #161c33;
}

.cage-q {
  font-size: 15px;
  color: var(--ink-2);
  text-align: center;
}

.cage-pad .key {
  aspect-ratio: 1.1;
  max-height: 64px;
}

.span-grid {
  display: grid;
  gap: 6px;
  width: min(100%, 300px, 36vh);
  margin: 0 auto;
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 16px;
  background: #080b16b8;
  border: 1px solid var(--line-2);
}

.span-grid .lc .lv {
  font-size: clamp(20px, 5vw, 28px);
}

.rot-opts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.rot-opt {
  pointer-events: auto;
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  border: 1px solid var(--line);
  transition:
    border-color 0.2s,
    transform 0.15s var(--ease-spring);
}

.rot-opt:active {
  transform: scale(0.96);
}

.rot-opt .lmini {
  gap: 3px;
}

.rot-opt .lmini i {
  border-radius: 3px;
}

.rot-opt .lmini i.gold {
  background: #e2b457;
  box-shadow: 0 0 8px #e2b45780;
}

.rot-opt.right {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px #62eadb80;
}

.rot-opt.wrong {
  border-color: #ff8a4c;
  opacity: 0.6;
}

.drill-screen .pad .key {
  max-height: 54px;
  aspect-ratio: 1.6;
}

.drill-screen .pad.n9 {
  grid-template-columns: repeat(9, 1fr);
}

@media (max-width: 520px) {
  .drill-screen .pad.n9 {
    grid-template-columns: repeat(5, 1fr);
  }

  .drill-screen .pad .key {
    aspect-ratio: 1.2;
  }
}

.title-screen.keyart {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 0 0 0 7vw;
}

.title-screen.keyart .title-top,
.title-screen.keyart .menu {
  display: none;
}

.title-screen.keyart .logo-block {
  text-align: left;
  margin: 0;
  width: 46vw;
  z-index: 2;
}

.title-screen.keyart .logo {
  font-size: 6.3vw;
  margin: 0;
}

.title-screen.keyart .tagline {
  padding-left: 0.2em;
  font-size: 1.5vw;
  margin-top: 1.4vw;
}

.title-screen.keyart .hero-slot {
  position: absolute;
  right: 3vw;
  top: 8vh;
  bottom: 8vh;
  width: 44vw;
  flex: none;
}

.keyart-facts {
  margin-top: 2.2vw;
  font-size: 1.15vw;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-2);
  opacity: 0.85;
  padding-left: 0.3em;
}

.modal-back.pause-back {
  backdrop-filter: blur(14px) saturate(0.8);
  -webkit-backdrop-filter: blur(14px) saturate(0.8);
  background: #04060e9e;
}

.lc.hint {
  box-shadow:
    inset 0 0 0 2.5px #3fe0cf,
    0 0 14px #3fe0cf73;
}

.lc.ghost .lv {
  color: #3fe0cfbf;
  animation: ghostpulse 1.2s ease-in-out infinite;
}

@keyframes ghostpulse {
  50% {
    opacity: 0.35;
  }
}

.ln i.elim {
  color: #ff8a4c !important;
  text-decoration: line-through;
}

.recap.unlock {
  border-color: #e3b45673;
  background: #e3b45614;
  color: var(--gold-2);
}

#grain {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 3;
  background-image: var(--grain);
  opacity: 0.045;
  mix-blend-mode: overlay;
  animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
  0% {
    transform: translate(0);
  }

  20% {
    transform: translate(-3%, 2%);
  }

  40% {
    transform: translate(2%, -3%);
  }

  60% {
    transform: translate(-2%, -1%);
  }

  80% {
    transform: translate(3%, 3%);
  }

  to {
    transform: translate(0);
  }
}

html.reduce-motion #grain {
  animation: none;
}

.progress-line {
  height: 3px;
  border-radius: 2px;
  background: #ffffff0f;
  overflow: hidden;
  margin: -2px 2px 0;
}

.progress-line i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-2));
  box-shadow: 0 0 10px #e3b45699;
  transition: width 0.5s var(--ease-out);
}

.axis-gizmo {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 84px;
  height: 84px;
  pointer-events: none;
  opacity: 0.9;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.axis-gizmo svg {
  width: 100%;
  height: 100%;
}

.key.brush {
  background: linear-gradient(180deg, #f6d68a, #d7a246);
  border-color: #ffe296e6;
  box-shadow:
    0 0 0 2px #e3b45673,
    0 8px 24px #e3b45659;
}

.key.brush .d,
.key.brush .left {
  color: #1c1406;
}

.controls.brushing .key:not(.brush) {
  opacity: 0.75;
}

.tools {
  position: relative;
}

.more-pop {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  max-height: min(70vh, 340px);
  overflow-y: auto;
  z-index: 12;
  border-radius: 18px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 260px;
  pointer-events: auto;
  animation: rise 0.25s var(--ease-out);
}

.more-item {
  appearance: none;
  border: 0;
  background: none;
  color: var(--ink);
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
}

.more-item:hover {
  background: #ffffff12;
}

.more-item > span:first-child {
  width: 22px;
  height: 22px;
  color: var(--gold-2);
  flex: none;
}

.more-item > span:first-child svg {
  width: 22px;
  height: 22px;
}

.more-item b {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.more-item small {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 1px;
}

.tools .tool {
  min-width: 0;
}

@media (min-aspect-ratio: 1/1) and (min-width: 760px) {
  .more-pop {
    bottom: auto;
    top: calc(100% + 8px);
  }
}

.lvl-intro {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  pointer-events: auto;
  cursor: pointer;
  animation: fadeIn 0.35s ease-out both;
}

.lvl-intro .li-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 28px 16px;
  border-radius: 24px;
  width: min(88%, 440px);
  background: #090c1cdb;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent, #e3b456) 35%, transparent),
    0 18px 60px #00000073,
    0 0 80px color-mix(in srgb, var(--accent, #e3b456) 18%, transparent);
  animation: introIn 0.7s var(--ease-out) both;
}

.lvl-intro .li-eyebrow {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent, var(--gold-2));
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent, #e3b456) 50%, transparent);
}

.lvl-intro .li-name {
  font-family: var(--display);
  font-size: clamp(30px, 7vw, 48px);
  letter-spacing: 0.08em;
  color: var(--ink);
  line-height: 1.05;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.lvl-intro .li-rule {
  display: block;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--gold)), transparent);
  transform-origin: center;
  animation: ruleIn 0.9s 0.15s var(--ease-out) both;
}

.lvl-intro .li-teach {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--ink-2);
  animation: rise 0.5s 0.25s var(--ease-out) both;
}

.lvl-intro .li-teach svg {
  width: 18px;
  height: 18px;
  color: var(--accent, var(--gold-2));
}

.lvl-intro .li-teach b {
  color: var(--ink);
  font-weight: 650;
}

.lvl-intro .li-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  animation: rise 0.5s 0.35s var(--ease-out) both;
}

.lvl-intro .li-tap {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
  animation: fadeIn 0.6s 0.9s both;
}

.lvl-intro.out {
  animation: fadeOut 0.45s ease-in forwards;
  pointer-events: none;
}

.lvl-intro.out .li-card {
  animation: introOut 0.45s ease-in forwards;
}

@keyframes introIn {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
    letter-spacing: 0.2em;
    filter: blur(6px);
  }

  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes introOut {
  to {
    opacity: 0;
    transform: translateY(-18px) scale(1.02);
    filter: blur(4px);
  }
}

@keyframes ruleIn {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }

  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

.map-screen.diving {
  opacity: 0;
  transform: scale(1.03);
  transition:
    opacity 0.32s ease-in,
    transform 0.4s ease-in;
  pointer-events: none;
}

.realm-labels {
  transition: opacity 0.3s;
}

.map-screen.diving .realm-labels {
  opacity: 0;
}

.dive-flash {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 50%,
    color-mix(in srgb, var(--accent, #fff) 55%, white) 0%,
    color-mix(in srgb, var(--accent, #fff) 30%, transparent) 30%,
    transparent 70%
  );
  opacity: 0;
  animation: diveFlash 1.2s ease-out forwards;
  mix-blend-mode: screen;
}

@keyframes diveFlash {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }

  35% {
    opacity: 0.85;
    transform: scale(1.1);
  }

  to {
    opacity: 0;
    transform: scale(1.6);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dive-flash {
    display: none;
  }
}

.star-gain {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  color: var(--gold-2);
  margin-top: 2px;
  animation: rise 0.5s 1.6s var(--ease-out) both;
}

.star-check {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.star-check .sc-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13.5px;
  color: var(--ink-3);
  padding: 5px 10px;
  border-radius: 10px;
  animation: rise 0.4s var(--ease-out) both;
}

.star-check .sc-row svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--coral);
  opacity: 0.8;
}

.star-check .sc-row.ok {
  color: var(--ink);
  background: #ffffff08;
}

.star-check .sc-row.ok svg {
  color: var(--teal);
  opacity: 1;
}

.star-check .sc-rule {
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
  padding: 4px 10px 0;
}

.theme-unlock {
  display: flex;
  gap: 12px;
  align-items: center;
}

.theme-unlock .btn {
  margin-left: auto;
  padding: 7px 14px;
  font-size: 13px;
  flex: none;
}

.tu-sw {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  flex: none;
  box-shadow: 0 0 0 1px #ffffff26;
}

.tu-sw i {
  display: block;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.theme-card {
  appearance: none;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  border-radius: 18px;
  padding: 10px 10px 12px;
  background: #ffffff09;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition:
    transform 0.2s var(--ease-spring),
    border-color 0.2s,
    background 0.2s;
}

.theme-card:hover {
  transform: translateY(-2px);
  border-color: #fff3;
}

.theme-card.on {
  border-color: #e3b456b3;
  box-shadow:
    0 0 0 1px #e3b45659,
    0 10px 30px #e3b4561f;
}

.theme-card .tc-art svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.theme-card.locked .tc-art {
  filter: grayscale(0.85) brightness(0.55);
}

.theme-card .tc-name {
  font-weight: 650;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-card .tc-name .chip {
  padding: 2px 8px;
  font-size: 10px;
}

.theme-card .tc-desc {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.4;
  display: flex;
  gap: 6px;
  align-items: center;
}

.theme-card .tc-desc svg {
  width: 13px;
  height: 13px;
  flex: none;
}

.logo {
  background-image:
    linear-gradient(105deg, #fff0 42%, #fffcecf2, #fff0 58%),
    linear-gradient(180deg, #fff6d8, #f2cf7c 45%, #b7862e);
  background-size:
    250% 100%,
    100% 100%;
  background-repeat: no-repeat;
  background-position:
    150% 0,
    0 0;
}

.title-screen.shown .logo {
  animation:
    logoIn 1.5s var(--ease-out) both,
    shimmer 8s ease-in-out 2.4s infinite;
}

.title-screen.shown .tagline {
  animation: fadeIn 1s 0.55s ease-out both;
}

.title-screen.shown .menu > .btn {
  animation: rise 0.6s 0.7s var(--ease-out) both;
}

.title-screen.shown .menu-row > :nth-child(1) {
  animation: rise 0.55s 0.82s var(--ease-out) both;
}

.title-screen.shown .menu-row > :nth-child(2) {
  animation: rise 0.55s 0.9s var(--ease-out) both;
}

.title-screen.shown .menu-row > :nth-child(3) {
  animation: rise 0.55s 0.98s var(--ease-out) both;
}

.title-screen.shown .credit {
  animation: fadeIn 0.8s 1.2s ease-out both;
}

@keyframes logoIn {
  0% {
    opacity: 0;
    letter-spacing: 0.42em;
    filter: blur(12px) drop-shadow(0 4px 24px rgba(227, 180, 86, 0));
  }

  to {
    opacity: 1;
    letter-spacing: 0.26em;
    filter: blur(0) drop-shadow(0 4px 24px rgba(227, 180, 86, 0.35));
  }
}

@keyframes shimmer {
  0% {
    background-position:
      150% 0,
      0 0;
  }

  22%,
  to {
    background-position:
      -50% 0,
      0 0;
  }
}

.title-screen.keyart .logo {
  animation: none !important;
}

.screen.page.shown .wrap > :nth-child(1) {
  animation: rise 0.5s 0.05s var(--ease-out) both;
}

.screen.page.shown .wrap > :nth-child(2) {
  animation: rise 0.5s 0.11s var(--ease-out) both;
}

.screen.page.shown .wrap > :nth-child(3) {
  animation: rise 0.5s 0.17s var(--ease-out) both;
}

.screen.page.shown .wrap > :nth-child(4) {
  animation: rise 0.5s 0.23s var(--ease-out) both;
}

.screen.page.shown .wrap > :nth-child(5) {
  animation: rise 0.5s 0.29s var(--ease-out) both;
}

.screen.page.shown .wrap > :nth-child(6) {
  animation: rise 0.5s 0.35s var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  .logo,
  .tagline,
  .tile-btn,
  .credit,
  .menu > .btn,
  .wrap > *,
  .lvl-intro,
  .lvl-intro .li-card,
  .star-check .sc-row,
  .star-gain {
    animation: none !important;
  }
}

.realm-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.realm-nav .icon-btn {
  width: 36px;
  height: 36px;
}

.realm-nav .icon-btn svg {
  width: 18px;
  height: 18px;
}

.realm-nav .icon-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.screen.page .topbar h1,
.screen.page .topbar .sub,
.screen.page .section-title,
.screen.page .lede,
.screen.page .intro,
.screen.page .muted,
.screen.page .science {
  text-shadow:
    0 1px 2px rgba(3, 5, 14, 0.55),
    0 0 18px rgba(3, 5, 14, 0.65);
}

.tile-btn .new-badge {
  position: absolute;
  top: 7px;
  right: 8px;
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--teal);
  color: #05201c;
}

.insights {
  margin-top: 12px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 16px;
  background: #ffffff09;
  border: 1px solid var(--line);
}

.insights .ins-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.insights .ins-head svg {
  width: 16px;
  height: 16px;
}

.insights .ins-head small {
  margin-left: auto;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink-4);
}

.insights .ins-wait {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-4);
  animation: pulseText 1.2s ease-in-out infinite;
}

@keyframes pulseText {
  50% {
    opacity: 0.45;
  }
}

.insights .ins-chart-wrap {
  margin: 10px 0 4px;
  height: 62px;
}

.insights .ins-chart {
  width: 100%;
  height: 100%;
  display: block;
}

.insights.ready .ins-chart rect {
  transform-origin: 50% 100%;
  transform-box: fill-box;
  animation: barIn 0.6s var(--ease-out) both;
}

@keyframes barIn {
  0% {
    transform: scaleY(0);
  }

  to {
    transform: none;
  }
}

.insights .ins-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 10.5px;
  color: var(--ink-4);
  margin-bottom: 6px;
}

.insights .ins-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.insights .ins-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

.insights .ins-line {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
  margin-top: 6px;
}

.insights .ins-line svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  color: var(--gold-2);
}

.insights .ins-line b {
  color: var(--ink);
  font-weight: 650;
}

.insights .ins-practise {
  margin-top: 10px;
  width: 100%;
  padding: 9px;
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .insights.ready .ins-chart rect {
    animation: none;
  }
}

.menu-row {
  grid-template-columns: repeat(4, 1fr);
}

.menu {
  width: min(94vw, 520px);
}

.title-screen.shown .menu-row > :nth-child(4) {
  animation: rise 0.55s 1.06s var(--ease-out) both;
}

@media (max-width: 480px) {
  .tile-btn {
    padding: 12px 4px 10px;
  }

  .tile-btn .t {
    font-size: 12.5px;
  }

  .tile-btn .s {
    font-size: 10px;
    line-height: 1.25;
  }
}

.rush-wrap {
  max-width: 560px;
}

.rush-hero {
  border-radius: 24px;
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.rush-hero .rh-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #5ff0e01f;
  color: var(--teal);
  box-shadow: 0 0 30px #5ff0e040;
}

.rush-hero .rh-icon svg {
  width: 30px;
  height: 30px;
}

.rush-hero .rh-best .k {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.rush-hero .rh-best .v {
  font-family: var(--display);
  font-size: 54px;
  line-height: 1.05;
  color: var(--ink);
}

.rush-hero .rh-best .d,
.rush-hero .rh-last {
  font-size: 12.5px;
  color: var(--ink-3);
}

.rush-hero .btn.primary {
  margin-top: 8px;
  width: 100%;
  padding: 16px;
}

.rush-rules {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rush-rule {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: 16px;
  padding: 12px 14px;
}

.rush-rule > span {
  width: 22px;
  height: 22px;
  color: var(--teal);
  flex: none;
}

.rush-rule > span svg {
  width: 22px;
  height: 22px;
}

.rush-rule b {
  display: block;
  font-size: 14px;
}

.rush-rule small {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.rush-hud {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #080c1a8c;
  border: 1px solid var(--line);
  margin-right: 6px;
}

.rush-hud .rh-strikes {
  display: flex;
  gap: 3px;
}

.rush-hud .rh-strikes i {
  width: 16px;
  height: 16px;
  color: var(--coral);
  display: block;
  transition:
    opacity 0.3s,
    transform 0.3s var(--ease-spring);
}

.rush-hud .rh-strikes i svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.rush-hud .rh-strikes i.lost {
  opacity: 0.2;
  transform: scale(0.7);
}

.rush-hud .rh-time {
  position: relative;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: center;
  color: var(--ink);
}

.rush-hud .rh-time.low {
  color: var(--coral);
  animation: lowPulse 1s ease-in-out infinite;
}

@keyframes lowPulse {
  50% {
    transform: scale(1.12);
  }
}

.rush-hud .rh-score {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: var(--gold-2);
}

.rush-hud .rh-score b {
  font-size: 18px;
}

.rush-hud .rh-score small {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.rush-hud.hit {
  animation: hudHit 0.45s ease-out;
}

@keyframes hudHit {
  20% {
    transform: translate(-5px);
    border-color: var(--coral);
  }

  45% {
    transform: translate(4px);
  }

  70% {
    transform: translate(-2px);
  }
}

.rush-pop {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%);
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  white-space: nowrap;
  pointer-events: none;
  animation: popUp 1.1s var(--ease-out) forwards;
}

.rush-pop.gold {
  color: var(--gold-2);
}

@keyframes popUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 6px) scale(0.8);
  }

  20% {
    opacity: 1;
    transform: translate(-50%) scale(1.15);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -22px) scale(1);
  }
}

.rush-score-big {
  font-family: var(--display);
  font-size: 72px;
  line-height: 1;
  margin-top: 6px;
  background: linear-gradient(180deg, #fff6d8, #f2cf7c 55%, #b7862e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rush-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 4px;
}

.rush-best-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
  color: #05201c;
  background: var(--teal);
  box-shadow: 0 0 24px #5ff0e059;
}

@media (max-width: 520px) {
  .rush-hud {
    gap: 8px;
    padding: 4px 9px;
  }

  .rush-hud .rh-time {
    font-size: 17px;
    min-width: 44px;
  }

  .rush-hud .rh-strikes i,
  .rush-hud .rh-strikes i svg {
    width: 13px;
    height: 13px;
  }
}

.name-input {
  width: min(46vw, 200px);
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff0d;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.name-input:focus {
  outline: none;
  border-color: #e3b456b3;
}

.challenge-btn {
  margin-top: 10px;
  width: 100%;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  padding: 10px;
}

.challenge-btn svg {
  width: 17px;
  height: 17px;
  color: var(--gold-2);
}

.vs-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
}

.vs-row .vs {
  border-radius: 14px;
  padding: 10px;
  background: #ffffff0a;
  border: 1px solid var(--line);
}

.vs-row .vs.win {
  border-color: #62eadb99;
  background: #62eadb14;
  box-shadow: 0 0 24px #62eadb1f;
}

.vs-row .vs .k {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-row .vs .v {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.vs-row .vs-mid {
  width: 26px;
  height: 26px;
  color: var(--gold-2);
}

.vs-row .vs-mid svg {
  width: 26px;
  height: 26px;
}

.skill-row .v .spark {
  display: block;
  margin: 3px 0 0 auto;
  opacity: 0.9;
}

.restored-banner {
  position: absolute;
  left: 50%;
  top: calc(64px + var(--safe-t));
  transform: translate(-50%);
  z-index: 25;
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: introIn 0.9s var(--ease-out) both;
}

.restored-banner .rb-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent, var(--gold-2));
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent, #e3b456) 60%, transparent);
}

.restored-banner .rb-name {
  font-family: var(--display);
  font-size: clamp(34px, 7vw, 60px);
  letter-spacing: 0.08em;
  color: var(--ink);
  text-shadow:
    0 2px 30px rgba(0, 0, 0, 0.7),
    0 0 40px color-mix(in srgb, var(--accent, #e3b456) 35%, transparent);
  white-space: nowrap;
}

.restored-banner .li-rule {
  display: block;
  width: 160px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--gold)), transparent);
  animation: ruleIn 1s 0.2s var(--ease-out) both;
}

.restored-banner .rb-sub {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--ink-2);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
}

.restored-banner.out {
  animation: fadeOut 0.7s ease-in forwards;
}

.recap.unlock.restored {
  border-color: #ffd98a99;
  background: linear-gradient(90deg, #e3b45624, #e3b4560d);
}

.type-grid {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}

.type-grid .tile-btn {
  padding: 12px 6px 10px;
}

.type-grid .tile-btn .t {
  font-size: 12.5px;
  text-align: center;
}

@media (max-width: 480px) {
  .type-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .type-grid .tile-btn svg {
    width: 22px;
    height: 22px;
  }
}

.news-pill {
  pointer-events: auto;
  margin: 14px auto 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  border: 1px solid rgba(98, 234, 219, 0.4);
  box-shadow: 0 0 22px #62eadb26;
  animation: fadeIn 0.8s 1.4s both;
}

.news-pill svg {
  width: 15px;
  height: 15px;
  color: var(--teal);
}

.news-pill:hover {
  border-color: #62eadbcc;
}

.news .news-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.news .news-item:last-of-type {
  border-bottom: 0;
}

.news .ni {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #e3b4561f;
  color: var(--gold-2);
  flex: none;
}

.news .ni svg {
  width: 20px;
  height: 20px;
}

.news .nt {
  flex: 1;
  min-width: 0;
}

.news .nt b {
  display: block;
  font-size: 14.5px;
}

.news .nt small {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.4;
  margin-top: 2px;
}

.news .news-item .btn {
  padding: 7px 14px;
  font-size: 13px;
  flex: none;
}

.news {
  text-align: center;
}

@media (max-width: 480px) {
  .news-pill span {
    font-size: 11px;
  }
}

.pad > .key {
  min-width: 0;
}

@media (max-aspect-ratio: 1/1) {
  .controls.is3d {
    gap: 6px;
  }

  .controls.is3d .lens {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "head head" "grid strip";
    gap: 6px 10px;
    align-items: center;
  }

  .controls.is3d .lens-head {
    grid-area: head;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
  }

  .controls.is3d .lens-grid {
    grid-area: grid;
    width: auto;
    height: min(24vh, 62vw);
    max-width: none;
    justify-self: center;
    padding: 5px;
    gap: 3px;
  }

  .controls.is3d .lens-strip {
    grid-area: strip;
    display: grid;
    grid-template-columns: auto;
    gap: 4px;
    align-content: center;
  }

  .controls.is3d .lens-strip[data-n="5"],
  .controls.is3d .lens-strip[data-n="6"] {
    grid-template-columns: auto auto;
  }

  .controls.is3d .lens-tabs .seg {
    padding: 6px 10px;
    font-size: 12px;
  }

  .controls.is3d .cube-mini-bar .seg.icon {
    width: 30px;
    height: 30px;
  }

  .controls.is3d .cube-mini-bar .seg.icon svg {
    width: 16px;
    height: 16px;
  }

  .controls.is3d .lc .lv {
    font-size: clamp(16px, 3.6vh, 26px);
  }

  .controls.is3d .tools .tool {
    padding: 3px 4px;
  }

  .controls.is3d .tools .tool svg {
    width: 21px;
    height: 21px;
  }

  .controls.is3d .pad.n9 .key {
    aspect-ratio: 0.8;
    max-height: 52px;
    border-radius: 11px;
  }

  .controls.is3d .pad.n9 .key .d {
    font-size: clamp(18px, 5vw, 24px);
  }

  .controls.is3d .pad.n9 {
    gap: 5px;
  }
}

@media (max-aspect-ratio: 1/1) and (max-width: 380px) {
  .controls.is3d .lens-tabs .seg {
    padding: 5px 8px;
    font-size: 11.5px;
  }

  .controls.is3d .cube-mini-bar {
    gap: 3px;
  }

  .controls.is3d .cube-mini-bar .seg.icon {
    width: 28px;
    height: 28px;
  }
}

@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .game {
    padding-top: calc(6px + var(--safe-t));
    padding-bottom: calc(6px + var(--safe-b));
    gap: 6px;
  }

  .hud-top .icon-btn {
    width: 38px;
    height: 38px;
  }

  .game-body {
    gap: 10px;
  }

  .controls {
    gap: 6px;
  }

  .tools .tool {
    padding: 4px;
  }

  .tools .tool span {
    display: none;
  }

  .key {
    aspect-ratio: auto;
    height: min(19vh, 80px);
    max-height: none;
  }

  .key .left {
    margin-top: 1px;
  }

  .controls.is3d .lens {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "head head" "grid strip";
    gap: 5px 8px;
    align-items: center;
  }

  .controls.is3d .lens-head {
    grid-area: head;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .controls.is3d .lens-grid {
    grid-area: grid;
    width: auto;
    height: min(40vh, 190px);
    max-width: none;
    justify-self: center;
    padding: 4px;
    gap: 3px;
  }

  .controls.is3d .lens-strip {
    grid-area: strip;
    display: grid;
    grid-template-columns: auto;
    gap: 3px;
    align-content: center;
  }

  .controls.is3d .lens-strip[data-n="5"],
  .controls.is3d .lens-strip[data-n="6"] {
    grid-template-columns: auto auto;
  }

  .controls.is3d .lens-tabs .seg {
    padding: 5px 9px;
    font-size: 11.5px;
  }

  .controls.is3d .cube-mini-bar .seg.icon {
    width: 28px;
    height: 28px;
  }

  .controls.is3d .lc .lv {
    font-size: clamp(14px, 5vh, 24px);
  }

  .controls.is3d .pad.n9 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .controls.is3d .key {
    aspect-ratio: auto;
    height: min(10.5vh, 44px);
    max-height: none;
  }

  .controls.is3d .key .d {
    font-size: 18px;
  }

  .controls.is3d .key .left {
    display: none;
  }
}

@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .controls.is3d .key {
    height: min(10vh, 40px);
  }

  .coach {
    top: calc(52px + var(--safe-t));
    padding: 10px 12px;
  }

  .coach .ct {
    font-size: 13px;
  }
}

@media (min-aspect-ratio: 1/1) and (min-width: 760px) {
  .game .coach {
    left: calc((100% - min(38vw, 420px)) / 2);
    width: min(52vw, 460px);
  }
}

@media (max-aspect-ratio: 1/1) and (max-height: 700px) {
  .game #board-slot {
    min-height: 110px;
  }

  .controls.is3d .tools .tool span {
    display: none;
  }

  .controls.is3d .lens-grid {
    height: min(21vh, 58vw);
  }

  .controls.is3d .pad.n9 .key {
    max-height: 44px;
  }

  .coach {
    padding: 10px 12px;
  }

  .coach .ct {
    font-size: 13px;
  }
}

.ln i {
  font-size: clamp(10px, 2.1vh, 16px);
  font-weight: 700;
}

.lens-grid .ln {
  inset: 6%;
}

.key .left {
  font-size: 11px;
}

.pause-theme {
  margin-top: 12px;
  text-align: left;
}

.pause-theme .k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0 0 6px 2px;
}

.theme-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-swatch {
  appearance: none;
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #ffffff0a;
  border-radius: 12px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--ink-3);
  transition:
    border-color 0.2s,
    transform 0.2s var(--ease-spring);
}

.theme-swatch:hover {
  transform: translateY(-2px);
}

.theme-swatch.on {
  border-color: #e3b456cc;
  color: var(--gold-2);
  box-shadow: 0 0 0 1px #e3b45659;
}

.theme-swatch .ts-art svg {
  width: 46px;
  height: 46px;
  display: block;
  border-radius: 8px;
}

.theme-swatch .ts-name {
  font-size: 10.5px;
  font-weight: 600;
}

.science.credits {
  margin-top: 10px;
}

.science.credits a {
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 2px;
}

.now-playing {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}

.dg {
  --t-gold: #f2c75c;
  --t-teal: #4fe3d0;
  --t-coral: #ff7a59;
  --t-violet: #b59cff;
  --t-blue: #6fb6ff;
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  aspect-ratio: 1;
}

.dg-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  font-family: var(--font);
}

.dg.cropped .dg-svg {
  overflow: hidden;
  border-radius: 10px;
}

.dg.tappable .dg-svg {
  cursor: pointer;
  touch-action: manipulation;
}

.dg-slab {
  fill: #0b1020;
  stroke: #d2a650bf;
  stroke-width: 1.6;
}

.dg-cell {
  fill: var(--lens-tile, #1a2240);
  transition:
    fill 0.35s,
    opacity 0.35s;
}

.dg-cell.given {
  fill: var(--lens-given, #e6dfcc);
}

.dg-cell.dim {
  opacity: 0.3;
}

.dg-box {
  stroke: #d2a650d9;
  stroke-width: 1.5;
}

.dg-digit {
  font-size: 25px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
  transition: opacity 0.35s;
}

.dg-digit.given {
  fill: var(--lens-ink, #161c33);
}

.dg-digit.player {
  fill: var(--lens-player, #6ff0df);
}

.dg-digit.dim {
  opacity: 0.22;
}

.dg-digit.ghost {
  fill: var(--t-teal);
  opacity: 0.4;
}

.dg-digit.q {
  fill: var(--t-gold);
  font-weight: 700;
}

.dg-digit.gold {
  fill: var(--t-gold);
}

.dg-digit.teal {
  fill: var(--t-teal);
}

.dg-digit.coral {
  fill: var(--t-coral);
}

.dg-digit.blue {
  fill: var(--t-blue);
}

.dg-digit.given.gold {
  fill: #8a5a06;
}

.dg-digit.given.coral {
  fill: #b8321c;
}

.dg-digit.given.teal {
  fill: #0a6a60;
}

.dg-digit.given.violet {
  fill: #5b3cc4;
}

.dg-digit.given.blue {
  fill: #1c5aa6;
}

.dg-cand {
  font-size: 11.5px;
  font-weight: 600;
  fill: #b4c0e2;
  text-anchor: middle;
  dominant-baseline: central;
  transition: opacity 0.35s;
}

.n4 .dg-cand,
.n6 .dg-cand {
  font-size: 12.5px;
}

.dg-cand.dim {
  opacity: 0.13;
}

.dg-cand.solo {
  fill: #e3eaff;
  font-size: 19px;
  font-weight: 500;
}

.dg-cand.solo.dim {
  opacity: 0.16;
}

.dg-cand.gone {
  opacity: 0.35;
  transition: opacity 0.4s 0.5s;
}

.dg-tone {
  fill-opacity: 0.3;
}

.dg-tone.gold {
  fill: var(--t-gold);
}

.dg-tone.teal {
  fill: var(--t-teal);
}

.dg-tone.coral {
  fill: var(--t-coral);
}

.dg-tone.violet {
  fill: var(--t-violet);
}

.dg-tone.blue {
  fill: var(--t-blue);
}

.dg-house .fill {
  fill-opacity: 0.13;
}

.dg-house .edge {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.dg-house.gold .fill {
  fill: var(--t-gold);
}

.dg-house.gold .edge {
  stroke: var(--t-gold);
}

.dg-house.teal .fill {
  fill: var(--t-teal);
}

.dg-house.teal .edge {
  stroke: var(--t-teal);
}

.dg-house.coral .fill {
  fill: var(--t-coral);
}

.dg-house.coral .edge {
  stroke: var(--t-coral);
  stroke-dasharray: 5 3;
}

.dg-house.violet .fill {
  fill: var(--t-violet);
}

.dg-house.violet .edge {
  stroke: var(--t-violet);
  stroke-dasharray: 6 3;
}

.dg-house.blue .fill {
  fill: var(--t-blue);
}

.dg-house.blue .edge {
  stroke: var(--t-blue);
}

.dg-cage .edge {
  fill: none;
  stroke: #eef1fa9e;
  stroke-width: 1.1;
  stroke-dasharray: 3 2.4;
}

.dg-cage .sum {
  font-size: 9.5px;
  font-weight: 700;
  fill: #eef1fa;
}

.dg-cage.hot .edge {
  stroke: var(--t-gold);
  stroke-width: 2;
  stroke-dasharray: 4 2.4;
}

.dg-cage.hot .sum {
  fill: var(--t-gold);
  font-size: 11px;
}

.dg-ray {
  stroke-width: 3.2;
  stroke-linecap: round;
  opacity: 0.9;
}

.dg-ray.gold {
  stroke: var(--t-gold);
}

.dg-ray.coral {
  stroke: var(--t-coral);
}

.dg-ray.teal {
  stroke: var(--t-teal);
}

.dg-ray.violet {
  stroke: var(--t-violet);
}

.dg-ray.blue {
  stroke: var(--t-blue);
}

.dg-outline {
  fill: none;
  stroke-width: 2.4;
}

.dg-outline.gold {
  stroke: var(--t-gold);
}

.dg-outline.teal {
  stroke: var(--t-teal);
}

.dg-outline.blue {
  stroke: var(--t-blue);
}

.dg-outline.violet {
  stroke: var(--t-violet);
}

.dg-outline.coral {
  stroke: var(--t-coral);
}

.dg-picked {
  fill: #6fb6ff2e;
  stroke: var(--t-blue);
  stroke-width: 2.4;
}

.dg-x line {
  stroke: var(--t-coral);
  stroke-width: 2.6;
  stroke-linecap: round;
}

.dg-disc {
  fill-opacity: 0.85;
}

.dg-disc.blue {
  fill: #2f6fc4;
}

.dg-disc.violet {
  fill: #6a4fc9;
}

.dg-disc.teal {
  fill: #138f83;
}

.dg-disc.gold {
  fill: #9b7414;
}

.dg-ring {
  fill: none;
  stroke-width: 1.9;
}

.dg-ring.gold {
  stroke: var(--t-gold);
}

.dg-ring.teal {
  stroke: var(--t-teal);
}

.dg-ring.violet {
  stroke: var(--t-violet);
}

.dg-ring.blue {
  stroke: var(--t-blue);
}

.dg-ring.coral {
  stroke: var(--t-coral);
}

.dg-strike .halo {
  fill: none;
  stroke: var(--t-coral);
  stroke-width: 1.6;
}

.dg-strike line {
  stroke: var(--t-coral);
  stroke-width: 2.1;
  stroke-linecap: round;
}

.dg-link {
  stroke-linecap: round;
}

.dg-link.strong {
  stroke: #eef1fa;
  stroke-width: 2.4;
}

.dg-link.weak {
  stroke: #eef1fa;
  stroke-width: 1.4;
  stroke-dasharray: 3.5 3;
  opacity: 0.85;
}

.dg-label rect {
  fill: #090c18f0;
  stroke-width: 1.2;
}

.dg-label text {
  font-size: 10.5px;
  font-weight: 650;
  text-anchor: middle;
  dominant-baseline: central;
}

.dg-label.gold rect {
  stroke: var(--t-gold);
}

.dg-label.gold text {
  fill: var(--t-gold);
}

.dg-label.teal rect {
  stroke: var(--t-teal);
}

.dg-label.teal text {
  fill: var(--t-teal);
}

.dg-label.coral rect {
  stroke: var(--t-coral);
}

.dg-label.coral text {
  fill: var(--t-coral);
}

.dg-label.violet rect {
  stroke: var(--t-violet);
}

.dg-label.violet text {
  fill: var(--t-violet);
}

.dg-label.blue rect {
  stroke: var(--t-blue);
}

.dg-label.blue text {
  fill: var(--t-blue);
}

.dg-flash {
  fill-opacity: 0;
  animation: dgFlash 0.9s ease-out both;
}

.dg-flash.good {
  fill: var(--t-teal);
}

.dg-flash.bad {
  fill: var(--t-coral);
}

@keyframes dgFlash {
  0% {
    fill-opacity: 0.6;
  }

  to {
    fill-opacity: 0;
  }
}

.dg .in {
  transform-box: fill-box;
  transform-origin: center;
  animation: dgIn 0.42s var(--ease-out) both;
}

.dg .dg-digit.in {
  animation: dgPop 0.5s var(--ease-spring) both;
}

.dg .dg-ray.in,
.dg .dg-link.strong.in {
  stroke-dasharray: var(--len);
  animation: dgDraw 0.55s var(--ease-out) both;
}

.dg .dg-link.weak.in,
.dg .dg-house.in {
  animation: dgFade 0.45s var(--ease-out) both;
}

@keyframes dgIn {
  0% {
    opacity: 0;
    transform: scale(0.55);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes dgPop {
  0% {
    opacity: 0;
    transform: translateY(-14px) scale(0.6);
  }

  70% {
    opacity: 1;
    transform: scale(1.14);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes dgDraw {
  0% {
    stroke-dashoffset: var(--len);
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes dgFade {
  0% {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.lesson {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse 90% 70% at 50% 30%, #0e142ae6, #04060ef5);
  backdrop-filter: blur(16px) saturate(0.9);
  -webkit-backdrop-filter: blur(16px) saturate(0.9);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.28s var(--ease-out);
  padding: 0 0 var(--safe-b);
}

.lesson.shown {
  opacity: 1;
}

.lesson.leaving {
  opacity: 0;
}

.ls-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + var(--safe-t)) 14px 6px;
  flex: none;
}

.ls-head .icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: none;
}

.ls-title {
  min-width: 0;
  flex: 1;
}

.ls-title .n {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ls-title .a {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ls-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
}

.ls-dots .lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0 2px 0 6px;
}

.ls-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff24;
  transition:
    background 0.3s,
    transform 0.3s;
}

.ls-dots .dot.done {
  background: var(--teal);
}

.ls-dots .dot.on {
  background: var(--gold);
  transform: scale(1.3);
}

.ls-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 16px 12px;
}

.ls-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
}

.ls-board {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  min-height: 0;
}

.ls-board .dg {
  width: min(100%, 100cqh);
  max-width: 470px;
  max-height: 100%;
}

.ls-stage {
  container-type: size;
}

.ls-empty {
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  color: var(--ink-4);
}

.ls-empty svg {
  width: 64px;
  height: 64px;
}

.ls-replay {
  position: absolute;
  right: 2px;
  bottom: -4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  background: #090c18cc;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  cursor: pointer;
}

.ls-replay svg {
  width: 14px;
  height: 14px;
}

.ls-replay[hidden] {
  display: none;
}

.ls-sheet {
  flex: none;
  border-radius: 22px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 30%;
  max-height: 52%;
  overflow-y: auto;
  box-shadow: 0 -6px 30px #00000040;
}

.ls-sheet.good {
  border-color: #4fe3d059;
}

.ls-count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.ls-text {
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
}

.ls-text b {
  color: #fff;
  font-weight: 650;
}

.ls-text .ok {
  color: var(--teal);
  font-weight: 700;
}

.ls-text .soft {
  color: #ffb49e;
  font-weight: 650;
}

.ls-text .muted {
  color: var(--ink-3);
}

.ls-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
}

.ls-actions .btn {
  min-height: 48px;
}

.ls-actions .btn.primary {
  flex: 1;
}

.ls-actions .btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.ls-actions .btn.auto {
  position: relative;
  overflow: hidden;
}

.ls-actions .btn.auto:after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: #20170a73;
  transform-origin: left;
  animation: lsAuto 1.5s linear both;
}

@keyframes lsAuto {
  0% {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.ls-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 6px;
  cursor: pointer;
}

.ls-back svg {
  width: 16px;
  height: 16px;
}

.ls-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ls-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.lg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lg {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 12px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 3px;
}

.lg.house {
  background: #6fb6ff2e;
  border: 1.5px solid #6fb6ff;
}

.lg.beam {
  height: 3px;
  background: #f2c75c;
  border-radius: 2px;
}

.lg.x {
  color: #ff7a59;
}

.lg.disc {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2f6fc4;
}

.lg.link {
  height: 2px;
  background: #eef1fa;
}

.lg.strike {
  color: #ff7a59;
}

.lg.place {
  color: #4fe3d0;
}

.ls-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ls-chip {
  text-align: left;
  font-size: 15px;
  line-height: 1.35;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: #ffffff0a;
  color: var(--ink);
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.ls-chip:hover {
  background: #ffffff14;
}

.ls-chip.good {
  border-color: #4fe3d0b3;
  background: #4fe3d01f;
}

.ls-chip.bad {
  border-color: #ff7a59b3;
  background: #ff7a591a;
}

.ls-chip[disabled] {
  cursor: default;
}

.ls-pad {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
}

.ls-pad button {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: #ffffff0f;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
}

.ls-pad button:active {
  transform: scale(0.95);
}

.ls-tools {
  display: flex;
  justify-content: flex-start;
}

.ls-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
}

.ls-hint svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.ls-stars {
  display: flex;
  gap: 6px;
}

.ls-stars span {
  width: 30px;
  height: 30px;
  color: var(--ink-4);
}

.ls-stars span.on {
  color: var(--gold-2);
  filter: drop-shadow(0 0 8px rgba(246, 217, 143, 0.5));
}

.ls-short {
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff0d;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  font-size: 15.5px;
}

.ls-short .k {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
}

@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .ls-main {
    flex-direction: row;
    align-items: stretch;
    gap: 22px;
    padding: 10px 28px 24px;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
  }

  .ls-stage {
    flex: 1.15 1 0;
  }

  .ls-sheet {
    flex: 0.85 1 0;
    max-height: none;
    min-height: 0;
    align-self: center;
    max-width: 440px;
    padding: 22px;
  }

  .ls-board .dg {
    max-width: 620px;
  }

  .ls-text {
    font-size: 18px;
  }
}

@media (max-width: 420px) {
  .ls-dots .lbl {
    display: none;
  }

  .ls-dots {
    gap: 4px;
  }

  .ls-dots .dot {
    width: 7px;
    height: 7px;
  }

  .ls-text {
    font-size: 16px;
  }

  .ls-pad {
    gap: 4px;
  }

  .ls-pad button {
    min-height: 44px;
    font-size: 18px;
  }
}

.ac-next {
  pointer-events: auto;
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border-radius: 24px;
  margin: 6px 0 12px;
  cursor: pointer;
  border-color: #f6d98f47;
}

.ac-next .ac-art .dg {
  max-width: 190px;
}

.ac-next .ac-art {
  min-height: 120px;
  display: grid;
  place-items: center;
}

.ac-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ac-k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.ac-n {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ac-d {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.45;
}

.ac-next .btn {
  align-self: flex-start;
  margin-top: 6px;
}

.ac-mix {
  pointer-events: auto;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 22px;
  margin-bottom: 8px;
  cursor: pointer;
}

.ac-mix .ic {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: #ffffff0f;
  flex: none;
  color: var(--teal);
}

.ac-mix .ic svg {
  width: 24px;
  height: 24px;
}

.ac-mix.due {
  border-color: #f6d98f59;
}

.ac-mix.due .ic {
  color: var(--gold-2);
}

.ac-mix .ac-n {
  font-size: 17px;
}

.ac-mix .ac-d {
  font-size: 13px;
}

.ac-mix > .btn {
  flex: none;
}

.ac-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--ink-3);
  margin: 14px 4px 0;
}

.ac-legend span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ac-legend svg {
  width: 12px;
  height: 12px;
  color: var(--gold-2);
}

.ac-legend b {
  color: var(--ink-2);
  margin: 0 4px 0 5px;
  font-weight: 650;
}

.sec-count {
  float: right;
  letter-spacing: 0.05em;
  color: var(--ink-4);
}

.tech-card .tc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}

.tech-card .stars {
  display: flex;
  gap: 2px;
  color: var(--ink-4);
}

.tech-card .stars svg {
  width: 15px;
  height: 15px;
}

.tech-card.learned .stars,
.tech-card.fluent .stars,
.tech-card.mastered .stars {
  color: var(--gold-2);
}

.tech-card .ta {
  font-size: 12px;
  color: var(--ink-4);
  margin-top: -4px;
}

.tech-card.next {
  border-color: #f6d98f66;
}

.tech-card .chip {
  font-size: 10.5px;
  padding: 3px 8px;
}

.mix-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.mix-row .st {
  color: var(--gold-2);
  letter-spacing: 1px;
}

.mix-row .muted {
  grid-column: 1 / -1;
  font-size: 13px;
}

@media (max-width: 560px) {
  .ac-next {
    grid-template-columns: 1fr;
  }

  .ac-next .ac-art {
    display: none;
  }
}

.hint-card .h-learn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-2);
  background: #ffffff0d;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
}

.hint-card .h-learn svg {
  width: 13px;
  height: 13px;
  color: var(--gold-2);
}

.hint-card .h-learn.new {
  color: #20170a;
  background: linear-gradient(180deg, #f6d68a, #d9a444);
  border-color: #ffe296b3;
}

.hint-card .h-learn.new svg {
  color: #20170a;
}

.lvl-intro.with-lesson {
  cursor: default;
}

.lvl-intro .li-teach.learn {
  align-items: flex-start;
  text-align: left;
  max-width: 360px;
}

.lvl-intro .li-teach.learn svg {
  margin-top: 2px;
  flex: none;
}

.lvl-intro .li-teach small {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-3);
  margin-top: 4px;
}

.lvl-intro .li-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
  animation: rise 0.5s 0.4s var(--ease-out) both;
}

.lvl-intro .li-actions .btn {
  flex: 1;
  min-height: 46px;
  padding: 10px 14px;
}

.lvl-intro .li-actions .btn.primary {
  flex: 1.4;
}

.lesson.basics .ls-skip {
  margin-left: 4px;
  background: none;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.lesson.basics .ls-board .dg {
  max-width: 360px;
}

.lesson.basics .n4 .dg-digit {
  font-size: 22px;
}

.ls-pad.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ls-pad.four button {
  min-height: 58px;
  font-size: 24px;
}

.lvl-intro .li-actions .btn.primary {
  flex-direction: column;
  gap: 0;
  line-height: 1.15;
}

.lvl-intro .li-actions .btn .mins {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.7;
  letter-spacing: 0.04em;
}

:where(html, body, #ui, #ui *) {
  touch-action: manipulation;
}

@media (pointer: coarse) {
  #grain {
    display: none;
  }

  .glass,
  .tile-btn,
  .key,
  .modal-back.pause-back,
  .lesson {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .glass {
    background: #0d1225e6;
  }

  .tile-btn {
    background: #0d1225e0;
  }

  .key {
    background: linear-gradient(180deg, #263058f2, #131930f7);
  }

  .modal-back.pause-back {
    background: #04060edb;
  }

  .lesson {
    background: radial-gradient(ellipse 90% 70% at 50% 30%, #0f152b, #05070f);
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

.sound-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sp-row {
  display: grid;
  grid-template-columns: 22px 64px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.sp-row.mute {
  grid-template-columns: 22px auto 1fr auto;
}

.sp-row.solve {
  grid-template-columns: 22px auto minmax(0, 1fr);
}

.sp-row.solve .seg-group {
  justify-self: end;
  flex-wrap: nowrap;
}

.sp-row.solve .seg {
  padding: 6px 11px;
  font-size: 12px;
}

.sp-ic {
  width: 20px;
  height: 20px;
  color: var(--gold-2);
  display: grid;
  place-items: center;
}

.sp-ic svg {
  width: 19px;
  height: 19px;
}

.sp-l {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.sp-val {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sound-panel input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 30px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}

.sound-panel input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    var(--gold) 0 var(--p, 50%),
    rgba(255, 255, 255, 0.14) var(--p, 50%) 100%
  );
}

.sound-panel input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #ffffff24;
}

.sound-panel input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--gold);
}

.sound-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-top: -8px;
  background: #f6e2b0;
  border: 2px solid #20170a;
  box-shadow: 0 2px 8px #0006;
}

.sound-panel input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f6e2b0;
  border: 2px solid #20170a;
}

.sp-note {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-4);
  margin-top: 4px;
}

.sound-pop {
  position: absolute;
  z-index: 25;
  top: calc(64px + var(--safe-t));
  right: max(12px, var(--safe-r));
  width: min(92vw, 340px);
  border-radius: 18px;
  padding: 12px 14px;
  animation: rise 0.25s var(--ease-out);
}

.icon-btn.sound-btn.on {
  background: #e3b4562e;
  border-color: #f6d98f80;
  color: var(--gold-2);
}

.pause-sound {
  margin-top: 12px;
  text-align: left;
  padding: 10px 14px 8px;
  border-radius: 16px;
  background: #ffffff0a;
  border: 1px solid var(--line);
}

.pause-sound .k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0 0 4px;
}

.pause-sound .sp-note {
  display: none;
}

.sound-pop {
  background: #0b0f1ff7;
  box-shadow: 0 18px 50px #0000008c;
}
