:root {
  color-scheme: dark;
  --night-1000: #071722;
  --night-950: #0b2232;
  --night-900: #142b3d;
  --night-850: #18394c;
  --night-800: #1d4659;
  --mist-blue: #23536a;
  --dusk-teal: #2b8190;
  --petrol: #176b80;
  --cyan: #50c4ce;
  --violet: #514377;
  --violet-light: #8b6ba8;
  --coral: #bd5363;
  --coral-dark: #843844;
  --leaf: #2c735b;
  --ochre: #e0aa32;
  --yellow: #f4cf3c;
  --cream: #f2f1d8;
  --cream-muted: #cbcdbd;
  --ink: #102536;
  --line: rgb(242 241 216 / 30%);
  --line-strong: rgb(242 241 216 / 58%);
  --danger: #ff7f83;
  --success: #9bd88c;
  --light-key: #fff0c7;
  --light-key-soft: rgb(255 240 199 / 15%);
  --light-rim: rgb(104 220 224 / 11%);
  --shadow-contact: rgb(4 21 31 / 82%);
  --shadow-ambient: rgb(3 17 27 / 42%);
  --shadow-card-contact: 6px 8px 0 var(--shadow-contact);
  --shadow-card-air: 14px 24px 34px var(--shadow-ambient);
  --paper-fibre: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' seed='17' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.38'/%3E%3C/svg%3E");
  --hand-perspective: 1380px;
  --shadow-color: rgb(4 18 29 / 52%);
  --shadow-low: 0 5px 0 rgb(5 25 37 / 82%), 0 12px 24px var(--shadow-color);
  --shadow-high: 0 9px 0 rgb(5 25 37 / 88%), 0 26px 44px rgb(4 18 29 / 48%);
  --radius-sm: 6px;
  --radius-md: 11px;
  --radius-lg: 18px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-fast: 160ms;
  --motion-medium: 260ms;
  --z-base: 0;
  --z-panel: 10;
  --z-card: 20;
  --z-tools: 40;
  --z-skip: 100;
  --z-grain: 1000;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--night-950);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 4%, rgb(255 226 164 / 10%), transparent 25%),
    radial-gradient(circle at 10% 31%, rgb(189 83 99 / 13%), transparent 29%),
    radial-gradient(circle at 89% 29%, rgb(80 196 206 / 16%), transparent 31%),
    radial-gradient(circle at 52% 87%, rgb(43 129 144 / 26%), transparent 42%),
    linear-gradient(180deg, #122b3e 0%, var(--mist-blue) 51%, #246b7d 100%);
  color: var(--cream);
  font: 450 15px/1.5 "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  z-index: var(--z-base);
  background:
    radial-gradient(circle at 8% 30%, transparent 0 4px, rgb(242 241 216 / 11%) 4.5px 5.5px, transparent 6px),
    radial-gradient(circle at 19% 22%, transparent 0 3px, rgb(80 196 206 / 13%) 3.5px 4.5px, transparent 5px),
    radial-gradient(circle at 80% 18%, transparent 0 4px, rgb(242 241 216 / 9%) 4.5px 5.5px, transparent 6px),
    linear-gradient(90deg, transparent 7%, rgb(6 27 40 / 25%) 7.2% 7.6%, transparent 7.8% 24%, rgb(6 27 40 / 18%) 24.2% 24.5%, transparent 24.8%),
    linear-gradient(0deg, rgb(7 23 34 / 36%) 0 11%, transparent 11.3% 44%, rgb(7 23 34 / 18%) 44.4% 45%, transparent 45.2%);
  background-size: 280px 230px, 360px 260px, 420px 280px, 100% 100%, 100% 100%;
  opacity: 0.78;
}

#app {
  position: relative;
  z-index: 1;
}

body::after {
  z-index: var(--z-grain);
  background-image:
    repeating-radial-gradient(circle at 20% 30%, rgb(255 255 255 / 7%) 0 0.5px, transparent 0.7px 3px),
    repeating-linear-gradient(115deg, transparent 0 6px, rgb(8 29 41 / 4%) 6px 7px);
  background-size: 7px 7px, 13px 13px;
  mix-blend-mode: soft-light;
  opacity: 0.24;
}

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

button,
a {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: var(--z-skip);
  top: 10px;
  left: 10px;
  min-height: 44px;
  padding: 11px 16px;
  transform: translateY(-160%);
  border: 2px solid var(--cream);
  border-radius: var(--radius-sm);
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main:not(.game-main),
footer {
  width: min(1480px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-grid;
  align-items: center;
  color: var(--cream);
  line-height: 1;
  text-decoration: none;
}

.brand strong {
  display: flex;
  align-items: center;
  font-size: clamp(22px, 2.1vw, 34px);
  font-weight: 750;
  letter-spacing: 0.08em;
}

.brand-diamond {
  margin-inline: 4px;
  color: var(--yellow);
  font-size: 0.64em;
  filter: drop-shadow(3px 3px 0 rgb(189 83 99 / 58%));
}

.brand small {
  margin-top: 6px;
  color: var(--cream-muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.header-rule {
  max-width: 420px;
  margin: 0;
  color: var(--cream-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--yellow);
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Setup */

.setup-shell {
  display: grid;
  min-height: calc(100dvh - 176px);
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.66fr);
  align-items: center;
  gap: clamp(48px, 8vw, 132px);
  padding: 64px clamp(0px, 4vw, 72px) 86px;
}

.setup-copy h1 {
  max-width: 760px;
  margin: 10px 0 24px;
  color: var(--cream);
  font: 760 clamp(48px, 6vw, 92px) / 0.94 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

.setup-copy > p:not(.eyebrow) {
  max-width: 620px;
  color: var(--cream-muted);
  font-size: 17px;
  line-height: 1.68;
}

.setup-steps {
  display: flex;
  max-width: 760px;
  margin: 42px 0 0;
  padding: 0;
  list-style: none;
}

.setup-steps li {
  flex: 1;
  padding: 14px 22px 14px 0;
  border-top: 2px solid var(--line);
  color: var(--cream-muted);
  font-size: 13px;
}

.setup-steps li + li {
  padding-left: 18px;
}

.setup-steps span {
  display: block;
  margin-bottom: 8px;
  color: var(--yellow);
  font: 800 11px/1 ui-monospace, Menlo, monospace;
}

.setup-card,
.paper-panel {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: rgb(19 55 72 / 92%);
  box-shadow: var(--shadow-high);
}

.setup-card {
  position: relative;
  padding: 28px;
  border-color: rgb(244 207 60 / 68%);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 7%), transparent 42%),
    var(--violet);
}

.setup-card::before {
  position: absolute;
  z-index: -1;
  inset: 12px -12px -12px 12px;
  border: 2px solid var(--night-950);
  border-radius: inherit;
  background: var(--coral-dark);
  box-shadow: 8px 8px 0 var(--night-1000);
  content: "";
}

.setup-card fieldset {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
}

.setup-card legend {
  margin-bottom: 16px;
  color: var(--cream);
  font-size: 19px;
  font-weight: 750;
}

.setup-card label {
  display: grid;
  gap: 6px;
  color: var(--cream-muted);
  font-size: 12px;
  font-weight: 650;
}

.setup-card input,
.setup-card select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 2px solid rgb(16 37 54 / 52%);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
}

.mode-label {
  margin-top: 18px;
}

.form-note,
.section-help {
  color: var(--cream-muted);
  font-size: 12px;
}

.form-note {
  margin: 18px 0;
}

.mode-switch-card {
  display: flex;
  max-width: 760px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid rgb(242 241 216 / 22%);
  border-radius: var(--radius-sm);
  background: rgb(8 34 47 / 44%);
}

.mode-switch-card div,
.mode-switch-card span {
  display: grid;
  gap: 4px;
}

.mode-switch-card strong {
  color: var(--cream);
}

.mode-switch-card span {
  color: var(--cream-muted);
  font-size: 12px;
}

/* Controls */

.button,
.icon-button {
  min-height: 44px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 750;
  transition:
    transform var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out),
    filter var(--motion-fast) ease,
    background-color var(--motion-fast) ease;
}

.button {
  padding: 10px 16px;
}

.button.primary {
  border-color: var(--cream);
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--coral-dark);
}

.button.secondary {
  background: var(--night-850);
  color: var(--cream);
  box-shadow: 0 4px 0 var(--night-1000);
}

.button:hover:not(:disabled),
.icon-button:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--night-1000), 0 12px 18px rgb(3 16 25 / 30%);
}

.button:active:not(:disabled),
.icon-button:active {
  transform: translateY(2px) scale(0.985);
  box-shadow: 0 1px 0 var(--night-1000);
}

.button[aria-disabled="true"],
.button:disabled {
  border-color: rgb(242 241 216 / 16%);
  color: rgb(242 241 216 / 52%);
  cursor: not-allowed;
  opacity: 0.72;
  box-shadow: none;
}

.button-note {
  display: block;
  margin-top: 2px;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.button.wide {
  width: 100%;
}

.icon-button {
  display: grid;
  width: 48px;
  min-width: 48px;
  padding: 0;
  place-items: center;
  background: var(--night-850);
  color: var(--yellow);
  box-shadow: 0 4px 0 var(--night-1000);
  font-size: 22px;
}

/* Game HUD */

.game-main {
  width: 100%;
}

.game-shell {
  position: relative;
  isolation: isolate;
  width: min(1720px, calc(100% - 32px));
  margin-inline: auto;
  padding: 16px 0 72px;
}

.game-shell > :not(.lab-atmosphere) {
  position: relative;
  z-index: 2;
}

.lab-atmosphere {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  overflow: visible;
}

.lab-atmosphere__far {
  fill: none;
  opacity: 0.64;
  stroke: rgb(184 214 213 / 12%);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.lab-atmosphere__shelf {
  stroke: rgb(8 32 45 / 54%);
  stroke-width: 11;
}

.lab-atmosphere__cabinet {
  fill: rgb(8 33 47 / 18%);
  stroke: rgb(139 182 187 / 8%);
  stroke-width: 4;
}

.lab-atmosphere__molecule {
  opacity: 0.72;
  stroke-width: 2;
}

.lab-atmosphere__molecule circle {
  fill: rgb(181 218 213 / 9%);
}

.lab-atmosphere__mid {
  opacity: 0.9;
}

.lab-prop {
  transform: translateY(-62px);
  transform-box: fill-box;
  transform-origin: center;
}

.lab-prop__glass,
.lab-prop__shine,
.lab-prop__stand {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lab-prop__glass {
  stroke: rgb(212 231 220 / 21%);
  stroke-width: 4;
}

.lab-prop__shine {
  stroke: rgb(255 241 201 / 20%);
  stroke-width: 3;
}

.lab-prop__stand {
  stroke: rgb(7 28 41 / 56%);
  stroke-width: 8;
}

.lab-prop__liquid {
  opacity: 0.25;
  stroke: none;
}

.lab-prop__liquid--ochre {
  fill: var(--ochre);
}

.lab-prop__liquid--coral {
  fill: var(--coral);
}

.lab-prop__liquid--violet {
  fill: var(--violet-light);
}

.lab-prop__liquid--leaf {
  fill: #79b66f;
}

.lab-prop__liquid--cyan {
  fill: var(--cyan);
}

.lab-atmosphere__near {
  opacity: 0.84;
}

.lab-atmosphere__table {
  fill: rgb(6 31 43 / 31%);
}

.lab-atmosphere__table-edge {
  fill: rgb(5 25 36 / 46%);
  stroke: rgb(126 183 187 / 10%);
  stroke-width: 2;
}

.lab-atmosphere__notebook,
.lab-atmosphere__pencil {
  fill: rgb(223 185 119 / 7%);
  stroke: rgb(240 216 169 / 13%);
  stroke-linejoin: round;
  stroke-width: 3;
}

.game-hud {
  display: grid;
  grid-template-columns: auto auto minmax(460px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 82px;
  padding: 12px 14px 16px;
  border-bottom: 2px solid rgb(242 241 216 / 22%);
}

.game-hud .brand {
  min-width: 205px;
}

.round-chip {
  display: grid;
  min-width: 104px;
  padding: 9px 12px;
  border: 2px solid rgb(244 207 60 / 58%);
  border-radius: 4px 10px 4px 10px;
  background: var(--ochre);
  color: var(--ink);
  box-shadow: 4px 5px 0 var(--night-1000);
}

.round-chip span {
  font: 800 11px/1.2 ui-monospace, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.round-chip strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-hud {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(132px, 1fr));
  gap: 10px;
}

.player-chip {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 9px 12px 10px;
  border: 2px solid rgb(242 241 216 / 35%);
  border-radius: 5px 12px 5px 12px;
  background: var(--chip-bg, var(--night-800));
  color: var(--cream);
  box-shadow: 4px 5px 0 var(--night-1000);
  transition: transform var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast) var(--ease-out);
}

.player-chip--0 {
  --chip-bg: #236d72;
  --chip-dot: #82d9cf;
}

.player-chip--1 {
  --chip-bg: #5a477d;
  --chip-dot: #c2a6e8;
}

.player-chip--2 {
  --chip-bg: #934552;
  --chip-dot: #ff9e8e;
}

.player-chip.active {
  transform: translateY(-3px);
  border-color: var(--yellow);
  box-shadow: 4px 8px 0 var(--night-1000), 0 0 0 2px rgb(244 207 60 / 18%);
}

.player-chip.active::after {
  position: absolute;
  bottom: -10px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-inline: 7px solid transparent;
  border-top: 8px solid var(--yellow);
  content: "";
}

.player-chip__name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.player-chip > strong {
  font: 750 13px/1 ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.player-chip__stamps {
  display: flex;
  grid-column: 1 / -1;
  gap: 3px;
}

.player-chip__families {
  grid-column: 1 / -1;
  color: rgb(242 241 216 / 78%);
  font: 700 8px/1.1 ui-monospace, Menlo, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.player-stamp {
  width: 8px;
  height: 8px;
  flex: 0 1 8px;
  border: 1px solid rgb(242 241 216 / 48%);
  border-radius: 50%;
  background: rgb(5 24 36 / 48%);
}

.player-stamp.filled {
  border-color: var(--chip-dot);
  background: var(--chip-dot);
  box-shadow: 0 0 8px color-mix(in srgb, var(--chip-dot) 68%, transparent);
}

.deck-counts {
  display: flex;
  gap: 7px;
}

.deck-counts > span {
  display: grid;
  min-width: 52px;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px 6px;
  border: 2px solid rgb(242 241 216 / 28%);
  border-radius: 4px 8px;
  background: var(--night-850);
  box-shadow: 3px 4px 0 var(--night-1000);
}

.deck-counts b {
  color: var(--cyan);
  font: 800 12px/1 ui-monospace, Menlo, monospace;
}

.deck-counts > span:nth-child(2) b {
  color: var(--violet-light);
}

.deck-counts > span:nth-child(3) b {
  color: #ff7987;
}

.deck-counts strong {
  font: 750 13px/1 ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.deck-counts small {
  display: none;
}

/* Board frame and tools */

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 14px;
  padding-top: 10px;
}

.game-board {
  min-width: 0;
}

.lab-tools {
  position: sticky;
  z-index: var(--z-tools);
  top: 10px;
  display: grid;
  align-self: start;
  gap: 7px;
  padding: 8px;
  border: 2px solid rgb(242 241 216 / 24%);
  border-radius: 10px 4px 12px 5px;
  background: rgb(12 40 54 / 88%);
  box-shadow: 5px 7px 0 var(--night-1000), 0 18px 30px rgb(3 18 27 / 30%);
}

.lab-tools a {
  display: grid;
  min-width: 62px;
  min-height: 64px;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-bottom-color: rgb(242 241 216 / 16%);
  border-radius: var(--radius-sm);
  color: var(--cream-muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.lab-tools a:hover,
.lab-tools a:focus-visible {
  background: rgb(80 196 206 / 12%);
  color: var(--yellow);
  transform: translateX(-2px);
}

.lab-tools svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.feedback {
  margin: 10px 0 14px;
  padding: 12px 16px;
  border: 2px solid #ff9b91;
  border-radius: 6px 12px 6px 12px;
  background: #713641;
  color: #fff4dc;
  box-shadow: 4px 5px 0 var(--night-1000);
  font-size: 13px;
}

/* Reaction arena */

.arena-shell {
  position: relative;
  padding: 4px 16px 0;
}

.arena-shell::after {
  position: absolute;
  z-index: 0;
  top: 130px;
  right: 1.5%;
  left: 1.5%;
  height: 340px;
  border-bottom: 9px solid rgb(5 25 36 / 52%);
  background:
    radial-gradient(ellipse at 50% 38%, rgb(255 237 194 / 7%), transparent 46%),
    linear-gradient(180deg, rgb(26 78 92 / 10%), rgb(7 35 48 / 26%));
  clip-path: polygon(3.5% 8%, 96.5% 8%, 100% 100%, 0 100%);
  content: "";
  pointer-events: none;
}

.arena-shell > * {
  position: relative;
  z-index: 1;
}

.phase-rail {
  display: grid;
  width: min(560px, 80%);
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 12px auto 28px;
  padding: 0;
  list-style: none;
}

.phase-step {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: rgb(242 241 216 / 45%);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.phase-step:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -12%;
  width: 24%;
  height: 2px;
  transform: translateY(-50%);
  background: rgb(242 241 216 / 22%);
  content: "";
}

.phase-step span {
  font: 700 9px/1 ui-monospace, Menlo, monospace;
}

.phase-step.active {
  color: var(--yellow);
}

.phase-step.active::before {
  position: absolute;
  right: 23%;
  bottom: -10px;
  left: 23%;
  height: 3px;
  border-radius: 2px;
  background: var(--yellow);
  box-shadow: 0 4px 0 var(--coral-dark);
  content: "";
}

.lab-bench {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 0.52fr) minmax(260px, 1fr);
  align-items: center;
  gap: clamp(18px, 2.2vw, 36px);
  min-height: 360px;
  perspective: 1400px;
  transform-style: preserve-3d;
  isolation: isolate;
}

.lab-bench::before {
  position: absolute;
  z-index: 0;
  top: 52%;
  right: 16%;
  left: 16%;
  height: 7px;
  border: 2px solid var(--night-950);
  border-radius: 8px;
  background: linear-gradient(90deg, #a869bf 0 47%, var(--night-850) 47% 53%, var(--cyan) 53% 100%);
  box-shadow: 0 5px 0 rgb(5 24 36 / 72%);
  content: "";
}

.lab-bench::after {
  position: absolute;
  z-index: 1;
  top: calc(52% - 7px);
  left: calc(50% - 9px);
  width: 18px;
  height: 18px;
  transform: rotate(45deg);
  border: 3px solid var(--night-950);
  background: var(--yellow);
  box-shadow: 0 0 0 4px var(--petrol);
  content: "";
}

.molecule-card {
  position: relative;
  z-index: var(--z-panel);
  min-height: 326px;
  padding: 22px 24px 20px;
  border: 2px solid var(--card-border);
  border-radius: 13px 5px 17px 8px;
  background:
    linear-gradient(155deg, var(--light-key-soft), transparent 24% 68%, var(--light-rim)),
    radial-gradient(circle at 17% 12%, rgb(255 255 255 / 8%), transparent 31%),
    linear-gradient(180deg, var(--card-face-light, var(--card-face)), var(--card-face) 46%, var(--card-face-dark, var(--card-face)));
  color: var(--cream);
  box-shadow:
    inset 1px 1px 0 rgb(255 240 199 / 32%),
    inset -3px -4px 0 rgb(4 21 31 / 17%),
    var(--shadow-card-contact),
    var(--shadow-card-air);
  isolation: isolate;
  transform-style: preserve-3d;
}

.molecule-card::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 1px solid rgb(255 240 199 / 13%);
  border-radius: inherit;
  background:
    linear-gradient(155deg, var(--light-key-soft), transparent 24% 68%, var(--light-rim)),
    var(--paper-fibre),
    radial-gradient(circle at 17% 12%, rgb(255 255 255 / 8%), transparent 31%),
    linear-gradient(180deg, var(--card-face-light, var(--card-face)), var(--card-face) 46%, var(--card-face-dark, var(--card-face)));
  background-blend-mode: normal, soft-light, normal, normal;
  background-size: auto, 96px 96px, auto, auto;
  content: "";
  box-shadow: inset 1px 1px 0 rgb(255 240 199 / 28%), inset -3px -4px 0 rgb(4 21 31 / 16%);
  pointer-events: none;
}

.molecule-card--target {
  --card-face: #494066;
  --card-face-light: #5a4a77;
  --card-face-dark: #3e385d;
  --card-border: #c39bd9;
  --layer-one: #8d4563;
  --layer-two: #c9912f;
  transform: rotateY(3.6deg) rotateX(1.2deg) rotateZ(-0.9deg);
}

.molecule-card--current {
  --card-face: #155c71;
  --card-face-light: #1e7182;
  --card-face-dark: #104b62;
  --card-border: #77d3d8;
  --layer-one: #317f91;
  --layer-two: #5e4b83;
  transform: rotateY(-3.6deg) rotateX(1.2deg) rotateZ(0.9deg);
}

.molecule-card > :not(.molecule-card__layer) {
  position: relative;
  z-index: 2;
}

.molecule-card__layer {
  position: absolute;
  z-index: 0;
  inset: 0;
  transform: translate3d(8px, 9px, -8px);
  border: 2px solid rgb(255 240 199 / 14%);
  border-radius: inherit;
  background: var(--layer-one);
  box-shadow: 5px 7px 0 rgb(4 21 31 / 34%);
  content: "";
  pointer-events: none;
}

.molecule-card__layer:nth-child(2) {
  transform: translate3d(15px, 17px, -16px);
  background: var(--layer-two);
  box-shadow: 7px 9px 0 rgb(4 21 31 / 46%);
}

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

.mono-label,
.table-token {
  color: var(--cream-muted);
  font: 700 9px/1 ui-monospace, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-token {
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px 8px;
  background: rgb(5 24 36 / 22%);
}

.skeletal {
  display: grid;
  min-height: 145px;
  place-items: center;
  color: var(--cream);
}

.skeletal svg {
  display: block;
  width: min(100%, 330px);
  height: 142px;
  filter: drop-shadow(2px 3px 0 rgb(5 24 36 / 28%));
}

.molecule-name {
  margin: 4px 0 0;
  color: var(--cream);
  font-size: clamp(18px, 1.5vw, 24px);
  font-weight: 750;
  letter-spacing: -0.025em;
  text-align: center;
  text-wrap: balance;
}

.formula {
  margin: 3px 0 9px;
  color: var(--cream-muted);
  font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.tag {
  padding: 4px 8px;
  border: 1px solid rgb(242 241 216 / 25%);
  border-radius: 4px;
  background: rgb(6 28 41 / 32%);
  color: var(--cream);
  font-size: 10px;
}

.beyond-badge {
  width: fit-content;
  margin: 10px auto 0;
  padding: 5px 9px;
  border: 1px solid rgb(244 207 60 / 48%);
  border-radius: 4px;
  background: rgb(244 207 60 / 13%);
  color: #ffe696;
  font-size: 10px;
}

.distance-stage {
  position: relative;
  z-index: 4;
  display: grid;
  min-height: 230px;
  align-content: center;
  justify-items: center;
  padding: 26px 12px 22px;
  transform: translate3d(0, -10px, 28px) rotateX(0.7deg);
  border: 3px solid var(--night-950);
  border-radius: 7px 13px 7px 13px;
  background:
    radial-gradient(circle at 2px 2px, rgb(16 37 54 / 10%) 1px, transparent 1.3px) 0 0 / 7px 7px,
    linear-gradient(145deg, rgb(255 255 255 / 42%), transparent 28% 76%, rgb(42 89 94 / 7%)),
    var(--paper-fibre),
    var(--cream);
  background-size: 7px 7px, auto, 96px 96px, auto;
  box-shadow:
    inset 1px 1px 0 rgb(255 255 255 / 60%),
    inset -3px -4px 0 rgb(16 37 54 / 9%),
    7px 9px 0 #293e4c,
    11px 15px 0 rgb(4 21 31 / 78%),
    18px 29px 38px rgb(3 18 27 / 38%);
  color: var(--ink);
  text-align: center;
}

.distance-stage::before,
.distance-stage::after {
  position: absolute;
  top: 13px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--night-950);
  border-radius: 50%;
  background: var(--ochre);
  box-shadow: inset 2px 2px 0 rgb(255 240 199 / 48%), 2px 3px 0 rgb(4 21 31 / 38%);
  content: "";
}

.distance-stage::before {
  left: 13px;
}

.distance-stage::after {
  right: 13px;
}

.distance-hanger {
  position: absolute;
  top: -37px;
  left: 50%;
  width: 58%;
  height: 40px;
  transform: translateX(-50%);
  border: 5px solid #183c4d;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, #102f3f, #365565 48% 52%, #102f3f);
  box-shadow: inset 2px 0 0 rgb(255 240 199 / 13%), 6px 7px 0 rgb(4 21 31 / 52%);
}

.distance-hanger::before,
.distance-hanger::after {
  position: absolute;
  bottom: -10px;
  width: 13px;
  height: 25px;
  border: 3px solid #102f3f;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(90deg, #294b5c, #66808a 48%, #294b5c);
  box-shadow: 3px 4px 0 rgb(4 21 31 / 42%);
  content: "";
}

.distance-hanger::before {
  left: 12%;
}

.distance-hanger::after {
  right: 12%;
}

.distance-stage .eyebrow {
  color: #4f5960;
}

.distance-value {
  margin: -7px 0 -2px;
  color: var(--ochre);
  font: 800 clamp(78px, 8vw, 128px) / 0.92 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: -0.07em;
  text-shadow: 3px 4px 0 rgb(132 56 68 / 28%);
  animation: distance-change var(--motion-medium) var(--ease-out) both;
}

.distance-value.dead {
  color: var(--coral-dark);
}

.distance-caption {
  margin: 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.distance-line {
  width: 54%;
  height: 3px;
  margin-top: 15px;
  border-radius: 2px;
  background: var(--night-850);
}

@keyframes distance-change {
  from {
    opacity: 0.35;
    transform: translateY(8px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Hand and actions */

.play-area {
  position: relative;
  margin-top: 30px;
  padding: 18px 14px 0;
  border-top: 2px solid rgb(242 241 216 / 20%);
}

.section-heading h2 {
  margin: 0;
  color: var(--cream);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.section-heading.compact {
  align-items: center;
}

.section-heading.compact > p {
  max-width: 430px;
  margin: 0;
  color: var(--cream-muted);
  font-size: 11px;
}

.hand-count {
  margin-left: 7px;
  color: var(--cyan);
  font: 750 12px/1 ui-monospace, Menlo, monospace;
}

.action-buttons {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.section-help {
  margin: 6px 0 4px;
}

.hand {
  position: relative;
  display: flex;
  min-height: 334px;
  align-items: flex-end;
  justify-content: center;
  padding: 38px 28px 22px;
  perspective: var(--hand-perspective);
  perspective-origin: 50% 76%;
  transform-style: preserve-3d;
  isolation: isolate;
}

.hand::before {
  position: absolute;
  z-index: 0;
  right: 6%;
  bottom: 2px;
  left: 6%;
  height: 72px;
  transform: rotateX(68deg) translateZ(-28px);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgb(3 18 27 / 48%) 0%, rgb(3 18 27 / 19%) 48%, transparent 72%);
  content: "";
  filter: blur(3px);
  pointer-events: none;
}

.reagent-card {
  --card-face: #2c5267;
  --card-face-light: #37657a;
  --card-face-dark: #244657;
  --card-edge: #173746;
  --card-ink: var(--cream);
  --card-highlight: var(--cyan);
  --fan-y: 0px;
  --fan-z: 0px;
  --fan-layer: var(--card-index);
  position: relative;
  z-index: calc(var(--z-card) + var(--fan-layer));
  display: flex;
  width: clamp(158px, 12.2vw, 198px);
  min-width: 0;
  min-height: 258px;
  flex: 0 0 auto;
  flex-direction: column;
  margin: 0 0 0 clamp(-14px, -0.75vw, -8px);
  padding: 16px 15px 18px;
  transform:
    translate3d(0, var(--fan-y), var(--fan-z))
    rotateZ(calc(var(--card-position) * 2.65deg))
    rotateX(3.2deg)
    rotateY(calc(var(--card-position) * -1.25deg));
  transform-origin: 50% 122%;
  transform-style: preserve-3d;
  border: 2px solid rgb(242 241 216 / 58%);
  border-radius: 12px 8px 18px 8px;
  background:
    linear-gradient(155deg, var(--light-key-soft), transparent 24% 68%, var(--light-rim)),
    radial-gradient(circle at 18% 13%, rgb(255 255 255 / 10%), transparent 31%),
    linear-gradient(180deg, var(--card-face-light), var(--card-face) 48%, var(--card-face-dark));
  box-shadow:
    inset 1px 1px 0 rgb(255 240 199 / 42%),
    inset -3px -4px 0 rgb(4 21 31 / 18%),
    var(--shadow-card-contact),
    var(--shadow-card-air);
  color: var(--card-ink);
  cursor: pointer;
  overflow: visible;
  text-align: left;
  transition:
    transform var(--motion-medium) var(--ease-out),
    box-shadow var(--motion-medium) var(--ease-out),
    filter var(--motion-fast) ease,
    border-color var(--motion-fast) ease;
}

.reagent-card:first-child {
  margin-left: 0;
}

.reagent-card:nth-child(1),
.reagent-card:nth-last-child(1) {
  --fan-y: 33px;
  --fan-z: 0px;
  --fan-layer: 1;
}

.reagent-card:nth-child(2),
.reagent-card:nth-last-child(2) {
  --fan-y: 17px;
  --fan-z: 8px;
  --fan-layer: 2;
}

.reagent-card:nth-child(3),
.reagent-card:nth-last-child(3) {
  --fan-y: 7px;
  --fan-z: 16px;
  --fan-layer: 3;
}

.reagent-card:nth-child(4) {
  --fan-y: 0px;
  --fan-z: 26px;
  --fan-layer: 4;
}

.reagent-card::before {
  position: absolute;
  z-index: -1;
  top: 6px;
  right: -7px;
  bottom: -8px;
  left: 5px;
  border: 2px solid rgb(4 21 31 / 62%);
  border-top-color: rgb(255 240 199 / 8%);
  border-left-color: rgb(255 240 199 / 8%);
  border-radius: 10px 7px 18px 9px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--card-edge) 82%, var(--light-key)), var(--card-edge) 32% 100%);
  box-shadow: 3px 5px 0 rgb(4 21 31 / 32%);
  content: "";
}

.reagent-card::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 3% 8%, rgb(255 240 199 / 22%) 0 0.7px, transparent 1.2px),
    radial-gradient(circle at 96% 74%, rgb(4 21 31 / 22%) 0 0.8px, transparent 1.3px),
    linear-gradient(112deg, transparent 0 73%, rgb(255 255 255 / 8%) 74% 76%, transparent 78%),
    var(--paper-fibre);
  background-position: 0 0, 0 0, 0 0, calc(var(--card-index) * 9px) calc(var(--card-index) * -7px);
  background-size: auto, auto, auto, 96px 96px;
  content: "";
  mix-blend-mode: soft-light;
  opacity: 0.21;
  pointer-events: none;
}

.reagent-card[data-reagent-family="oxidation"] {
  --card-face: #daa72f;
  --card-face-light: #e3b94c;
  --card-face-dark: #b98224;
  --card-edge: #76551c;
  --card-ink: #102536;
  --card-highlight: #fff2a8;
}

.reagent-card[data-reagent-family="elimination"] {
  --card-face: #514377;
  --card-face-light: #66558b;
  --card-face-dark: #40375f;
  --card-edge: #2e2949;
  --card-ink: #f7f0d5;
  --card-highlight: #c8a8e4;
}

.reagent-card[data-reagent-family="halogenation"] {
  --card-face: #a74652;
  --card-face-light: #bd5b61;
  --card-face-dark: #853642;
  --card-edge: #5a2932;
  --card-ink: #fff1d6;
  --card-highlight: #ff9a8f;
}

.reagent-card[data-reagent-family="reduction"] {
  --card-face: #226b78;
  --card-face-light: #2e8190;
  --card-face-dark: #185665;
  --card-edge: #123e4b;
  --card-ink: #f6f1d8;
  --card-highlight: #74d3d3;
}

.reagent-card[data-reagent-family="substitution"] {
  --card-face: #2c6c56;
  --card-face-light: #3a8067;
  --card-face-dark: #225744;
  --card-edge: #193c32;
  --card-ink: #f4f0d7;
  --card-highlight: #9ed79a;
}

.reagent-card[data-reagent-family="substitution"]:nth-child(even) {
  --card-face: #7a405f;
  --card-face-light: #91516e;
  --card-face-dark: #61344f;
  --card-edge: #44283a;
  --card-highlight: #f29aaa;
}

.reagent-card__glyph {
  position: relative;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--card-highlight) 50%, transparent);
  border-radius: 50% 44% 52% 42%;
  color: var(--card-highlight);
  box-shadow: inset 1px 1px 0 rgb(255 240 199 / 15%);
}

.reagent-card__glyph svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.reagent-card:hover,
.reagent-card:focus-visible {
  z-index: 80;
  transform: translate3d(0, -28px, 52px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1.04);
  border-color: var(--yellow);
  box-shadow:
    inset 1px 1px 0 rgb(255 240 199 / 52%),
    inset -3px -4px 0 rgb(4 21 31 / 16%),
    8px 11px 0 var(--card-edge),
    20px 34px 42px rgb(3 18 27 / 46%);
  filter: brightness(1.045) saturate(1.025);
}

.reagent-card:active {
  transform: translate3d(0, -19px, 34px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(0.99);
}

.reagent-card.illegal {
  filter: saturate(0.86) brightness(0.96);
}

.reagent-card.illegal:hover,
.reagent-card.illegal:focus-visible {
  filter: saturate(0.94) brightness(1.02);
}

.reagent-card.legal {
  border-color: var(--yellow);
  box-shadow:
    inset 1px 1px 0 rgb(255 240 199 / 48%),
    inset -3px -4px 0 rgb(4 21 31 / 16%),
    var(--shadow-card-contact),
    0 0 0 2px rgb(244 207 60 / 19%),
    var(--shadow-card-air);
}

.reagent-card.temporary {
  border-color: var(--cream);
  background:
    linear-gradient(155deg, rgb(255 255 255 / 17%), transparent 25% 74%, rgb(61 43 24 / 12%)),
    linear-gradient(180deg, #edc24e, var(--ochre) 52%, #b77c25);
  color: var(--ink);
}

.reagent-card .card-code,
.reagent-card .reagent-card__glyph,
.reagent-card .reagent-key,
.reagent-card .card-state,
.reagent-card .card-orb {
  position: relative;
  z-index: 2;
}

.reagent-card .card-code {
  position: absolute;
  top: 18px;
  right: 14px;
  display: block;
  max-width: calc(100% - 62px);
  margin: 0;
  color: var(--card-highlight);
  font: 800 9px/1.15 ui-monospace, Menlo, monospace;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}

.reagent-card .reagent-key {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(14px, 1.1vw, 17px);
  font-weight: 650;
  line-height: 1.32;
  text-wrap: pretty;
}

.reagent-card .card-state {
  display: block;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px dashed color-mix(in srgb, var(--card-ink) 45%, transparent);
  color: color-mix(in srgb, var(--card-ink) 88%, transparent);
  font-size: 10px;
  font-weight: 520;
  line-height: 1.42;
}

.reagent-card.legal .card-state {
  font-weight: 700;
}

.card-orb {
  width: 18px;
  height: 18px;
  margin: 14px auto 0;
  border: 2px solid var(--card-highlight);
  border-radius: 50%;
  background: transparent;
}

.reagent-card.legal .card-orb {
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgb(16 37 54 / 18%);
}

/* Phase, Dex, log and network */

.phase-panel {
  width: min(980px, calc(100% - 28px));
  margin: 18px auto 0;
  padding: clamp(22px, 4vw, 42px);
  border: 3px solid var(--night-950);
  border-radius: 8px 16px 8px 16px;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 8%), transparent 45%),
    var(--violet);
  box-shadow: 9px 10px 0 var(--coral-dark), 15px 17px 0 var(--night-1000), 0 28px 42px rgb(3 18 27 / 35%);
}

.phase-panel h2 {
  max-width: 780px;
  margin: 0 0 10px;
  color: var(--cream);
  font: 760 clamp(27px, 3.5vw, 46px) / 1.08 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.phase-panel p {
  max-width: 760px;
  margin: 8px 0;
  color: var(--cream-muted);
}

.phase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.phase-actions .button {
  border-color: var(--cream);
}

.quiz-panel {
  background:
    linear-gradient(145deg, rgb(255 255 255 / 9%), transparent 42%),
    linear-gradient(120deg, var(--violet), #24596b);
}

.quiz-handoff {
  margin-top: 22px;
  border: 2px solid var(--cream);
  border-radius: 8px 14px;
  background: rgb(7 23 34 / 48%);
  overflow: clip;
}

.quiz-handoff summary {
  display: grid;
  min-height: 58px;
  align-content: center;
  gap: 3px;
  padding: 12px 48px 12px 16px;
  background: rgb(244 207 60 / 12%);
  color: var(--cream);
  cursor: pointer;
  list-style: none;
  position: relative;
}

.quiz-handoff summary::-webkit-details-marker {
  display: none;
}

.quiz-handoff summary::after {
  position: absolute;
  right: 17px;
  top: 50%;
  content: "+";
  color: var(--yellow);
  font: 800 24px/1 ui-monospace, Menlo, monospace;
  transform: translateY(-50%);
}

.quiz-handoff[open] summary::after {
  content: "−";
}

.quiz-handoff summary span {
  color: var(--cream-muted);
  font-size: 12px;
}

.quiz-handoff__body {
  padding: 18px;
  border-top: 1px solid var(--line);
}

.quiz-handoff fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.quiz-handoff legend {
  padding: 0;
  color: var(--cream);
  font-size: 16px;
  font-weight: 750;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quiz-options .button {
  width: 100%;
  min-height: 48px;
  text-align: left;
}

.quiz-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.quiz-result {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 9px;
  padding: 13px;
  border: 2px solid var(--line-strong);
  border-radius: 7px 12px;
  background: rgb(7 23 34 / 42%);
}

.quiz-result::before {
  grid-row: 1 / 4;
  align-self: center;
  color: var(--cream);
  font: 800 19px/1 ui-monospace, Menlo, monospace;
}

.quiz-result.correct::before {
  content: "✓";
  color: var(--success);
}

.quiz-result.incorrect::before {
  content: "!";
  color: var(--danger);
}

.quiz-result span,
.quiz-result em {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.quiz-result em {
  color: var(--cream-muted);
  font-style: normal;
}

.quiz-hand-lock {
  min-height: 150px;
}

.quiz-hand-lock .hand {
  min-height: 34px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: rgb(7 23 34 / 20%);
}

.product-structure-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-structure-choice {
  min-height: 170px;
  padding: 12px;
  border: 2px solid var(--cream);
  border-radius: 8px 14px;
  background: var(--night-850);
  color: var(--cream);
  cursor: pointer;
}

.product-structure-choice:hover,
.product-structure-choice:focus-visible {
  border-color: var(--yellow);
  background: var(--mist-blue);
}

.product-structure-choice svg {
  display: block;
  width: 100%;
  height: 112px;
}

.product-structure-choice span {
  display: block;
  font-weight: 750;
  text-align: center;
}

.network-hidden-message {
  display: grid;
  min-height: 326px;
  margin: 0;
  padding: 24px;
  place-items: center;
  color: var(--cream-muted);
  text-align: center;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 16px;
  margin-top: 34px;
}

.dex-section,
.log-section,
.network-section {
  padding: 20px;
}

.dex-section {
  background:
    linear-gradient(135deg, rgb(255 255 255 / 5%), transparent 38%),
    #183f53;
}

.log-section {
  background:
    linear-gradient(135deg, rgb(255 255 255 / 5%), transparent 38%),
    #3f3c63;
}

.dex-boards {
  display: grid;
  gap: 13px;
  margin-top: 16px;
}

.dex-board {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: start;
  gap: 13px;
  padding: 11px;
  border: 1px solid rgb(242 241 216 / 14%);
  border-radius: 5px 10px;
  background: rgb(7 29 42 / 34%);
}

.dex-board.active {
  border-color: var(--yellow);
  box-shadow: inset 4px 0 0 var(--yellow);
}

.dex-player {
  font-size: 13px;
}

.dex-player strong,
.dex-player span {
  display: block;
}

.dex-families {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 7px;
}

.dex-family {
  padding: 2px 4px;
  border: 1px dashed rgb(242 241 216 / 25%);
  border-radius: 3px;
  color: var(--cream-muted);
  font: 650 7px/1.15 ui-monospace, Menlo, monospace;
}

.dex-family.filled {
  border-style: solid;
  border-color: var(--yellow);
  background: rgb(244 207 60 / 13%);
  color: var(--yellow-soft);
}

.dex-player strong {
  color: var(--cream);
}

.dex-player span {
  margin-top: 3px;
  color: var(--cream-muted);
  font-size: 10px;
}

.dex-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dex-slot {
  padding: 4px 7px;
  border: 1px dashed rgb(242 241 216 / 28%);
  border-radius: 3px;
  color: var(--cream-muted);
  font-size: 9px;
}

.dex-slot.filled {
  border-style: solid;
  border-color: #aadd9c;
  background: #2d7256;
  color: #f2ffd9;
}

.round-log {
  display: grid;
  max-height: 360px;
  gap: 0;
  margin: 15px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-color: var(--violet-light) var(--night-850);
}

.round-log li {
  padding: 10px 0;
  border-top: 1px solid rgb(242 241 216 / 16%);
  color: var(--cream-muted);
  font-size: 11px;
}

.round-log li:last-child {
  color: var(--cream);
}

.round-log strong {
  color: #d4b8ee;
  font: 750 9px/1 ui-monospace, Menlo, monospace;
  text-transform: uppercase;
}

.network-section {
  margin-top: 16px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 5%), transparent 38%),
    #16485a;
}

.network-map {
  min-height: 330px;
  margin-top: 15px;
  border: 2px solid rgb(242 241 216 / 18%);
  border-radius: 6px 12px;
  background: rgb(7 29 42 / 54%);
  overflow: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--cyan) var(--night-850);
}

.network-svg {
  display: block;
  width: max(100%, 1120px);
  min-width: 1120px;
  height: auto;
  min-height: 330px;
  color: var(--cream);
}

.network-edge path {
  fill: none;
  stroke: #7499a4;
  stroke-width: 1.4;
}

.network-edge > rect {
  fill: #153d4f;
  stroke: #72909a;
  stroke-width: 0.6;
}

.network-edge > text {
  fill: var(--cream-muted);
  font: 8px "Avenir Next", "Segoe UI", sans-serif;
}

.network-edge marker path,
#network-arrow path {
  fill: #85b0bb;
}

.network-node > rect {
  fill: #193f51;
  stroke: #6d8e99;
  stroke-width: 1.2;
}

.network-node.current > rect,
.network-node.current-target > rect {
  fill: #176b80;
  stroke: var(--cyan);
  stroke-width: 2.2;
}

.network-node.target > rect,
.network-node.current-target > rect {
  stroke: var(--yellow);
  stroke-width: 2.4;
}

.network-node.target > rect {
  fill: #514377;
}

.network-role {
  fill: var(--yellow);
  font: 750 8px ui-monospace, Menlo, monospace;
  text-transform: uppercase;
}

.network-name {
  fill: var(--cream);
  font: 650 11px "Avenir Next", "Segoe UI", sans-serif;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--cream-muted);
  font-size: 11px;
}

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

/* Local online rooms */

.online-setup {
  grid-template-columns: minmax(0, 0.9fr) minmax(600px, 1.1fr);
  gap: clamp(36px, 5vw, 88px);
}

.online-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.online-entry-grid .setup-card {
  align-self: stretch;
  padding: 24px;
}

.online-entry-grid .setup-card h2 {
  margin: 0 0 20px;
  color: var(--cream);
  font-size: 22px;
}

.online-entry-grid .setup-card .button {
  margin-top: 22px;
}

.connection-copy {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  margin-top: 18px;
  padding: 7px 11px;
  border: 1px solid rgb(80 196 206 / 38%);
  border-radius: 4px 9px;
  background: rgb(18 72 85 / 54%);
  color: var(--cyan) !important;
  font: 750 11px/1.3 ui-monospace, Menlo, monospace !important;
}

.online-feedback {
  width: min(100%, 760px);
  margin: 12px 0;
  padding: 11px 14px;
  border: 2px solid rgb(242 241 216 / 26%);
  border-radius: 5px 10px;
  background: var(--night-850);
  color: var(--cream);
  font-size: 13px;
}

.online-feedback.error {
  border-color: #ff9b91;
  background: #713641;
}

.online-feedback.pending {
  border-color: var(--yellow);
  color: var(--yellow);
}

.online-lobby {
  width: min(1040px, 100%);
  min-height: calc(100dvh - 176px);
  margin-inline: auto;
  padding: clamp(30px, 6vw, 78px) 0 90px;
}

.online-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid rgb(242 241 216 / 22%);
  border-radius: 4px 10px;
  background: rgb(9 35 49 / 86%);
  color: var(--cream-muted);
  font: 700 11px/1.25 ui-monospace, Menlo, monospace;
}

.online-status strong,
.online-status [data-connection-state="connected"] {
  color: var(--cyan);
}

.online-status [data-connection-state="reconnecting"],
.online-status [data-connection-state="paused"],
.online-status [data-connection-state="waiting for server"] {
  color: var(--yellow);
}

.room-label {
  display: grid;
  justify-items: start;
  padding: clamp(26px, 5vw, 52px);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 7%), transparent 45%),
    var(--violet);
}

.room-label h1 {
  margin: 0 0 24px;
  color: var(--cream);
  font: 760 clamp(34px, 5vw, 58px) / 1 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: -0.05em;
}

.room-code {
  display: block;
  margin-bottom: 18px;
  padding: 10px 14px 8px;
  border: 2px dashed rgb(16 37 54 / 54%);
  border-radius: 4px 9px;
  background: var(--cream);
  color: var(--ink);
  font: 850 clamp(36px, 7vw, 74px) / 1 ui-monospace, Menlo, monospace;
  letter-spacing: 0.14em;
  user-select: all;
}

.room-code:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

.online-seat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 16px;
}

.online-station {
  display: grid;
  min-height: 150px;
  align-content: space-between;
  gap: 10px;
  padding: 20px;
  border: 2px dashed rgb(242 241 216 / 25%);
  border-radius: 6px 14px;
  background: rgb(8 34 48 / 62%);
  color: var(--cream-muted);
}

.online-station strong {
  color: var(--cream);
  font-size: 20px;
}

.online-station.connected {
  border-style: solid;
  border-color: rgb(80 196 206 / 62%);
  box-shadow: inset 5px 0 0 var(--cyan), 5px 6px 0 var(--night-1000);
}

.online-game .online-status {
  margin: 0 14px 8px;
}

.online-game .game-hud {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.online-game .round-chip {
  align-content: center;
  font: 800 12px/1.2 ui-monospace, Menlo, monospace;
  text-transform: uppercase;
}

.online-game .player-chip {
  grid-template-columns: 1fr;
}

.online-game .player-chip > span {
  color: var(--cream-muted);
  font-size: 9px;
}

.online-arena {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(170px, 0.46fr) minmax(240px, 1fr);
  align-items: center;
  gap: clamp(18px, 2.2vw, 36px);
  min-height: 360px;
  perspective: 1400px;
}

.online-arena .molecule-card {
  display: grid;
  min-height: 310px;
  align-content: center;
  justify-items: center;
  padding: 24px;
  text-align: center;
}

.online-arena .molecule-card h2 {
  margin: 12px 0 0;
  color: var(--cream);
}

.online-arena .distance-stage {
  min-height: 210px;
}

.online-game .reagent-card:disabled {
  opacity: 0.86;
  cursor: default;
}

.online-game .reagent-card {
  z-index: var(--z-card);
  margin-left: 10px;
  transform: none;
}

.online-game .reagent-card:first-child {
  margin-left: 0;
}

.online-game .reagent-card:disabled:hover,
.online-game .reagent-card:disabled:focus-visible {
  transform: none;
  filter: saturate(0.86) brightness(0.96);
}

.online-game .dex-section,
.online-game .network-section {
  margin: 24px 14px 0;
}

.online-game .dex-board > span {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.online-expired-room {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.online-pause-sheet {
  position: fixed !important;
  z-index: 1200 !important;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 9px;
  padding: 24px;
  background: rgb(4 20 30 / 78%);
  color: var(--cream);
  text-align: center;
  backdrop-filter: blur(5px);
}

.online-pause-sheet strong {
  padding: 18px 28px 8px;
  border-top: 3px solid var(--yellow);
  color: var(--yellow);
  font: 780 clamp(30px, 5vw, 58px) / 1 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: -0.04em;
}

.online-pause-sheet span {
  max-width: 520px;
  color: var(--cream-muted);
}

/* Responsive */

@media (max-width: 1450px) {
  .game-hud {
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  }

  .game-hud .brand {
    min-width: 170px;
  }

  .brand strong {
    font-size: 25px;
  }

  .player-chip {
    padding-inline: 9px;
  }

  .reagent-card {
    width: clamp(154px, 12vw, 180px);
  }
}

@media (max-width: 1260px) {
  .lab-prop--narrow-bottle {
    display: none;
  }

  .game-hud {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }

  .game-hud > .icon-button {
    grid-column: 4;
  }

  .player-hud {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .deck-counts {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .lab-bench {
    grid-template-columns: minmax(235px, 1fr) minmax(175px, 0.46fr) minmax(235px, 1fr);
    gap: 18px;
  }

  .molecule-card {
    min-height: 305px;
    padding-inline: 18px;
  }

  .hand {
    padding-inline: 4px;
  }

  .reagent-card {
    width: clamp(148px, 13.2vw, 168px);
    min-height: 246px;
    margin-left: -10px;
  }
}

@media (max-width: 1080px) {
  .online-setup {
    grid-template-columns: 1fr;
  }

  .online-entry-grid {
    max-width: 760px;
  }

  .online-game .game-hud {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .online-game .deck-counts {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: start;
  }

  .lab-prop--bottle-b,
  .lab-prop--round-flask,
  .lab-prop--test-tubes {
    display: none;
  }

  .lab-atmosphere__mid {
    opacity: 0.76;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .lab-tools {
    position: static;
    display: flex;
    width: fit-content;
    justify-self: end;
    order: -1;
    padding: 6px;
  }

  .lab-tools a {
    min-width: 72px;
    min-height: 48px;
    grid-template-columns: 20px auto;
    border-right: 1px solid rgb(242 241 216 / 16%);
    border-bottom: 0;
  }

  .lab-tools svg {
    width: 20px;
    height: 20px;
  }

  .lab-tools a:hover,
  .lab-tools a:focus-visible {
    transform: translateY(-2px);
  }

  .arena-shell {
    padding-inline: 4px;
  }

  .hand {
    width: 100%;
    min-height: 270px;
    justify-content: flex-start;
    margin-inline: 0;
    padding: 18px 4px;
    perspective: none;
    overflow-x: auto;
    overflow-y: visible;
    scroll-padding-inline: 4px;
    scroll-snap-type: x proximity;
    scrollbar-color: var(--yellow) var(--night-850);
  }

  .reagent-card,
  .reagent-card:nth-child(n),
  .reagent-card:nth-last-child(n) {
    --fan-y: 0px;
    width: 230px;
    min-width: 230px;
    min-height: 230px;
    margin-left: 10px;
    transform: none;
    scroll-snap-align: start;
  }

  .reagent-card:first-child {
    margin-left: 0;
  }

  .reagent-card:hover,
  .reagent-card:focus-visible {
    transform: translateY(-5px);
  }
}

@media (max-width: 900px) {
  .site-header,
  main:not(.game-main),
  footer {
    width: min(100% - 28px, 1480px);
  }

  .setup-shell {
    grid-template-columns: 1fr;
    gap: 52px;
    padding-block: 54px 80px;
  }

  .game-shell {
    width: min(100% - 20px, 1720px);
  }

  .lab-bench {
    grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr);
    gap: 10px;
  }

  .molecule-card {
    min-height: 282px;
    padding: 16px 13px;
  }

  .skeletal {
    min-height: 118px;
  }

  .skeletal svg {
    height: 116px;
  }

  .distance-stage {
    min-height: 205px;
  }

  .reagent-card {
    width: 146px;
    min-height: 236px;
    margin-left: -27px;
    padding-inline: 12px;
  }

  .reagent-card .reagent-key {
    font-size: 13px;
  }

  .hand {
    display: flex;
    min-height: 270px;
    justify-content: flex-start;
    margin-inline: -4px;
    padding: 18px 4px;
    perspective: none;
    overflow-x: auto;
    overflow-y: visible;
    scroll-padding-inline: 4px;
    scroll-snap-type: x proximity;
    scrollbar-color: var(--yellow) var(--night-850);
  }

  .reagent-card,
  .reagent-card:nth-child(n),
  .reagent-card:nth-last-child(n) {
    --fan-y: 0px;
    width: 258px;
    min-width: 258px;
    min-height: 226px;
    margin-left: 10px;
    transform: none;
    scroll-snap-align: start;
  }

  .reagent-card::before {
    right: -5px;
    bottom: -6px;
  }

  .reagent-card:first-child {
    margin-left: 0;
  }

  .reagent-card:hover,
  .reagent-card:focus-visible {
    transform: translateY(-5px);
  }

  .lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .site-header {
    min-height: 76px;
  }

  .header-rule {
    display: none;
  }

  .setup-copy h1 {
    font-size: clamp(44px, 13vw, 68px);
  }

  .setup-steps {
    display: grid;
  }

  .setup-steps li + li {
    padding-left: 0;
  }

  .mode-switch-card,
  .online-status {
    align-items: stretch;
    flex-direction: column;
  }

  .online-entry-grid,
  .online-seat-grid {
    grid-template-columns: 1fr;
  }

  .online-station {
    min-height: 112px;
  }

  .room-code {
    width: 100%;
    overflow: hidden;
    font-size: clamp(30px, 12vw, 54px);
    text-align: center;
  }

  .online-arena {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .online-arena .distance-stage {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .online-arena .molecule-card--target {
    grid-column: 1;
    grid-row: 2;
  }

  .online-arena .molecule-card--current {
    grid-column: 2;
    grid-row: 2;
  }

  .game-hud {
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    padding-inline: 6px;
  }

  .game-hud .brand {
    min-width: 0;
  }

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

  .game-hud .brand small {
    font-size: 8px;
  }

  .round-chip {
    min-width: 90px;
    padding: 7px 9px;
  }

  .deck-counts {
    grid-column: 1 / 3;
    grid-row: 2;
    justify-self: start;
  }

  .player-hud {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .player-chip {
    padding: 8px;
  }

  .player-stamp {
    width: 6px;
    height: 6px;
  }

  .lab-tools {
    justify-self: stretch;
  }

  .lab-tools a {
    flex: 1;
  }

  .phase-rail {
    width: 94%;
    margin-bottom: 48px;
  }

  .lab-atmosphere__far,
  .lab-prop--bottle-b,
  .lab-prop--round-flask,
  .lab-prop--test-tubes,
  .lab-prop--narrow-bottle {
    display: none;
  }

  .lab-atmosphere__mid {
    opacity: 0.62;
  }

  .lab-atmosphere__near {
    opacity: 0.68;
  }

  .arena-shell::after {
    display: none;
  }

  .lab-bench {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
  }

  .lab-bench::before,
  .lab-bench::after {
    display: none;
  }

  .distance-stage {
    width: min(280px, 86%);
    min-height: 132px;
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    padding: 17px 10px 13px;
  }

  .distance-hanger {
    top: -28px;
    height: 30px;
  }

  .distance-value {
    font-size: 68px;
  }

  .distance-line {
    display: none;
  }

  .molecule-card--target {
    grid-column: 1;
    grid-row: 2;
  }

  .molecule-card--current {
    grid-column: 2;
    grid-row: 2;
  }

  .molecule-card--target,
  .molecule-card--current {
    min-height: 250px;
    transform: none;
  }

  .molecule-card__layer {
    display: none;
  }

  .skeletal {
    min-height: 96px;
  }

  .skeletal svg {
    height: 92px;
  }

  .molecule-name {
    font-size: 15px;
  }

  .formula {
    font-size: 10px;
  }

  .play-area {
    padding-inline: 4px;
  }

  .section-heading:not(.compact) {
    display: grid;
  }

  .action-buttons {
    grid-row: 2;
    flex-wrap: wrap;
  }

  .hand {
    display: flex;
    min-height: 270px;
    justify-content: flex-start;
    margin-inline: -4px;
    padding: 18px 4px 18px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-padding-inline: 4px;
    scroll-snap-type: x proximity;
    scrollbar-color: var(--yellow) var(--night-850);
  }

  .reagent-card,
  .reagent-card:nth-child(n),
  .reagent-card:nth-last-child(n) {
    --fan-y: 0px;
    width: min(72vw, 258px);
    min-width: min(72vw, 258px);
    min-height: 226px;
    margin-left: 10px;
    transform: none;
    scroll-snap-align: start;
  }

  .reagent-card__glyph {
    width: 31px;
    height: 31px;
  }

  .reagent-card:first-child {
    margin-left: 0;
  }

  .reagent-card:hover,
  .reagent-card:focus-visible {
    transform: translateY(-5px);
  }

  .phase-panel {
    width: calc(100% - 20px);
  }
}

@media (max-width: 520px) {
  .online-lobby {
    padding-top: 24px;
  }

  .online-entry-grid .setup-card {
    padding: 20px;
  }

  .online-game .player-hud {
    display: grid;
    grid-template-columns: 1fr;
  }

  .online-arena {
    gap: 8px;
    padding-inline: 0;
  }

  .online-arena .molecule-card {
    min-height: 222px;
    padding: 12px 8px;
  }

  .game-shell {
    width: min(100% - 14px, 1720px);
  }

  .game-hud {
    padding-top: 8px;
  }

  .game-hud .brand strong {
    font-size: 17px;
  }

  .game-hud .brand small {
    display: none;
  }

  .round-chip {
    min-width: 78px;
  }

  .round-chip strong {
    display: none;
  }

  .deck-counts > span {
    min-width: 48px;
  }

  .player-chip__name {
    font-size: 11px;
  }

  .player-chip > strong {
    font-size: 11px;
  }

  .player-chip__stamps {
    gap: 2px;
  }

  .player-stamp {
    flex-basis: 5px;
  }

  .lab-tools a {
    min-width: 0;
    font-size: 8px;
  }

  .lab-prop--bottle-a,
  .lab-prop--conical-flask {
    opacity: 0.66;
  }

  .phase-step {
    gap: 4px;
    font-size: 10px;
  }

  .molecule-card {
    min-height: 222px;
    padding: 12px 8px;
  }

  .panel-heading .eyebrow,
  .mono-label,
  .table-token,
  .molecule-card .tags {
    display: none;
  }

  .skeletal {
    min-height: 100px;
  }

  .skeletal svg {
    height: 98px;
  }

  .molecule-name {
    overflow-wrap: anywhere;
    font-size: 13px;
  }

  .formula {
    margin-top: 6px;
  }

  .beyond-badge {
    padding: 3px 5px;
    font-size: 8px;
  }

  .action-buttons .button {
    padding-inline: 11px;
  }

  .quiz-options,
  .quiz-results,
  .product-structure-options {
    grid-template-columns: 1fr;
  }

  .quiz-handoff__body {
    padding: 13px;
  }

  .dex-board {
    grid-template-columns: 82px 1fr;
  }

  .dex-section,
  .log-section,
  .network-section {
    padding: 14px;
  }

  .section-heading.compact > p {
    display: none;
  }

  footer {
    display: grid;
  }
}

@media (min-width: 1081px) and (max-height: 950px) {
  .game-shell {
    padding-top: 10px;
  }

  .game-hud {
    min-height: 72px;
    padding-block: 8px 12px;
  }

  .phase-rail {
    margin-block: 8px 20px;
  }

  .lab-bench {
    min-height: 294px;
  }

  .molecule-card {
    min-height: 270px;
    padding-block: 17px 15px;
  }

  .skeletal {
    min-height: 112px;
  }

  .skeletal svg {
    height: 108px;
  }

  .distance-stage {
    min-height: 205px;
    padding-block: 22px 18px;
  }

  .distance-value {
    font-size: clamp(74px, 7vw, 104px);
  }

  .play-area {
    margin-top: 20px;
    padding-top: 14px;
  }

  .hand {
    min-height: 266px;
    padding-top: 22px;
  }

  .reagent-card {
    min-height: 230px;
    padding-block: 13px 15px;
  }
}

@media (min-width: 1081px) and (max-height: 760px) {
  .game-hud {
    min-height: 64px;
    padding-block: 6px 9px;
  }

  .phase-rail {
    margin-block: 5px 15px;
  }

  .lab-bench {
    min-height: 248px;
  }

  .molecule-card {
    min-height: 230px;
    padding: 13px 18px 12px;
  }

  .skeletal {
    min-height: 88px;
  }

  .skeletal svg {
    height: 84px;
  }

  .distance-stage {
    min-height: 178px;
    padding-block: 18px 14px;
  }

  .distance-value {
    font-size: clamp(66px, 6.4vw, 88px);
  }

  .play-area {
    margin-top: 11px;
    padding-top: 11px;
  }

  .hand {
    min-height: 244px;
    padding-top: 13px;
  }

  .reagent-card {
    min-height: 218px;
    padding-block: 11px 13px;
  }

  .reagent-card__glyph {
    width: 30px;
    height: 30px;
    margin-bottom: 9px;
  }

  .reagent-card__glyph svg {
    width: 21px;
    height: 21px;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .lab-atmosphere__far,
  .lab-atmosphere__mid,
  .lab-atmosphere__notebook,
  .lab-atmosphere__pencil {
    display: none;
  }

  .game-hud {
    min-height: 64px;
  }

  .player-chip__stamps,
  .game-hud .brand small {
    display: none;
  }

  .phase-rail {
    margin-block: 6px 24px;
  }

  .distance-stage {
    min-height: 110px;
  }

  .molecule-card {
    min-height: 205px;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgb(242 241 216 / 55%);
    --line-strong: rgb(242 241 216 / 86%);
  }

  .reagent-card.illegal {
    filter: none;
  }

  .reagent-card::after {
    opacity: 0.04;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reagent-card,
  .molecule-card,
  .distance-stage,
  .player-chip {
    transform: none !important;
  }
}

/* Keep projected online cards clear of the absolute card-code label after all responsive shorthands. */
.online-game .reagent-card {
  padding-top: 58px !important;
}
