:root {
  color-scheme: dark;
  --ink-950: #030a12;
  --ink-900: #06111e;
  --ink-850: #091725;
  --ink-800: #0d1d2c;
  --ink-700: #15293a;
  --ivory: #f1ead9;
  --ivory-muted: #a9adad;
  --gold: #c8a766;
  --gold-bright: #e7cd8f;
  --gold-dim: #75633f;
  --cyan: #63d9e8;
  --cyan-soft: #99edf1;
  --danger: #dc7665;
  --line: rgba(209, 185, 125, 0.18);
  --line-soft: rgba(255, 255, 255, 0.08);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  --topbar-height: 76px;
  --toast-height: 52px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--ink-950);
}

body {
  min-width: 320px;
  color: var(--ivory);
  font-family: var(--sans);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.app-shell {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 36%, rgba(34, 103, 121, 0.16), transparent 30%),
    radial-gradient(circle at 14% 18%, rgba(111, 84, 40, 0.09), transparent 24%),
    linear-gradient(155deg, #071523 0%, #040d17 52%, #07111c 100%);
}

.app-shell::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  opacity: 0.2;
  background-image:
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.7) 0 0.65px, transparent 0.8px),
    radial-gradient(circle at 68% 33%, rgba(111, 218, 231, 0.7) 0 0.6px, transparent 0.8px),
    radial-gradient(circle at 82% 76%, rgba(255, 255, 255, 0.65) 0 0.55px, transparent 0.75px),
    radial-gradient(circle at 35% 84%, rgba(228, 195, 124, 0.6) 0 0.6px, transparent 0.8px);
  background-size: 173px 149px, 211px 189px, 137px 193px, 229px 167px;
}

.app-shell::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

body.menu-open,
body.community-open {
  overflow: hidden;
}

body.boot-blocked {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.start-menu {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100dvh;
  min-height: 100svh;
  padding:
    max(22px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(39, 137, 153, 0.16), transparent 25%),
    radial-gradient(circle at 50% 58%, rgba(176, 132, 57, 0.055), transparent 35%),
    linear-gradient(155deg, rgba(7, 21, 35, 0.995) 0%, rgba(3, 10, 18, 0.995) 52%, rgba(6, 17, 29, 0.995) 100%);
  pointer-events: none;
  transition: opacity 280ms ease, visibility 280ms;
  overscroll-behavior: contain;
}

.start-menu.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.start-menu.closing {
  visibility: visible;
  opacity: 0;
}

.orientation-guard {
  display: none;
}

.orientation-device {
  position: relative;
  width: 46px;
  height: 78px;
  border: 1px solid rgba(231, 205, 143, 0.7);
  border-radius: 8px;
  box-shadow: inset 0 0 20px rgba(99, 217, 232, 0.06), 0 0 26px rgba(99, 217, 232, 0.08);
}

.orientation-device::before {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 13px;
  height: 2px;
  content: "";
  transform: translateX(-50%);
  border-radius: 2px;
  background: rgba(231, 205, 143, 0.55);
}

.orientation-device i {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  height: 1px;
  background: rgba(99, 217, 232, 0.42);
}

.orientation-mark {
  width: 42px;
  height: 42px;
  margin-top: -11px;
}

.orientation-guard h2 {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 400;
}

.orientation-guard p {
  max-width: 330px;
  margin: 0;
  color: #8c9ba3;
  font-size: 11px;
  line-height: 1.5;
}

.start-menu::before,
.start-menu::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.start-menu::before {
  inset: 0;
  opacity: 0.22;
  background-image:
    radial-gradient(circle at 8% 16%, rgba(255, 255, 255, 0.78) 0 0.6px, transparent 0.8px),
    radial-gradient(circle at 66% 28%, rgba(99, 217, 232, 0.72) 0 0.55px, transparent 0.8px),
    radial-gradient(circle at 88% 72%, rgba(231, 205, 143, 0.7) 0 0.6px, transparent 0.8px),
    radial-gradient(circle at 31% 82%, rgba(255, 255, 255, 0.68) 0 0.55px, transparent 0.8px);
  background-size: 197px 163px, 223px 191px, 149px 207px, 251px 179px;
}

.start-menu::after {
  top: 50%;
  left: 50%;
  width: min(86vw, 820px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, transparent 53%, rgba(99, 217, 232, 0.018) 54%, transparent 69%);
  box-shadow: inset 0 0 90px rgba(99, 217, 232, 0.025);
}

.start-menu-atmosphere {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.start-menu-atmosphere i {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  transform: translate(-50%, -50%);
  opacity: 0.54;
}

.start-menu-atmosphere i:nth-child(1) {
  width: min(72vw, 680px);
  aspect-ratio: 1;
  border: 1px solid rgba(200, 167, 102, 0.12);
  border-radius: 50%;
}

.start-menu-atmosphere i:nth-child(2) {
  width: min(58vw, 540px);
  aspect-ratio: 1;
  border: 1px dashed rgba(200, 167, 102, 0.14);
  border-radius: 50%;
  animation: start-menu-orbit 48s linear infinite;
}

.start-menu-atmosphere i:nth-child(3) {
  width: min(90vw, 880px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 167, 102, 0.15), transparent);
}

.start-menu-atmosphere i:nth-child(4) {
  width: 1px;
  height: min(88vh, 820px);
  background: linear-gradient(180deg, transparent, rgba(99, 217, 232, 0.09), transparent);
}

.start-menu-content {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(100%, 430px);
  align-content: center;
  justify-items: center;
  gap: clamp(27px, 4.5vh, 44px);
  margin: auto;
}

.start-menu-brand {
  display: grid;
  justify-items: center;
  text-align: center;
}

.brand-mark.start-menu-mark {
  width: clamp(72px, 7vw, 88px);
  height: clamp(72px, 7vw, 88px);
  margin-bottom: 25px;
  border-color: rgba(231, 205, 143, 0.78);
  box-shadow:
    inset 0 0 34px rgba(196, 160, 85, 0.17),
    0 0 50px rgba(48, 174, 193, 0.1);
  animation: start-menu-core 4.8s ease-in-out infinite;
}

.brand-mark.start-menu-mark::before {
  inset: 8px;
  border-color: rgba(200, 167, 102, 0.34);
}

.brand-mark.start-menu-mark::after {
  inset: 19px;
  border-color: rgba(200, 167, 102, 0.3);
}

.brand-mark.start-menu-mark span {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 20px var(--cyan), 0 0 42px rgba(99, 217, 232, 0.42);
}

.start-menu-brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 5.8vw, 70px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
}

.start-menu-brand p {
  margin: 12px 0 0;
  color: #84939b;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.start-menu-actions {
  display: grid;
  width: 100%;
  gap: 10px;
}

.start-menu-action {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 62px;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 12px;
  border: 1px solid rgba(200, 167, 102, 0.22);
  border-radius: 2px;
  background: rgba(6, 19, 30, 0.78);
  box-shadow: inset 0 0 28px rgba(200, 167, 102, 0.025);
  text-align: left;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms var(--ease-out);
}

.start-menu-action:hover {
  transform: translateY(-1px);
  border-color: rgba(231, 205, 143, 0.5);
  background: rgba(11, 29, 42, 0.9);
}

.start-menu-action-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  transform: rotate(45deg);
  border: 1px solid rgba(200, 167, 102, 0.34);
  color: var(--gold-bright);
  background: rgba(8, 24, 36, 0.68);
}

.start-menu-action-icon .icon {
  width: 17px;
  height: 17px;
  transform: rotate(-45deg);
}

.start-menu-action-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.start-menu-action-copy strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.start-menu-action-copy small {
  overflow: hidden;
  color: #81919a;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.start-menu-play {
  border-color: rgba(231, 205, 143, 0.58);
  background:
    linear-gradient(110deg, rgba(147, 112, 46, 0.2), rgba(8, 25, 38, 0.88) 58%),
    rgba(7, 20, 31, 0.9);
  box-shadow: inset 0 0 34px rgba(231, 205, 143, 0.055), 0 12px 36px rgba(0, 0, 0, 0.24);
}

.start-menu-play:hover {
  border-color: rgba(231, 205, 143, 0.86);
  box-shadow: inset 0 0 34px rgba(231, 205, 143, 0.09), 0 15px 40px rgba(0, 0, 0, 0.3);
}

.start-menu-action-arrow {
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 24px;
  transition: transform 180ms var(--ease-out);
}

.start-menu-play:hover .start-menu-action-arrow {
  transform: translateX(3px);
}

.start-menu-guest-note {
  margin: -3px 0 3px;
  color: #667983;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.045em;
  line-height: 1.45;
  text-align: center;
}

.start-menu-login .start-menu-action-icon {
  border-color: rgba(255, 255, 255, 0.15);
  color: #89979f;
}

.start-menu-login em {
  padding: 5px 7px 4px;
  border: 1px solid rgba(200, 167, 102, 0.26);
  color: var(--gold);
  font-size: 7px;
  font-style: normal;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.start-menu-utilities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 3px;
}

.start-menu-utilities button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: #8d9ba3;
  background: transparent;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.start-menu-utilities button:hover {
  border-color: rgba(200, 167, 102, 0.16);
  color: var(--ivory);
  background: rgba(255, 255, 255, 0.025);
}

.start-menu-utilities .icon {
  width: 16px;
  height: 16px;
  color: var(--gold);
}

.start-menu.open .start-menu-brand {
  animation: start-menu-brand-in 520ms 80ms var(--ease-out) both;
}

.start-menu.open .start-menu-action,
.start-menu.open .start-menu-guest-note,
.start-menu.open .start-menu-utilities {
  animation: start-menu-action-in 420ms var(--ease-out) both;
}

.start-menu.open .start-menu-play { animation-delay: 170ms; }
.start-menu.open .start-menu-guest-note { animation-delay: 220ms; }
.start-menu.open .start-menu-login { animation-delay: 260ms; }
.start-menu.open .start-menu-utilities { animation-delay: 320ms; }

@keyframes start-menu-brand-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes start-menu-action-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes start-menu-orbit {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes start-menu-core {
  0%, 100% { transform: rotate(45deg) scale(0.98); filter: brightness(0.94); }
  50% { transform: rotate(45deg) scale(1.025); filter: brightness(1.13); }
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  min-height: calc(var(--topbar-height) + env(safe-area-inset-top));
  padding:
    calc(10px + env(safe-area-inset-top))
    max(clamp(18px, 3vw, 48px), env(safe-area-inset-right))
    10px
    max(clamp(18px, 3vw, 48px), env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(3, 11, 19, 0.66);
  backdrop-filter: blur(20px) saturate(120%);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  transform: rotate(45deg);
  border: 1px solid rgba(231, 205, 143, 0.66);
  box-shadow: inset 0 0 18px rgba(196, 160, 85, 0.14), 0 0 20px rgba(48, 174, 193, 0.08);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(200, 167, 102, 0.25);
}

.brand-mark::before {
  inset: 4px;
}

.brand-mark::after {
  inset: 9px;
}

.brand-mark span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan-soft);
  box-shadow: 0 0 14px var(--cyan);
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.brand-copy small {
  color: #88969f;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.progress-summary {
  display: grid;
  grid-template-columns: auto 112px;
  align-items: center;
  gap: 14px;
  justify-self: center;
}

.progress-copy {
  display: flex;
  align-items: baseline;
  gap: 9px;
  white-space: nowrap;
}

.progress-copy > span {
  color: #85949d;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.progress-copy strong {
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.progress-copy em {
  margin-left: 2px;
  color: #62717b;
  font-family: var(--sans);
  font-size: 10px;
  font-style: normal;
}

.progress-track {
  width: 112px;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.progress-track span {
  display: block;
  width: 1%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
  box-shadow: 0 0 9px rgba(99, 217, 232, 0.8);
  transition: width 500ms var(--ease-out);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
}

.icon-button,
.quiet-button {
  position: relative;
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #9eabb3;
  background: transparent;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.icon-button:hover,
.quiet-button:hover {
  color: var(--ivory);
  background: rgba(255, 255, 255, 0.06);
}

.icon-button:active,
.quiet-button:active {
  transform: scale(0.94);
}

.tutorial-trigger {
  display: inline-flex;
  width: auto;
  min-width: 44px;
  gap: 8px;
  padding: 0 12px;
  border-radius: 2px;
  color: #87969f;
}

.tutorial-trigger span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.action-count {
  position: absolute;
  top: 3px;
  right: 1px;
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border: 1px solid rgba(5, 15, 24, 0.9);
  border-radius: 10px;
  color: #07131e;
  background: var(--gold-bright);
  font-size: 9px;
  font-weight: 750;
}

.game-surface {
  display: grid;
  grid-template-rows: minmax(420px, 1fr) auto;
  min-width: 0;
  min-height: calc(100svh - var(--topbar-height));
}

.workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(240px, 1fr) auto;
  width: min(980px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: clamp(22px, 3vh, 34px) clamp(20px, 5vw, 72px) 14px;
}

.workspace::before {
  position: absolute;
  z-index: -1;
  top: 28%;
  left: 50%;
  width: min(70vw, 680px);
  aspect-ratio: 1;
  content: "";
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(55, 163, 181, 0.08), rgba(11, 33, 49, 0.025) 46%, transparent 70%);
  filter: blur(2px);
  pointer-events: none;
}

.workspace-heading,
.tray-heading,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #788993;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.section-kicker > span:first-child {
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
  background: var(--gold);
  box-shadow: 0 0 8px rgba(200, 167, 102, 0.5);
}

.instruction-block {
  margin: clamp(10px, 2vh, 22px) auto 0;
  text-align: center;
}

.instruction-block h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 4.5vw, 45px);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.instruction-block p {
  margin: 7px 0 0;
  color: #8998a1;
  font-size: 12px;
}

.fusion-zone {
  position: relative;
  display: grid;
  grid-template-columns: minmax(120px, 178px) 94px minmax(120px, 178px);
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.6vw, 32px);
  padding: clamp(16px, 2vh, 28px) 0 12px;
}

.fusion-zone::before {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: min(72vw, 580px);
  height: 1px;
  content: "";
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, rgba(203, 177, 113, 0.12) 24%, rgba(90, 201, 218, 0.18) 50%, rgba(203, 177, 113, 0.12) 76%, transparent);
}

.element-slot-shell {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
}

.element-slot {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  padding: 8px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transition: transform 360ms var(--ease-out), filter 360ms ease;
}

.slot-lock,
.slot-info {
  position: absolute;
  z-index: 4;
  top: -40px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #65767f;
  background: rgba(2, 10, 16, 0.6);
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease-out);
}

[data-slot-shell="a"] .slot-lock {
  right: 2px;
}

[data-slot-shell="b"] .slot-lock {
  left: 2px;
}

[data-slot-shell="a"] .slot-info {
  left: 2px;
}

[data-slot-shell="b"] .slot-info {
  right: 2px;
}

.slot-lock .icon,
.slot-info .icon {
  width: 17px;
  height: 17px;
}

.slot-lock:hover:not(:disabled),
.slot-lock:focus-visible,
.slot-info:hover:not(:disabled),
.slot-info:focus-visible {
  color: var(--ivory);
  background: rgba(8, 24, 33, 0.88);
}

.slot-lock:focus-visible,
.slot-info:focus-visible {
  outline: 1px solid rgba(99, 217, 232, 0.7);
  outline-offset: 2px;
}

.slot-info {
  color: #64848e;
}

.slot-info:hover:not(:disabled),
.slot-info:focus-visible {
  color: var(--cyan-soft);
  box-shadow: 0 0 16px rgba(99, 217, 232, 0.12);
}

.slot-lock[aria-pressed="true"] {
  color: var(--gold-bright);
  background: rgba(43, 35, 20, 0.82);
  box-shadow: 0 0 18px rgba(200, 167, 102, 0.18);
}

.slot-lock:active:not(:disabled),
.slot-info:active:not(:disabled) {
  transform: scale(0.92);
}

.slot-lock:disabled,
.slot-info:disabled {
  opacity: 0.3;
  cursor: default;
}

.slot-info[hidden] {
  display: none;
}

.element-slot-shell.locked .element-slot::before {
  border-color: rgba(200, 167, 102, 0.42);
  box-shadow: inset 0 0 38px rgba(35, 28, 16, 0.58), 0 0 24px rgba(200, 167, 102, 0.08);
}

.element-slot::before,
.element-slot::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  transition: border-color 220ms ease, opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.element-slot::before {
  inset: 8%;
  border: 1px solid rgba(206, 184, 125, 0.28);
  box-shadow: inset 0 0 38px rgba(14, 38, 53, 0.9), 0 0 32px rgba(41, 125, 142, 0.05);
}

.element-slot::after {
  inset: 3%;
  border: 1px dashed rgba(206, 184, 125, 0.11);
}

.element-slot:hover::before,
.element-slot.drop-ready::before {
  border-color: rgba(99, 217, 232, 0.65);
  box-shadow: inset 0 0 38px rgba(18, 62, 75, 0.82), 0 0 24px rgba(99, 217, 232, 0.18);
}

.element-slot.drop-ready::after {
  transform: scale(1.05);
  border-color: rgba(99, 217, 232, 0.38);
}

.slot-empty {
  display: grid;
  justify-items: center;
  gap: 9px;
  color: #647680;
}

.slot-glyph {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(200, 167, 102, 0.26);
  transform: rotate(45deg);
  color: var(--gold-dim);
  font-family: var(--serif);
  font-size: 13px;
}

.slot-glyph::first-letter {
  transform: rotate(-45deg);
}

.slot-empty small {
  max-width: 80px;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.slot-filled {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.slot-filled[hidden] {
  display: none;
}

.slot-filled img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 15px 18px rgba(0, 0, 0, 0.42));
  animation: token-arrive 480ms var(--ease-out) both;
}

.slot-filled strong {
  position: absolute;
  right: 4%;
  bottom: -10px;
  left: 4%;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: clamp(13px, 1.5vw, 17px);
  font-weight: 500;
  text-shadow: 0 2px 8px #000;
}

.element-slot.has-element::before,
.element-slot.has-element::after {
  opacity: 0;
}

.element-slot.has-element:hover {
  transform: translateY(-3px);
}

.meld-control {
  --meld-button-size: 58px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  justify-items: center;
  gap: 15px;
}

.meld-control > small {
  color: #778891;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.meld-button {
  position: relative;
  z-index: 3;
  display: grid;
  width: var(--meld-button-size);
  height: var(--meld-button-size);
  padding: 0;
  place-items: center;
  border: 1px solid rgba(200, 167, 102, 0.4);
  border-radius: 50%;
  color: var(--gold-bright);
  background: radial-gradient(circle at 38% 34%, #273443, #09131e 72%);
  box-shadow: inset 0 0 16px rgba(229, 199, 126, 0.08), 0 9px 22px rgba(0, 0, 0, 0.4);
  transition: transform 200ms ease, color 250ms ease, border-color 250ms ease, box-shadow 250ms ease;
}

.meld-button .icon {
  width: 24px;
  height: 24px;
  transform: translate(-1px, 1px);
}

.meld-button:disabled {
  opacity: 0.32;
  filter: grayscale(0.6);
}

.meld-button:not(:disabled):hover {
  transform: scale(1.08);
  border-color: var(--cyan);
  color: var(--cyan-soft);
  box-shadow: inset 0 0 18px rgba(80, 204, 221, 0.14), 0 0 28px rgba(80, 204, 221, 0.18), 0 9px 22px rgba(0, 0, 0, 0.42);
}

.meld-button:not(:disabled):active {
  transform: scale(0.95);
}

.orbit {
  position: absolute;
  z-index: 1;
  top: calc(var(--meld-button-size) / 2);
  left: 50%;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  pointer-events: none;
  transform-origin: center;
}

.orbit-one {
  border: 1px solid rgba(200, 167, 102, 0.13);
  border-top-color: rgba(200, 167, 102, 0.45);
  transform: translate(-50%, -50%) rotate(24deg);
}

.orbit-two {
  width: 84px;
  height: 84px;
  transform: translate(-50%, -50%) rotate(-35deg);
  border: 1px dashed rgba(99, 217, 232, 0.12);
}

.fusion-zone.ready .orbit-one {
  animation: orbit-spin 5s linear infinite;
  border-top-color: var(--gold-bright);
}

.fusion-zone.ready .orbit-two {
  animation: orbit-spin-reverse 7s linear infinite;
  border-color: rgba(99, 217, 232, 0.25);
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 9px;
  min-height: 44px;
  color: #89979f;
}

.status-line p {
  min-width: 0;
  margin: 0;
  font-size: 11px;
}

.status-mote {
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
  background: #526771;
  transition: background 200ms ease, box-shadow 200ms ease;
}

.status-line.active .status-mote {
  background: var(--cyan);
  box-shadow: 0 0 9px rgba(99, 217, 232, 0.8);
}

.status-line.error {
  color: #d99284;
}

.status-line.error .status-mote {
  background: var(--danger);
  box-shadow: 0 0 9px rgba(220, 118, 101, 0.7);
}

.clear-combination {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  margin-left: 6px;
  padding: 0 8px;
  border: 0;
  color: #9ca8af;
  background: transparent;
  font-size: 10px;
}

.clear-combination[hidden] {
  display: none;
}

.clear-combination .icon {
  width: 15px;
  height: 15px;
}

.known-tray {
  position: relative;
  z-index: 5;
  min-width: 0;
  padding: 17px clamp(20px, 4vw, 52px) max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(4, 13, 22, 0.78);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(22px) saturate(120%);
}

.tray-heading {
  max-width: 1180px;
  margin: 0 auto 11px;
}

.tray-heading h2 {
  margin: 3px 0 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.tray-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: clamp(10px, 1.5vw, 18px);
}

.tray-sort-field {
  position: relative;
  display: flex;
  width: 132px;
  height: 34px;
  align-items: center;
  padding: 0 8px;
  border-bottom: 1px solid rgba(200, 167, 102, 0.24);
  color: #9f895d;
  background: rgba(200, 167, 102, 0.025);
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.tray-sort-field:focus-within,
.tray-sort-field:hover {
  border-color: rgba(99, 217, 232, 0.5);
  color: var(--cyan-soft);
  background: rgba(99, 217, 232, 0.04);
}

.tray-sort-field > .icon:first-child {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
}

.tray-sort-field select {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 16px 0 7px;
  border: 0;
  outline: 0;
  appearance: none;
  color: #aeb9bd;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.tray-sort-field option {
  color: var(--ivory);
  background: #07151f;
  text-transform: none;
}

.tray-sort-chevron {
  position: absolute;
  right: 8px;
  width: 10px;
  height: 10px;
  pointer-events: none;
}

.tray-category-filter {
  position: relative;
  display: flex;
  flex: 0 0 132px;
  width: 132px;
  height: 34px;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid rgba(200, 167, 102, 0.24);
  color: #aeb9bd;
  background: rgba(200, 167, 102, 0.025);
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.tray-category-filter:hover,
.tray-category-filter:focus-visible,
.tray-category-filter.active {
  border-color: rgba(99, 217, 232, 0.5);
  color: var(--cyan-soft);
  background: rgba(99, 217, 232, 0.04);
}

.tray-category-filter:focus-visible {
  outline: 1px solid rgba(99, 217, 232, 0.42);
  outline-offset: 2px;
}

.tray-category-filter > .icon:first-child {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  color: #9f895d;
}

.tray-category-filter span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tray-category-chevron {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-left: auto;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  color: #a8b2b8;
  background: transparent;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.text-button:hover {
  color: var(--cyan-soft);
}

.text-button .icon {
  width: 17px;
  height: 17px;
}

.text-button em {
  padding: 2px 6px;
  border: 1px solid rgba(200, 167, 102, 0.22);
  color: var(--gold);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.08em;
}

.quickbar-shell {
  position: relative;
  max-width: 1256px;
  margin: 0 auto;
  padding: 0 38px;
}

.quickbar-shell::before,
.quickbar-shell::after {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 42px;
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.quickbar-shell::before {
  left: 38px;
  background: linear-gradient(90deg, rgba(4, 13, 22, 0.98), transparent);
}

.quickbar-shell::after {
  right: 38px;
  background: linear-gradient(270deg, rgba(4, 13, 22, 0.98), transparent);
}

.quickbar-shell.can-scroll-back::before,
.quickbar-shell.can-scroll-forward::after {
  opacity: 1;
}

.quickbar-scroll {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: grid;
  width: 32px;
  height: 58px;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(200, 167, 102, 0.13);
  color: #7e919a;
  background: rgba(7, 18, 28, 0.72);
  transition: color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.quickbar-scroll:hover:not(:disabled) {
  border-color: rgba(99, 217, 232, 0.3);
  color: var(--cyan-soft);
}

.quickbar-scroll:disabled {
  opacity: 0.16;
  cursor: default;
}

.quickbar-scroll-prev {
  left: 0;
}

.quickbar-scroll-next {
  right: 0;
}

.quickbar-scroll-prev .icon {
  transform: rotate(90deg);
}

.quickbar-scroll-next .icon {
  transform: rotate(-90deg);
}

.element-strip {
  display: flex;
  min-width: 0;
  min-height: 100px;
  gap: 8px;
  padding: 2px 6px 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scrollbar-width: none;
  scroll-snap-type: inline proximity;
  touch-action: pan-x;
}

.element-strip::-webkit-scrollbar {
  display: none;
}

.element-token {
  position: relative;
  display: grid;
  flex: 0 0 82px;
  min-height: 98px;
  padding: 1px 5px 5px;
  align-content: start;
  justify-items: center;
  gap: 3px;
  scroll-snap-align: start;
  border: 0;
  border-radius: 9px;
  background: transparent;
  transition: transform 220ms var(--ease-out), background 180ms ease;
}

.element-token.pinned::before {
  position: absolute;
  z-index: 2;
  top: 5px;
  left: 9px;
  width: 6px;
  height: 6px;
  content: "";
  transform: rotate(45deg);
  border: 1px solid rgba(231, 205, 143, 0.75);
  background: rgba(8, 21, 32, 0.92);
  box-shadow: 0 0 7px rgba(200, 167, 102, 0.28);
}

.quickbar-divider {
  display: grid;
  flex: 0 0 58px;
  min-height: 88px;
  place-content: center;
  justify-items: center;
  gap: 7px;
  scroll-snap-align: start;
}

.quickbar-divider i {
  width: 1px;
  height: 38px;
  background: linear-gradient(transparent, rgba(200, 167, 102, 0.38), transparent);
}

.quickbar-divider span {
  color: #657985;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.quickbar-empty {
  align-self: center;
  margin: 0;
  padding: 0 14px;
  color: #71838d;
  font-family: var(--serif);
  font-size: 12px;
}

.element-token:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.025);
}

.element-token.selected {
  transform: translateY(-5px);
  background: rgba(99, 217, 232, 0.04);
}

.element-token.selected img {
  filter: drop-shadow(0 0 12px rgba(99, 217, 232, 0.38));
}

.element-token.dragging,
.collection-item.dragging {
  transform: scale(0.94);
  opacity: 0.45;
  cursor: grabbing;
}

.element-token img {
  width: 69px;
  height: 69px;
  object-fit: contain;
  filter: drop-shadow(0 7px 7px rgba(0, 0, 0, 0.34));
  transition: filter 180ms ease;
  -webkit-user-drag: element;
}

img.element-asset-loading,
img.element-asset-failed {
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 46%, rgba(99, 217, 232, 0.16), transparent 24%),
    radial-gradient(circle, rgba(49, 68, 78, 0.34), rgba(5, 18, 29, 0.76) 70%);
}

img.element-asset-loading {
  opacity: 0.58;
}

img.element-asset-failed {
  opacity: 0.42;
}

.element-token strong {
  max-width: 78px;
  overflow: hidden;
  color: #b9c0c2;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.element-token small {
  color: #586a74;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.09em;
}

.element-potential {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #a38d60;
  font-size: 6.5px;
  font-weight: 750;
  letter-spacing: 0.035em;
  line-height: 1.25;
  text-transform: uppercase;
  white-space: nowrap;
}

.element-potential::before {
  width: 4px;
  height: 4px;
  content: "";
  transform: rotate(45deg);
  border: 1px solid currentColor;
}

.element-potential.complete {
  color: #70cbd4;
}

.element-potential.complete::before {
  border-color: var(--cyan-soft);
  background: rgba(99, 217, 232, 0.55);
  box-shadow: 0 0 7px rgba(99, 217, 232, 0.45);
}

.new-dot {
  position: absolute;
  top: 4px;
  right: 7px;
  width: 7px;
  height: 7px;
  border: 1px solid #152433;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(99, 217, 232, 0.9);
}

.panel-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  background: rgba(0, 5, 10, 0.62);
  opacity: 0;
  backdrop-filter: blur(3px);
  transition: opacity 250ms ease;
}

.panel-backdrop.visible {
  opacity: 1;
}

.collection-panel,
.settings-panel {
  position: fixed;
  z-index: 70;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(430px, 100%);
  overflow: hidden;
  transform: translateX(102%);
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at 70% 4%, rgba(46, 118, 131, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(10, 25, 38, 0.99), rgba(5, 14, 23, 0.99));
  box-shadow: -26px 0 70px rgba(0, 0, 0, 0.42);
  transition: transform 360ms var(--ease-out);
}

.collection-panel.open,
.settings-panel.open {
  transform: translateX(0);
}

.collection-panel {
  display: flex;
  flex-direction: column;
}

.panel-header {
  flex: 0 0 auto;
  min-height: 88px;
  padding: 20px 22px 15px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
}

.collection-tools {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 16px 22px 10px;
}

.collection-progress-filters {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  gap: 3px 16px;
}

.collection-completion-filter {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  min-height: 27px;
  padding: 0 2px;
  color: #82939c;
  cursor: pointer;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.025em;
  transition: color 180ms ease, opacity 180ms ease;
}

.collection-completion-filter:hover {
  color: var(--ivory);
}

.collection-completion-filter.disabled {
  cursor: default;
  opacity: 0.34;
}

.collection-completion-filter input {
  display: grid;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  appearance: none;
  place-items: center;
  border: 1px solid rgba(200, 167, 102, 0.38);
  border-radius: 2px;
  outline: 0;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.collection-completion-filter input::before {
  width: 8px;
  height: 4px;
  border-bottom: 2px solid var(--ink-950);
  border-left: 2px solid var(--ink-950);
  content: "";
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.7);
  transition: opacity 140ms ease, transform 180ms var(--ease-out);
}

.collection-completion-filter input:checked {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(99, 217, 232, 0.2);
}

.collection-completion-filter input:checked::before {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.collection-completion-filter input:focus-visible {
  outline: 2px solid rgba(99, 217, 232, 0.42);
  outline-offset: 3px;
}

.collection-completion-filter input:disabled {
  cursor: default;
}

.quickbar-manager {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 58px;
  margin: 0 22px 10px;
  gap: 11px;
  padding: 8px 12px;
  border: 1px solid rgba(200, 167, 102, 0.16);
  color: #aab4b8;
  background: rgba(255, 255, 255, 0.018);
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.quickbar-manager:hover,
.quickbar-manager[aria-pressed="true"] {
  border-color: rgba(99, 217, 232, 0.34);
  color: var(--ivory);
  background: rgba(99, 217, 232, 0.055);
}

.quickbar-manager > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.quickbar-manager strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quickbar-manager small {
  overflow: hidden;
  color: #71838d;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quickbar-manager em {
  color: var(--gold);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.quickbar-manager-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  transform: rotate(45deg);
  border: 1px solid rgba(200, 167, 102, 0.22);
  color: var(--gold);
}

.quickbar-manager-icon .icon {
  width: 15px;
  transform: rotate(-45deg);
}

.quickbar-manager[aria-pressed="true"] .quickbar-manager-icon {
  border-color: rgba(99, 217, 232, 0.45);
  color: var(--cyan-soft);
  box-shadow: 0 0 14px rgba(99, 217, 232, 0.12);
}

.quickbar-manage-hint {
  flex: 0 0 auto;
  margin: -1px 22px 11px;
  color: #84959d;
  font-size: 9px;
  line-height: 1.45;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  color: #778993;
  background: rgba(255, 255, 255, 0.025);
}

.search-field:focus-within {
  border-color: rgba(99, 217, 232, 0.55);
  color: var(--cyan);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ivory);
  background: transparent;
  font-size: 12px;
}

.search-field input::placeholder {
  color: #657681;
}

.collection-sort-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 156px;
  height: 44px;
  padding: 0 9px 0 11px;
  border-bottom: 1px solid rgba(200, 167, 102, 0.28);
  color: var(--gold);
  background: rgba(200, 167, 102, 0.035);
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.collection-sort-field:focus-within,
.collection-sort-field:hover {
  border-color: rgba(99, 217, 232, 0.55);
  color: var(--cyan-soft);
  background: rgba(99, 217, 232, 0.045);
}

.collection-sort-field > .icon:first-child {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.collection-sort-field select {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 17px 0 8px;
  border: 0;
  outline: 0;
  appearance: none;
  color: var(--ivory);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.collection-sort-field option {
  color: var(--ivory);
  background: #07151f;
}

.collection-sort-field select:disabled {
  cursor: default;
  opacity: 0.34;
}

.collection-sort-chevron {
  position: absolute;
  right: 9px;
  width: 11px;
  height: 11px;
  pointer-events: none;
}

.collection-category-filter {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 20px minmax(0, 1fr) auto 14px;
  align-items: center;
  min-height: 44px;
  gap: 9px;
  padding: 5px 10px;
  border: 0;
  border-bottom: 1px solid rgba(200, 167, 102, 0.22);
  color: #8b9ba2;
  background: rgba(255, 255, 255, 0.018);
  text-align: left;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.collection-category-filter:hover:not(:disabled),
.collection-category-filter:focus-visible {
  border-color: rgba(99, 217, 232, 0.52);
  color: var(--cyan-soft);
  background: rgba(99, 217, 232, 0.035);
}

.collection-category-filter:focus-visible {
  outline: 1px solid rgba(99, 217, 232, 0.58);
  outline-offset: 2px;
}

.collection-category-filter:disabled {
  cursor: default;
  opacity: 0.34;
}

.collection-category-filter > .icon:first-child {
  width: 16px;
  height: 16px;
}

.collection-category-filter > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.collection-category-filter small {
  color: #667982;
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.collection-category-filter strong {
  overflow: hidden;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-category-filter em {
  color: var(--gold);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.collection-category-chevron {
  width: 12px;
  height: 12px;
}

.category-picker {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: block;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s linear 240ms, opacity 220ms ease;
}

.category-picker.open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.category-picker-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 5, 9, 0.66);
  backdrop-filter: blur(5px);
}

.category-picker-sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  width: min(430px, 100%);
  height: min(76%, 680px);
  flex-direction: column;
  overflow: hidden;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(200, 167, 102, 0.28);
  background:
    radial-gradient(circle at 76% 0%, rgba(46, 118, 131, 0.11), transparent 34%),
    #07141e;
  box-shadow: 0 -24px 52px rgba(0, 0, 0, 0.42);
  transform: translateY(24px);
  transition: transform 280ms var(--ease-out);
}

.category-picker.open .category-picker-sheet {
  transform: translateY(0);
}

.category-picker-sheet > header {
  display: flex;
  flex: 0 0 auto;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px 10px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.category-picker-sheet > header p {
  margin: 0 0 2px;
  color: var(--gold);
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.category-picker-sheet > header h3 {
  margin: 0;
  outline: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
}

.category-picker-intro {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 22px 9px;
  color: #7d8e96;
  font-size: 9px;
  line-height: 1.5;
}

.category-picker-list {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 22px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.category-picker-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 43px;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  color: #aab6ba;
  cursor: pointer;
}

.category-picker-option:hover {
  color: var(--ivory);
}

.category-picker-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--cyan);
}

.category-picker-option strong {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
}

.category-picker-option em {
  color: #71838b;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.category-picker-option:has(input:checked) strong {
  color: var(--cyan-soft);
}

.category-picker-option:has(input:checked) em {
  color: var(--gold);
}

.category-picker-sheet > footer {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(100px, 0.7fr) minmax(150px, 1.3fr);
  gap: 9px;
  padding: 12px 22px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.category-picker-sheet > footer button {
  min-height: 44px;
}

.category-picker-reset {
  border: 1px solid rgba(200, 167, 102, 0.2);
  color: #a9b3b7;
  background: rgba(255, 255, 255, 0.018);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.category-picker-reset:hover,
.category-picker-reset:focus-visible {
  border-color: rgba(99, 217, 232, 0.38);
  color: var(--ivory);
}

.collection-tabs {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr 1fr;
  padding: 0 22px;
  border-bottom: 1px solid var(--line-soft);
}

.collection-tabs button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 45px;
  padding: 0;
  border: 0;
  color: #72838d;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.collection-tabs button::after {
  position: absolute;
  right: 18%;
  bottom: -1px;
  left: 18%;
  height: 1px;
  content: "";
  transform: scaleX(0);
  background: var(--cyan);
  transition: transform 180ms ease;
}

.collection-tabs button.active {
  color: var(--ivory);
}

.collection-tabs button:disabled {
  opacity: 0.28;
  cursor: default;
}

.collection-tabs button.active::after {
  transform: scaleX(1);
}

.collection-tabs em {
  color: var(--gold);
  font-size: 9px;
  font-style: normal;
}

.all-archive-note {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  color: #70818a;
  background: rgba(2, 10, 17, 0.2);
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.collection-grid {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: repeat(3, 1fr);
  align-content: start;
  gap: 14px 8px;
  min-height: 0;
  padding: 18px 16px 34px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.collection-item {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 0;
  justify-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  transition: transform 160ms ease, opacity 160ms ease;
}

.collection-item.quickbar-candidate {
  padding-top: 3px;
  border-radius: 10px;
}

.collection-item.quickbar-candidate.pinned {
  background: radial-gradient(circle at 50% 42%, rgba(99, 217, 232, 0.09), transparent 62%);
}

.collection-item.quickbar-candidate.pinned img {
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.34)) drop-shadow(0 0 13px rgba(99, 217, 232, 0.28));
}

.quickbar-pin-marker {
  position: absolute;
  z-index: 2;
  top: 2px;
  right: 8px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  transform: rotate(45deg);
  border: 1px solid rgba(200, 167, 102, 0.32);
  color: var(--gold);
  background: rgba(5, 15, 24, 0.92);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.quickbar-pin-marker .icon {
  width: 13px;
  transform: rotate(-45deg);
}

.collection-item.quickbar-candidate.pinned .quickbar-pin-marker {
  border-color: rgba(99, 217, 232, 0.55);
  color: var(--cyan-soft);
  box-shadow: 0 0 12px rgba(99, 217, 232, 0.18);
}

.collection-item img,
.locked-medallion {
  width: min(100%, 104px);
  aspect-ratio: 1;
  object-fit: contain;
}

.collection-item img {
  filter: drop-shadow(0 8px 7px rgba(0, 0, 0, 0.34));
  transition: transform 180ms var(--ease-out), filter 180ms ease;
}

.collection-item:not(.locked):hover img {
  transform: translateY(-3px) scale(1.025);
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 9px rgba(99, 217, 232, 0.12));
}

.collection-item strong {
  width: 100%;
  overflow: hidden;
  color: #bbc2c4;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-item small {
  color: #586a73;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.collection-item .element-potential {
  margin-top: 2px;
}

.locked-medallion {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(174, 153, 103, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(36, 53, 65, 0.38), rgba(6, 16, 25, 0.45) 65%),
    repeating-radial-gradient(circle at center, transparent 0 9px, rgba(200, 167, 102, 0.025) 10px 11px);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.45);
}

.locked-medallion::before,
.locked-medallion::after {
  position: absolute;
  width: 8px;
  height: 8px;
  content: "";
  transform: rotate(45deg);
  border: 1px solid rgba(200, 167, 102, 0.2);
  background: var(--ink-900);
}

.locked-medallion::before {
  top: -5px;
}

.locked-medallion::after {
  bottom: -5px;
}

.locked-medallion .icon {
  width: 18px;
  color: #4e5e67;
}

.collection-item.locked strong {
  color: #4f606a;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.empty-state {
  padding: 44px 30px;
  color: #6f7f88;
  text-align: center;
  font-size: 12px;
}

.element-detail {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  visibility: hidden;
  background:
    radial-gradient(circle at 50% 25%, rgba(28, 100, 115, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(8, 22, 33, 0.995), rgba(5, 15, 24, 0.995));
  opacity: 0;
  transform: translateX(102%);
  transition: transform 240ms var(--ease-out), opacity 180ms ease, visibility 240ms;
}

.element-detail.open {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
}

.element-detail-header {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(92px, auto) 1fr 44px;
  align-items: center;
  min-height: 76px;
  gap: 8px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 13, 21, 0.48);
}

.element-detail-header > p {
  margin: 0;
  overflow: hidden;
  color: #6f818a;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.element-detail-header > p em {
  margin-left: 5px;
  color: var(--gold);
  font-style: normal;
  letter-spacing: 0.08em;
}

.element-detail-back {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  gap: 7px;
  padding: 0 8px;
  border: 0;
  color: #a8b4b9;
  background: transparent;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.element-detail-back:hover {
  color: var(--ivory);
}

.element-detail-back .icon {
  width: 16px;
}

.element-detail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 24px 27px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.element-detail-hero {
  position: relative;
  display: grid;
  min-height: 184px;
  place-items: center;
  isolation: isolate;
}

.element-detail-hero::before {
  position: absolute;
  z-index: -2;
  width: 162px;
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(200, 167, 102, 0.18);
  transform: rotate(45deg);
  box-shadow: inset 0 0 45px rgba(99, 217, 232, 0.035);
}

.element-detail-rings,
.element-detail-rings i {
  position: absolute;
  z-index: -1;
  width: 188px;
  aspect-ratio: 1;
  border: 1px solid rgba(99, 217, 232, 0.09);
  border-radius: 50%;
}

.element-detail-rings i:first-child {
  inset: 18px;
  width: auto;
  border-color: rgba(200, 167, 102, 0.11);
}

.element-detail-rings i:last-child {
  inset: 41px;
  width: auto;
  border-color: rgba(99, 217, 232, 0.08);
}

.element-detail-hero img {
  width: 168px;
  height: 168px;
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 16px 15px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 18px rgba(99, 217, 232, 0.11));
  transform: scale(0.9);
}

.element-detail.open .element-detail-hero img {
  animation: element-detail-reveal 520ms 90ms var(--ease-out) forwards;
}

.element-detail-copy {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 11px 0 28px;
  text-align: center;
}

.element-detail-copy::after {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 54px;
  height: 1px;
  content: "";
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(200, 167, 102, 0.7), transparent);
}

.element-detail-copy h2 {
  margin: 0;
  outline: 0;
  font-family: var(--serif);
  font-size: 35px;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.element-detail-copy > p:not(.element-detail-potential) {
  max-width: 330px;
  margin: 10px 0 0;
  color: #9aa8ae;
  font-size: 12px;
  line-height: 1.65;
}

.element-detail-potential {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 15px 0 0;
  padding: 0 10px;
  border: 1px solid rgba(200, 167, 102, 0.2);
  color: #c7a967;
  background: rgba(200, 167, 102, 0.035);
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.element-detail-potential.complete {
  border-color: rgba(99, 217, 232, 0.2);
  color: var(--cyan-soft);
  background: rgba(99, 217, 232, 0.035);
}

.element-results,
.element-origins {
  padding-top: 28px;
}

.element-results > header,
.element-origins > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-width: 0;
  gap: 12px;
  margin-bottom: 11px;
}

.element-results .section-kicker,
.element-origins .section-kicker {
  flex: 0 0 auto;
  margin: 0;
}

.element-results > header > small,
.element-origins > header > small {
  max-width: 220px;
  color: #667983;
  font-size: 8px;
  line-height: 1.45;
  text-align: right;
}

.element-result-list {
  display: block;
  min-height: 74px;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.element-result-category {
  padding: 13px 0 16px;
}

.element-result-category + .element-result-category {
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.element-result-category > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.element-result-category > header strong {
  color: #b9c4c8;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
}

.element-result-category > header small {
  color: #71838c;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.055em;
}

.element-result-category.complete > header small {
  color: var(--cyan-soft);
}

.element-result-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 15px 8px;
}

.element-result-token {
  display: grid;
  min-width: 0;
  align-content: start;
  justify-items: center;
  gap: 6px;
  opacity: 0;
  text-align: center;
  transform: translateY(6px);
}

.element-detail.open .element-result-token {
  animation: element-origin-enter 280ms calc(150ms + min(var(--result-index), 8) * 30ms) var(--ease-out) forwards;
}

.element-result-medallion {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
}

.element-result-medallion img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.38));
}

.element-result-token.unknown .element-result-medallion {
  width: 48px;
  height: 48px;
  margin: 3px;
  border: 1px solid rgba(200, 167, 102, 0.24);
  border-radius: 50%;
  color: #61747d;
  background:
    radial-gradient(circle at 50% 44%, rgba(200, 167, 102, 0.07), transparent 67%),
    rgba(255, 255, 255, 0.015);
  font-family: var(--serif);
  font-size: 19px;
}

.element-result-token.unknown.available .element-result-medallion {
  border-color: rgba(99, 217, 232, 0.42);
  color: var(--cyan-soft);
  background:
    radial-gradient(circle at 50% 44%, rgba(99, 217, 232, 0.12), transparent 68%),
    rgba(99, 217, 232, 0.025);
  box-shadow: 0 0 15px rgba(99, 217, 232, 0.09);
}

.element-result-token > strong {
  overflow: hidden;
  width: 100%;
  color: #87979e;
  font-size: 8px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.element-result-token:not(.unknown) > strong {
  color: #b8c1c4;
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 500;
}

.element-result-partner-hint {
  display: grid;
  width: 100%;
  justify-items: center;
  gap: 2px;
  margin-top: 1px;
  color: #61747d;
  font-size: 5.5px;
  font-weight: 750;
  letter-spacing: 0.07em;
  line-height: 1.25;
  text-align: center;
}

.element-result-partner-hint span:first-child {
  text-transform: uppercase;
}

.element-result-partner-hint span:last-child {
  color: #80cbd4;
  font-size: 6.5px;
  font-weight: 650;
  letter-spacing: 0.015em;
  overflow-wrap: anywhere;
}

.element-insight-state {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 12px;
  color: #778991;
  font-size: 9px;
  line-height: 1.45;
}

.element-insight-state.error {
  color: #b58982;
}

.element-insight-state button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(99, 217, 232, 0.22);
  color: var(--cyan-soft);
  background: rgba(99, 217, 232, 0.035);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.element-insight-state button:focus-visible {
  outline: 2px solid rgba(99, 217, 232, 0.42);
  outline-offset: 2px;
}

.element-origin-list {
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.element-origin-row {
  position: relative;
  display: grid;
  min-height: 82px;
  padding: 14px 0 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  opacity: 0;
  transform: translateY(7px);
}

.element-detail.open .element-origin-row {
  animation: element-origin-enter 300ms calc(180ms + var(--origin-index) * 45ms) var(--ease-out) forwards;
}

.element-origin-badge {
  position: absolute;
  top: 8px;
  right: 0;
  color: rgba(200, 167, 102, 0.76);
  font-size: 6px;
  font-weight: 760;
  letter-spacing: 0.12em;
}

.element-origin-row.discovered-origin:not(.first-origin) .element-origin-badge {
  color: rgba(99, 217, 232, 0.76);
}

.element-origin-row.undiscovered-origin .element-origin-badge {
  color: #70828b;
}

.element-origin-row.undiscovered-origin .element-origin-formula {
  opacity: 0.72;
}

.element-origin-formula {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.element-origin-formula > i {
  color: rgba(200, 167, 102, 0.65);
  font-family: var(--serif);
  font-size: 20px;
  font-style: normal;
  text-align: center;
}

.element-origin-input {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.element-origin-input:last-child {
  grid-template-columns: minmax(0, 1fr) 48px;
  text-align: right;
}

.element-origin-input:last-child img,
.element-origin-input:last-child .element-origin-unknown {
  grid-column: 2;
  grid-row: 1;
}

.element-origin-input:last-child strong {
  grid-column: 1;
  grid-row: 1;
}

.element-origin-input img,
.element-origin-unknown {
  width: 48px;
  height: 48px;
}

.element-origin-input img {
  object-fit: contain;
  filter: drop-shadow(0 6px 7px rgba(0, 0, 0, 0.38));
}

.element-origin-unknown {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 3px;
  place-items: center;
  border: 1px solid rgba(200, 167, 102, 0.22);
  border-radius: 50%;
  color: #657780;
  background: rgba(255, 255, 255, 0.018);
  font-family: var(--serif);
  font-size: 17px;
}

.element-origin-input:last-child .element-origin-unknown {
  justify-self: end;
}

.element-origin-input strong {
  overflow: hidden;
  color: #b5c0c4;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.element-origin-starter {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  min-height: 86px;
  gap: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.element-origin-starter > .icon {
  width: 22px;
  margin: 0 auto;
  color: var(--gold-bright);
  filter: drop-shadow(0 0 9px rgba(200, 167, 102, 0.24));
}

.element-origin-starter > span {
  display: grid;
  gap: 5px;
}

.element-origin-starter strong {
  color: #c4b17c;
  font-size: 8px;
  letter-spacing: 0.13em;
}

.element-origin-starter small {
  color: #788991;
  font-size: 10px;
  line-height: 1.45;
}

.element-detail-footer {
  display: grid;
  flex: 0 0 auto;
  padding: 14px 22px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(4, 13, 21, 0.92);
  backdrop-filter: blur(10px);
}

.element-detail-footer .primary-button {
  width: 100%;
}

@keyframes element-detail-reveal {
  to { opacity: 1; transform: scale(1); }
}

@keyframes element-origin-enter {
  to { opacity: 1; transform: translateY(0); }
}

.settings-panel {
  display: flex;
  flex-direction: column;
  width: min(390px, 100%);
}

.settings-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.profile-section {
  display: grid;
  gap: 13px;
  padding: 20px 22px 22px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 88% 0%, rgba(99, 217, 232, 0.075), transparent 42%),
    rgba(255, 255, 255, 0.012);
}

.profile-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.profile-heading p {
  margin: 0 0 3px;
  color: var(--gold);
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.profile-heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
}

.profile-state {
  flex: 0 0 auto;
  padding: 5px 7px 4px;
  border: 1px solid rgba(200, 167, 102, 0.28);
  color: var(--gold-bright);
  font-size: 7px;
  font-weight: 760;
  letter-spacing: 0.13em;
}

.profile-state.eligible {
  border-color: rgba(99, 217, 232, 0.34);
  color: var(--cyan-soft);
}

.profile-detail,
.profile-rule,
.profile-feedback {
  margin: 0;
  color: #82929a;
  font-size: 10px;
  line-height: 1.55;
}

.profile-rule {
  padding-left: 10px;
  border-left: 1px solid rgba(200, 167, 102, 0.36);
  color: #9fa9ac;
}

.profile-feedback {
  min-height: 0;
  color: var(--cyan-soft);
}

.profile-feedback:empty {
  display: none;
}

.profile-username-form {
  display: grid;
  gap: 7px;
}

.profile-username-form > label {
  color: #85949c;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-username-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(2, 9, 15, 0.48);
}

.profile-username-form input {
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  color: var(--ivory);
  background: transparent;
  font-size: 16px;
}

.profile-username-form button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid rgba(200, 167, 102, 0.22);
  color: var(--gold-bright);
  background: rgba(200, 167, 102, 0.07);
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile-verification {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(99, 217, 232, 0.18);
  background:
    linear-gradient(135deg, rgba(99, 217, 232, 0.045), transparent 64%),
    rgba(2, 9, 15, 0.34);
}

.profile-verification > div {
  display: grid;
  gap: 3px;
}

.profile-verification > div strong {
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
}

.profile-verification > div p,
.profile-verification > p {
  margin: 0;
  color: #7f9098;
  font-size: 9px;
  line-height: 1.5;
}

.profile-verification label {
  display: grid;
  gap: 5px;
}

.profile-verification label > span {
  color: #82939b;
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-verification input {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 0;
  color: var(--ivory);
  background: rgba(2, 9, 15, 0.56);
  font-size: 16px;
}

.profile-verification button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(200, 167, 102, 0.3);
  color: var(--gold-bright);
  background: rgba(200, 167, 102, 0.06);
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.profile-verification button[aria-busy="true"] {
  opacity: 0.68;
}

.profile-verification > p:empty {
  display: none;
}

.profile-verification > p[data-state="success"] {
  color: var(--cyan-soft);
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.profile-action,
.profile-delete {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #9ba8ad;
  background: rgba(255, 255, 255, 0.018);
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-action:hover:not(:disabled) {
  border-color: rgba(200, 167, 102, 0.38);
  color: var(--ivory);
}

.profile-action.primary {
  border-color: rgba(200, 167, 102, 0.4);
  color: var(--gold-bright);
  background: rgba(200, 167, 102, 0.07);
}

.profile-delete {
  width: 100%;
  min-height: 44px;
  border-color: rgba(180, 92, 81, 0.28);
  color: #c47b70;
  background: rgba(115, 38, 31, 0.08);
  text-align: center;
}

.profile-delete:disabled {
  border-color: rgba(255, 255, 255, 0.07);
  color: #58656b;
  background: rgba(255, 255, 255, 0.012);
}

.settings-list {
  border-bottom: 1px solid var(--line-soft);
}

.setting-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 78px;
  gap: 12px;
  padding: 0 22px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: transparent;
  text-align: left;
}

.setting-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.setting-row > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.setting-row strong {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.setting-row small {
  color: #71828c;
  font-size: 10px;
}

.setting-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(200, 167, 102, 0.18);
  transform: rotate(45deg);
  color: var(--gold);
}

.setting-icon .icon {
  width: 18px;
  transform: rotate(-45deg);
}

.switch {
  position: relative;
  width: 38px;
  height: 21px;
  border: 1px solid rgba(99, 217, 232, 0.4);
  border-radius: 12px;
  background: rgba(49, 151, 168, 0.2);
  transition: border-color 180ms ease, background 180ms ease;
}

.switch i {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--cyan-soft);
  box-shadow: 0 0 8px rgba(99, 217, 232, 0.5);
  transition: transform 180ms ease, background 180ms ease;
}

.setting-row[aria-pressed="false"] .switch {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.setting-row[aria-pressed="false"] .switch i {
  transform: translateX(-17px);
  background: #6a7881;
  box-shadow: none;
}

.setting-section {
  padding: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.setting-section > p {
  margin: 0 0 12px;
  color: #71828c;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.language-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.language-switch button {
  min-height: 44px;
  border: 0;
  color: #75858e;
  background: transparent;
  font-size: 11px;
}

.language-switch button.active {
  color: var(--ivory);
  background: rgba(99, 217, 232, 0.08);
  box-shadow: inset 0 -1px var(--cyan);
}

.settings-credits {
  display: grid;
  gap: 5px;
  padding: 22px;
  border-top: 1px solid var(--line-soft);
  color: #71828c;
}

.settings-credits strong {
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
}

.settings-credits p {
  margin: 0;
  font-size: 9px;
  line-height: 1.6;
}

.settings-credits a {
  color: var(--gold-bright);
  text-decoration: none;
}

.settings-credits a:hover,
.settings-credits a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.data-management {
  margin-top: clamp(72px, 18vh, 150px);
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(1, 7, 12, 0.18);
}

.data-management summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 60px;
  gap: 14px;
  padding: 12px 22px max(12px, env(safe-area-inset-bottom));
  color: #63737c;
  cursor: pointer;
  list-style: none;
}

.data-management summary::-webkit-details-marker {
  display: none;
}

.data-management summary > span {
  display: grid;
  gap: 3px;
}

.data-management summary strong {
  color: #788890;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.data-management summary small {
  color: #55656e;
  font-size: 8px;
  line-height: 1.45;
}

.data-management summary > .icon {
  width: 14px;
  height: 14px;
  transition: transform 180ms var(--ease-out);
}

.data-management[open] summary > .icon {
  transform: rotate(180deg);
}

.data-management summary:hover,
.data-management summary:focus-visible {
  color: #8c9aa1;
  background: rgba(255, 255, 255, 0.018);
}

.data-management summary:focus-visible {
  outline: 1px solid rgba(99, 217, 232, 0.42);
  outline-offset: -2px;
}

.data-management-body {
  display: grid;
  gap: 13px;
  padding: 2px 22px max(24px, env(safe-area-inset-bottom));
  animation: data-management-reveal 180ms var(--ease-out) both;
}

.data-management-body p {
  margin: 0;
  color: #76868e;
  font-size: 9px;
  line-height: 1.55;
}

@keyframes data-management-reveal {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
}

.community-dialog {
  position: fixed;
  z-index: 150;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100dvh;
  min-height: 100svh;
  place-items: center;
  padding:
    max(18px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(30, 102, 118, 0.13), transparent 33%),
    rgba(2, 8, 14, 0.9);
  backdrop-filter: blur(12px);
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms;
}

.community-dialog.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.community-sheet {
  position: relative;
  width: min(100%, 480px);
  max-height: calc(100dvh - max(36px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  overflow-x: hidden;
  overflow-y: auto;
  transform: translateY(14px) scale(0.985);
  border: 1px solid rgba(200, 167, 102, 0.28);
  background:
    radial-gradient(circle at 78% 0%, rgba(63, 165, 181, 0.085), transparent 34%),
    linear-gradient(165deg, rgba(10, 27, 40, 0.99), rgba(4, 13, 22, 0.99));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), inset 0 0 70px rgba(200, 167, 102, 0.015);
  transition: transform 280ms var(--ease-out);
  overscroll-behavior: contain;
}

.community-dialog.open .community-sheet {
  transform: translateY(0) scale(1);
}

.community-sheet::before {
  position: absolute;
  top: 0;
  right: 20%;
  left: 20%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
}

.community-header {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.community-header p {
  margin: 0 0 3px;
  color: var(--gold);
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.18em;
}

.community-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 400;
}

.community-intro {
  margin: 0;
  padding: 18px 20px 0;
  color: #88989f;
  font-size: 10px;
  line-height: 1.58;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 18px 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-tabs button {
  position: relative;
  min-height: 43px;
  border: 0;
  color: #778890;
  background: transparent;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.auth-tabs button[aria-selected="true"] {
  color: var(--ivory);
}

.auth-tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  content: "";
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(99, 217, 232, 0.4);
}

.auth-back {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-self: start;
  gap: 8px;
  margin: 10px 20px 0;
  padding: 0;
  border: 0;
  color: #9aa8ad;
  background: transparent;
  font-size: 8px;
  font-weight: 740;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.auth-back span:first-child {
  color: var(--gold-bright);
  font-size: 15px;
}

.auth-form,
.delete-form {
  display: grid;
  gap: 13px;
  padding: 18px 20px 20px;
}

.auth-form label,
.delete-form > label:not(.delete-acknowledgement) {
  display: grid;
  gap: 6px;
}

.auth-form label > span,
.delete-form label > span:first-child {
  color: #87969d;
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-form input,
.delete-form input[type="password"] {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 0;
  color: var(--ivory);
  background: rgba(2, 9, 15, 0.56);
  font-size: 16px;
}

.auth-form label small {
  color: #687b84;
  font-size: 8px;
  line-height: 1.45;
}

.forgot-password {
  min-height: 40px;
  justify-self: end;
  margin-top: -8px;
  padding: 0;
  border: 0;
  color: var(--gold-bright);
  background: transparent;
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.06em;
}

.form-feedback {
  min-height: 16px;
  margin: 0;
  color: #e59585;
  font-size: 9px;
  line-height: 1.45;
}

.form-feedback[data-state="success"] {
  color: var(--cyan-soft);
}

.auth-submit {
  width: 100%;
}

.auth-submit[aria-busy="true"],
.danger-button[aria-busy="true"] {
  opacity: 0.68;
}

.social-auth {
  display: grid;
  gap: 10px;
  padding: 0 20px 20px;
}

.social-auth > p:first-child {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #5f727b;
  font-size: 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.social-auth > p:first-child::before,
.social-auth > p:first-child::after {
  height: 1px;
  content: "";
  background: rgba(255, 255, 255, 0.075);
}

.social-auth > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.social-auth.google-only > p:first-child {
  display: none;
}

.social-auth.google-only > div {
  grid-template-columns: 1fr;
}

.social-auth.google-web > div {
  grid-template-columns: 1fr;
}

.google-web-signin {
  display: grid;
  min-height: 44px;
  place-items: center;
  overflow: hidden;
}

.google-web-signin:not([data-google-button-state="ready"]) {
  visibility: hidden;
}

.google-web-signin[aria-busy="true"] {
  opacity: 0.72;
}

.google-signin-brand {
  display: none;
  width: 180px;
  height: 40px;
}

.social-auth.google-only #googleSignInButton:not([aria-busy="true"]) {
  min-height: 48px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.social-auth.google-only #googleSignInButton:not([aria-busy="true"]) .google-signin-brand {
  display: block;
  justify-self: center;
}

.social-auth.google-only #googleSignInButton:not([aria-busy="true"]) strong {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.social-auth button {
  display: grid;
  min-height: 52px;
  align-content: center;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #707f86;
  background: rgba(255, 255, 255, 0.015);
}

.social-auth button:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.82);
  color: #202124;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.social-auth button:not(:disabled):hover {
  background: #f7f8f8;
}

.social-auth button[aria-busy="true"] {
  opacity: 0.72;
}

.social-auth button strong {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 650;
}

.social-auth button small {
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.google-signin-status {
  color: #819199;
  font-size: 8px;
  letter-spacing: 0.06em;
  text-align: center;
}

.social-auth-feedback {
  min-height: 15px;
  margin: 0;
  color: #e59585;
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.social-username-form {
  padding-top: 24px;
}

.social-username-later {
  min-height: 42px;
  border: 0;
  color: #819199;
  background: transparent;
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leaderboard-sheet {
  display: flex;
  min-height: min(650px, calc(100dvh - 36px));
  flex-direction: column;
}

.leaderboard-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 28px 20px;
  text-align: center;
}

.leaderboard-state strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
}

.leaderboard-state small {
  max-width: 300px;
  color: #71838b;
  font-size: 9px;
  line-height: 1.5;
}

.leaderboard-state button,
.leaderboard-footer button {
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid rgba(200, 167, 102, 0.3);
  color: var(--gold-bright);
  background: rgba(200, 167, 102, 0.05);
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.state-orbit {
  display: block;
  width: 34px;
  height: 34px;
  margin-bottom: 7px;
  transform: rotate(45deg);
  border: 1px solid rgba(99, 217, 232, 0.42);
  box-shadow: inset 0 0 16px rgba(99, 217, 232, 0.08);
}

.leaderboard-state[data-state="loading"] .state-orbit {
  animation: community-orbit 1.8s linear infinite;
}

.leaderboard-state[data-state="empty"] .state-orbit,
.leaderboard-state[data-state="error"] .state-orbit {
  border-color: rgba(200, 167, 102, 0.34);
  animation: none;
}

.leaderboard-list {
  display: grid;
  min-height: 0;
  margin: 16px 0 0;
  padding: 0 20px;
  overflow-y: auto;
  list-style: none;
}

.leaderboard-entry {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.leaderboard-entry.current {
  margin: 0 -8px;
  padding: 0 8px;
  border-color: rgba(99, 217, 232, 0.2);
  background: rgba(99, 217, 232, 0.045);
}

.leaderboard-rank {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 18px;
  text-align: center;
}

.leaderboard-name {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.leaderboard-name strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-name small,
.leaderboard-score small {
  color: #687a83;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.leaderboard-score {
  display: grid;
  justify-items: end;
}

.leaderboard-score strong {
  color: var(--cyan-soft);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
}

.leaderboard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding: 14px 20px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.leaderboard-footer p {
  margin: 0;
  color: #74858d;
  font-size: 8px;
  line-height: 1.45;
}

.delete-sheet {
  width: min(100%, 430px);
}

.delete-acknowledgement {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(220, 118, 101, 0.18);
  background: rgba(220, 118, 101, 0.035);
}

.delete-acknowledgement input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--danger);
}

.delete-acknowledgement span {
  color: #9caaaF;
  font-size: 9px;
  line-height: 1.5;
}

.delete-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px;
}

.delete-actions button {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #89979d;
  background: transparent;
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.delete-actions .danger-button {
  border-color: rgba(220, 118, 101, 0.42);
  color: #f0b2a7;
  background: rgba(220, 118, 101, 0.08);
}

.delete-actions .danger-button:disabled {
  border-color: rgba(255, 255, 255, 0.075);
  color: #59656b;
  background: rgba(255, 255, 255, 0.012);
}

@keyframes community-orbit {
  to { transform: rotate(405deg); }
}

.discovery-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  background: rgba(2, 8, 14, 0.94);
  backdrop-filter: blur(12px);
  transition: opacity 320ms ease, visibility 320ms;
}

.discovery-overlay.open {
  visibility: visible;
  opacity: 1;
}

.discovery-overlay::before {
  position: absolute;
  width: min(86vw, 580px);
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(200, 167, 102, 0.13);
  transform: rotate(45deg);
  box-shadow: inset 0 0 120px rgba(28, 100, 115, 0.07);
}

.discovery-overlay::after {
  position: absolute;
  width: min(65vw, 440px);
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(99, 217, 232, 0.1);
  border-radius: 50%;
}

.discovery-close {
  position: absolute;
  z-index: 4;
  top: max(20px, env(safe-area-inset-top));
  right: max(22px, env(safe-area-inset-right));
}

body.panel-open,
body.discovery-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.discovery-content {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  width: min(90vw, 480px);
  max-height: calc(100svh - 36px);
  padding: 10px 0;
  overflow-y: auto;
  scrollbar-width: none;
  text-align: center;
}

.discovery-content::-webkit-scrollbar {
  display: none;
}

.discovery-kicker {
  margin: 0 0 4px;
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.28em;
}

.discovery-content img {
  width: min(62vw, 290px);
  aspect-ratio: 1;
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.48)) drop-shadow(0 0 28px rgba(99, 217, 232, 0.12));
  transform: scale(0.72) rotate(-7deg);
}

.discovery-overlay.open .discovery-content img {
  animation: discovery-reveal 900ms 120ms var(--ease-out) forwards;
}

.discovery-number {
  margin-top: -2px;
  color: #6e808a;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.discovery-content h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: clamp(34px, 8vw, 52px);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.discovery-description {
  max-width: 390px;
  margin: 8px 0 13px;
  color: #91a0a8;
  font-size: 12px;
  line-height: 1.55;
}

.discovery-origin-label {
  margin: 0;
  color: rgba(200, 167, 102, 0.75);
  font-size: 7px;
  font-weight: 760;
  letter-spacing: 0.16em;
}

.discovery-formula {
  margin: 5px 0 20px;
  color: #a9b4b8;
  font-family: var(--serif);
  font-size: 14px;
}

.primary-button {
  min-width: 150px;
  min-height: 46px;
  padding: 0 24px;
  border: 1px solid rgba(231, 205, 143, 0.62);
  color: #09141e;
  background: linear-gradient(135deg, #e0c783, #b89450);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(200, 167, 102, 0.09);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: transform 180ms ease, filter 180ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.discovery-radiance {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 1px;
  height: 1px;
}

.discovery-radiance i {
  position: absolute;
  width: 420px;
  height: 1px;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, rgba(99, 217, 232, 0.2), transparent);
}

.discovery-radiance i:nth-child(2) {
  transform: translate(-50%, -50%) rotate(60deg);
}

.discovery-radiance i:nth-child(3) {
  transform: translate(-50%, -50%) rotate(-60deg);
}

body.tutorial-open {
  overflow: hidden;
}

.tutorial-overlay {
  position: fixed;
  z-index: 180;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(10px, 2vh, 24px);
  padding:
    max(18px, env(safe-area-inset-top))
    max(22px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 44%, rgba(41, 133, 151, 0.16), transparent 34%),
    radial-gradient(circle at 14% 18%, rgba(154, 116, 54, 0.09), transparent 26%),
    rgba(2, 8, 14, 0.975);
  backdrop-filter: blur(18px) saturate(115%);
  transition: opacity 280ms ease, visibility 280ms;
}

.tutorial-overlay.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.tutorial-overlay::before,
.tutorial-overlay::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  pointer-events: none;
}

.tutorial-overlay::before {
  width: min(54vw, 690px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1px solid rgba(200, 167, 102, 0.075);
  box-shadow: inset 0 0 150px rgba(31, 107, 123, 0.045);
}

.tutorial-overlay::after {
  width: min(72vw, 920px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(99, 217, 232, 0.045);
  border-radius: 50%;
}

.tutorial-atmosphere {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.tutorial-atmosphere i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(90vw, 1080px);
  height: 1px;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, rgba(99, 217, 232, 0.12), transparent);
}

.tutorial-atmosphere i:nth-child(2) {
  transform: translate(-50%, -50%) rotate(60deg);
}

.tutorial-atmosphere i:nth-child(3) {
  transform: translate(-50%, -50%) rotate(-60deg);
}

.tutorial-header,
.tutorial-stage,
.tutorial-footer {
  position: relative;
  z-index: 2;
  width: min(100%, 1040px);
  margin-inline: auto;
}

.tutorial-header {
  display: flex;
  min-height: 58px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(200, 167, 102, 0.13);
}

.tutorial-kicker {
  margin: 0 0 2px;
  color: var(--gold);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.3em;
}

.tutorial-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.tutorial-header h2:focus {
  outline: none;
}

.tutorial-close {
  margin-top: -5px;
  margin-right: -8px;
}

.tutorial-stage {
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
}

.tutorial-step {
  display: grid;
  grid-template-columns: minmax(320px, 1.18fr) minmax(270px, 0.82fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  align-items: center;
  gap: clamp(38px, 7vw, 96px);
}

.tutorial-step.active {
  animation: tutorial-step-in 340ms var(--ease-out) both;
}

.tutorial-visual {
  position: relative;
  display: grid;
  width: 100%;
  min-height: clamp(220px, 42vh, 390px);
  place-items: center;
}

.tutorial-visual::after {
  position: absolute;
  right: 5%;
  bottom: 11%;
  left: 5%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(200, 167, 102, 0.16), transparent);
}

.tutorial-pick-demo {
  grid-template-columns: auto 38px auto;
  justify-content: center;
  gap: clamp(9px, 2vw, 20px);
}

.tutorial-demo-element {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.tutorial-medallion {
  position: relative;
  display: grid;
  width: clamp(112px, 14vw, 164px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
}

.tutorial-medallion::before,
.tutorial-medallion::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}

.tutorial-medallion::before {
  inset: 2px;
  border: 1px solid rgba(200, 167, 102, 0.34);
}

.tutorial-medallion::after {
  inset: -7px;
  border: 1px dashed rgba(200, 167, 102, 0.18);
}

.tutorial-demo-element.selected .tutorial-medallion::after {
  border-color: rgba(99, 217, 232, 0.62);
  box-shadow: 0 0 25px rgba(99, 217, 232, 0.12);
  animation: tutorial-ring-pulse 1.8s ease-in-out infinite;
}

.tutorial-medallion img {
  width: 94%;
  height: 94%;
  object-fit: contain;
  filter: drop-shadow(0 13px 18px rgba(0, 0, 0, 0.4));
}

.tutorial-demo-element strong {
  font-family: var(--serif);
  font-size: clamp(14px, 1.7vw, 18px);
  font-weight: 400;
}

.tutorial-pair-mark {
  color: var(--gold-dim);
  font-family: var(--serif);
  font-size: 23px;
}

.tutorial-tap-mark {
  position: absolute;
  right: 4px;
  bottom: 26px;
  width: 23px;
  height: 23px;
  border: 1px solid rgba(99, 217, 232, 0.62);
  border-radius: 50%;
  box-shadow: 0 0 13px rgba(99, 217, 232, 0.35);
  animation: tutorial-tap 1.8s ease-out infinite;
}

.tutorial-slots-demo {
  grid-template-columns: auto minmax(38px, 72px) auto;
  justify-content: center;
  gap: clamp(6px, 1.5vw, 16px);
}

.tutorial-demo-slot {
  position: relative;
  display: grid;
  width: clamp(122px, 15vw, 176px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(200, 167, 102, 0.38);
  border-radius: 50%;
  box-shadow: inset 0 0 36px rgba(10, 28, 42, 0.7), 0 0 22px rgba(99, 217, 232, 0.045);
}

.tutorial-demo-slot::before {
  position: absolute;
  inset: -8px;
  content: "";
  border: 1px dashed rgba(200, 167, 102, 0.17);
  border-radius: 50%;
}

.tutorial-demo-slot img {
  width: 86%;
  height: 86%;
  object-fit: contain;
}

.tutorial-slot-index {
  position: absolute;
  top: 9px;
  left: 50%;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  transform: translateX(-50%);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 8px;
}

.tutorial-slot-index::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  transform: rotate(45deg);
  border: 1px solid rgba(200, 167, 102, 0.4);
}

.tutorial-demo-slot strong {
  position: absolute;
  bottom: 13px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 400;
  text-shadow: 0 2px 5px #02070c;
}

.tutorial-demo-slot small {
  position: absolute;
  bottom: -28px;
  color: #697b86;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tutorial-link-line {
  position: relative;
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(200, 167, 102, 0.14), rgba(99, 217, 232, 0.55), rgba(200, 167, 102, 0.14));
}

.tutorial-link-line i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1px solid var(--cyan-soft);
  background: #0b1d2b;
  box-shadow: 0 0 12px rgba(99, 217, 232, 0.55);
}

.tutorial-meld-demo {
  grid-template-columns: auto 92px auto;
  justify-content: center;
  gap: clamp(5px, 1.4vw, 14px);
}

.tutorial-meld-element {
  position: relative;
  z-index: 2;
  display: block;
  width: clamp(108px, 14vw, 158px);
  aspect-ratio: 1;
}

.tutorial-meld-element img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 15px 20px rgba(0, 0, 0, 0.44));
}

.tutorial-meld-symbol {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 44px;
}

.tutorial-meld-symbol > i {
  position: absolute;
  top: 0;
  left: 50%;
  width: 80px;
  height: 80px;
  transform: translateX(-50%);
  border: 1px solid rgba(200, 167, 102, 0.28);
  border-radius: 50%;
}

.tutorial-meld-symbol > i:nth-child(2) {
  width: 94px;
  height: 94px;
  margin-top: -7px;
  border-style: dashed;
  border-color: rgba(99, 217, 232, 0.2);
  animation: tutorial-orbit 8s linear infinite;
}

.tutorial-meld-symbol > span {
  z-index: 1;
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  transform: rotate(45deg);
  border: 1px solid rgba(231, 205, 143, 0.72);
  color: var(--gold-bright);
  background: rgba(11, 30, 44, 0.9);
  box-shadow: 0 0 28px rgba(99, 217, 232, 0.13), inset 0 0 18px rgba(200, 167, 102, 0.1);
  animation: tutorial-core-pulse 1.8s ease-in-out infinite;
}

.tutorial-meld-symbol .icon {
  width: 23px;
  height: 23px;
  transform: rotate(-45deg);
}

.tutorial-meld-symbol small {
  color: #7a8b94;
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tutorial-overlay.open .tutorial-step.active .tutorial-meld-water {
  animation: tutorial-converge-left 2.2s ease-in-out infinite;
}

.tutorial-overlay.open .tutorial-step.active .tutorial-meld-fire {
  animation: tutorial-converge-right 2.2s ease-in-out infinite;
}

.tutorial-discovery-demo {
  grid-template-rows: minmax(0, 1fr) auto;
}

.tutorial-reveal-rings,
.tutorial-reveal-rings i {
  position: absolute;
  top: 44%;
  left: 50%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.tutorial-reveal-rings {
  width: clamp(170px, 23vw, 270px);
  border: 1px solid rgba(99, 217, 232, 0.2);
  box-shadow: 0 0 70px rgba(99, 217, 232, 0.07);
}

.tutorial-reveal-rings i:first-child {
  width: 72%;
  border: 1px dashed rgba(200, 167, 102, 0.25);
}

.tutorial-reveal-rings i:last-child {
  width: 118%;
  border: 1px solid rgba(200, 167, 102, 0.08);
}

.tutorial-result-medallion {
  z-index: 2;
  display: block;
  width: clamp(145px, 19vw, 220px);
  aspect-ratio: 1;
  align-self: center;
}

.tutorial-result-medallion img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 25px rgba(0, 0, 0, 0.46)) drop-shadow(0 0 22px rgba(99, 217, 232, 0.16));
}

.tutorial-overlay.open .tutorial-step.active .tutorial-result-medallion {
  animation: tutorial-result-reveal 760ms 80ms var(--ease-out) both;
}

.tutorial-archive-record {
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto;
  width: min(92%, 360px);
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid rgba(200, 167, 102, 0.18);
  border-bottom: 1px solid rgba(200, 167, 102, 0.1);
}

.tutorial-archive-record > span {
  display: grid;
  gap: 1px;
}

.tutorial-archive-record small {
  color: #6f8089;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.tutorial-archive-record strong {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
}

.tutorial-archive-record em {
  color: var(--gold-bright);
  font-size: 8px;
  font-style: normal;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tutorial-archive-record em.complete {
  color: var(--cyan-soft);
}

.tutorial-archive-record em i {
  font-style: normal;
}

.tutorial-archive-record em b {
  font: inherit;
}

.tutorial-status-choice {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tutorial-status-choice > small {
  color: #647680;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tutorial-step-copy {
  align-self: center;
  max-width: 390px;
}

.tutorial-step-number {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 9px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.22em;
}

.tutorial-step-number::after {
  width: 42px;
  height: 1px;
  content: "";
  background: rgba(200, 167, 102, 0.4);
}

.tutorial-step-copy h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(32px, 4.1vw, 50px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.tutorial-step-copy > p:last-child {
  max-width: 370px;
  margin: 15px 0 0;
  color: #96a3a9;
  font-size: 12px;
  line-height: 1.7;
}

.tutorial-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 62px;
  align-items: end;
  gap: 20px;
  border-top: 1px solid rgba(200, 167, 102, 0.13);
}

.tutorial-skip,
.tutorial-previous {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  color: #87969f;
  background: transparent;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 180ms ease, opacity 180ms ease;
}

.tutorial-skip {
  justify-self: start;
  margin-left: -12px;
}

.tutorial-skip:hover,
.tutorial-previous:hover:not(:disabled) {
  color: var(--ivory);
}

.tutorial-previous:disabled {
  opacity: 0.25;
  cursor: default;
}

.tutorial-progress-group {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding-bottom: 5px;
}

.tutorial-progress {
  color: #75858e;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tutorial-dots {
  display: flex;
  gap: 7px;
}

.tutorial-dots i {
  width: 18px;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  transition: width 220ms var(--ease-out), background 220ms ease, box-shadow 220ms ease;
}

.tutorial-dots i.active {
  width: 30px;
  background: var(--cyan);
  box-shadow: 0 0 9px rgba(99, 217, 232, 0.5);
}

.tutorial-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.tutorial-next {
  min-width: 126px;
}

@keyframes tutorial-step-in {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes tutorial-ring-pulse {
  0%, 100% { transform: scale(0.98); opacity: 0.42; }
  50% { transform: scale(1.05); opacity: 1; }
}

@keyframes tutorial-tap {
  0% { transform: scale(0.55); opacity: 0; }
  22% { opacity: 1; }
  62%, 100% { transform: scale(1.45); opacity: 0; }
}

@keyframes tutorial-orbit {
  to { transform: translateX(-50%) rotate(360deg); }
}

@keyframes tutorial-core-pulse {
  0%, 100% { transform: rotate(45deg) scale(0.94); filter: brightness(0.9); }
  50% { transform: rotate(45deg) scale(1.04); filter: brightness(1.25); }
}

@keyframes tutorial-converge-left {
  0%, 100% { transform: translateX(-4px); }
  50% { transform: translateX(11px); }
}

@keyframes tutorial-converge-right {
  0%, 100% { transform: translateX(4px); }
  50% { transform: translateX(-11px); }
}

@keyframes tutorial-result-reveal {
  from { opacity: 0; transform: scale(0.7) rotate(-7deg); filter: brightness(1.8) blur(6px); }
  to { opacity: 1; transform: scale(1) rotate(0); filter: brightness(1) blur(0); }
}

.toast {
  position: absolute;
  z-index: 120;
  top: calc(var(--topbar-height) + env(safe-area-inset-top) + 8px);
  left: 50%;
  display: flex;
  width: min(560px, calc(100% - 28px));
  height: var(--toast-height);
  max-width: none;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 14px;
  overflow: hidden;
  transform: translate(-50%, -8px);
  border: 1px solid transparent;
  opacity: 0;
  color: #b7c0c4;
  background: rgba(8, 22, 33, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  font-size: 11px;
  pointer-events: none;
  transition:
    border-color 180ms ease,
    opacity 180ms ease,
    transform 220ms var(--ease-out);
}

.toast.visible {
  transform: translate(-50%, 0);
  border-color: rgba(200, 167, 102, 0.23);
  opacity: 1;
}

body.menu-open .toast {
  top: max(12px, env(safe-area-inset-top));
}

.toast .icon {
  flex: 0 0 auto;
  color: var(--gold);
}

.loading-screen {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100dvh;
  min-height: 100svh;
  align-content: center;
  justify-items: center;
  gap: 24px;
  padding:
    max(24px, env(safe-area-inset-top))
    max(22px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(39, 137, 153, 0.14), transparent 27%),
    radial-gradient(circle at 50% 61%, rgba(176, 132, 57, 0.05), transparent 34%),
    linear-gradient(155deg, #071523 0%, var(--ink-950) 54%, #06111d 100%);
  isolation: isolate;
  transition: opacity 500ms ease, visibility 500ms;
}

.loading-screen::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  opacity: 0.2;
  background-image:
    radial-gradient(circle at 10% 18%, rgba(255, 255, 255, 0.74) 0 0.6px, transparent 0.8px),
    radial-gradient(circle at 67% 29%, rgba(99, 217, 232, 0.72) 0 0.55px, transparent 0.8px),
    radial-gradient(circle at 86% 74%, rgba(231, 205, 143, 0.7) 0 0.6px, transparent 0.8px),
    radial-gradient(circle at 30% 84%, rgba(255, 255, 255, 0.66) 0 0.55px, transparent 0.8px);
  background-size: 197px 163px, 223px 191px, 149px 207px, 251px 179px;
}

.loading-screen.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loading-atmosphere,
.loading-atmosphere i {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}

.loading-atmosphere {
  z-index: -1;
  width: min(88vw, 720px);
}

.loading-atmosphere i:first-child {
  width: 100%;
  border: 1px solid rgba(200, 167, 102, 0.09);
}

.loading-atmosphere i:last-child {
  width: 74%;
  border: 1px dashed rgba(99, 217, 232, 0.1);
  animation: loading-orbit 44s linear infinite;
}

.loading-copy {
  display: grid;
  width: min(100%, 430px);
  min-height: 278px;
  grid-template-rows: 14px 58px 42px 52px auto 16px;
  align-items: center;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.loading-actions {
  display: grid;
  min-height: 48px;
  align-content: center;
  justify-items: center;
  gap: 10px;
}

.loading-kicker {
  margin: 0;
  color: var(--gold);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.2em;
}

.loading-screen strong {
  font-family: var(--serif);
  font-size: clamp(38px, 8vw, 50px);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.loading-screen h1 {
  margin: 0;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: clamp(23px, 5vw, 30px);
  font-weight: 400;
  line-height: 1.1;
}

.loading-detail {
  max-width: 390px;
  margin: 0;
  color: #8c9ba3;
  font-size: 11px;
  line-height: 1.55;
}

.loading-action {
  min-width: min(100%, 250px);
  height: 44px;
  padding: 0 24px;
  transform: translateY(4px);
  border: 1px solid rgba(200, 167, 102, 0.42);
  border-radius: 2px;
  visibility: hidden;
  opacity: 0;
  color: var(--ivory);
  background: rgba(14, 31, 43, 0.86);
  box-shadow: inset 0 0 26px rgba(200, 167, 102, 0.035), 0 12px 32px rgba(0, 0, 0, 0.28);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms var(--ease-out), border-color 180ms ease, color 180ms ease;
}

.loading-screen[data-action-visible="true"] .loading-action {
  transform: translateY(0);
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.loading-action:hover:not(:disabled) {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.loading-action:disabled {
  border-color: rgba(255, 255, 255, 0.1);
  opacity: 0.54;
  color: #7f8c92;
  cursor: default;
}

.loading-secondary-action {
  color: #8fa1aa;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: underline;
  text-decoration-color: rgba(143, 161, 170, 0.45);
  text-underline-offset: 4px;
  text-transform: uppercase;
  transition: color 180ms ease, text-decoration-color 180ms ease;
}

.loading-secondary-action:hover,
.loading-secondary-action:focus-visible {
  color: var(--ivory);
  text-decoration-color: var(--gold);
}

.loading-screen small.loading-build {
  color: #6e7e87;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.loading-mark {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  transform: rotate(45deg);
  border: 1px solid rgba(200, 167, 102, 0.5);
  box-shadow: inset 0 0 24px rgba(200, 167, 102, 0.05), 0 0 32px rgba(99, 217, 232, 0.055);
  animation: loading-turn 2s ease-in-out infinite;
}

.loading-mark::before,
.loading-mark::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(200, 167, 102, 0.2);
}

.loading-mark::before {
  inset: 7px;
}

.loading-mark::after {
  inset: 17px;
}

.loading-mark i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
}

.loading-screen[data-state="update"] .loading-mark {
  border-color: rgba(231, 205, 143, 0.74);
  animation: loading-breathe 2.4s ease-in-out infinite;
}

.loading-screen[data-state="update"] .loading-mark i {
  background: var(--gold-bright);
  box-shadow: 0 0 18px var(--gold-bright);
}

.loading-screen[data-state="unavailable"] .loading-mark,
.loading-screen[data-state="rateLimited"] .loading-mark {
  border-color: rgba(220, 118, 101, 0.55);
  animation: loading-breathe 2.8s ease-in-out infinite;
}

.loading-screen[data-state="unavailable"] .loading-mark i,
.loading-screen[data-state="rateLimited"] .loading-mark i {
  background: var(--danger);
  box-shadow: 0 0 16px rgba(220, 118, 101, 0.8);
}

.fusion-zone.combining [data-slot-shell="a"]:not(.locked) .element-slot {
  animation: slot-converge-left 780ms var(--ease-out) both;
}

.fusion-zone.combining [data-slot-shell="b"]:not(.locked) .element-slot {
  animation: slot-converge-right 780ms var(--ease-out) both;
}

.fusion-zone.combining .element-slot-shell.locked .element-slot {
  animation: slot-hold 780ms var(--ease-out) both;
}

.fusion-zone.combining .meld-button {
  animation: core-flash 780ms ease-in-out both;
}

.fusion-zone.invalid {
  animation: invalid-shake 440ms ease both;
}

@keyframes token-arrive {
  from { opacity: 0; transform: scale(0.78) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes orbit-spin {
  from { transform: translate(-50%, -50%) rotate(24deg); }
  to { transform: translate(-50%, -50%) rotate(384deg); }
}

@keyframes orbit-spin-reverse {
  from { transform: translate(-50%, -50%) rotate(-35deg); }
  to { transform: translate(-50%, -50%) rotate(-395deg); }
}

@keyframes slot-converge-left {
  0% { transform: translateX(0) scale(1); opacity: 1; }
  65% { transform: translateX(48%) scale(0.82); opacity: 0.84; }
  100% { transform: translateX(58%) scale(0.38); opacity: 0; }
}

@keyframes slot-converge-right {
  0% { transform: translateX(0) scale(1); opacity: 1; }
  65% { transform: translateX(-48%) scale(0.82); opacity: 0.84; }
  100% { transform: translateX(-58%) scale(0.38); opacity: 0; }
}

@keyframes slot-hold {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  46% { transform: scale(0.94); filter: brightness(1.34); }
  72% { transform: scale(1.02); filter: brightness(1.08); }
}

@keyframes core-flash {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.25); color: white; box-shadow: 0 0 0 14px rgba(99, 217, 232, 0.04), 0 0 55px rgba(99, 217, 232, 0.85); }
  72% { transform: scale(0.78); }
}

@keyframes invalid-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

@keyframes discovery-reveal {
  0% { opacity: 0; transform: scale(0.72) rotate(-7deg); filter: brightness(2.1) blur(8px) drop-shadow(0 0 60px rgba(99, 217, 232, 0.8)); }
  55% { opacity: 1; filter: brightness(1.28) blur(0) drop-shadow(0 0 44px rgba(99, 217, 232, 0.35)); }
  100% { opacity: 1; transform: scale(1) rotate(0); filter: brightness(1) drop-shadow(0 18px 22px rgba(0, 0, 0, 0.48)) drop-shadow(0 0 28px rgba(99, 217, 232, 0.12)); }
}

@keyframes loading-turn {
  0%, 100% { transform: rotate(45deg) scale(0.9); opacity: 0.7; }
  50% { transform: rotate(225deg) scale(1.05); opacity: 1; }
}

@keyframes loading-orbit {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes loading-breathe {
  0%, 100% { transform: rotate(45deg) scale(0.94); opacity: 0.78; }
  50% { transform: rotate(45deg) scale(1.04); opacity: 1; }
}

@media (min-width: 721px) {
  .game-surface {
    grid-template-rows: minmax(340px, 1fr) auto;
  }

  .workspace {
    grid-template-rows: auto auto minmax(200px, 1fr) auto;
    padding-top: 14px;
    padding-bottom: 8px;
  }

  .instruction-block {
    margin-top: 2px;
  }

  .instruction-block h1 {
    font-size: clamp(28px, 3vw, 36px);
  }

  .instruction-block p {
    margin-top: 4px;
    font-size: 11px;
  }

  .fusion-zone {
    padding-top: 8px;
    padding-bottom: 6px;
  }

  .status-line {
    min-height: 40px;
  }

  .known-tray {
    --quickbar-medallion-size: clamp(88px, 12vh, 108px);
    padding-top: 14px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .tray-heading {
    max-width: 1440px;
    margin-bottom: 10px;
  }

  .known-tray .section-kicker {
    font-size: 10px;
  }

  .tray-heading h2 {
    font-size: 22px;
  }

  .quickbar-shell {
    max-width: 1500px;
    padding-right: 44px;
    padding-left: 44px;
  }

  .quickbar-shell::before {
    left: 44px;
  }

  .quickbar-shell::after {
    right: 44px;
  }

  .quickbar-scroll {
    width: 36px;
    height: 82px;
  }

  .element-strip {
    min-height: calc(var(--quickbar-medallion-size) + 67px);
    gap: 12px;
    padding: 3px 8px 7px;
  }

  .element-token {
    flex-basis: clamp(112px, 8vw, 128px);
    min-height: calc(var(--quickbar-medallion-size) + 58px);
    gap: 4px;
    padding: 2px 8px 7px;
  }

  .element-token img {
    width: var(--quickbar-medallion-size);
    height: var(--quickbar-medallion-size);
  }

  .element-token strong {
    max-width: 112px;
    font-size: 15px;
    line-height: 1.15;
  }

  .element-token small {
    font-size: 10px;
  }

  .element-token .element-potential {
    gap: 5px;
    font-size: 9px;
    line-height: 1.25;
  }

  .element-token .element-potential::before {
    width: 5px;
    height: 5px;
  }

  .quickbar-divider {
    flex-basis: 70px;
    min-height: calc(var(--quickbar-medallion-size) + 50px);
  }

  .quickbar-divider span {
    font-size: 8.5px;
  }

  .element-detail-header {
    min-height: 84px;
    padding: 14px 18px;
  }

  .element-detail-header > p {
    font-size: 10px;
  }

  .element-detail-back {
    font-size: 11px;
  }

  .element-detail-scroll {
    padding: 26px 30px 38px;
  }

  .element-detail-copy h2 {
    font-size: 42px;
  }

  .element-detail-copy > p:not(.element-detail-potential) {
    max-width: 360px;
    font-size: 15px;
    line-height: 1.6;
  }

  .element-detail-potential {
    min-height: 36px;
    max-width: 100%;
    padding: 7px 12px;
    justify-content: center;
    font-size: 10px;
    line-height: 1.35;
    text-align: center;
  }

  .element-results,
  .element-origins {
    padding-top: 32px;
  }

  .element-results .section-kicker,
  .element-origins .section-kicker {
    font-size: 11px;
    letter-spacing: 0.16em;
  }

  .element-results > header > small,
  .element-origins > header > small {
    font-size: 10.5px;
    line-height: 1.5;
  }

  .element-result-category {
    padding: 18px 0 20px;
  }

  .element-result-category > header {
    margin-bottom: 16px;
  }

  .element-result-category > header strong {
    font-size: 16px;
  }

  .element-result-category > header small {
    font-size: 9.5px;
    line-height: 1.35;
  }

  .element-result-category-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 20px 10px;
  }

  .element-result-token {
    gap: 8px;
  }

  .element-result-medallion,
  .element-result-medallion img {
    width: 64px;
    height: 64px;
  }

  .element-result-token.unknown .element-result-medallion {
    width: 58px;
    height: 58px;
    font-size: 22px;
  }

  .element-result-token > strong {
    font-size: 10.5px;
    line-height: 1.3;
  }

  .element-result-token:not(.unknown) > strong {
    font-size: 13.5px;
  }

  .element-result-partner-hint {
    font-size: 8px;
    line-height: 1.35;
  }

  .element-result-partner-hint span:last-child {
    font-size: 9px;
  }

  .element-insight-state {
    font-size: 11.5px;
  }

  .element-origin-row {
    min-height: 96px;
    padding: 17px 0 15px;
  }

  .element-origin-badge {
    font-size: 8px;
  }

  .element-origin-formula {
    grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr);
    gap: 7px;
  }

  .element-origin-formula > i {
    font-size: 24px;
  }

  .element-origin-input {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 9px;
  }

  .element-origin-input:last-child {
    grid-template-columns: minmax(0, 1fr) 56px;
  }

  .element-origin-input img,
  .element-origin-unknown {
    width: 56px;
    height: 56px;
  }

  .element-origin-unknown {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .element-origin-input strong {
    font-size: 15px;
  }

  .element-origin-starter {
    min-height: 96px;
  }

  .element-origin-starter strong {
    font-size: 10px;
  }

  .element-origin-starter small {
    font-size: 13px;
    line-height: 1.5;
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: 68px;
    --toast-height: 64px;
  }

  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .start-menu {
    padding:
      max(15px, env(safe-area-inset-top))
      max(15px, env(safe-area-inset-right))
      max(15px, env(safe-area-inset-bottom))
      max(15px, env(safe-area-inset-left));
  }

  .start-menu-content {
    width: min(100%, 380px);
    gap: clamp(20px, 4vh, 29px);
  }

  .start-menu-atmosphere i:nth-child(1) {
    width: min(116vw, 530px);
  }

  .start-menu-atmosphere i:nth-child(2) {
    width: min(88vw, 410px);
  }

  .brand-mark.start-menu-mark {
    width: 62px;
    height: 62px;
    margin-bottom: 18px;
  }

  .brand-mark.start-menu-mark::before {
    inset: 6px;
  }

  .brand-mark.start-menu-mark::after {
    inset: 15px;
  }

  .brand-mark.start-menu-mark span {
    width: 8px;
    height: 8px;
  }

  .start-menu-brand h1 {
    font-size: clamp(39px, 12.4vw, 48px);
  }

  .start-menu-brand p {
    margin-top: 10px;
    font-size: 8px;
    letter-spacing: 0.2em;
  }

  .start-menu-actions {
    gap: 8px;
  }

  .start-menu-action {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 56px;
    gap: 10px;
    padding: 7px 13px 7px 10px;
  }

  .start-menu-action-icon {
    width: 32px;
    height: 32px;
  }

  .start-menu-action-copy strong {
    font-size: 16px;
  }

  .start-menu-action-copy small {
    font-size: 7px;
  }

  .start-menu-login em {
    padding: 4px 5px 3px;
    font-size: 6px;
  }

  .start-menu-utilities button {
    min-height: 44px;
    gap: 5px;
    padding: 0 5px;
    font-size: 7px;
    letter-spacing: 0.07em;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    padding:
      calc(8px + env(safe-area-inset-top))
      max(13px, env(safe-area-inset-right))
      8px
      max(16px, env(safe-area-inset-left));
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 29px;
    height: 29px;
  }

  .brand-copy strong {
    font-size: 20px;
  }

  .brand-copy small,
  .progress-copy > span,
  .progress-track {
    display: none;
  }

  .progress-summary {
    position: absolute;
    top: calc(47px + env(safe-area-inset-top));
    left: max(55px, calc(env(safe-area-inset-left) + 39px));
    display: block;
  }

  .progress-copy strong {
    color: #7e8d96;
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 650;
  }

  .top-actions {
    gap: 1px;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .game-surface {
    grid-template-rows: minmax(430px, 1fr) auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  .workspace {
    grid-template-rows: auto auto minmax(260px, 1fr) auto;
    padding: 17px 14px 7px;
  }

  .instruction-block {
    margin-top: 4px;
  }

  .instruction-block h1 {
    font-size: clamp(25px, 7.8vw, 31px);
  }

  .instruction-block p {
    max-width: 300px;
    margin: 5px auto 0;
    font-size: 10px;
    line-height: 1.45;
  }

  .fusion-zone {
    grid-template-columns: minmax(105px, 138px) 58px minmax(105px, 138px);
    gap: 1px;
    padding: 9px 0 5px;
  }

  .meld-control {
    --meld-button-size: 50px;
    gap: 13px;
  }

  .orbit {
    width: 64px;
    height: 64px;
  }

  .orbit-two {
    width: 72px;
    height: 72px;
  }

  .slot-filled strong {
    bottom: -5px;
    font-size: 13px;
  }

  .status-line {
    min-height: 38px;
  }

  .status-line p {
    max-width: 220px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .known-tray {
    padding:
      13px
      max(14px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  .tray-heading {
    margin-bottom: 7px;
  }

  .tray-heading h2 {
    font-size: 15px;
  }

  .tray-actions {
    gap: 7px;
  }

  .tray-sort-field {
    width: 112px;
    height: 30px;
    padding-left: 7px;
  }

  .tray-sort-field > .icon:first-child {
    width: 12px;
    height: 12px;
  }

  .tray-sort-field select {
    padding-left: 6px;
    font-size: 8px;
  }

  .tray-category-filter {
    flex-basis: 104px;
    width: 104px;
    height: 30px;
    gap: 5px;
    padding: 0 7px;
    font-size: 8px;
  }

  .tray-category-filter > .icon:first-child {
    width: 12px;
    height: 12px;
  }

  .text-button span {
    display: none;
  }

  .text-button {
    gap: 6px;
  }

  .quickbar-shell {
    padding: 0;
  }

  .quickbar-shell::before {
    left: 0;
  }

  .quickbar-shell::after {
    right: 0;
  }

  .quickbar-shell::before,
  .quickbar-shell::after {
    width: 28px;
  }

  .quickbar-scroll {
    display: none;
  }

  .element-strip {
    min-height: 88px;
    gap: 2px;
    padding-right: 28px;
    -webkit-overflow-scrolling: touch;
  }

  .element-token {
    flex-basis: 74px;
    min-height: 85px;
  }

  .element-token img {
    width: 61px;
    height: 61px;
  }

  .element-token strong {
    max-width: 70px;
    font-size: 10px;
  }

  .element-token small {
    display: none;
  }

  .element-token .element-potential {
    display: inline-flex;
    margin-top: 1px;
    font-size: 5.9px;
    letter-spacing: 0.015em;
  }

  .collection-panel,
  .settings-panel {
    top: auto;
    width: 100%;
    height: min(88vh, 760px);
    height: min(88dvh, 760px);
    transform: translateY(102%);
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.48);
  }

  .collection-panel.open,
  .settings-panel.open {
    transform: translateY(0);
  }

  .collection-panel::before,
  .settings-panel::before {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 34px;
    height: 3px;
    content: "";
    transform: translateX(-50%);
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.17);
  }

  .panel-header {
    min-height: 78px;
    padding-top: 20px;
  }

  .collection-grid {
    grid-template-columns: repeat(3, 1fr);
    height: auto;
    min-height: 0;
  }

  .search-field input {
    font-size: 16px;
  }

  .collection-sort-field select {
    font-size: 16px;
    letter-spacing: 0;
  }

  .element-detail {
    border-radius: 18px 18px 0 0;
  }

  .element-detail-header {
    grid-template-columns: minmax(78px, auto) 1fr 42px;
    min-height: 70px;
    padding: 14px 10px 8px;
  }

  .element-detail-back {
    padding: 0 5px;
    font-size: 8px;
  }

  .element-detail-header > p {
    font-size: 7px;
  }

  .element-detail-scroll {
    padding: 18px 20px 25px;
  }

  .element-detail-hero {
    min-height: 154px;
  }

  .element-detail-hero::before {
    width: 134px;
  }

  .element-detail-rings {
    width: 158px;
  }

  .element-detail-hero img {
    width: 142px;
    height: 142px;
  }

  .element-detail-copy {
    padding-top: 8px;
    padding-bottom: 24px;
  }

  .element-detail-copy h2 {
    font-size: 31px;
  }

  .element-detail-copy > p:not(.element-detail-potential) {
    font-size: 11px;
    line-height: 1.58;
  }

  .element-results,
  .element-origins {
    padding-top: 24px;
  }

  .element-results > header,
  .element-origins > header {
    display: grid;
    align-items: start;
    gap: 7px;
  }

  .element-results > header > small,
  .element-origins > header > small {
    max-width: none;
    text-align: left;
  }

  .element-result-list {
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 13px 6px;
  }

  .element-result-medallion,
  .element-result-medallion img {
    width: 49px;
    height: 49px;
  }

  .element-result-token.unknown .element-result-medallion {
    width: 44px;
    height: 44px;
    margin: 2.5px;
  }

  .element-origin-row {
    min-height: 78px;
  }

  .element-origin-input {
    grid-template-columns: 43px minmax(0, 1fr);
  }

  .element-origin-input:last-child {
    grid-template-columns: minmax(0, 1fr) 43px;
  }

  .element-origin-input img {
    width: 43px;
    height: 43px;
  }

  .element-origin-unknown {
    width: 37px;
    height: 37px;
  }

  .element-origin-input strong {
    font-size: 11px;
  }

  .element-detail-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .quickbar-manager {
    margin-right: 16px;
    margin-left: 16px;
  }

  .quickbar-manage-hint {
    margin-right: 16px;
    margin-left: 16px;
  }

  .discovery-content img {
    width: min(68vw, 275px);
  }

  .discovery-description {
    max-width: min(86vw, 360px);
    font-size: 11px;
  }

  .discovery-overlay::before {
    width: 82vw;
  }

  .settings-panel {
    height: auto;
    max-height: min(88vh, 760px);
    max-height: min(88dvh, 760px);
  }

  .profile-section {
    padding-right: 16px;
    padding-left: 16px;
  }

  .community-dialog {
    align-items: end;
    padding:
      max(10px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      0
      max(8px, env(safe-area-inset-left));
  }

  .community-sheet {
    width: min(100%, 520px);
    max-height: calc(100dvh - max(10px, env(safe-area-inset-top)));
    transform: translateY(28px);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }

  .community-sheet::after {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 34px;
    height: 3px;
    content: "";
    transform: translateX(-50%);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.16);
  }

  .community-header {
    min-height: 78px;
    padding-top: 22px;
  }

  .community-header h2 {
    font-size: 26px;
  }

  .leaderboard-sheet {
    min-height: min(82dvh, 650px);
  }

  .leaderboard-list {
    -webkit-overflow-scrolling: touch;
  }

  .tutorial-trigger {
    gap: 6px;
    padding: 0 9px;
  }

  .tutorial-trigger span {
    font-size: 8px;
  }

  .tutorial-overlay {
    gap: 8px;
    padding:
      max(12px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  .tutorial-overlay::before {
    width: min(88vw, 520px);
  }

  .tutorial-overlay::after {
    width: min(118vw, 680px);
  }

  .tutorial-header {
    min-height: 50px;
  }

  .tutorial-header h2 {
    font-size: 24px;
  }

  .tutorial-close {
    margin-top: -7px;
    margin-right: -7px;
  }

  .tutorial-stage {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .tutorial-stage::-webkit-scrollbar {
    display: none;
  }

  .tutorial-step {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(150px, 1fr) auto;
    height: auto;
    min-height: 100%;
    align-content: center;
    gap: 5px;
    padding: 2px 0 9px;
  }

  .tutorial-visual {
    min-height: clamp(158px, 28svh, 220px);
  }

  .tutorial-visual::after {
    right: 12%;
    bottom: 4%;
    left: 12%;
  }

  .tutorial-medallion {
    width: clamp(92px, 29vw, 126px);
  }

  .tutorial-demo-element strong {
    font-size: 14px;
  }

  .tutorial-tap-mark {
    right: -1px;
    bottom: 23px;
    width: 20px;
    height: 20px;
  }

  .tutorial-demo-slot {
    width: clamp(100px, 29vw, 126px);
  }

  .tutorial-slots-demo {
    grid-template-columns: auto minmax(25px, 48px) auto;
    gap: 5px;
  }

  .tutorial-demo-slot small {
    bottom: -20px;
    font-size: 6px;
  }

  .tutorial-demo-slot strong {
    bottom: 9px;
    font-size: 12px;
  }

  .tutorial-slot-index {
    top: 7px;
    width: 20px;
    height: 20px;
  }

  .tutorial-meld-demo {
    grid-template-columns: auto 70px auto;
  }

  .tutorial-meld-element {
    width: clamp(89px, 26vw, 116px);
  }

  .tutorial-meld-symbol {
    gap: 35px;
  }

  .tutorial-meld-symbol > i {
    width: 63px;
    height: 63px;
  }

  .tutorial-meld-symbol > i:nth-child(2) {
    width: 75px;
    height: 75px;
    margin-top: -6px;
  }

  .tutorial-meld-symbol > span {
    width: 50px;
    height: 50px;
  }

  .tutorial-meld-symbol .icon {
    width: 19px;
    height: 19px;
  }

  .tutorial-reveal-rings {
    top: 42%;
    width: clamp(145px, 48vw, 190px);
  }

  .tutorial-result-medallion {
    width: clamp(124px, 39vw, 160px);
  }

  .tutorial-archive-record {
    width: min(96%, 340px);
    gap: 10px;
    padding: 8px 0;
  }

  .tutorial-step-copy {
    width: min(100%, 520px);
    max-width: none;
    margin-inline: auto;
  }

  .tutorial-step-number {
    margin-bottom: 5px;
  }

  .tutorial-step-copy h3 {
    font-size: clamp(27px, 8.2vw, 35px);
  }

  .tutorial-step-copy > p:last-child {
    max-width: 520px;
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.5;
  }

  .tutorial-footer {
    grid-template-columns: 1fr auto;
    min-height: 94px;
    align-content: end;
    align-items: center;
    gap: 2px 12px;
  }

  .tutorial-skip {
    align-self: center;
  }

  .tutorial-progress-group {
    justify-self: end;
    padding: 0;
  }

  .tutorial-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(90px, 0.65fr) minmax(130px, 1fr);
    width: 100%;
    gap: 8px;
  }

  .tutorial-previous,
  .tutorial-next {
    width: 100%;
  }
}

@media (max-height: 640px) {
  .start-menu-content {
    gap: 17px;
  }

  .brand-mark.start-menu-mark {
    width: 52px;
    height: 52px;
    margin-bottom: 13px;
  }

  .brand-mark.start-menu-mark::before {
    inset: 5px;
  }

  .brand-mark.start-menu-mark::after {
    inset: 12px;
  }

  .start-menu-brand h1 {
    font-size: 36px;
  }

  .start-menu-brand p {
    margin-top: 7px;
    font-size: 7px;
  }

  .start-menu-action {
    min-height: 52px;
  }

  .start-menu-guest-note {
    font-size: 7px;
  }

  .start-menu-utilities button {
    min-height: 44px;
  }

  .community-header {
    min-height: 70px;
  }

  .community-intro {
    padding-top: 12px;
  }

  .auth-tabs {
    margin-top: 12px;
  }

  .auth-form {
    gap: 9px;
    padding-top: 13px;
    padding-bottom: 13px;
  }

  .social-auth {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (min-width: 640px) and (max-height: 500px) {
  .start-menu {
    padding:
      max(12px, env(safe-area-inset-top))
      max(24px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(24px, env(safe-area-inset-left));
  }

  .start-menu-content {
    grid-template-columns: minmax(210px, 0.8fr) minmax(330px, 1.2fr);
    width: min(100%, 820px);
    gap: clamp(44px, 8vw, 90px);
  }

  .brand-mark.start-menu-mark {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
  }

  .start-menu-brand h1 {
    font-size: 40px;
  }

  .start-menu-actions {
    width: min(100%, 390px);
  }
}

@media (max-width: 370px) {
  .brand-copy small {
    display: none;
  }

  .tray-heading > div:first-child {
    display: none;
  }

  .tray-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .progress-summary {
    top: 42px;
  }

  .fusion-zone {
    grid-template-columns: minmax(96px, 122px) 48px minmax(96px, 122px);
  }

  .meld-control {
    --meld-button-size: 44px;
  }

  .orbit {
    width: 58px;
    height: 58px;
  }

  .orbit-two {
    width: 66px;
    height: 66px;
  }

  .clear-combination span {
    display: none;
  }

  .tutorial-trigger {
    width: 44px;
    padding: 0;
    border-radius: 50%;
  }

  .tutorial-trigger span {
    display: none;
  }

  .tutorial-pick-demo {
    grid-template-columns: auto 22px auto;
    gap: 5px;
  }

  .tutorial-archive-record {
    gap: 7px;
  }

  .tutorial-archive-record strong {
    font-size: 15px;
  }

  .tutorial-archive-record em {
    font-size: 7px;
  }
}

@media (max-width: 480px) {
  .tray-heading > div:first-child {
    min-width: 0;
  }

  .tray-heading h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tray-sort-field {
    width: 92px;
  }

  .tray-category-filter {
    flex-basis: 96px;
    width: 96px;
  }

  .tray-category-filter > .icon:first-child {
    display: none;
  }
}

@media (min-width: 721px) and (max-height: 700px) {
  .tutorial-overlay {
    gap: 6px;
    padding:
      max(11px, env(safe-area-inset-top))
      max(18px, env(safe-area-inset-right))
      max(11px, env(safe-area-inset-bottom))
      max(18px, env(safe-area-inset-left));
  }

  .tutorial-header {
    min-height: 45px;
  }

  .tutorial-header h2 {
    font-size: 24px;
  }

  .tutorial-step {
    gap: clamp(28px, 5vw, 64px);
  }

  .tutorial-visual {
    min-height: 190px;
  }

  .tutorial-step-copy h3 {
    font-size: clamp(30px, 3.6vw, 40px);
  }

  .tutorial-step-copy > p:last-child {
    margin-top: 9px;
    font-size: 11px;
    line-height: 1.5;
  }

  .tutorial-footer {
    min-height: 50px;
  }

  .tutorial-medallion,
  .tutorial-demo-slot,
  .tutorial-meld-element {
    max-width: 132px;
  }

  .tutorial-result-medallion {
    max-width: 170px;
  }
}

@media (max-width: 720px) and (max-height: 700px) {
  .game-surface {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .workspace {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    min-height: 0;
  }

  .discovery-content img {
    width: min(48vw, 190px);
  }

  .discovery-content h2 {
    font-size: 30px;
  }

  .discovery-description {
    margin-top: 5px;
    margin-bottom: 9px;
    font-size: 10px;
  }

  .element-detail-scroll {
    padding-top: 12px;
  }

  .element-detail-hero {
    min-height: 126px;
  }

  .element-detail-hero::before {
    width: 108px;
  }

  .element-detail-rings {
    width: 130px;
  }

  .element-detail-hero img {
    width: 118px;
    height: 118px;
  }

  .tutorial-overlay {
    gap: 4px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .tutorial-header {
    min-height: 43px;
  }

  .tutorial-kicker {
    display: none;
  }

  .tutorial-header h2 {
    font-size: 21px;
  }

  .tutorial-step {
    grid-template-rows: minmax(132px, auto) auto;
  }

  .tutorial-visual {
    min-height: 140px;
  }

  .tutorial-step-copy h3 {
    font-size: clamp(24px, 7.3vw, 30px);
  }

  .tutorial-step-copy > p:last-child {
    font-size: 10px;
    line-height: 1.4;
  }

  .tutorial-footer {
    min-height: 86px;
  }

  .tutorial-skip,
  .tutorial-previous,
  .tutorial-next {
    min-height: 44px;
  }
}

@media (max-width: 720px) and (max-height: 620px) {
  :root {
    --topbar-height: 60px;
    --toast-height: 52px;
  }

  .topbar {
    padding-top: calc(4px + env(safe-area-inset-top));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: 4px;
    padding-left: max(11px, env(safe-area-inset-left));
  }

  .brand {
    min-height: 44px;
    gap: 8px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .progress-summary {
    top: calc(39px + env(safe-area-inset-top));
    left: max(47px, calc(env(safe-area-inset-left) + 36px));
  }

  .top-actions .icon-button {
    width: 44px;
    height: 44px;
  }

  .game-surface {
    grid-template-rows: minmax(0, 1fr) calc(123px + max(3px, env(safe-area-inset-bottom)));
  }

  .workspace {
    grid-template-rows: 44px auto minmax(0, 1fr) 44px;
    padding: 4px 11px 2px;
  }

  .workspace-heading .section-kicker {
    font-size: 8px;
    letter-spacing: 0.15em;
  }

  .tutorial-trigger {
    min-height: 44px;
  }

  .instruction-block {
    margin-top: 0;
  }

  .instruction-block h1 {
    font-size: clamp(22px, 7.2vw, 25px);
  }

  .instruction-block p {
    max-width: 276px;
    margin-top: 3px;
    font-size: 9px;
    line-height: 1.35;
  }

  .fusion-zone {
    grid-template-columns: minmax(88px, 100px) 50px minmax(88px, 100px);
    min-height: 0;
    padding: 2px 0;
  }

  .slot-empty {
    gap: 5px;
  }

  .slot-glyph {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .slot-empty small {
    font-size: 8px;
    line-height: 1.25;
  }

  .meld-control {
    --meld-button-size: 46px;
    gap: 10px;
  }

  .orbit {
    width: 58px;
    height: 58px;
  }

  .orbit-two {
    width: 66px;
    height: 66px;
  }

  .status-line {
    min-height: 44px;
  }

  .status-line p {
    font-size: 9px;
  }

  .known-tray {
    height: calc(123px + max(3px, env(safe-area-inset-bottom)));
    padding:
      5px
      max(10px, env(safe-area-inset-right))
      max(3px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
    overflow: hidden;
  }

  .tray-heading {
    min-height: 28px;
    margin-bottom: 2px;
  }

  .tray-heading .section-kicker {
    display: none;
  }

  .tray-heading h2 {
    margin: 0;
    font-size: 14px;
  }

  .tray-heading .text-button {
    min-height: 30px;
  }

  .tray-actions {
    gap: 5px;
  }

  .tray-sort-field {
    width: 104px;
    height: 28px;
  }

  .tray-sort-field select {
    font-size: 7.5px;
  }

  .element-strip {
    height: 86px;
    min-height: 86px;
    padding-top: 1px;
    padding-bottom: 1px;
  }

  .element-token {
    flex-basis: 64px;
    min-height: 82px;
    gap: 2px;
    padding-bottom: 2px;
  }

  .element-token img {
    width: 52px;
    height: 52px;
  }

  .element-token strong {
    max-width: 61px;
    font-size: 9px;
  }

  .element-token .element-potential {
    font-size: 5.5px;
  }

  .quickbar-divider {
    min-height: 80px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .element-token img,
  .collection-item img {
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    user-select: none;
  }
}

@media (min-width: 721px) and (max-height: 780px) {
  .known-tray {
    --quickbar-medallion-size: clamp(78px, 11vh, 88px);
    padding-top: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .tray-heading {
    margin-bottom: 7px;
  }

  .tray-heading .text-button {
    min-height: 36px;
  }

}

@media (min-width: 1100px) and (min-height: 930px) {
  .game-surface {
    grid-template-rows: minmax(560px, 1fr) auto;
  }

  .known-tray {
    padding-top: 20px;
    padding-bottom: 22px;
  }
}

@media (orientation: landscape) and (max-width: 520px) and (max-height: 520px) and (hover: none) and (pointer: coarse),
  (orientation: landscape) and (max-width: 950px) and (max-height: 280px) and (hover: none) and (pointer: coarse) {
  .orientation-guard {
    position: fixed;
    z-index: 190;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 10px;
    padding:
      max(18px, env(safe-area-inset-top))
      max(26px, env(safe-area-inset-right))
      max(18px, env(safe-area-inset-bottom))
      max(26px, env(safe-area-inset-left));
    overflow: hidden;
    background:
      radial-gradient(circle at 50% 50%, rgba(41, 132, 148, 0.13), transparent 30%),
      linear-gradient(155deg, #071523, #030a12 58%, #07111c);
    text-align: center;
  }

  .orientation-guard::before,
  .orientation-guard::after {
    position: absolute;
    z-index: -1;
    width: min(52vh, 260px);
    aspect-ratio: 1;
    content: "";
    border: 1px solid rgba(200, 167, 102, 0.1);
    transform: rotate(45deg);
  }

  .orientation-guard::after {
    width: min(76vh, 370px);
    transform: none;
    border-color: rgba(99, 217, 232, 0.07);
    border-radius: 50%;
  }

  .orientation-device {
    animation: orientation-turn 2.8s var(--ease-out) infinite;
  }
}

@media (orientation: landscape) and (min-width: 521px) and (min-height: 281px) and (max-width: 950px) and (max-height: 520px) and (hover: none) and (pointer: coarse) {
  :root {
    --topbar-height: 52px;
    --toast-height: 48px;
    --landscape-tray-height: 110px;
  }

  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .orientation-guard {
    display: none;
  }

  .topbar {
    grid-template-columns: minmax(116px, 0.8fr) auto minmax(96px, 0.8fr);
    min-height: calc(var(--topbar-height) + env(safe-area-inset-top));
    padding:
      calc(4px + env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      4px
      max(10px, env(safe-area-inset-left));
  }

  .brand {
    min-height: 44px;
    gap: 8px;
  }

  .brand-mark {
    width: 27px;
    height: 27px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .brand-copy small,
  .progress-copy > span,
  .progress-track {
    display: none;
  }

  .progress-summary {
    position: static;
    display: block;
    justify-self: center;
  }

  .progress-copy {
    gap: 0;
  }

  .progress-copy strong {
    color: #8d9ba2;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 700;
  }

  .progress-copy em {
    font-size: 8px;
  }

  .top-actions {
    gap: 0;
  }

  .top-actions .icon-button {
    width: 44px;
    height: 44px;
  }

  .toast,
  body.menu-open .toast {
    position: fixed;
    top: calc(var(--topbar-height) + env(safe-area-inset-top) + 5px);
    width: min(390px, calc(100% - max(24px, env(safe-area-inset-left) + env(safe-area-inset-right))));
    height: var(--toast-height);
    padding: 8px 12px;
    font-size: 10px;
  }

  body.menu-open .toast {
    top: max(8px, env(safe-area-inset-top));
  }

  .game-surface {
    grid-template-rows:
      minmax(0, 1fr)
      calc(var(--landscape-tray-height) + env(safe-area-inset-bottom));
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .workspace {
    grid-template-columns: minmax(132px, 0.68fr) minmax(292px, 1.5fr);
    grid-template-rows: 44px minmax(0, 1fr) 44px;
    width: 100%;
    height: 100%;
    min-height: 0;
    column-gap: clamp(8px, 2vw, 20px);
    margin: 0;
    padding:
      0
      max(10px, env(safe-area-inset-right))
      0
      max(12px, env(safe-area-inset-left));
  }

  .workspace::before {
    top: 50%;
    left: 70%;
    width: min(58dvh, 260px);
  }

  .workspace-heading {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    align-self: start;
  }

  .workspace-heading .section-kicker {
    min-width: 0;
    overflow: hidden;
    font-size: 7px;
    letter-spacing: 0.1em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tutorial-trigger {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
  }

  .tutorial-trigger span {
    display: none;
  }

  .instruction-block {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    min-width: 0;
    margin: 0;
    text-align: left;
  }

  .instruction-block h1 {
    max-width: 210px;
    font-size: clamp(22px, 3.7vw, 29px);
    line-height: 0.98;
  }

  .instruction-block p {
    max-width: 220px;
    margin: 6px 0 0;
    font-size: 8px;
    line-height: 1.38;
  }

  .fusion-zone {
    grid-column: 2;
    grid-row: 1 / 4;
    grid-template-columns:
      clamp(92px, 33dvh, 142px)
      clamp(48px, 7vw, 60px)
      clamp(92px, 33dvh, 142px);
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    gap: clamp(0px, 1vw, 10px);
    padding: 0;
  }

  .fusion-zone::before {
    width: min(100%, 430px);
  }

  .element-slot-shell {
    align-self: center;
  }

  .element-slot {
    padding: 4px;
  }

  .slot-lock,
  .slot-info {
    top: -42px;
  }

  [data-slot-shell="a"] .slot-lock {
    right: 0;
  }

  [data-slot-shell="b"] .slot-lock {
    left: 0;
  }

  [data-slot-shell="a"] .slot-info {
    left: 0;
  }

  [data-slot-shell="b"] .slot-info {
    right: 0;
  }

  .slot-empty {
    gap: 4px;
  }

  .slot-glyph {
    width: 27px;
    height: 27px;
    font-size: 11px;
  }

  .slot-empty small {
    max-width: 64px;
    font-size: 7px;
    line-height: 1.25;
  }

  .slot-filled strong {
    bottom: -3px;
    font-size: clamp(11px, 2.1vw, 14px);
  }

  .meld-control {
    --meld-button-size: 48px;
    gap: 10px;
  }

  .meld-control > small {
    font-size: 7px;
  }

  .meld-button .icon {
    width: 20px;
    height: 20px;
  }

  .orbit {
    width: 60px;
    height: 60px;
  }

  .orbit-two {
    width: 68px;
    height: 68px;
  }

  .status-line {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
    min-height: 44px;
    justify-content: flex-start;
    gap: 7px;
  }

  .status-line p {
    max-width: min(22vw, 180px);
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .clear-combination {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    margin-left: auto;
    padding: 0;
    justify-content: center;
  }

  .clear-combination span {
    display: none;
  }

  .known-tray {
    height: calc(var(--landscape-tray-height) + env(safe-area-inset-bottom));
    min-height: 0;
    padding:
      0
      max(10px, env(safe-area-inset-right))
      env(safe-area-inset-bottom)
      max(10px, env(safe-area-inset-left));
    overflow: hidden;
  }

  .tray-heading {
    height: 44px;
    min-height: 44px;
    margin: 0 auto;
  }

  .tray-heading .section-kicker {
    display: none;
  }

  .tray-heading h2 {
    margin: 0;
    font-size: 14px;
  }

  .tray-actions {
    gap: 5px;
  }

  .tray-sort-field {
    width: 116px;
    height: 44px;
    padding-left: 8px;
  }

  .tray-sort-field select {
    padding-left: 6px;
    font-size: 7.5px;
  }

  .tray-sort-field > .icon:first-child {
    width: 12px;
    height: 12px;
  }

  .tray-category-filter {
    flex-basis: 110px;
    width: 110px;
    height: 44px;
    font-size: 7.5px;
  }

  .text-button {
    min-height: 44px;
    gap: 6px;
  }

  .text-button span {
    display: none;
  }

  .quickbar-shell {
    max-width: none;
    height: calc(100% - 44px);
    min-height: 0;
    padding: 0;
  }

  .quickbar-shell::before {
    left: 0;
  }

  .quickbar-shell::after {
    right: 0;
  }

  .quickbar-shell::before,
  .quickbar-shell::after {
    width: 28px;
  }

  .quickbar-scroll {
    display: none;
  }

  .element-strip {
    height: 100%;
    min-height: 0;
    gap: 2px;
    padding: 0 24px 0 2px;
    -webkit-overflow-scrolling: touch;
  }

  .element-token {
    flex-basis: 68px;
    min-width: 68px;
    min-height: 64px;
    align-content: start;
    gap: 0;
    padding: 0 3px 1px;
  }

  .element-token img {
    width: 45px;
    height: 45px;
  }

  .element-token strong {
    max-width: 62px;
    font-size: 9px;
  }

  .element-token small {
    display: none;
  }

  .element-token .element-potential {
    display: inline-flex;
    margin-top: 0;
    font-size: 5.4px;
    letter-spacing: 0.01em;
  }

  .element-token.pinned::before {
    top: 3px;
    left: 7px;
  }

  .new-dot {
    top: 2px;
    right: 6px;
  }

  .quickbar-divider {
    flex-basis: 48px;
    min-height: 62px;
    gap: 4px;
  }

  .quickbar-divider i {
    height: 28px;
  }

  .collection-panel,
  .settings-panel {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(76vw, 600px);
    height: 100vh;
    height: 100dvh;
    max-height: none;
    transform: translateX(102%);
    border-top: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    box-shadow: -26px 0 70px rgba(0, 0, 0, 0.48);
  }

  .settings-panel {
    width: min(80vw, 540px);
  }

  .collection-panel.open,
  .settings-panel.open {
    transform: translateX(0);
  }

  .collection-panel::before,
  .settings-panel::before {
    display: none;
    content: none;
  }

  .panel-header {
    min-height: 56px;
    padding:
      5px
      max(10px, env(safe-area-inset-right))
      5px
      14px;
  }

  .panel-header h2 {
    font-size: 22px;
  }

  .collection-tools {
    gap: 7px;
    padding: 5px max(10px, env(safe-area-inset-right)) 4px 14px;
  }

  .collection-progress-filters {
    gap: 0 14px;
  }

  .collection-completion-filter {
    min-height: 22px;
  }

  .search-field,
  .collection-sort-field {
    height: 44px;
  }

  .collection-sort-field {
    width: 148px;
  }

  .search-field input,
  .collection-sort-field select {
    font-size: 16px;
  }

  .collection-sort-field select {
    letter-spacing: 0;
  }

  .quickbar-manager {
    min-height: 48px;
    margin: 0 max(10px, env(safe-area-inset-right)) 4px 14px;
    padding: 5px 10px;
  }

  .quickbar-manager small {
    display: none;
  }

  .quickbar-manage-hint {
    margin: 0 max(10px, env(safe-area-inset-right)) 4px 14px;
    font-size: 8px;
  }

  .collection-tabs {
    padding: 0 max(10px, env(safe-area-inset-right)) 0 14px;
  }

  .collection-tabs button {
    min-height: 44px;
  }

  .all-archive-note {
    padding: 6px 14px;
    font-size: 8px;
  }

  .collection-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px 5px;
    height: auto;
    min-height: 0;
    padding:
      9px
      max(10px, env(safe-area-inset-right))
      max(18px, env(safe-area-inset-bottom))
      10px;
  }

  .collection-item {
    min-height: 94px;
  }

  .collection-item img,
  .locked-medallion {
    width: min(100%, 72px);
  }

  .collection-item strong {
    font-size: 10px;
  }

  .collection-item small {
    font-size: 7px;
  }

  .element-detail {
    border-radius: 0;
  }

  .element-detail-header {
    grid-template-columns: minmax(76px, auto) 1fr 44px;
    min-height: 56px;
    padding: 5px max(8px, env(safe-area-inset-right)) 5px 8px;
  }

  .element-detail-scroll {
    display: grid;
    grid-template-columns: minmax(118px, 0.58fr) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 0 15px;
    padding: 10px max(12px, env(safe-area-inset-right)) 18px 12px;
    overflow-y: auto;
  }

  .element-detail-hero {
    position: sticky;
    top: 0;
    grid-column: 1;
    grid-row: 1 / 4;
    min-height: 130px;
    align-self: start;
  }

  .element-detail-hero::before {
    width: 108px;
  }

  .element-detail-rings {
    width: 128px;
  }

  .element-detail-hero img {
    width: 116px;
    height: 116px;
  }

  .element-detail-copy {
    grid-column: 2;
    grid-row: 1;
    justify-items: start;
    padding: 0 0 14px;
    text-align: left;
  }

  .element-detail-copy::after {
    left: 0;
    transform: none;
  }

  .element-detail-copy h2 {
    font-size: 28px;
  }

  .element-detail-copy > p:not(.element-detail-potential) {
    margin-top: 6px;
    font-size: 10px;
    line-height: 1.45;
  }

  .element-detail-potential {
    min-height: 28px;
    margin-top: 8px;
  }

  .element-results {
    grid-column: 2;
    grid-row: 2;
    padding-top: 12px;
  }

  .element-origins {
    grid-column: 2;
    grid-row: 3;
    padding-top: 12px;
  }

  .element-results > header,
  .element-origins > header {
    display: grid;
    align-items: start;
    gap: 5px;
    margin-bottom: 6px;
  }

  .element-results > header > small,
  .element-origins > header > small {
    max-width: none;
    text-align: left;
  }

  .element-result-list {
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    min-height: 62px;
    gap: 9px 5px;
    padding: 10px 0 12px;
  }

  .element-result-medallion,
  .element-result-medallion img {
    width: 44px;
    height: 44px;
  }

  .element-result-token.unknown .element-result-medallion {
    width: 40px;
    height: 40px;
    margin: 2px;
    font-size: 16px;
  }

  .element-result-token > strong {
    font-size: 7px;
  }

  .element-result-token:not(.unknown) > strong {
    font-size: 9px;
  }

  .element-origin-row {
    min-height: 72px;
    padding: 10px 0;
  }

  .element-origin-input,
  .element-origin-input:last-child {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .element-origin-input:last-child {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .element-origin-input img {
    width: 40px;
    height: 40px;
  }

  .element-origin-unknown {
    width: 34px;
    height: 34px;
  }

  .element-detail-footer {
    padding:
      6px
      max(12px, env(safe-area-inset-right))
      max(6px, env(safe-area-inset-bottom))
      12px;
  }

  .element-detail-footer .primary-button {
    min-height: 44px;
  }

  .settings-scroll {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .profile-section {
    gap: 8px;
    padding: 12px max(12px, env(safe-area-inset-right)) 14px 16px;
  }

  .profile-heading h3 {
    font-size: 19px;
  }

  .profile-detail,
  .profile-rule,
  .profile-feedback {
    font-size: 9px;
    line-height: 1.42;
  }

  .profile-actions {
    gap: 6px;
  }

  .profile-action,
  .profile-delete {
    min-height: 44px;
  }

  .setting-row {
    grid-template-columns: 40px 1fr auto;
    min-height: 58px;
    gap: 10px;
    padding: 0 max(14px, env(safe-area-inset-right)) 0 16px;
  }

  .setting-row strong {
    font-size: 14px;
  }

  .setting-row small {
    font-size: 8px;
  }

  .setting-icon {
    width: 34px;
    height: 34px;
  }

  .setting-section,
  .settings-credits {
    padding: 14px max(14px, env(safe-area-inset-right)) 14px 16px;
  }

  .data-management {
    margin-top: 38px;
  }

  .data-management summary {
    min-height: 54px;
    padding:
      5px
      max(14px, env(safe-area-inset-right))
      max(5px, env(safe-area-inset-bottom))
      16px;
  }

  .data-management-body {
    padding:
      2px
      max(14px, env(safe-area-inset-right))
      max(18px, env(safe-area-inset-bottom))
      16px;
  }

  .community-dialog {
    place-items: center;
    align-items: center;
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .community-sheet {
    width: min(100%, 760px);
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
    transform: translateY(10px) scale(0.99);
    border: 1px solid rgba(200, 167, 102, 0.28);
    border-radius: 2px;
  }

  .community-sheet::after {
    display: none;
    content: none;
  }

  .community-header {
    min-height: 62px;
    padding: 8px 14px;
  }

  .community-header h2 {
    font-size: 24px;
  }

  .community-intro {
    padding: 10px 14px 0;
    font-size: 9px;
    line-height: 1.45;
  }

  .auth-sheet {
    display: grid;
    grid-template-columns: minmax(170px, 0.72fr) minmax(290px, 1.28fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    width: min(100%, 740px);
    overflow-y: auto;
  }

  .auth-sheet > .community-header {
    grid-column: 1;
    grid-row: 1;
  }

  .auth-sheet > .community-intro {
    grid-column: 1;
    grid-row: 2;
  }

  .auth-sheet > .auth-back {
    grid-column: 1;
    grid-row: 3;
    margin: 2px 14px 0;
  }

  .auth-sheet > .auth-tabs {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    margin: 8px 14px 0;
  }

  .auth-sheet > #authForm {
    grid-column: 2;
    grid-row: 2 / 5;
    align-self: start;
    gap: 6px;
    padding: 8px 14px 12px;
  }

  .auth-sheet > .social-auth {
    grid-column: 1;
    grid-row: 4;
    align-self: end;
    padding: 8px 14px 12px;
  }

  .auth-sheet > .social-username-form {
    grid-column: 2;
    grid-row: 1 / 5;
    align-self: center;
    gap: 7px;
    padding: 12px 16px;
  }

  .auth-form label {
    gap: 3px;
  }

  .auth-form input,
  .delete-form input[type="password"] {
    min-height: 44px;
  }

  .forgot-password {
    min-height: 34px;
    margin-top: -4px;
  }

  .form-feedback {
    min-height: 13px;
  }

  .social-auth {
    gap: 7px;
  }

  .social-auth button {
    min-height: 48px;
  }

  .leaderboard-sheet {
    display: grid;
    grid-template-columns: minmax(180px, 0.65fr) minmax(300px, 1.35fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(100%, 760px);
    height: min(92dvh, 360px);
    min-height: 0;
    overflow: hidden;
  }

  .leaderboard-sheet > .community-header {
    grid-column: 1;
    grid-row: 1;
  }

  .leaderboard-sheet > .community-intro {
    grid-column: 1;
    grid-row: 2;
  }

  .leaderboard-state,
  .leaderboard-list {
    grid-column: 2;
    grid-row: 1 / 3;
    min-height: 0;
  }

  .leaderboard-state {
    padding: 16px;
  }

  .leaderboard-list {
    margin: 0;
    padding: 6px 16px;
  }

  .leaderboard-entry {
    min-height: 52px;
  }

  .leaderboard-footer {
    grid-column: 1 / -1;
    grid-row: 3;
    min-height: 52px;
    margin-top: 0;
    padding:
      4px
      14px
      max(4px, env(safe-area-inset-bottom))
      14px;
  }

  .leaderboard-state button,
  .leaderboard-footer button {
    min-height: 44px;
  }

  .delete-sheet {
    display: grid;
    grid-template-columns: minmax(170px, 0.72fr) minmax(290px, 1.28fr);
    grid-template-rows: auto minmax(0, 1fr);
    width: min(100%, 650px);
  }

  .delete-sheet > .community-header {
    grid-column: 1;
    grid-row: 1;
  }

  .delete-sheet > .community-intro {
    grid-column: 1;
    grid-row: 2;
  }

  .delete-sheet > .delete-form {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    gap: 8px;
    padding: 12px 16px;
  }

  .discovery-content {
    grid-template-columns: minmax(170px, 0.88fr) minmax(220px, 1.12fr);
    grid-template-rows: auto auto auto auto auto auto auto;
    width: min(88vw, 720px);
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
    align-items: center;
    column-gap: clamp(22px, 5vw, 58px);
    padding: 8px 0;
    overflow: hidden;
    text-align: left;
  }

  .discovery-content img {
    grid-column: 1;
    grid-row: 1 / 8;
    width: min(58dvh, 220px);
    justify-self: center;
  }

  .discovery-kicker,
  .discovery-number,
  .discovery-content h2,
  .discovery-description,
  .discovery-origin-label,
  .discovery-formula,
  .discovery-content .primary-button {
    grid-column: 2;
    justify-self: start;
  }

  .discovery-kicker {
    grid-row: 1;
    margin: 0 0 2px;
    font-size: 8px;
  }

  .discovery-number {
    grid-row: 2;
    margin: 0;
  }

  .discovery-content h2 {
    grid-row: 3;
    margin-top: 1px;
    font-size: clamp(31px, 6vw, 44px);
  }

  .discovery-description {
    grid-row: 4;
    max-width: 390px;
    margin: 4px 0 7px;
    font-size: 10px;
    line-height: 1.42;
  }

  .discovery-origin-label {
    grid-row: 5;
  }

  .discovery-formula {
    grid-row: 6;
    margin: 3px 0 8px;
    font-size: 12px;
  }

  .discovery-content .primary-button {
    grid-row: 7;
    min-width: 140px;
    min-height: 44px;
  }

  .discovery-overlay::before {
    width: min(58dvh, 250px);
  }

  .discovery-overlay::after {
    width: min(48dvh, 210px);
  }

  .discovery-radiance {
    top: 50%;
    left: 31%;
  }

  .discovery-close {
    top: max(6px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
  }

  .tutorial-overlay {
    grid-template-rows: 44px minmax(0, 1fr) 52px;
    gap: 4px;
    padding:
      max(6px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(6px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .tutorial-overlay::before {
    width: min(52dvh, 250px);
  }

  .tutorial-overlay::after {
    width: min(72dvh, 340px);
  }

  .tutorial-header {
    min-height: 44px;
    align-items: center;
  }

  .tutorial-kicker {
    display: none;
  }

  .tutorial-header h2 {
    font-size: 21px;
  }

  .tutorial-close {
    margin: 0 -4px 0 0;
  }

  .tutorial-stage {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .tutorial-stage::-webkit-scrollbar {
    display: none;
  }

  .tutorial-step {
    grid-template-columns: minmax(250px, 1.08fr) minmax(220px, 0.92fr);
    grid-template-rows: minmax(0, 1fr);
    width: 100%;
    height: 100%;
    min-height: 0;
    align-items: center;
    gap: clamp(14px, 3vw, 34px);
    padding: 0;
  }

  .tutorial-visual {
    min-height: min(100%, 194px);
  }

  .tutorial-visual::after {
    right: 5%;
    bottom: 5%;
    left: 5%;
  }

  .tutorial-medallion,
  .tutorial-demo-slot {
    width: min(29dvh, 104px);
  }

  .tutorial-demo-element strong {
    font-size: 12px;
  }

  .tutorial-tap-mark {
    right: 0;
    bottom: 19px;
    width: 19px;
    height: 19px;
  }

  .tutorial-slots-demo {
    grid-template-columns: auto minmax(28px, 44px) auto;
    gap: 5px;
  }

  .tutorial-demo-slot small {
    bottom: -19px;
    font-size: 6px;
  }

  .tutorial-demo-slot strong {
    bottom: 8px;
    font-size: 11px;
  }

  .tutorial-slot-index {
    top: 5px;
    width: 20px;
    height: 20px;
  }

  .tutorial-meld-demo {
    grid-template-columns: auto 66px auto;
  }

  .tutorial-meld-element {
    width: min(27dvh, 98px);
  }

  .tutorial-meld-symbol {
    gap: 32px;
  }

  .tutorial-meld-symbol > i {
    width: 58px;
    height: 58px;
  }

  .tutorial-meld-symbol > i:nth-child(2) {
    width: 70px;
    height: 70px;
    margin-top: -6px;
  }

  .tutorial-meld-symbol > span {
    width: 48px;
    height: 48px;
  }

  .tutorial-meld-symbol .icon {
    width: 18px;
    height: 18px;
  }

  .tutorial-meld-symbol small {
    font-size: 6px;
  }

  .tutorial-reveal-rings {
    top: 42%;
    width: min(39dvh, 142px);
  }

  .tutorial-result-medallion {
    width: min(35dvh, 128px);
  }

  .tutorial-archive-record {
    width: min(94%, 290px);
    gap: 8px;
    padding: 6px 0;
  }

  .tutorial-archive-record strong {
    font-size: 14px;
  }

  .tutorial-archive-record em {
    font-size: 7px;
  }

  .tutorial-step-copy {
    width: 100%;
    max-width: 360px;
    margin: 0;
  }

  .tutorial-step-number {
    margin-bottom: 5px;
  }

  .tutorial-step-copy h3 {
    font-size: clamp(23px, 4.1vw, 32px);
  }

  .tutorial-step-copy > p:last-child {
    max-width: 360px;
    margin-top: 7px;
    font-size: 9.5px;
    line-height: 1.42;
  }

  .tutorial-footer {
    grid-template-columns: auto minmax(90px, 1fr) auto;
    min-height: 52px;
    align-content: center;
    align-items: center;
    gap: 6px 12px;
  }

  .tutorial-skip {
    align-self: center;
  }

  .tutorial-progress-group {
    justify-self: center;
    padding: 0;
  }

  .tutorial-actions {
    grid-column: auto;
    display: flex;
    width: auto;
    gap: 6px;
  }

  .tutorial-previous,
  .tutorial-next {
    width: auto;
    min-width: 88px;
    min-height: 44px;
  }

  .tutorial-next {
    min-width: 108px;
  }

  .start-menu {
    padding:
      max(8px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .start-menu-content {
    grid-template-columns: minmax(180px, 0.72fr) minmax(280px, 1.28fr);
    width: min(100%, 800px);
    align-items: center;
    gap: clamp(24px, 6vw, 62px);
  }

  .brand-mark.start-menu-mark {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
  }

  .brand-mark.start-menu-mark::before {
    inset: 5px;
  }

  .brand-mark.start-menu-mark::after {
    inset: 12px;
  }

  .start-menu-brand h1 {
    font-size: clamp(34px, 6.2vw, 46px);
  }

  .start-menu-brand p {
    margin-top: 7px;
    font-size: 7px;
  }

  .start-menu-actions {
    width: 100%;
    gap: 6px;
  }

  .start-menu-action {
    min-height: 50px;
  }

  .start-menu-guest-note {
    margin: -2px 0 1px;
    font-size: 7px;
    line-height: 1.35;
  }

  .start-menu-utilities {
    gap: 4px;
    margin-top: 0;
  }

  .start-menu-utilities button {
    min-height: 44px;
    padding: 0 5px;
    font-size: 7px;
  }

  .loading-screen {
    grid-template-columns: 60px minmax(300px, 430px);
    grid-template-rows: minmax(0, 1fr);
    align-content: center;
    align-items: center;
    justify-content: center;
    justify-items: center;
    gap: clamp(24px, 6vw, 54px);
    padding:
      max(10px, env(safe-area-inset-top))
      max(18px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(18px, env(safe-area-inset-left));
  }

  .loading-mark {
    width: 54px;
    height: 54px;
  }

  .loading-copy {
    width: 100%;
    min-height: 0;
    grid-template-rows: auto auto auto auto auto auto;
    gap: 5px;
  }

  .loading-screen strong {
    font-size: 36px;
  }

  .loading-screen h1 {
    font-size: 23px;
  }

  .loading-detail {
    font-size: 10px;
    line-height: 1.42;
  }

  .loading-actions {
    min-height: 44px;
  }
}

@keyframes orientation-turn {
  0%, 18% { transform: rotate(90deg); opacity: 0.58; }
  43%, 82% { transform: rotate(0); opacity: 1; }
  100% { transform: rotate(0); opacity: 0.58; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
