@font-face {
  font-family: TessabiSerif;
  src: local("Georgia");
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  font-family: Arial, Helvetica, sans-serif;
  color: #f6ecd9;
  background: #211a13;
  background-image:
    radial-gradient(ellipse at 28% 5%, #5b493329, transparent 65%),
    radial-gradient(ellipse at 90% 80%, #02020170, transparent 70%);
  font-size: 15px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
  border: 1px solid #bea36b4a;
  background: #33291f;
  border-radius: 5px;
  min-height: 44px;
  padding: 10px 16px;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s;
}
button:hover {
  background: #443526;
  border-color: #cba76b;
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #f6d690;
  outline-offset: 3px;
}
button.primary {
  background: linear-gradient(135deg, #edcd8c, #c59b59);
  color: #21180e;
  border-color: #f5d8a0;
  box-shadow:
    0 3px 0 #876132,
    0 10px 28px #0004;
  font-weight: 700;
}
button.primary:hover {
  background: linear-gradient(135deg, #ffe1a5, #d8ad66);
}
button.quiet {
  background: transparent;
  border-color: transparent;
  color: #d8c7ac;
}
button.danger {
  color: #f3b7a1;
  border-color: #c06b5059;
}
a {
  color: #e8c286;
  text-underline-offset: 4px;
}
input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #9e825052;
  background: #211a14;
  color: #f6ecd9;
  border-radius: 4px;
  padding: 10px 12px;
}
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  accent-color: #d9b36e;
}
input[type="range"] {
  padding: 0;
  accent-color: #d9b36e;
}
textarea {
  resize: vertical;
  min-height: 100px;
}
label {
  display: block;
  color: #d9cbb6;
  font-size: 13px;
  margin: 14px 0 6px;
  line-height: 1.5;
}
label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-family: Georgia, serif;
  font-weight: 400;
}
h2 {
  font-size: 30px;
  margin: 6px 0 0;
  color: #f2dfba;
}
h3 {
  font-size: 22px;
  color: #ead4ad;
  margin: 20px 0 8px;
}
p {
  line-height: 1.65;
  color: #cabba5;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #c4a575;
}
.subtle {
  font-size: 12px;
  color: #ae9c84;
  line-height: 1.6;
}
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #d2b48155, transparent);
  margin: 20px 0;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.row > * {
  flex: 1;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pill {
  font-size: 11px;
  color: #c8b48d;
  padding: 4px 8px;
  border: 1px solid #c9ac6c3a;
  border-radius: 30px;
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
#app {
  height: 100dvh;
  width: 100%;
  padding: max(8px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  height: 44px;
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  z-index: 2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: none;
  background: none !important;
  font-family: Georgia, serif;
  font-size: 21px;
  letter-spacing: 0.13em;
  color: #e1bd7c;
}
.brand img {
  width: 61px;
  height: 36px;
  object-fit: contain;
  mix-blend-mode: screen;
}
.brand span {
  padding-top: 1px;
}
#mode-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: #bca789;
  text-align: center;
}
.top-actions {
  display: flex;
  gap: 2px;
}
.icon-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 23px;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b69c6c;
  box-shadow: 0 0 0 4px #c4a67512;
}
.online .status-dot {
  background: #9eac8a;
}
.offline .status-dot {
  background: #c17a5c;
}
.top-actions button:hover {
  background: #ffffff08;
}
#main {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.home {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
  max-width: 1400px;
  margin: auto;
  align-items: center;
  padding: 32px 5%;
  gap: 6%;
}
.home-intro {
  max-width: 420px;
  width: 100%;
  margin: auto;
}
.hero-symbol {
  width: 220px;
  height: 110px;
  object-fit: contain;
  margin-left: -10px;
  margin-bottom: 16px;
}
.home h1 {
  font-size: clamp(46px, 6.5vw, 88px);
  letter-spacing: 0.085em;
  color: #ebc785;
  line-height: 0.95;
  margin: 0 0 18px;
  text-shadow: 0 3px 20px #0005;
}
.home .tagline {
  font-family: Georgia, serif;
  font-size: 21px;
  color: #dac7a7;
  margin-bottom: 30px;
}
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.menu-buttons button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  min-height: 55px;
  font-size: 16px;
  padding: 14px 20px;
  background: #2e251ca8;
}
.menu-buttons button.primary {
  background: linear-gradient(120deg, #ebc987, #bc914f);
  min-height: 62px;
}
.menu-buttons small {
  font-size: 11px;
  color: #b5a184;
}
.menu-buttons .primary small {
  color: #5d4221;
}
.menu-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 18px;
}
.menu-links button {
  font-size: 12px;
  padding: 10px 12px;
}
.home-note {
  font-size: 11px;
  color: #8f806b;
  text-align: center;
  margin-top: 22px;
}
.hero-board {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  height: 95%;
  max-height: 950px;
  perspective: 1200px;
}
.hero-board img {
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 26px 38px #0007);
  border-radius: 8px;
}
.home-account {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  color: #ae9b7d;
  font-size: 12px;
}
.home-account button {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
  border: 0;
}
.play {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail, 276px);
  gap: 12px;
  padding-top: 8px;
}
.board-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  position: relative;
}
.board-svg {
  display: block;
  width: var(--bw);
  height: var(--bh);
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
  filter: drop-shadow(0 8px 12px #0007);
  user-select: none;
  touch-action: manipulation;
}
.board-svg .point {
  cursor: pointer;
  outline: none;
}
.board-svg .hit:focus-visible {
  stroke: #2b614e;
  stroke-width: 6;
  fill: #d5edd333;
}
.board-svg .hit {
  fill: transparent;
}
.board-svg .selected {
  stroke: #fff4be;
  stroke-width: 5;
  filter: drop-shadow(0 0 6px #ffd47099);
}
.board-svg .target {
  fill: #355c49;
  stroke: #fbedd4;
  stroke-width: 2;
}
.board-svg .target-ring {
  fill: none;
  stroke: #36654f;
  stroke-width: 3;
}
.board-svg .last {
  fill: #a1662e22;
  stroke: #9d6a3155;
  stroke-width: 2;
}
.board-svg text {
  pointer-events: none;
}
.board-svg .runner {
  pointer-events: none;
}
.piece-motion {
  animation: piece-settle 0.17s ease-out both;
}
@keyframes piece-settle {
  from {
    transform: translate(var(--dx), var(--dy));
  }
  to {
    transform: translate(0, 0);
  }
}
.rail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 0 12px;
}
.player-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 56px;
  min-height: 48px;
  border: 1px solid #b4935a25;
  border-radius: 4px;
  padding: 6px 10px;
  background: #110e0a33;
}
.player-strip.turn {
  border-color: #c6a1638c;
  background: #b68b3c0c;
  box-shadow: inset 3px 0 #c9a76a;
}
.side-face {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.player-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: #dfcfb6;
}
.player-score {
  font:
    20px Georgia,
    serif;
  color: #e2bd7c;
  white-space: nowrap;
}
.player-clock {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  min-width: 57px;
  text-align: right;
  color: #f4e8d6;
}
.player-clock.untimed {
  font-size: 11px;
  color: #8f806a;
}
.player-clock.low {
  color: #f2a78e;
}
.turn-line {
  min-height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 5px;
  font:
    19px Georgia,
    serif;
  color: #f1dfc1;
}
.turn-line small {
  font:
    11px Arial,
    sans-serif;
  color: #a99a82;
  margin-top: 6px;
}
.play-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.play-actions button {
  padding: 9px 5px;
  font-size: 12px;
  min-height: 44px;
}
.rail-moves {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-top: 16px;
  border-top: 1px solid #c5a4672a;
  padding-top: 16px;
}
.rail-moves .eyebrow {
  margin-bottom: 12px;
}
.move-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.move-list button {
  min-height: 31px;
  padding: 7px 8px;
  text-align: left;
  background: transparent;
  border-color: transparent;
  font-size: 12px;
  color: #bda987;
}
.move-list button.current {
  background: #cfa45917;
  color: #efcf99;
}
.move-list button span {
  color: #746652;
  font-size: 10px;
  margin-right: 9px;
}
.status-banner {
  padding: 12px;
  background: #7651222e;
  border: 1px solid #bfa16b50;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.6;
}
.status-banner .row {
  margin-top: 10px;
}
.status-banner strong {
  font-weight: 500;
  color: #f0d5a1;
}
.preview-text {
  padding: 12px;
  color: #d7c4a4;
  line-height: 1.65;
  font-size: 12px;
  border: 1px solid #bfa16b30;
  border-radius: 4px;
}
.score-result {
  text-align: center;
  padding: 20px 10px;
}
.score-result h2 {
  font-size: 34px;
}
.score-result .scores {
  font:
    48px Georgia,
    serif;
  color: #e4bb75;
  margin: 20px;
}
.stacked.play {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 44px minmax(0, 1fr) 44px 44px 44px;
  gap: 4px;
  padding-top: 4px;
}
.stacked .board-stage {
  grid-row: 2;
}
.stacked .rail {
  display: contents;
}
.stacked .player-strip {
  height: 44px;
  min-height: 44px;
  max-width: 540px;
  width: 100%;
  margin: auto;
  padding: 4px 8px;
}
.stacked .opponent {
  grid-row: 1;
}
.stacked .self {
  grid-row: 3;
}
.stacked .turn-line {
  grid-row: 4;
  min-height: 44px;
  font-size: 17px;
}
.stacked .turn-line small {
  margin-top: 3px;
}
.stacked .play-actions {
  grid-row: 5;
  max-width: 540px;
  width: 100%;
  margin: auto;
}
.stacked .rail-moves {
  display: none;
}
.stacked .status-banner,
.stacked .preview-text {
  position: absolute;
  bottom: 98px;
  left: 12px;
  right: 12px;
  background: #241c15f5;
  z-index: 3;
}
.stacked .player-name {
  font-size: 12px;
}
.stacked .player-clock {
  font-size: 19px;
}
.stacked .side-face {
  width: 28px;
  height: 28px;
}
.stacked .player-score {
  font-size: 21px;
}
dialog {
  background: linear-gradient(135deg, #362a1f, #241d17);
  color: #f2e3ca;
  border: 1px solid #b596606b;
  border-radius: 9px;
  box-shadow: 0 24px 100px #000b;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog::backdrop {
  background: #080604bb;
  backdrop-filter: blur(7px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 18px;
  border-bottom: 1px solid #c1a06c25;
  flex-shrink: 0;
}
#dialog-content {
  padding: 22px 24px 28px;
  overflow-y: auto;
  min-height: 0;
}
#dialog-live {
  font-size: 12px;
  text-align: center;
  color: #e1bf82;
  background: #0002;
  padding: 0 15px;
}
#dialog-live:not(:empty) {
  padding: 9px 15px;
}
dialog .icon-button {
  font-size: 29px;
  color: #c7af8b;
}
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.menu-grid button {
  text-align: left;
  padding: 16px 13px;
  background: transparent;
}
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #b79a6829;
  padding: 12px 0;
}
.list-row button {
  min-height: 34px;
  font-size: 12px;
  padding: 7px 10px;
}
.list-row p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.list-row small {
  font-size: 11px;
  color: #a49175;
}
.rule-list {
  padding-left: 20px;
  color: #cdbda4;
  font-size: 14px;
  line-height: 1.8;
}
.rule-list li {
  padding-bottom: 10px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table td,
.table th {
  border-bottom: 1px solid #b79a6830;
  padding: 12px 6px;
  text-align: left;
}
.table th {
  color: #ab9575;
  font-size: 11px;
  font-weight: 400;
}
.exercise-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.exercise-grid button {
  text-align: left;
  font-size: 12px;
  line-height: 1.6;
  padding: 13px;
}
.exercise-grid span {
  display: block;
  color: #b28c54;
  font-size: 10px;
  letter-spacing: 0.1em;
}
#toast {
  position: fixed;
  z-index: 100;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: #463526;
  border: 1px solid #d0a96c77;
  color: #f8e4bd;
  padding: 14px 20px;
  box-shadow: 0 8px 30px #0008;
  border-radius: 6px;
  max-width: min(560px, calc(100vw - 32px));
  font-size: 13px;
  line-height: 1.6;
  width: max-content;
}
.accessible-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.accessible-input select {
  min-width: 0;
}
.mini-board {
  width: 200px;
  max-height: 200px;
  margin: auto;
}
.coordinate-label {
  font-family: Georgia, serif;
  font-size: 28px;
  fill: #735034;
}
.board-caption {
  font:
    bold 26px Arial,
    sans-serif;
  letter-spacing: 3px;
  fill: #765437;
}
.legal-copy {
  font-size: 13px;
  line-height: 1.75;
}
.legal-copy h3 {
  font-size: 21px;
}
.result-tag {
  color: #e9c584;
  font-family: Georgia, serif;
  font-size: 19px;
}
.replay-controls {
  display: flex;
  gap: 5px;
  justify-content: center;
}
.replay-controls button {
  flex: 1;
  padding: 8px 5px;
}
.note-error {
  color: #efb29b;
  font-size: 13px;
  line-height: 1.6;
}
.loading {
  text-align: center;
  padding: 30px;
  color: #bba17b;
}
.spinner {
  width: 24px;
  height: 24px;
  margin: 0 auto 14px;
  border: 2px solid #c6a36528;
  border-top-color: #dcc090;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.reduced * {
  animation: none !important;
  transition: none !important;
}
.contrast {
  color: #fff6e6;
}
.contrast button {
  border-color: #d2b780;
}
.contrast .subtle,
.contrast p {
  color: #e3d2b5;
}
@media (max-width: 767px) {
  #app {
    padding-left: 8px;
    padding-right: 8px;
  }
  .brand span {
    font-size: 17px;
  }
  .brand img {
    width: 43px;
    height: 29px;
  }
  .topbar {
    gap: 6px;
  }
  #mode-label {
    font-size: 9px;
    letter-spacing: 0.08em;
  }
  .home {
    display: flex;
    padding: 12px 20px;
    justify-content: center;
  }
  .home-intro {
    max-width: 360px;
    z-index: 1;
  }
  .hero-board {
    display: none;
  }
  .hero-symbol {
    width: 130px;
    height: 65px;
    display: block;
    margin: 0 auto 12px;
  }
  .home h1 {
    text-align: center;
    font-size: 51px;
  }
  .home .tagline {
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
  }
  .menu-buttons button {
    min-height: 48px;
    font-size: 14px;
    padding: 12px 17px;
  }
  .menu-buttons button.primary {
    min-height: 52px;
  }
  .home-note {
    margin-top: 12px;
  }
  .home-account {
    margin-top: 12px;
  }
  .menu-links {
    margin-top: 10px;
  }
  .dialog-head {
    padding: 19px 19px 15px;
  }
  #dialog-content {
    padding: 18px 19px 22px;
  }
  .home .eyebrow {
    text-align: center;
  }
}
@media (max-height: 640px) and (max-width: 767px) {
  .hero-symbol {
    display: none;
  }
  .home h1 {
    font-size: 42px;
  }
  .home .tagline {
    margin-bottom: 14px;
    font-size: 16px;
  }
  .home-account,
  .home-note {
    margin-top: 5px;
  }
  .menu-links {
    margin-top: 5px;
  }
  .menu-buttons {
    gap: 6px;
  }
  .menu-buttons button {
    min-height: 44px;
  }
  .home {
    padding: 8px 20px;
  }
  .home-intro > .eyebrow {
    display: none;
  }
}
@media (max-height: 450px) and (min-width: 480px) {
  .home {
    grid-template-columns: 1fr 1fr;
    padding: 10px 30px;
    gap: 25px;
  }
  .home-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 800px;
    gap: 8px 24px;
  }
  .home h1 {
    font-size: 43px;
  }
  .home .tagline {
    font-size: 16px;
    margin-bottom: 10px;
  }
  .hero-symbol,
  .hero-board,
  .home-note {
    display: none;
  }
  .menu-buttons {
    grid-column: 2;
    grid-row: 1/6;
  }
  .home-account,
  .menu-links {
    margin: 0;
  }
  .home h1,
  .home .tagline {
    grid-column: 1;
  }
  .menu-buttons button {
    min-height: 44px;
    padding: 8px 14px;
  }
  .home .eyebrow {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  body {
    overflow: visible;
    background: white;
    color: black;
  }
  #app {
    display: none;
  }
  dialog {
    position: static;
    display: block;
    width: 100%;
    max-height: none;
    background: white;
    color: black;
    border: 0;
  }
  #dialog-content {
    overflow: visible;
  }
  dialog::backdrop {
    display: none;
  }
  .dialog-head button {
    display: none;
  }
  p,
  li {
    color: black !important;
  }
}
