@font-face {
  font-family: Bricolage;
  src: url('/fonts/display.woff2') format('woff2');
  font-weight: 600 800;
  font-display: swap;
}
@font-face {
  font-family: DM Sans;
  src: url('/fonts/body.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: Plex Mono;
  src: url('/fonts/mono.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --background: #0a0a0a;
  --text: #f3f1ed;
  --muted: #b9b7b2;
  --line: #303030;
  --copper: #f7bd99;
  --ice: #bce4f2;
  --selection: #fff2dc;
  --display: Bricolage, "DM Sans", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
  --mono: "Plex Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-height: 100dvh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--body);
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.site-header { border-bottom: 1px solid #ffffff12; }
.header-inner, .shell { width: min(1232px, 100%); margin-inline: auto; padding-inline: 29px; }
.header-inner { height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wordmark { color: var(--text); text-decoration: none; white-space: nowrap; font: 800 21px/1 var(--display); letter-spacing: -.045em; }
.wordmark span { color: #b9b6b0; font-weight: 600; }
nav { display: flex; align-items: center; gap: 21px; white-space: nowrap; }
.quiet { padding: 7px 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.quiet:hover:not(:disabled) { color: var(--text); }
.quiet:disabled { opacity: .6; }
.pill, .subtle-button { padding: 8px 14px; border: 1px solid #494846; border-radius: 999px; background: #202020; color: var(--text); font-size: 13px; font-weight: 700; }
.pill:hover:not(:disabled), .subtle-button:hover { background: #2d2b29; }
.pill:disabled { opacity: .6; }
.intro { display: grid; justify-items: center; gap: 9px; padding: 26px 0 23px; text-align: center; }
.intro h1 { margin: 0; font: 800 clamp(52px, 7.2vw, 95px)/.94 var(--display); letter-spacing: -.071em; }
.intro em { color: #fff1e6; font-style: normal; }
.intro p { margin: 0; color: var(--muted); font-size: 15px; letter-spacing: -.015em; }
.arena {
  position: relative;
  isolation: isolate;
  border: 1px solid #3b3936;
  border-radius: 23px;
  background: #121212;
  box-shadow: 0 16px 58px #0009, inset 0 1px 0 #ffffff0d;
}
.arena::before {
  position: absolute;
  z-index: -1;
  inset: 4px;
  border-radius: 32px;
  background:
    radial-gradient(ellipse at 0 34%, #ba765b7b, transparent 46%),
    radial-gradient(ellipse at 100% 58%, #6d9db179, transparent 45%);
  filter: blur(38px);
  opacity: .68;
  pointer-events: none;
  content: "";
}
.map-panel { padding: 0 17px 8px; border-radius: 22px 22px 0 0; background: #161616; }
.map-header {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 13px;
  min-height: 54px;
  padding: 6px 0;
}
.map-header h2 { margin: 0; font: 700 16px/1.12 var(--display); letter-spacing: -.025em; }
.play-mode { justify-self: start; margin: 0; padding: 5px 8px; border: 1px solid #45413e; border-radius: 5px; color: #e2c6b5; font: 500 9px/1.2 var(--mono); white-space: nowrap; }
.rounds-display { justify-self: end; display: flex; gap: 12px; align-items: center; }
.round-text { display: flex; gap: 5px; white-space: nowrap; font: 500 10px var(--mono); text-transform: uppercase; }
#round-limit { color: var(--muted); }
.rounds { width: 104px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.rounds span { height: 3px; border-radius: 3px; background: #494746; }
.rounds .done { background: #887d73; }
.rounds .current { background: var(--copper); }
.reset { margin-left: 3px; padding: 5px 0 5px 12px; border-left: 1px solid #43403d; font-size: 12px; }
.map-layout { display: grid; grid-template-columns: 19px 1fr; grid-template-rows: 17px 1fr; }
.columns, .rows { display: grid; color: #c2beb8; font: 500 10px var(--mono); text-align: center; }
.columns { grid-column: 2; grid-template-columns: repeat(7, 1fr); }
.rows { grid-row: 2; grid-template-rows: repeat(7, 1fr); align-items: center; justify-items: start; padding-left: 1px; }
.map-frame {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #64605a;
  border-radius: 13px;
  background: linear-gradient(115deg, #382c27, #101519 52%, #253641);
}
.landscape, #trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.landscape { object-fit: cover; object-position: center; filter: brightness(.82) saturate(.88); }
.map-frame::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #8b4d342b, transparent 42%, #588aa422), radial-gradient(ellipse, transparent 30%, #06070855 100%);
  pointer-events: none;
  content: "";
}
#trail { z-index: 3; }
.board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(7, minmax(0, 1fr));
  height: clamp(254px, calc(100svh - 426px), 427px);
}
.tile {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 0;
  border: 0 solid #f3efeb48;
  border-right-width: 1px;
  border-bottom-width: 1px;
  border-radius: 0;
  background: transparent;
  color: var(--text);
}
.tile:nth-child(7n) { border-right-width: 0; }
.tile:nth-child(n+43) { border-bottom-width: 0; }
.tile[data-range="true"] { background: #fff3d324; box-shadow: inset 0 0 0 1px #fff1d127; }
.tile:hover:not(:disabled) { background: #fff1d344; }
.tile[data-mark="near"] { background: #ffc39738; }
.tile[data-mark="far"] { background: #b9e7ff38; }
.tile[data-pending="true"] { animation: checking-tile .85s ease-in-out alternate infinite; }
.tile[data-route="true"] { background: #fff4d025; }
.tile[data-ghost="true"] { background: #ffe4b95e; box-shadow: inset 0 0 0 1px #fff1d5bd; }
.tile[data-candidate="true"]:not([aria-pressed="true"]) { background: #fff4d43d; box-shadow: inset 0 0 0 1px #fff1d3a0; }
.tile[aria-pressed="true"] { z-index: 2; outline: 2px solid var(--selection); outline-offset: -2px; background: #fff2cf57; }
.tile:focus-visible { z-index: 4; outline: 2px dashed white; outline-offset: -5px; }
.mark { position: relative; padding: 4px 5px; border-radius: 4px; pointer-events: none; color: var(--selection); font: 500 10px/1 var(--mono); }
.mark:not(:empty) { background: #101010ed; }
.tile[data-mark="near"] .mark { color: var(--copper); }
.tile[data-mark="far"] .mark { color: var(--ice); }
.tile[aria-pressed="true"] .mark, .tile[data-ghost="true"] .mark { color: var(--selection); }
@keyframes checking-tile { to { background: #ffeacf81; } }
.map-foot { display: flex; justify-content: space-between; gap: 12px; min-height: 29px; align-items: center; padding-left: 19px; color: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 15px; }
.legend span { padding-bottom: 1px; border-bottom: 2px solid #d7cbb7; white-space: nowrap; }
.legend .legend-near { border-color: var(--copper); }
.legend .legend-far { border-color: var(--ice); }
.board-help { text-align: right; }
.console { border-radius: 0 0 22px 22px; background: #141414; }
.action-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px 18px;
  padding: 14px 17px 14px 36px;
  border-top: 1px solid var(--line);
}
.action-instructions h3 { margin: 0; font: 750 28px/.99 var(--display); letter-spacing: -.043em; }
.action-instructions p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.command-buttons { display: flex; align-items: center; gap: 12px; }
.action {
  position: relative;
  display: flex;
  min-width: 210px;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
  padding: 8px 10px 8px 15px;
  border: 1px solid white;
  border-radius: 999px;
  background: #faf8f4;
  color: #161515;
  text-align: left;
  font-weight: 800;
  font-size: 14px;
  transition: background .15s ease, transform .15s ease;
}
.action:hover:not(:disabled) { background: #ffe9d6; transform: translateY(-1px); }
.action:active:not(:disabled) { transform: translateY(1px); }
.action:disabled { border-color: #575452; background: #272727; color: #e1ddd5; }
.action[aria-busy="true"]::after {
  position: absolute;
  bottom: 1px;
  left: 7%;
  width: 33%;
  height: 2px;
  border-radius: 4px;
  background: var(--copper);
  content: "";
  animation: loading-sweep 1.15s ease-in-out infinite alternate;
}
@keyframes loading-sweep { to { transform: translateX(158%); } }
.action-coordinate { min-width: 34px; padding: 5px 6px; border: 1px solid #0003; border-radius: 6px; background: #0000000b; text-align: center; font: 500 11px var(--mono); }
.action:disabled .action-coordinate { border-color: #78736f; }
.invite { white-space: nowrap; }
.error { grid-column: 1 / -1; margin: 0; color: var(--copper); font-size: 13px; }
.signals {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 9px 17px 11px 36px;
  border-top: 1px solid var(--line);
}
.signal-heading { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.signal-heading h3 { margin: 0; font-size: 12px; }
.signal-heading span { color: var(--muted); font: 500 10px var(--mono); }
.signal-log {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.empty { grid-column: 1 / -1; }
.empty { margin: 0; padding-block: 3px; color: var(--muted); font-size: 12px; }
.signal-row {
  display: flex;
  gap: 7px;
  align-items: center;
  white-space: nowrap;
  padding: 6px 7px;
  border: 1px solid #363432;
  border-radius: 5px;
  background: #212121;
  color: #e0dbd2;
  font: 500 10px var(--mono);
}
.signal-row span:first-child { color: var(--muted); }
.signal-row .near { color: var(--copper); }
.signal-row .far { color: var(--ice); }
.signal-row span:last-child { margin-left: auto; }
.latest-result { justify-self: end; display: flex; gap: 6px; align-items: center; padding: 5px 8px; border: 1px solid #393532; border-radius: 5px; font: 500 10px var(--mono); }
.latest-result[data-mark="near"] { border-color: #684d40; background: #30231e; color: var(--copper); }
.latest-result[data-mark="far"] { border-color: #3e5862; background: #1b2a31; color: var(--ice); }
.latest-result strong { font-size: 11px; }
.footer { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 5px 2px 15px; color: var(--muted); font-size: 11px; }
.footer .quiet { font-size: 11px; }
dialog { width: min(470px, calc(100% - 26px)); padding: 21px; border: 1px solid #514943; border-radius: 17px; background: #1c1b1a; color: var(--text); box-shadow: 0 18px 70px #000b; }
dialog::backdrop { background: #090a0ac4; backdrop-filter: blur(5px); }
.dialog-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.dialog-head h2 { margin: 0; font: 750 31px var(--display); letter-spacing: -.04em; }
dialog p, dialog li { color: #d1ccc4; font-size: 14px; line-height: 1.55; }
dialog li { margin: 8px 0; padding-left: 4px; }
dialog p:last-child { margin-bottom: 0; }
dialog strong { color: var(--text); }

@media (max-width: 850px) {
  .header-inner, .shell { padding-inline: 19px; }
}
@media (max-width: 700px) {
  .header-inner, .shell { padding-inline: 12px; }
  .header-inner { height: 52px; }
  .wordmark { font-size: 18px; }
  nav { gap: 11px; }
  nav .quiet, .pill { font-size: 11px; }
  .pill { padding: 7px 10px; }
  .intro { padding: 23px 0 17px; gap: 7px; }
  .intro h1 { font-size: clamp(41px, 12vw, 70px); }
  .intro p { font-size: 13px; }
  .arena { border-radius: 15px; }
  .arena::before { filter: blur(20px); }
  .map-panel { padding: 0 7px 5px; border-radius: 14px 14px 0 0; }
  .map-header { padding: 8px 2px; min-height: 53px; grid-template-columns: auto 1fr auto; gap: 5px 8px; }
  .map-header h2 { font-size: 14px; white-space: nowrap; }
  .play-mode { justify-self: end; font-size: 8px; padding: 4px 5px; }
  .rounds-display { grid-row: 2; grid-column: 1 / -1; justify-self: start; gap: 7px; }
  .rounds { width: 77px; }
  .round-text { font-size: 9px; }
  .reset { font-size: 10px; padding-left: 7px; white-space: nowrap; }
  .map-layout { grid-template-columns: 15px 1fr; grid-template-rows: 14px 1fr; }
  .columns, .rows { font-size: 8px; }
  .map-frame { border-radius: 8px; }
  .board { height: auto; min-height: 200px; aspect-ratio: 1.21; }
  .mark { font-size: 8px; padding: 3px; }
  .map-foot { min-height: 24px; padding-left: 15px; font-size: 10px; }
  .board-help { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .console { border-radius: 0 0 14px 14px; }
  .action-section { grid-template-columns: 1fr; gap: 8px; padding: 10px 12px; }
  .action-instructions h3 { font-size: 23px; }
  .action-instructions p { font-size: 12px; }
  .command-buttons { flex-wrap: wrap; }
  .action { flex: 1; min-height: 42px; }
  .signals { padding: 8px 12px; gap: 7px 9px; }
  .signal-heading h3 { font-size: 11px; }
  .signal-heading span, .signal-row, .latest-result { font-size: 9px; }
  .signal-log { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .latest-result { grid-column: 1 / -1; justify-self: start; }

}
@media (max-width: 700px) and (max-height: 700px) {
  .intro { padding-block: 13px 10px; }
  .board { height: clamp(175px, calc(100svh - 373px), 260px); min-height: 0; aspect-ratio: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
