:root {
  --bg: #0b171b;
  --panel: #122226;
  --line: #ffffff16;
  --ink: #f0eddf;
  --muted: #8eaaa9;
  --cyan: #8fd9d7;
  --gold: #dfbd79;
  --serif: Georgia, "Songti SC", "Noto Serif CJK SC", serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px/1.6 "Noto Sans CJK SC",
    "PingFang SC",
    "Microsoft YaHei",
    Arial,
    sans-serif;
  min-height: 100vh;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
  transition:
    background 0.2s,
    transform 0.2s,
    border-color 0.2s;
}
button:hover:not(:disabled) {
  filter: brightness(1.12);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}
a {
  color: inherit;
  text-decoration: none;
}
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.atmosphere {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 25%, #243b3a55, transparent 60%),
    linear-gradient(115deg, #0b171b, #101f22);
  z-index: -2;
}
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.009;
  background-image: repeating-linear-gradient(
    0deg,
    #fff 0 1px,
    transparent 1px 4px
  );
  z-index: 10;
}
.site-header {
  max-width: 1500px;
  margin: auto;
  height: 104px;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: 4px;
}
.brand small {
  font-family: Arial, sans-serif;
  display: block;
  font-size: 8px;
  letter-spacing: 2.6px;
  color: var(--muted);
}
.brand-symbol {
  font-size: 39px;
  line-height: 1;
  color: var(--gold);
  font-family: Georgia;
  transform: rotate(-15deg);
}
.header-note {
  color: #9caeaa;
  font-size: 11px;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.live-dot,
.tiny-note i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px #8fd9d744;
  display: inline-block;
}
nav {
  display: flex;
  gap: 12px;
}
.icon-button {
  min-width: 36px;
  height: 36px;
  font-size: 20px;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 5px;
}
.icon-button:hover {
  border-color: var(--line);
}
.icon-button span {
  font-size: 11px;
  color: var(--muted);
}
.lobby {
  max-width: 1380px;
  margin: 52px auto 46px;
  padding: 0 4%;
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 8.5%;
  align-items: center;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 500;
}
.eyebrow > span:not(.small-line) {
  display: block;
  width: 25px;
  height: 1px;
  background: var(--gold);
}
h1 {
  font-family: var(--serif);
  font-size: 54px;
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: 3px;
  margin: 24px 0 20px;
}
h1 > span {
  color: var(--cyan);
}
.intro-copy {
  color: #9db2b0;
  font-size: 13px;
  line-height: 1.95;
  margin: 0 0 25px;
}
.spirits-pair {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.spirit-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.spirit-badge div {
  font-size: 13px;
  letter-spacing: 1px;
}
.spirit-badge small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0;
  margin-top: 1px;
}
.spirit-badge em {
  font-style: normal;
  font-size: 9px;
  color: #5c7475;
  align-self: flex-start;
  margin-top: 6px;
}
.portrait {
  display: block;
  flex: none;
  width: 43px;
  height: 48px;
  background-image: url("/assets/spirits.png");
  background-size: 200% 200%;
  background-repeat: no-repeat;
}
.portrait.sun {
  background-position: 100% 0;
}
.cyan strong,
.cyan.spirit-badge {
  color: var(--cyan);
}
.amber strong,
.amber.spirit-badge {
  color: var(--gold);
}
.bond {
  color: #668482;
  font-family: Georgia;
  font-size: 21px;
  margin-right: 5px;
}
.primary {
  background: #c5dcd0;
  color: #132c2b;
  border: 1px solid #e1eee0;
  border-radius: 5px;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 3px 20px #0002;
}
.primary:hover {
  background: #dfecdd;
}
.primary > span {
  font-size: 20px;
  line-height: 1;
}
.join-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.join-row input {
  min-width: 0;
  width: 55%;
  border: 1px solid #5775715c;
  background: #0b181bd9;
  padding: 11px 14px;
  color: var(--ink);
  border-radius: 5px;
  letter-spacing: 2px;
  font-size: 12px;
  text-transform: uppercase;
  outline: 0;
}
.join-row input:focus {
  border-color: var(--cyan);
}
input::placeholder {
  color: #78908e;
  letter-spacing: 1px;
}
.join-row button {
  flex: 1;
  border: 1px solid #55706e7a;
  border-radius: 5px;
  background: #1a3031;
  font-size: 12px;
}
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #6f8988;
  font-size: 10px;
  margin: 20px 0 13px;
}
.divider:before,
.divider:after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}
.secondary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #6585825a;
  border-radius: 5px;
  padding: 12px 17px;
  background: #1c303140;
  font-size: 12px;
}
.secondary span {
  color: var(--muted);
  font-size: 10px;
}
.text-button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  color: #8da7a3;
  padding: 12px 4px;
  font-size: 11px;
}
.text-button span {
  font-size: 10px;
  color: #698786;
}
.tiny-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  color: #637e7e;
  margin-top: 14px;
  white-space: nowrap;
}
.tiny-note b {
  font-weight: 400;
}
.tiny-note i {
  background: #688c80;
  width: 4px;
  height: 4px;
}
.world-preview {
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  padding-top: 5px;
}
.world-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.world-caption .eyebrow {
  font-size: 9px;
  color: #91aaa5;
  letter-spacing: 2.2px;
}
.chapter-pill {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 9px;
  color: #9cafaa;
}
.hero-art {
  position: relative;
  min-height: 425px;
  flex: 1;
  border: 1px solid #aacbb323;
  border-radius: 120px 120px 6px 6px;
  overflow: hidden;
  background: url("/assets/ruins.jpg") 67% center/cover;
  box-shadow: 0 25px 70px #0003;
}
.hero-art:before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #091b2370, transparent 65%),
    linear-gradient(0deg, #0b1b21, transparent 40%);
}
.hero-art:after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid #bdd2b825;
  border-radius: 110px 110px 3px 3px;
  pointer-events: none;
}
.hero-words {
  position: relative;
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: clamp(44px, 4.6vw, 70px);
  line-height: 0.97;
  letter-spacing: 4px;
  padding: 66px 36px 0;
  text-shadow: 0 2px 30px #001e29;
}
.hero-words > span {
  font-size: 0.81em;
  letter-spacing: 8px;
  color: #d5d0af;
}
.hero-description {
  position: absolute;
  bottom: 60px;
  left: 38px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.small-line {
  display: block;
  height: 40px;
  width: 1px;
  background: #aeb392;
}
.hero-description p {
  color: #ccdacb;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 3px;
  margin: 0;
}
.art-label {
  position: absolute;
  bottom: 25px;
  left: 39px;
  font-size: 7px;
  letter-spacing: 3.3px;
  color: #a5b4a0;
}
.chapter-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}
.chapter {
  padding: 16px 10px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  text-align: left;
  position: relative;
  background: #172b2c4d;
  display: flex;
  gap: 10px;
}
.chapter.selected {
  border-color: #97bca56a;
  background: #91b4a510;
}
.chapter > span {
  color: #6c8d87;
  font-family: Georgia;
  font-size: 16px;
}
.chapter.selected > span {
  color: var(--gold);
}
.chapter div {
  font-size: 12px;
}
.chapter small {
  display: block;
  font-size: 8px;
  color: #7d9993;
  margin-top: 7px;
  white-space: nowrap;
}
.chapter i {
  font-style: normal;
  position: absolute;
  right: 8px;
  top: 6px;
  color: #607f77;
  font-size: 11px;
}
footer {
  max-width: 1380px;
  margin: 0 auto;
  padding: 20px 4% 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #5e7977;
  font-size: 8px;
  letter-spacing: 1.6px;
  border-top: 1px solid var(--line);
}
footer p {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 2px;
  margin: 0;
}
.game {
  max-width: 1500px;
  margin: 24px auto 28px;
  padding: 0 4%;
}
.game-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.game-top .eyebrow {
  font-size: 9px;
}
h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 2px;
  margin: 5px 0;
}
.game-top h2 span {
  font-family: Arial;
  font-size: 10px;
  letter-spacing: 2px;
  color: #748b86;
  margin-left: 15px;
}
.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.small-button {
  border: 1px solid var(--line);
  padding: 7px 11px;
  border-radius: 4px;
  font-size: 10px;
  color: #bdcfc4;
}
.connection {
  font-size: 10px;
  color: #91b8a7;
  margin-right: 7px;
}
.room-code {
  padding: 6px 10px;
  color: var(--gold);
  border: 1px solid #b59e624a;
  border-radius: 4px;
  letter-spacing: 2px;
  font-size: 11px;
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 262px;
  gap: 25px;
}
.board-shell {
  border: 1px solid #76989130;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 15px 60px #0003;
  align-self: start;
  background: #101f24;
}
.board-top,
.board-bottom {
  display: flex;
  justify-content: space-between;
  padding: 12px 18px;
  color: #8da49e;
  font-size: 10px;
  letter-spacing: 1px;
}
.board-top {
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
}
#timer {
  font-family: monospace;
  letter-spacing: 2px;
}
.canvas-wrap {
  position: relative;
  aspect-ratio: 17/11;
  overflow: hidden;
  background: #0b191f;
}
#board {
  width: 100%;
  height: 100%;
  display: block;
}
.board-bottom {
  border-top: 1px solid var(--line);
  font-size: 8px;
  letter-spacing: 0;
}
.legend {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend i {
  width: 5px;
  height: 5px;
  display: inline-block;
  border-radius: 1px;
}
.cyan-dot {
  background: var(--cyan);
}
.amber-dot {
  background: var(--gold);
  margin-left: 10px;
}
.objective-card {
  border: 1px solid #95b89c38;
  padding: 20px;
  border-radius: 6px;
  background: #99bdab0a;
  margin-bottom: 17px;
}
.objective-card h3 {
  font-size: 15px;
  line-height: 1.8;
  margin: 12px 0 17px;
  font-weight: 500;
  letter-spacing: 1px;
}
.progress-line {
  height: 3px;
  background: #506a623f;
  border-radius: 3px;
  overflow: hidden;
}
.progress-line span {
  height: 3px;
  background: var(--cyan);
  display: block;
  transition: width 0.3s;
}
.status-text {
  font-size: 9px;
  color: #78968c;
  margin-top: 9px;
}
.player-card {
  border-bottom: 1px solid var(--line);
  padding: 17px 0;
  display: flex;
  gap: 9px;
  align-items: center;
}
.player-card .portrait {
  width: 46px;
  height: 51px;
}
.player-card strong {
  font-weight: 500;
  font-size: 12px;
}
.player-card small {
  font-size: 9px;
  color: #8ca298;
  display: block;
  margin: 3px 0 8px;
}
.keycaps {
  display: flex;
  align-items: center;
  gap: 3px;
}
.keycaps kbd {
  font-family: Arial;
  font-size: 8px;
  padding: 1px 4px;
  background: #243731;
  color: #b6c8bd;
  border: 1px solid #778b7a30;
  border-radius: 3px;
  min-width: 16px;
  text-align: center;
}
.keycaps b {
  font-weight: 400;
  color: #698578;
  font-size: 8px;
  margin: 0 3px;
}
.hint-card {
  border: 1px solid var(--line);
  border-radius: 5px;
  margin-top: 19px;
}
.hint-button {
  font-size: 11px;
  padding: 13px 14px;
  display: flex;
  justify-content: space-between;
  width: 100%;
  color: #c0c9ac;
}
.hint-button span {
  font-size: 16px;
  line-height: 1;
}
.hint-card p {
  font-size: 11px;
  color: #9bb3a6;
  line-height: 1.9;
  padding: 0 14px 12px;
  margin: 0;
}
.journal {
  padding: 21px 3px;
}
.journal .eyebrow {
  font-size: 8px;
  color: #627f70;
}
.journal p {
  font-size: 11px;
  color: #839d90;
  font-family: var(--serif);
  line-height: 1.8;
  min-height: 38px;
  margin-bottom: 0;
}
.chapter-progress {
  display: flex;
  align-items: center;
  padding: 0 30px;
  gap: 15px;
  font: 11px Georgia;
  color: #486354;
}
.chapter-progress i {
  height: 1px;
  flex: 1;
  background: #46674e55;
}
.chapter-progress .active {
  color: #cfcbaa;
}
.game-sidebar > .secondary {
  margin-top: 15px;
}
.board-overlay {
  position: absolute;
  inset: 0;
  background: #0a191df2;
  backdrop-filter: blur(7px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 2;
  padding: 20px;
}
.board-overlay p {
  font-size: 12px;
  max-width: 350px;
  color: #8ea99d;
  line-height: 1.9;
}
.board-overlay .primary {
  max-width: 260px;
  margin: 14px 0;
  justify-content: center;
}
.board-overlay small {
  font-size: 10px;
  color: #749583;
}
.waiting-orbit {
  font: 70px Georgia;
  color: var(--cyan);
  line-height: 1.1;
  margin-bottom: 15px;
  animation: float 3s ease-in-out infinite;
}
.code-big {
  font: 35px Georgia;
  letter-spacing: 10px;
  color: var(--gold);
  padding: 12px 20px;
}
.win-symbol {
  font-size: 65px;
  color: var(--gold);
  text-shadow: 0 0 45px #d9bc6666;
}
.board-overlay .eyebrow {
  font-size: 8px;
  margin: 13px 0;
}
.board-overlay h2 {
  font-size: 30px;
}
#win-stats {
  color: #b1c3a3;
  font: 12px monospace;
  letter-spacing: 2px;
  margin: 10px 0;
}
.touch-controls {
  display: none;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  border: 1px solid #88ada658;
  background: #1b3234ed;
  color: #e2e5cc;
  border-radius: 8px;
  padding: 12px 22px;
  max-width: 90vw;
  font-size: 12px;
  text-align: center;
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
}
#toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
dialog {
  background: #14292a;
  border: 1px solid #6c928466;
  border-radius: 12px;
  color: var(--ink);
  max-width: 650px;
  width: 90vw;
  padding: 35px;
  box-shadow: 0 30px 100px #0008;
}
dialog::backdrop {
  background: #020d11c9;
  backdrop-filter: blur(6px);
}
dialog h2 {
  margin: 16px 0;
  font-size: 30px;
}
dialog p {
  color: #a0b5a7;
  font-size: 12px;
  line-height: 1.9;
}
.dialog-close {
  position: absolute;
  right: 14px;
  top: 8px;
  font-size: 28px;
  color: #99b2a3;
}
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 25px;
  margin-top: 25px;
}
.help-grid strong {
  font-size: 12px;
  color: var(--gold);
  font-weight: 500;
}
.help-grid p {
  font-size: 11px;
}
.help-controls {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  line-height: 2.1;
  color: #9eb6a4;
  margin: 18px 0;
}
.help-controls b {
  color: #dae1c6;
  margin-right: 12px;
  font-weight: 400;
}
.help-controls + button {
  justify-content: center;
}
.game .eyebrow {
  letter-spacing: 1.5px;
}
.touch-controls button {
  touch-action: none;
  user-select: none;
}
@keyframes float {
  50% {
    transform: translateY(-7px);
  }
}
@media (min-width: 1600px) {
  .lobby {
    margin-top: 70px;
    margin-bottom: 70px;
  }
  .hero-art {
    min-height: 480px;
  }
}
@media (max-width: 1100px) {
  .lobby {
    grid-template-columns: 350px 1fr;
    gap: 5%;
    margin-top: 35px;
  }
  .hero-art {
    min-height: 390px;
  }
  .hero-words {
    font-size: 51px;
    padding-left: 30px;
  }
  .chapter {
    gap: 6px;
    padding-left: 8px;
  }
  .chapter > span {
    font-size: 12px;
  }
  .chapter small {
    font-size: 7px;
  }
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 225px;
    gap: 17px;
  }
  .game {
    padding: 0 3%;
  }
  .game-sidebar .keycaps {
    flex-wrap: wrap;
  }
  .board-bottom {
    font-size: 7px;
  }
  .header-note {
    display: none;
  }
  h1 {
    font-size: 49px;
  }
}
@media (max-width: 820px) {
  .site-header {
    height: 80px;
  }
  .lobby {
    display: flex;
    flex-direction: column-reverse;
    gap: 30px;
    max-width: 560px;
    margin-top: 25px;
  }
  .world-preview {
    width: 100%;
  }
  .hero-art {
    min-height: 320px;
    max-height: 340px;
    border-radius: 80px 80px 6px 6px;
  }
  .hero-art:after {
    border-radius: 70px 70px 3px 3px;
  }
  .hero-words {
    padding: 50px 35px 0;
    font-size: 53px;
  }
  .hero-description {
    left: auto;
    right: 28px;
    bottom: 47px;
  }
  .hero-description p {
    font-size: 13px;
  }
  .chapter {
    padding: 12px;
  }
  .chapter small {
    font-size: 8px;
  }
  .intro {
    width: 100%;
  }
  h1 {
    font-size: 42px;
    line-height: 1.25;
    margin-top: 18px;
  }
  h1 br {
    display: none;
  }
  .intro-copy {
    margin-bottom: 18px;
  }
  .spirits-pair {
    max-width: 380px;
  }
  .tiny-note {
    justify-content: center;
  }
  .world-caption {
    margin-bottom: 12px;
  }
  .game-layout {
    display: flex;
    flex-direction: column;
  }
  .game-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .objective-card {
    grid-column: 1/-1;
    margin: 0;
    padding: 13px 18px;
  }
  .objective-card h3 {
    font-size: 13px;
    margin: 5px 0 10px;
  }
  .objective-card .eyebrow {
    font-size: 8px;
  }
  .player-card {
    padding: 10px 0;
  }
  .hint-card {
    margin: 0;
  }
  .journal {
    padding: 10px;
  }
  .chapter-progress {
    display: none;
  }
  .game-top {
    flex-wrap: wrap;
    gap: 12px;
  }
  .game-top h2 {
    font-size: 23px;
  }
  .session-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .board-overlay h2 {
    font-size: 23px;
  }
  .board-overlay p {
    font-size: 11px;
  }
  .waiting-orbit {
    font-size: 40px;
    margin-bottom: 4px;
  }
  .code-big {
    font-size: 28px;
    padding: 6px;
  }
  .board-overlay .primary {
    margin: 8px;
  }
  .board-overlay {
    padding: 15px;
  }
  .connection {
    font-size: 9px;
  }
  .touch-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 0;
    gap: 25px;
    padding: 0 20px;
  }
  .dpad {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(2, 43px);
    gap: 5px;
  }
  .dpad button {
    background: #243c38;
    border: 1px solid #7c9c8055;
    border-radius: 6px;
    font-size: 21px;
  }
  .dpad button[data-dir="up"] {
    grid-column: 2;
  }
  .dpad button[data-dir="left"] {
    grid-column: 1;
    grid-row: 2;
  }
  .dpad button[data-dir="down"] {
    grid-column: 2;
    grid-row: 2;
  }
  .dpad button[data-dir="right"] {
    grid-column: 3;
    grid-row: 2;
  }
  #touch-action {
    width: 88px;
    height: 74px;
    justify-content: center;
  }
  .game-sidebar > #switch {
    margin: 0;
  }
  footer > span:last-child {
    display: none;
  }
  footer {
    font-size: 7px;
  }
  footer p {
    font-size: 9px;
  }
}
@media (max-width: 460px) {
  .brand {
    font-size: 21px;
  }
  .brand-symbol {
    font-size: 32px;
  }
  .icon-button span {
    display: none;
  }
  nav {
    gap: 6px;
  }
  .lobby {
    padding: 0 6%;
  }
  .hero-art {
    min-height: 295px;
  }
  .hero-words {
    font-size: 46px;
    padding-left: 24px;
  }
  .hero-description {
    right: 20px;
    bottom: 52px;
  }
  .hero-description p {
    font-size: 12px;
  }
  .chapter {
    padding: 12px 8px;
  }
  .chapter div {
    font-size: 10px;
  }
  .chapter small {
    font-size: 7px;
  }
  .chapter i {
    display: none;
  }
  .world-caption .eyebrow {
    font-size: 7px;
    letter-spacing: 1.8px;
  }
  .game {
    padding: 0 3%;
  }
  .game-sidebar {
    gap: 8px;
  }
  .player-card .portrait {
    width: 32px;
    height: 38px;
  }
  .player-card {
    gap: 4px;
  }
  .player-card small {
    font-size: 8px;
  }
  .keycaps {
    gap: 1px;
  }
  .keycaps kbd {
    font-size: 7px;
    min-width: 12px;
    padding: 1px 2px;
  }
  .keycaps b {
    font-size: 7px;
    margin: 0 1px;
  }
  .board-top,
  .board-bottom {
    padding: 8px;
    font-size: 8px;
  }
  .board-bottom > span:last-child {
    font-size: 7px;
  }
  .board-bottom .legend {
    font-size: 7px;
  }
  .game-top h2 {
    font-size: 21px;
  }
  .board-overlay h2 {
    font-size: 20px;
  }
  .board-overlay p {
    font-size: 10px;
    margin: 5px 0;
  }
  .board-overlay .primary {
    padding: 8px;
    font-size: 11px;
    width: 205px;
  }
  .waiting-orbit {
    font-size: 28px;
  }
  .code-big {
    font-size: 23px;
    padding: 4px;
  }
  .board-overlay small {
    font-size: 8px;
  }
  .win-symbol {
    font-size: 32px;
  }
  .board-overlay .eyebrow {
    font-size: 6px;
    margin: 6px 0;
  }
  #win-stats {
    font-size: 9px;
    margin: 4px;
  }
  .help-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  dialog {
    padding: 25px;
  }
  .help-grid p {
    margin: 4px 0;
  }
  .touch-controls {
    padding: 0 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (max-width: 820px) {
  .touch-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 6;
    padding: 8px max(20px, env(safe-area-inset-right))
      calc(8px + env(safe-area-inset-bottom));
    margin: 0;
    background: #0d2023f2;
    border-top: 1px solid #8bafa444;
    backdrop-filter: blur(12px);
    box-shadow: 0 -8px 30px #0003;
  }
  .game {
    padding-bottom: 120px;
  }
}
