:root {
  color-scheme: dark;
  --ink: #f8f5ec;
  --muted: #aeb3bd;
  --night: #171b28;
  --panel: #252a38;
  --line: #ffffff20;
  --coral: #ff7e68;
  --mint: #aee6bf;
  --shadow: #080a14aa;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--night);
}
body {
  margin: 0;
  color: var(--ink);
  min-height: 100svh;
  background:
    radial-gradient(ellipse 520px 400px at 80% -80px, #50556b77, transparent),
    linear-gradient(#1b2030, #151927);
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.42;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.app-shell {
  max-width: 560px;
  min-height: 100svh;
  margin: auto;
  padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 24px
    max(20px, env(safe-area-inset-left));
  position: relative;
}
.app-shell:before {
  content: "";
  position: absolute;
  top: 92px;
  left: 0;
  right: 0;
  height: 440px;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, #ff82691a, transparent 67%);
}
.topbar,
main,
footer {
  position: relative;
  z-index: 1;
}
.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 950;
  font-size: 17px;
  letter-spacing: 0.17em;
}
.brand-symbol {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--coral);
  color: var(--night);
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.1em;
}
.brand-symbol span {
  font-size: 9px;
  position: absolute;
  right: 2px;
  top: 1px;
}
.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff0a;
  color: var(--ink);
  font-size: 20px;
}
.icon-button.off {
  color: var(--muted);
}
.intro {
  padding: 31px 0 25px;
}
.eyebrow,
.section-kicker,
.stat-label,
.scene-mark,
footer {
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 850;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mint);
  margin: 0 0 14px;
}
.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 12px #aee6bfaa;
}
.intro h1 {
  font-family: Georgia, serif;
  font-size: clamp(39px, 11vw, 58px);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.98;
  margin: 0;
}
.intro h1 em {
  font-weight: 400;
  color: var(--coral);
}
.intro-copy {
  margin: 14px 0 0;
  max-width: 300px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  background: #0e1320a8;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 16px;
}
.mode-switch button {
  position: relative;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  font-size: 13px;
}
.mode-switch button.active {
  background: #363d50;
  color: var(--ink);
  box-shadow: 0 2px 8px #0005;
}
.new-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--coral);
  vertical-align: top;
  margin: 3px;
}
.new-dot[hidden] {
  display: none;
}
.play-panel {
  background: linear-gradient(155deg, #31374a, #242a39 55%, #1f2534);
  border: 1px solid #ffffff2b;
  border-radius: 20px;
  padding: 16px;
  box-shadow:
    0 22px 48px var(--shadow),
    inset 0 1px #ffffff16;
}
.puzzle-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.section-kicker {
  color: var(--coral);
  margin: 0 0 4px;
}
.puzzle-heading h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 23px;
  letter-spacing: -0.045em;
}
.puzzle-heading-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.puzzle-heading-side button {
  border: 1px solid #ffffff4a;
  border-radius: 9px;
  background: #273949;
  color: var(--ink);
  padding: 7px 8px;
  min-height: 44px;
  font-size: 12px;
  font-weight: 750;
}
.puzzle-heading-side button[hidden] {
  display: none;
}
.daily-number {
  align-self: center;
  border: 1px solid #ffffff29;
  background: #ffffff0c;
  border-radius: 9px;
  padding: 7px 8px;
  color: #d5d8de;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.board-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 4px solid #141927;
  box-shadow:
    0 12px 22px #06091588,
    inset 0 0 0 1px #fff3;
  aspect-ratio: 1;
}
.board {
  display: grid;
  width: 100%;
  height: 100%;
  gap: 3px;
  background: #161b29;
  padding: 3px;
}
.tile {
  position: relative;
  display: grid;
  place-items: end start;
  overflow: hidden;
  border: 0;
  padding: 0;
  background-color: #53566c;
  background-image: url("art/rooftop-relay.webp");
  background-repeat: no-repeat;
  border-radius: 4px;
  color: #fff;
  box-shadow: inset 0 1px #ffffff44;
  transition:
    transform 0.12s ease,
    filter 0.12s ease;
}
.tile:not(:disabled):hover {
  filter: brightness(1.12);
}
.tile:active {
  transform: scale(0.94);
}
.tile-number {
  margin: 0 0 6px 7px;
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding: 0 4px;
  border-radius: 7px;
  background: #101525d9;
  border: 1px solid #ffffff35;
  font-weight: 900;
  font-size: 12px;
  box-shadow: 0 2px 6px #0008;
}
.board.hide-numbers .tile-number {
  display: none;
}
.tile.suggested {
  outline: 3px solid var(--mint);
  outline-offset: -4px;
  z-index: 2;
}
.gap-tile {
  display: grid;
  place-items: center;
  background: #111623;
  border-radius: 4px;
  color: #ffffff4f;
  border: 1px dashed #ffffff2e;
  font-size: 24px;
}
.board-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: #ffe1b244;
}
.board-flash.go {
  animation: flash 0.42s ease-out;
}
@keyframes flash {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 0;
  }
}
.puzzle-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: #b3b9c4;
  font-size: 12px;
}
.scene-mark {
  font-size: 8px;
  white-space: nowrap;
  color: #8f9aa8;
}
.relay-rule {
  margin: -3px 0 13px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #aee6bf15;
  border: 1px solid #aee6bf52;
  color: #d8eee0;
}
.relay-rule strong {
  display: block;
  color: var(--mint);
  font-size: 11px;
  letter-spacing: 0.11em;
  margin-bottom: 5px;
}
.relay-rule span {
  display: block;
  font-size: 13px;
  line-height: 1.45;
}
.relay-rule b {
  color: #fff;
}
.version-warning {
  padding: 11px 13px;
  margin: -4px 0 13px;
  border: 1px solid #ff7e6880;
  border-radius: 10px;
  background: #ff7e681c;
  color: #ffe4dd;
  font-size: 12px;
  line-height: 1.4;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 17px 0 16px;
  padding: 13px 0;
  border-block: 1px solid var(--line);
}
.stats > div {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stats > div + div {
  border-left: 1px solid var(--line);
}
.stat-label {
  color: #9ca6b5;
  font-size: 11px;
}
.stats strong {
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}
.actions {
  display: grid;
  grid-template-columns: 1.55fr 0.8fr 0.8fr;
  gap: 8px;
}
#result-button {
  grid-column: 2 / 4;
}
.actions button,
.modal-actions button {
  min-height: 47px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
}
.primary-button {
  border: 1px solid #ffab9b;
  background: var(--coral);
  color: #252332;
  box-shadow: 0 7px 19px #ff7e6826;
}
.primary-button:hover {
  background: #ff9784;
}
.primary-button span {
  float: right;
  font-size: 17px;
}
.secondary-button {
  border: 1px solid #ffffff2d;
  background: #ffffff0c;
  color: var(--ink);
}
.secondary-button:not(:disabled):hover {
  background: #ffffff1d;
}
.utility-row {
  display: flex;
  justify-content: space-between;
  margin: 14px 0 4px;
}
.utility-row button {
  border: 0;
  background: none;
  color: #cbd0d8;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 2px;
}
.utility-row button:hover {
  color: white;
}
.live-status {
  min-height: 19px;
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--mint);
  text-align: center;
}
.save-warning {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #ffad91;
  border-radius: 12px;
  background: #5a2b2a;
  color: #fff5ee;
  font-size: 12px;
  line-height: 1.45;
}
.save-warning p {
  margin: 0;
}
.save-warning button {
  min-height: 44px;
  margin-top: 10px;
  padding: 0 14px;
  border: 1px solid #ffd3bd;
  border-radius: 8px;
  background: #fff0e6;
  color: #40211e;
  font-weight: 800;
}
.worldbook {
  margin-top: 12px;
  padding: 16px;
  background: #202635;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.worldbook-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}
.worldbook-heading .section-kicker {
  color: var(--mint);
  margin: 0 0 5px;
}
.worldbook-heading h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 500;
}
#worldbook-count {
  margin: 0 0 3px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}
.worldbook-list {
  display: grid;
  gap: 8px;
}
.worldbook-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 94px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff06;
}
.worldbook-thumb {
  width: 82px;
  height: 82px;
  border-radius: 8px;
  background: linear-gradient(145deg, #41495b, #242a38);
  box-shadow: inset 0 0 0 1px #ffffff17;
}
.worldbook-card.restored[data-world="rooftop-relay"] .worldbook-thumb {
  background: center / cover url("art/rooftop-relay.webp");
}
.worldbook-card.restored[data-world="night-market"] .worldbook-thumb {
  background: center / cover url("art/night-market.webp");
}
.worldbook-card.restored[data-world="signal-garden"] .worldbook-thumb {
  background: center / cover url("art/signal-garden.webp");
}
.worldbook-state {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  margin: 0 0 3px;
}
.worldbook-card.restored .worldbook-state {
  color: var(--mint);
}
.worldbook-card h3 {
  margin: 0 0 4px;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 500;
}
.worldbook-description {
  margin: 0;
  color: #c1c7d0;
  font-size: 12px;
  line-height: 1.4;
}
.worldbook-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.settings {
  margin-top: 12px;
  padding: 10px 15px;
  background: #202635;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.setting-row + .setting-row {
  border-top: 1px solid var(--line);
}
.setting-row strong {
  display: block;
  font-size: 14px;
}
.setting-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.size-switch {
  display: flex;
  gap: 4px;
}
.size-switch button,
.code-row button {
  min-width: 30px;
  min-height: 30px;
  border-radius: 7px;
  background: #ffffff12;
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}
.size-switch button.active {
  background: var(--mint);
  color: #12221d;
}
.toggle {
  width: 38px;
  height: 22px;
  border: 0;
  border-radius: 30px;
  background: var(--mint);
  padding: 3px;
  display: flex;
  justify-content: flex-end;
}
.toggle span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #163024;
}
.toggle.off {
  background: #5d6371;
  justify-content: flex-start;
}
.code-row {
  display: flex;
  gap: 5px;
}
.code-row input {
  width: 94px;
  min-height: 30px;
  background: #101523;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
}
.code-row button {
  padding: 0 9px;
}
.settings-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin: 5px 0 8px;
}
.erase-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 14px 0 4px;
}
.erase-row strong,
.erase-row small {
  display: block;
}
.erase-row strong {
  font-size: 13px;
}
.erase-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.erase-row button {
  flex: none;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #ffb7a8;
  border-radius: 9px;
  background: #ff7e6818;
  color: #ffd1c8;
  font-size: 12px;
  font-weight: 800;
}
.erase-dialog {
  width: min(410px, calc(100vw - 32px));
  margin: auto;
  padding: 22px;
  border: 1px solid #ffffff35;
  border-radius: 18px;
  background: #252a38;
  color: var(--ink);
  box-shadow: 0 20px 70px #000a;
}
.erase-dialog::backdrop {
  background: #0b0e18cf;
}
.erase-dialog .section-kicker {
  color: var(--coral);
  margin: 0 0 8px;
}
.erase-dialog h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 32px;
  font-weight: 500;
}
.erase-dialog p:not(.section-kicker) {
  color: #d8dbe2;
  font-size: 14px;
  line-height: 1.5;
}
.erase-dialog #erase-status {
  color: #ffd1c8;
  min-height: 1.5em;
}
.erase-actions {
  display: flex;
  gap: 8px;
}
.erase-actions button {
  flex: 1;
  min-height: 44px;
  padding: 8px;
  border-radius: 9px;
  font-weight: 800;
}
.erase-confirm {
  border: 1px solid #ffb7a8;
  background: var(--coral);
  color: var(--night);
}
@media (max-width: 380px) {
  .erase-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 25px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: #6d7886;
  font-size: 8px;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #090c14d9;
  display: grid;
  place-items: center;
  padding: 18px;
  backdrop-filter: blur(8px);
}
.modal-card {
  width: min(100%, 420px);
  max-height: calc(100svh - 36px);
  overflow-y: auto;
  background: #293043;
  border: 1px solid #ffffff3d;
  border-radius: 21px;
  padding: 18px;
  box-shadow: 0 30px 80px #000b;
}
.win-scene {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 11px;
  background: center/cover url("art/rooftop-relay.webp");
  margin-bottom: 17px;
}
.win-scene::after {
  content: "";
  position: absolute;
  left: 51.3%;
  top: 51.8%;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle,
    #dbffdbb8 0%,
    #b8edc66b 22%,
    #b8edc600 68%
  );
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 0;
}
.win-scene[data-world="signal-garden"]::after {
  top: 42.8%;
  background: radial-gradient(
    circle,
    #fff3c6c9 0%,
    #b6e7c47a 24%,
    #b6e7c400 70%
  );
}
.win-scene[data-world="night-market"]::after {
  left: 0;
  top: 15%;
  width: 100%;
  height: 30%;
  border-radius: 0;
  transform: none;
  background:
    radial-gradient(circle at 15% 55%, #ffe2a2ab 0%, #ffd39700 13%),
    radial-gradient(circle at 32% 66%, #ffe2a2ab 0%, #ffd39700 13%),
    radial-gradient(circle at 50% 67%, #ffe2a2ab 0%, #ffd39700 13%),
    radial-gradient(circle at 69% 54%, #ffe2a2ab 0%, #ffd39700 13%),
    radial-gradient(circle at 87% 30%, #ffe2a2ab 0%, #ffd39700 13%);
}
.modal:not([hidden]) .win-scene::after {
  animation: restore-beacon 1.05s ease-out both;
}
.modal:not([hidden]) .win-scene[data-world="night-market"]::after {
  animation-name: restore-lanterns;
}
@keyframes restore-beacon {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  38% {
    opacity: 0.82;
    transform: translate(-50%, -50%) scale(1.15);
  }
  100% {
    opacity: 0.22;
    transform: translate(-50%, -50%) scale(1);
  }
}
@keyframes restore-lanterns {
  0% {
    opacity: 0;
  }
  55% {
    opacity: 0.9;
  }
  100% {
    opacity: 0.3;
  }
}
.modal-card h2 {
  font-family: Georgia, serif;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.05em;
  margin: 0;
}
.modal-card p:not(.section-kicker) {
  color: #d5d9e2;
  font-size: 13px;
  line-height: 1.5;
}
.modal-card .win-best {
  color: var(--mint) !important;
  font-weight: 800;
}
.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.modal-actions .primary-button {
  grid-column: 1 / -1;
}
#win-card[hidden] + #win-close {
  grid-column: 1 / -1;
}
.modal-card .card-status {
  min-height: 18px;
  margin: 9px 0 0;
  color: var(--mint) !important;
  font-size: 12px !important;
}
.modal-card .world-story {
  font-family: Georgia, serif;
  font-size: 16px !important;
  color: #f8f5ec !important;
  margin: 6px 0 14px;
  font-style: italic;
}
.tile:disabled {
  opacity: 1;
}
.board {
  touch-action: none;
}
.icon-button {
  width: 44px;
  height: 44px;
}
.mode-switch button {
  min-height: 44px;
}
.utility-row button {
  min-height: 44px;
}
.size-switch button,
.code-row button {
  min-width: 44px;
  min-height: 44px;
}
.code-row input {
  min-height: 44px;
}
.toggle {
  width: 44px;
  height: 30px;
}
.toggle span {
  width: 24px;
  height: 24px;
}
@media (max-width: 600px) {
  .intro {
    padding: 26px 0 19px;
  }
  body.relay-mode .intro {
    padding: 12px 0;
  }
  body.relay-mode .eyebrow {
    margin-bottom: 8px;
  }
  body.relay-mode .intro-copy {
    display: none;
  }
  .actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin-inline: -8px;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    border-radius: 18px;
    background: #171b28;
    box-shadow: 0 0 0 1px #ffffff18;
  }
  body.solved-mode .actions,
  body.storage-warning .actions,
  body.large-text.relay-mode .actions {
    position: static;
  }
}
@media (max-width: 600px) and (max-height: 900px) {
  .topbar {
    height: 58px;
  }
  .intro {
    padding: 10px 0 8px;
  }
  .eyebrow {
    margin-bottom: 8px;
  }
  .intro h1 {
    font-size: clamp(36px, 10vw, 44px);
  }
  .intro-copy {
    display: none;
  }
  .mode-switch {
    margin-bottom: 8px;
  }
}
@media (max-width: 380px) {
  .worldbook-heading {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }
  .app-shell {
    padding-inline: max(14px, env(safe-area-inset-left))
      max(14px, env(safe-area-inset-right));
  }
  .intro {
    padding-top: 23px;
  }
  .play-panel {
    padding: 11px;
  }
  .scene-mark {
    display: none;
  }
  .actions {
    grid-template-columns: 1.35fr 0.7fr 0.7fr;
  }
  .actions button {
    font-size: 11px;
  }
}
@media (max-height: 720px) {
  .topbar {
    height: 56px;
  }
  .intro {
    padding: 17px 0;
  }
  .intro h1 {
    font-size: 39px;
  }
  .play-panel {
    padding: 11px;
  }
  .stats {
    margin: 10px 0;
  }
}
@media (max-width: 380px) and (max-height: 720px) {
  body.has-resume-daily .actions {
    position: static;
  }
  .intro {
    padding: 10px 0 14px;
  }
  .eyebrow,
  .intro-copy {
    display: none;
  }
  .intro h1 {
    font-size: 36px;
  }
  .mode-switch {
    margin-bottom: 8px;
  }
  .board-wrap {
    max-width: 248px;
    margin-inline: auto;
  }
  .relay-rule {
    padding: 7px 9px;
    margin-bottom: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* Optional in-game reading size; layout and board geometry stay independent. */
body.large-text .intro-copy,
body.large-text .relay-rule span,
body.large-text .setting-row strong,
body.large-text .modal-card p:not(.section-kicker) {
  font-size: 16px;
}
body.large-text .mode-switch button,
body.large-text .puzzle-caption,
body.large-text .utility-row button,
body.large-text .worldbook-description,
body.large-text .settings-note {
  font-size: 15px;
}
body.large-text .relay-rule strong,
body.large-text .stat-label,
body.large-text .worldbook-state,
body.large-text .worldbook-note {
  font-size: 13px;
}
body.large-text .setting-row small,
body.large-text .live-status,
body.large-text #worldbook-count {
  font-size: 14px;
}
body.large-text .actions button,
body.large-text .modal-actions button {
  font-size: 16px;
  line-height: 1.15;
  min-height: 54px;
}
body.large-text .mode-switch button {
  min-height: 52px;
}
body.large-text .scene-mark {
  display: none;
}
body.large-text .modal-card {
  max-height: calc(100svh - 36px);
  overflow-y: auto;
}
@media (orientation: landscape) and (min-width: 650px) and (max-width: 1200px) {
  .app-shell {
    --landscape-panel-width: min(48vw, calc(100svh - 82px));
    max-width: none;
    padding: max(8px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  .app-shell:before,
  .intro,
  footer {
    display: none;
  }
  .topbar {
    height: 46px;
    margin-bottom: 8px;
  }
  main {
    padding-left: calc(var(--landscape-panel-width) + 16px);
  }
  .play-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--landscape-panel-width);
    padding: 10px;
  }
  .puzzle-heading {
    margin-bottom: 8px;
  }
  .puzzle-heading h2 {
    font-size: 18px;
  }
  .board-wrap {
    max-width: min(100%, calc(100svh - 132px));
    margin-inline: auto;
  }
  body.relay-mode .board-wrap {
    max-width: min(100%, calc(100svh - 185px));
  }
  .mode-switch {
    margin-bottom: 8px;
  }
  .stats {
    margin: 8px 0;
    padding: 8px 0;
  }
  .actions,
  body.large-text.relay-mode .actions {
    position: static;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }
  .utility-row {
    margin: 8px 0 0;
  }
  .relay-rule {
    padding: 6px 8px;
    margin-bottom: 8px;
  }
  .relay-rule span {
    font-size: 11px;
  }
}
@media (orientation: landscape) and (min-width: 650px) and (max-width: 1200px) and (max-height: 500px) {
  body.relay-mode .board-wrap {
    max-width: min(100%, calc(100svh - 132px));
  }
  body.relay-mode .relay-rule {
    position: absolute;
    top: 248px;
    left: calc(100% + 16px);
    width: calc(100vw - var(--landscape-panel-width) - 44px);
  }
  body.large-text.relay-mode .relay-rule {
    top: 265px;
  }
  .settings,
  .worldbook {
    position: relative;
    z-index: 2;
  }
}
