@font-face {
  font-family: Instrument;
  src: url(./fonts/instrument-serif-latin-400-normal.woff2) format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Instrument;
  src: url(./fonts/instrument-serif-latin-400-italic.woff2) format('woff2');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url(./fonts/dm-sans-latin-400-normal.woff2) format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url(./fonts/dm-sans-latin-500-normal.woff2) format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url(./fonts/dm-sans-latin-600-normal.woff2) format('woff2');
  font-weight: 600 800;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ink: #f2eee1;
  --muted: #afbcaf;
  --faint: #85988a;
  --line: #354239;
  --gold: #e9c58e;
  --gold-dark: #3b3224;
  --base: #111914;
  --surface: #19241e;
  --serif: Instrument, Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 47% 25%, #1a251f 0, transparent 57%), var(--base);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  min-height: 100vh;
}
button,
input,
select {
  font: inherit;
}
button {
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
button,
input {
  outline-offset: 4px;
}
button:focus-visible,
canvas:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
}
button:focus:not(:focus-visible),
canvas:focus:not(:focus-visible) {
  outline: 0;
}
button,
button svg {
  flex-shrink: 0;
}
svg,
[data-i] {
  display: inline-flex;
  vertical-align: middle;
}
button {
  transition:
    background 0.16s,
    color 0.16s,
    border-color 0.16s;
}
button:focus-visible,
button:hover {
  color: #fff7e3;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
main {
  max-width: 1660px;
  margin: auto;
  padding-inline: clamp(16px, 3.15vw, 58px);
}
.brand,
.table-tools,
.connection,
.vr-btn,
.conditions,
.corner-controls,
.stage-toolbar,
.view-switch,
.section-heading,
.section-heading button,
.tabs button,
.panel-foot,
.panel-foot span,
.panel-foot button,
.subline,
.label-row,
.action-row,
.game-chip,
.split-actions,
.player-name,
.mini,
.choice,
.notice-inline {
  display: flex;
  align-items: center;
}
.brand { gap: 8px; }
.brand img { width: 30px; height: 30px; }
.brand h1 {
  font: 400 clamp(23px, 2vw, 30px) / 1 var(--serif);
  letter-spacing: -.015em;
}
.brand i { color: #f1d1a5; font-weight: 400; }
.table-tools { gap: clamp(8px, 1.2vw, 18px); margin-inline-start: auto; }
.connection {
  font-size: 12px;
  color: var(--muted);
  gap: 8px;
}
.connection i,
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9cc99e;
  box-shadow: 0 0 9px #89c78f45;
}
.connection.lost i {
  background: var(--gold);
}
.vr-btn {
  padding: 10px 18px;
  gap: 9px;
  border: 1px solid #b39d77;
  border-radius: 7px;
  font-weight: 600;
  color: #eed6a9;
  background: #252a20;
}
.vr-btn:hover {
  background: #3a3a2a;
}
.vr-btn svg {
  width: 21px;
}
main {
  padding-block: clamp(17px, 2vw, 34px) 32px;
}
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.65fr) minmax(300px, 1fr);
  grid-template-areas: "stage panels" "places places";
  gap: clamp(13px, 1.45vw, 25px);
  align-items: stretch;
}
.stage,
.sidebar {
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface);
}
.stage {
  grid-area: stage;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.viewport {
  position: relative;
  isolation: isolate;
  min-height: 410px;
  height: clamp(410px, 56.5vh, 655px);
  flex: 1 0 auto;
  background: linear-gradient(150deg, #566763, #303d35);
  overflow: hidden;
}
.viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: grab;
}
.viewport canvas:active {
  cursor: grabbing;
}
.stage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #0c171b73, transparent 27%, transparent 78%, #0d181a75);
}
.scene-info, .stage-vignette {
  transition: opacity .32s ease;
  pointer-events: none;
}
.viewport.scene-busy :is(.scene-info, .stage-vignette) { opacity: 0; }
.scene-heading, .scene-bottom {
  position: absolute;
  color: #fff8e7;
  text-shadow: 0 1px 3px #101910, 0 2px 12px #101910b0;
}
.scene-heading {
  top: max(17px, env(safe-area-inset-top));
  left: max(19px, env(safe-area-inset-left));
  right: 112px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 20px;
}
.conditions { gap: 7px; }
.conditions > div { display: grid; gap: 1px; }
.conditions-label {
  font: 600 9px/1.2 var(--sans);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.weather-icon svg { width: 19px; height: 19px; }
#scene-conditions { font: 500 13px/1.2 var(--sans); }
.scene-bottom {
  inset-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right));
  bottom: max(15px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  pointer-events: none;
}
.world-caption {
  justify-self: start;
  max-width: min(100%, 58ch);
  min-width: 0;
  font: 400 clamp(20px, 1.9vw, 28px)/1.13 var(--serif);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.world-caption.generated {
  font: 500 clamp(15px, 1.3vw, 19px)/1.35 var(--sans);
  max-width: min(100%, 62ch);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.world-caption.generated.long { font-size: clamp(14px, 1.15vw, 17px); }
.caption-ending { display: inline-block; max-width: 100%; }
.corner-controls {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  top: max(10px, env(safe-area-inset-top));
  gap: 7px;
}
.round {
  height: 34px;
  width: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #e4e5ca56;
  border-radius: 50%;
  color: #fbf5e1;
  background: #17221f75;
  backdrop-filter: blur(5px);
  padding: 0;
}
.round:hover {
  background: #1c291f;
}
.round svg {
  height: 16px;
  width: 16px;
}
.stage-toolbar {
  min-height: 52px;
  padding: 6px 14px;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #18231d;
}
.view-switch {
  gap: 3px;
}
.view-switch button,
.tabs button {
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 5px;
}
.view-switch button {
  display: flex;
  align-items: center;
  padding: 6px 10px;
}
.view-switch button svg {
  width: 15px;
  height: 15px;
}
.view-switch button[aria-pressed='true'] {
  background: #314033;
  color: #f5e7c7;
}
.view-switch button:hover,
.tabs button:hover,
.subtle:hover {
  background: #2a372d;
}
.orbit-help {
  font-size: 11px;
  color: var(--muted);
}
.orbit-help span {
  margin: 0 4px;
  color: var(--faint);
}
.stage.expanded {
  position: fixed;
  inset: 12px;
  z-index: 30;
  box-shadow: 0 0 0 100vmax #0a110ee0;
}
.stage.expanded .viewport {
  height: 100%;
}
.sidebar {
  grid-area: panels;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 10px 10px 0;
  border-bottom: 1px solid var(--line);
  gap: 3px;
}
.tabs button {
  justify-content: center;
  padding: 10px 2px 13px;
  border-radius: 4px 4px 0 0;
  position: relative;
  font-weight: 500;
}
.tabs button[aria-pressed='true'] {
  color: var(--gold);
}
.tabs button[aria-pressed='true']::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--gold);
}
.tabs svg {
  width: 16px;
  height: 16px;
}
.panel-body {
  padding: clamp(18px, 1.7vw, 29px);
  flex: 1;
  min-width: 0;
}
.panel-body h2,
dialog h2 {
  font: 400 clamp(34px, 2.6vw, 45px) / 1.06 var(--serif);
  letter-spacing: -0.016em;
  margin: 6px 0 9px;
}
.panel-body .kicker,
dialog .kicker,
.micro {
  color: var(--gold);
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.panel-body .kicker {
  display: flex;
  align-items: center;
  gap: 6px;
}
.body-copy,
.detail-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.detail-copy {
  font-size: 12px;
}
.form-group {
  margin-top: 19px;
}
.form-label,
.group-title {
  font-size: 12px;
  font-weight: 600;
  color: #dbe2d4;
}
.seat-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 8px 0 12px;
}
.seat-select {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 4px;
  border: 1px solid #3d4a3e;
  background: #17201b;
  border-radius: 6px;
  color: #bdc9bc;
  font-size: 13px;
}
.seat-select[aria-pressed='true'],
.choice[aria-pressed='true'] {
  border-color: #a68e65;
  background: #323328;
  color: #f4d49d;
}
.stone {
  display: inline-block;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #94a897;
  box-shadow: inset 0 0 0 1px #11191438;
}
.stone.w {
  background: #e7ddbd;
  border-color: #e8d9b2;
}
.stone.b {
  background: #253b34;
  border-color: #829c89;
}
.stone.auto {
  background: linear-gradient(107deg, #e7dabb 49%, #284035 51%);
  border-color: #abb49b;
}
.primary,
.secondary,
.subtle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 600;
  border-radius: 6px;
}
.primary {
  color: #28281f;
  background: var(--gold);
  border: 1px solid #edd4a7;
  padding: 11px 13px;
  width: 100%;
  box-shadow: inset 0 1px #fff4d64d;
}
.primary:hover {
  color: #1a2119;
  background: #f4d9aa;
}
.primary.justify {
  justify-content: space-between;
}
.secondary {
  padding: 8px 11px;
  border: 1px solid #485748;
  color: #e1e5d8;
  font-size: 12px;
}
.secondary:hover {
  background: #2c3a2f;
}
.subtle {
  padding: 6px 4px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}
.split-actions {
  margin-top: 8px;
  justify-content: space-between;
  gap: 6px;
}
.split-actions .subtle {
  padding: 5px 1px;
}
.panel-foot {
  border-top: 1px solid var(--line);
  min-height: 46px;
  justify-content: space-between;
  padding: 8px clamp(16px, 1.7vw, 29px);
  color: var(--muted);
  font-size: 11px;
  gap: 5px;
}
.panel-foot span,
.panel-foot button {
  gap: 6px;
}
.panel-foot svg {
  width: 14px;
  height: 14px;
}
.panel-foot button {
  color: var(--muted);
  font-size: 11.5px;
  padding: 0;
}
.preference {
  border-top: 1px solid var(--line);
  margin-top: 17px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #d2dccd;
  font-size: 12px;
}
.switch {
  padding: 2px;
  width: 33px;
  height: 19px;
  border-radius: 10px;
  background: #3a473d;
  border: 1px solid #526353;
  display: inline-flex;
  align-items: center;
}
.switch:after {
  content: '';
  height: 11px;
  width: 11px;
  background: #d8e1ce;
  border-radius: 50%;
  transition: transform 0.18s;
}
.switch[aria-checked='true'] {
  background: #829c7a;
  border-color: #9bb48e;
}
.switch[aria-checked='true']:after {
  transform: translateX(14px);
  background: #f0ecd9;
}
.atlas { grid-area: places; min-width: 0; }
.section-heading {
  justify-content: space-between;
  gap: 12px;
  margin: 0 1px 11px;
}
.section-heading h2 {
  font: 400 31px/1.2 var(--serif);
  letter-spacing: -0.016em;
}
.section-heading button {
  gap: 7px;
  color: #c5cebd;
  font-size: 12px;
  padding: 4px 0;
}
.section-heading svg {
  width: 15px;
}
.places {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.3vw, 22px);
}
.place-card {
  position: relative;
  isolation: isolate;
  min-height: 112px;
  height: clamp(116px, 12.6vh, 158px);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-flow: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 12px 15px;
  background: #33443a;
}
.place-card:before,
.place-card:after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
}
.place-card:before {
  background: var(--art) center 55% / cover no-repeat;
  transition: transform 0.4s ease;
}
.place-card:after {
  background: linear-gradient(0deg, #0a1617e8 0%, #0a161756 55%, #17232212 90%);
}
.place-card:hover:before {
  transform: scale(1.035);
}
.place-card[aria-pressed='true'] {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px #d8b67d38;
}
.place-card .place-kind {
  color: #deceaa;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.place-card strong {
  font: 400 clamp(22px, 1.85vw, 32px) / 1.1 var(--serif);
  color: #fff1d6;
  margin-top: 2px;
}
.place-status {
  position: absolute;
  right: 12px;
  top: 11px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #e9e8cf82;
  border-radius: 50%;
  background: #12221e88;
  color: #102019;
}
.place-status svg {
  display: none;
  width: 13px;
  height: 13px;
}
.place-card[aria-pressed='true'] .place-status {
  background: var(--gold);
  border-color: var(--gold);
}
.place-card[aria-pressed='true'] .place-status svg {
  display: block;
}
.game-chip {
  display: inline-flex;
  gap: 6px;
  font-size: 11px;
  color: #c7d6bd;
}
.game-chip .dot {
  width: 6px;
  height: 6px;
}
.player-list {
  margin: 15px 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 10px;
  font-size: 12px;
  background: #152019;
}
.player-row + .player-row {
  border-top: 1px solid var(--line);
}
.player-name {
  gap: 8px;
}
.seat-tag {
  font-size: 10px;
  color: var(--muted);
}
.seat-tag.turn {
  color: var(--gold);
}
.action-row {
  gap: 7px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.action-row button {
  flex: 1;
}
.invite {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11.5px;
}
.invite button {
  color: var(--gold);
}
.invite b {
  font-weight: 500;
  letter-spacing: 0.08em;
}
.inline-error,
.notice-inline {
  margin-top: 9px;
  font-size: 12px;
  color: #eed39a;
}
.panel-body .world-title {
  font-size: 34px;
  margin-bottom: 6px;
}
.group-title {
  display: block;
  margin: 13px 0 7px;
}
.choice-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.choice {
  gap: 6px;
  border: 1px solid #3d4b3e;
  border-radius: 5px;
  padding: 6px 9px;
  font-size: 12px;
  color: #c0cebf;
}
.choice svg {
  width: 14px;
  height: 14px;
}
.move-scroll {
  max-height: 252px;
  overflow: auto;
  margin-top: 14px;
  scrollbar-width: thin;
}
.move-ledger {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.move-ledger td,
.move-ledger th {
  padding: 5px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.move-ledger th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.move-ledger td:first-child {
  color: var(--faint);
  font-size: 11px;
}
.capture-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 6px 0;
  color: var(--muted);
  font-size: 11px;
}
.capture-row b {
  font:
    18px Georgia,
    serif;
  color: var(--gold);
  letter-spacing: 0.03em;
}
.loading,
.board-message {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #15211ded;
  border: 1px solid #77866d93;
  border-radius: 7px;
  color: #f1ead5;
  padding: 8px 14px;
  text-align: center;
  font-size: 12px;
  z-index: 4;
}
.loading {
  top: 47%;
  pointer-events: none;
}
.board-message {
  position: static;
  justify-self: center;
  transform: none;
  max-width: 90%;
  width: max-content;
  pointer-events: none;
}
.promotion-box {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  padding: 17px;
  min-width: 245px;
  background: #18261ff5;
  border: 1px solid #aa9167;
  border-radius: 10px;
  box-shadow: 0 12px 40px #07110d80;
  text-align: center;
}
.promotion-box h3 {
  font: 26px var(--serif);
  margin-bottom: 10px;
}
.promotion-options {
  display: flex;
  justify-content: center;
  gap: 5px;
}
.promotion-options button {
  min-width: 43px;
  padding: 3px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #25352a;
  display: grid;
  font-size: 10px;
}
.promotion-options b {
  font:
    28px Georgia,
    serif;
}
.promotion-box .subtle {
  margin: 8px auto 0;
}
.diagram-wrap {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #33473a, #1a2821);
  display: grid;
  place-items: center;
  padding: 9px;
  z-index: 2;
}
.diagram-board {
  width: min(100%, calc(var(--stage-height, 430px) - 22px));
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(8, minmax(0, 1fr));
  border: 5px solid #66513a;
  box-shadow: 0 3px 15px #1017117a;
}
.diagram-rank {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  min-height: 0;
}
.sq {
  position: relative;
  border: 0;
  border-radius: 0;
  padding: 0;
  text-align: center;
  font-family: Georgia, 'DejaVu Sans', serif;
  font-size: clamp(22px, calc(var(--stage-height, 430px) * 0.076), 45px);
  line-height: 1;
  background: #dbcdac;
  color: #202a23;
  text-shadow: 0 1px #f5edcf5e;
}
.sq.dark {
  background: #77927e;
}
.sq.lightpiece {
  color: #fcf2d6;
  text-shadow:
    -1px 0 #384339,
    0 -1px #384339,
    1px 0 #384339,
    0 1px #384339,
    0 2px 2px #26392c;
}
.sq:hover {
  box-shadow: inset 0 0 0 2px #f0ddb9;
}
.sq.sel {
  box-shadow: inset 0 0 0 4px #d3973e;
}
.sq.last:before {
  content: '';
  position: absolute;
  inset: 1px;
  border: 2px solid #a0784294;
  pointer-events: none;
}
.sq.legal:after {
  content: '';
  position: absolute;
  width: 24%;
  height: 24%;
  top: 38%;
  left: 38%;
  border-radius: 50%;
  background: #244b3c99;
  pointer-events: none;
}
.sq.legal.occupied:after {
  inset: 6%;
  width: auto;
  height: auto;
  border: 3px solid #467359b0;
  background: none;
}
.sq.incheck {
  background: #bc7965;
}
.sq .coord {
  position: absolute;
  font: 500 9px var(--sans);
  color: #294037;
  bottom: 1px;
  left: 3px;
  text-shadow: 0 0 2px #f0e9d7;
}
.viewport.flat .scene-info,
.viewport.flat .stage-vignette {
  display: none;
}
.viewport.flat .corner-controls {
  z-index: 3;
}
.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;
}
dialog {
  position: fixed;
  color: var(--ink);
  background: #1b2820;
  border: 1px solid #5b6a56;
  border-radius: 13px;
  width: min(420px, 92vw);
  padding: 28px;
  box-shadow: 0 24px 96px #0009;
}
dialog::backdrop {
  background: #0a130fb5;
  backdrop-filter: blur(4px);
}
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 29px;
  height: 29px;
}
dialog h2 {
  margin: 9px 25px 13px 0;
  font-size: 36px;
}
dialog p {
  color: #c9d2c3;
  font-size: 13px;
  margin: 9px 0;
}
dialog input, dialog textarea {
  width: 100%;
  margin: 8px 0 12px;
  border: 1px solid #546351;
  background: #121d16;
  color: var(--ink);
  border-radius: 5px;
  padding: 10px 12px;
  letter-spacing: 0.1em;
}
dialog textarea { font: inherit; letter-spacing: normal; resize: vertical; }
#create-world { margin-left: auto; }
.choice[data-action="usePanorama"] { overflow-wrap: anywhere; max-width: 100%; text-align: left; }
dialog label {
  font-size: 12px;
  color: var(--muted);
}
dialog .secondary {
  margin-top: 12px;
}
dialog dl {
  margin: 12px 0 0;
}
dialog dt {
  font-weight: 600;
  color: var(--gold);
  font-size: 12px;
  margin-top: 11px;
}
dialog dd {
  margin: 2px 0 0;
  color: #c9d2c3;
  font-size: 13px;
}
dialog code {
  font-size: 12px;
  color: var(--gold);
  overflow-wrap: anywhere;
}
@media (min-width: 1700px) {
  .viewport {
    height: 620px;
    min-height: 520px;
  }
}
@media (max-width: 1060px) {
  .play-layout {
    grid-template-columns: minmax(0, 1.95fr) minmax(270px, 1fr);
  }
  .orbit-help {
    display: none;
  }

  .stage-toolbar {
    padding-inline: 8px;
  }
  .view-switch button {
    padding-inline: 7px;
  }
  .panel-body {
    padding: 17px;
  }

}
@media (max-width: 800px) {
  .play-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(245px, 1fr);
  }
  .orbit-help {
    display: none;
  }
  .connection { display: none; }
  .scene-heading { align-items: start; flex-direction: column; gap: 8px; }
  .viewport {
    min-height: 370px;
  }
  .panel-body {
    padding: 15px;
  }
  .place-card {
    padding: 11px;
    min-height: 100px;
    height: 102px;
  }
}
@media (max-width: 680px), (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  main {
    padding: 0 0 max(18px, env(safe-area-inset-bottom));
  }
  .play-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "stage" "places" "panels";
    gap: 16px;
  }
  .stage { border-width: 0 0 1px; }
  .atlas, .sidebar {
    margin-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
  }
  .scene-heading { top: max(12px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); }
  .brand img { width: 25px; height: 25px; }
  .brand h1 { font-size: 24px; }
  .vr-btn { font-size: 12px; min-height: 40px; padding: 4px 9px; gap: 6px; }
  .vr-btn svg { width: 17px; }
  .scene-bottom { inset-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); bottom: 12px; }
  .corner-controls .round { width: 44px; height: 44px; }
  .world-caption.generated { font-size: 15px; }
  .world-caption.generated.long { font-size: 14px; }
  .view-switch button { min-height: 42px; }
  .section-heading { gap: 8px; }
  .section-heading button { min-height: 40px; }
  dialog textarea { font-size: 16px; }
  .viewport {
    min-height: 0;
    height: clamp(305px, 84vw, 445px);
    flex: auto;
  }
  .stage.expanded .viewport {
    height: auto;
    flex: 1;
  }
  .stage-toolbar {
    min-height: 43px;
    flex-wrap: wrap;
    row-gap: 3px;
    padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
  }
  .orbit-help { display: none; }
  .panel-body {
    padding: 17px 19px;
  }
  .tabs {
    padding-top: 4px;
  }
  .tabs button {
    padding: 7px 1px 9px;
  }
  .form-group {
    margin-top: 12px;
  }
  .seat-options {
    margin: 5px 0 8px;
  }
  .preference {
    margin-top: 11px;
    padding-top: 9px;
  }
  .panel-foot {
    min-height: 35px;
  }

  .section-heading h2 {
    font-size: 28px;
  }
  .places {
    gap: 6px;
  }
  .place-card {
    height: 90px;
    min-height: 90px;
    padding: 7px;
  }
  .place-card strong {
    font-size: 18px;
  }
  .place-card .place-kind {
    font-size: 7px;
    letter-spacing: 0.07em;
  }
  .place-status {
    height: 15px;
    width: 15px;
    top: 6px;
    right: 6px;
  }
  .place-status svg {
    width: 10px;
    height: 10px;
  }
  .stage { border-radius: 0 0 10px 10px; }
  .sidebar { border-radius: 9px; }
  .board-message {
    font-size: 11px;
    padding: 6px 9px;
    bottom: 6px;
  }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  .viewport {
    height: clamp(210px, calc(100vh - 52px), 435px);
    height: clamp(210px, calc(100svh - 52px), 435px);
  }
  .scene-heading { flex-direction: row; align-items: center; }
}
@media (max-width: 410px) {
  #conditions-link { width: 40px; justify-content: center; }
  #conditions-link .settings-label { display: none; }
  .section-heading h2 { font-size: 25px; }
  .stage-toolbar { padding: 3px 7px; gap: 4px; }
  .view-switch { gap: 0; }
  .view-switch button { padding-inline: 6px; gap: 4px; }
}
@media (max-width: 350px) {
  .view-switch button { padding-inline: 4px; gap: 3px; }
  .vr-btn { padding-inline: 7px; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.credits-link {
  color: var(--gold);
  font-size: 12px;
  text-underline-offset: 3px;
}

/* Focus view keeps game-critical prompts and one route back to the controls. */
.restore-label { display: none; }
.stage.expanded { inset: 0; border: 0; border-radius: 0; }
.stage.expanded .viewport { min-height: 0; height: 100%; flex: 1; }
.stage.expanded :is(.scene-info, .stage-vignette, .stage-toolbar, #sound-button) { display: none; }
.stage.expanded #expand-button {
  display: inline-flex; width: auto; min-height: 44px; min-width: 44px; padding: 0 13px; gap: 8px;
  justify-content: center; transition: opacity .36s, background .18s;
  align-items: center; color: #fff4da; background: #14231bd9; border-radius: 24px;
}
.stage.expanded .restore-label { display: inline; font: 500 12px var(--sans); }
body.table-focus { overflow: hidden; }

.stage.expanded.restore-idle #expand-button:not(:focus-visible) {
  opacity: .42; width: 44px; padding: 0; gap: 0;
}
.stage.expanded.restore-idle #expand-button:not(:focus-visible) .restore-label { display: none; }
.prompt-examples { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.prompt-examples button {
  border: 1px solid var(--line); border-radius: 18px;
  padding: 6px 10px; color: var(--muted); font: 500 12px/1.35 var(--sans);
}
.prompt-examples button:is(:hover, [aria-pressed="true"]) {
  color: var(--gold); border-color: #a68b62; background: #2b3024;
}
@media (pointer: coarse) {
  .prompt-examples button { min-height: 36px; }
}

.game-picker { display:flex; gap:5px; align-items:center; padding:3px 12px; border-top:1px solid var(--line); }
.game-picker a { display:grid; place-items:center; min-width:64px; min-height:40px; padding:2px 10px; border-bottom:2px solid transparent; color:var(--muted); text-decoration:none; font:500 13px var(--sans); }
.game-picker a[aria-current="page"] { color:var(--gold); border-color:var(--gold); }
.game-picker a:focus-visible,.set-grid button:focus-visible { outline:2px solid var(--gold); outline-offset:-2px; }
.stage.expanded .game-picker { display:none; }
.set-scores { display:flex; gap:15px; flex-wrap:wrap; margin:8px 0; font-size:13px; color:var(--muted); }
.set-scores b { color:var(--ink); }
.set-grid { display:grid; grid-template-columns:repeat(var(--cols),minmax(0,1fr)); grid-template-rows:repeat(3,minmax(0,1fr)); gap:5px; height:100%; width:min(100%,calc(var(--stage-height,440px)*1.47)); align-items:center; }
.set-grid button { display:grid; place-items:center; height:100%; min-width:0; min-height:0; padding:2px; border:2px solid transparent; border-radius:6px; }
.set-grid button[aria-pressed="true"] { border-color:#e8b968; background:#644927; }
.set-grid canvas { position:static; inset:auto; width:100%; height:100%; object-fit:contain; pointer-events:none; }
body[data-game="set"] .diagram-wrap { padding:46px 8px 6px; }
body[data-game="set"] .viewport.flat .scene-bottom {
  inset: 8px 108px auto 10px;
}
body[data-game="set"] .viewport.flat .board-message {
  justify-self: start;
  max-width: 100%;
  padding: 5px 9px;
  text-align: left;
}
.checker-token { display:inline-grid; place-items:center; width:73%; aspect-ratio:1; border-radius:50%; vertical-align:middle; border:2px solid #501f21; background:#a63c36; box-shadow:inset 0 0 0 2px #d88b72,0 2px 1px #25231c; color:#ffe3a3; font:600 .55em var(--sans); }
.checker-token.ivory { border-color:#8d7752; background:#ead7ad; color:#60491d; box-shadow:inset 0 0 0 2px #fff2ce,0 2px 1px #25231c; }
body[data-game="checkers"] .stone.w { background:#ac4740; } body[data-game="checkers"] .stone.b { background:#ead7ad; }
