:root {
  color-scheme: light;
  font-family:
    "Inter", "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  color: #20231f;
  background-color: #f3efe6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  --ink: #202720;
  --muted: #706f66;
  --paper: #f7f3ea;
  --paper-deep: #efe8db;
  --surface: rgba(255, 255, 255, 0.56);
  --surface-strong: rgba(255, 255, 255, 0.78);
  --line: rgba(44, 48, 40, 0.13);
  --line-strong: rgba(44, 48, 40, 0.22);
  --accent: #246b57;
  --accent-strong: #174f41;
  --accent-soft: rgba(36, 107, 87, 0.12);
  --ochre: #9a5b2a;
  --danger: #9b3e34;
  --serif:
    "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", Georgia,
    serif;
  --mono:
    "SFMono-Regular", "Cascadia Code", "Roboto Mono", "Noto Sans Mono CJK SC",
    monospace;
  --shadow-sm: 0 2px 10px rgba(48, 45, 36, 0.04);
  --shadow-md: 0 18px 48px rgba(48, 45, 36, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background-color: #f3efe6;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: #f3efe6;
  background-image:
    linear-gradient(rgba(32, 39, 32, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 39, 32, 0.028) 1px, transparent 1px),
    radial-gradient(
      circle at 10% -8%,
      rgba(36, 107, 87, 0.15),
      transparent 34rem
    ),
    radial-gradient(
      circle at 94% 2%,
      rgba(154, 91, 42, 0.1),
      transparent 28rem
    );
  background-size:
    44px 44px,
    44px 44px,
    auto,
    auto;
}

#root {
  min-height: 100vh;
}

h1,
h2,
h3,
p,
ul,
dl,
dd,
dt {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

code {
  font-family: var(--mono);
}

::selection {
  color: var(--paper);
  background: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.app-shell {
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 48px;
}

.app-shell > main {
  flex: 1;
}

/* -------------------------------------------------------------------------- */
/* Shared type and controls                                                    */
/* -------------------------------------------------------------------------- */

.eyebrow {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.3;
  white-space: nowrap;
}

.tag--solid {
  color: var(--paper);
  border-color: var(--ink);
  background: var(--ink);
}

.tag--warning {
  color: #7d4b23;
  border-color: rgba(154, 91, 42, 0.25);
  background: rgba(250, 238, 219, 0.78);
}

.tag--danger {
  color: #7b2e27;
  border-color: rgba(155, 62, 52, 0.3);
  background: rgba(253, 235, 231, 0.9);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  text-align: center;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button--primary {
  color: #fbf8f0;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(36, 107, 87, 0.16);
}

.button--primary:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.button--ghost {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.42);
}

.button--ghost:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--surface-strong);
}

.button--quiet {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.28);
}

.button--quiet:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.62);
}

.button:disabled {
  opacity: 0.42;
  transform: none;
  box-shadow: none;
}

.button--wide {
  grid-column: 1 / -1;
}

/* -------------------------------------------------------------------------- */
/* Home                                                                        */
/* -------------------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 96px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand__seal {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
}

.brand__name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

.brand__latin {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.15em;
}

.site-header__note,
.game-topbar__path {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.72fr);
  gap: clamp(36px, 6vw, 86px);
  align-items: end;
  padding: 72px 0 64px;
}

.hero__copy h1 {
  max-width: 780px;
  margin: 20px 0 26px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(3.2rem, 7vw, 5.7rem);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 1.02;
}

.hero__lead {
  max-width: 620px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.manifesto {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.manifesto__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.manifesto__number {
  margin-top: 28px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(5rem, 9vw, 7rem);
  font-weight: 500;
  letter-spacing: -0.1em;
  line-height: 0.75;
}

.manifesto__caption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.manifesto__list {
  display: grid;
  gap: 0;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.manifesto__list li {
  display: flex;
  align-items: baseline;
  gap: 13px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.manifesto__list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.manifesto__list li span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.games-section {
  padding: 58px 0 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 26px;
}

.section-heading h2 {
  margin-top: 7px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.section-heading > p {
  max-width: 440px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: var(--shadow-sm);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    background-color 220ms ease;
}

.game-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 84px;
  height: 84px;
  border-radius: 0 0 0 84px;
  background: var(--accent-soft);
  content: "";
  opacity: 0.55;
  pointer-events: none;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(36, 107, 87, 0.3);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-md);
}

.game-card__topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.game-card__glyph {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(36, 107, 87, 0.18);
  border-radius: 13px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1;
}

.game-card__index {
  position: relative;
  z-index: 1;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.game-card__body {
  flex: 1;
  padding-top: 22px;
}

.game-card__body h3 {
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.game-card__body > p {
  max-width: 450px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.game-card__specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.game-card__specs > div {
  min-width: 0;
  padding: 11px 12px 11px 0;
  border-right: 1px solid var(--line);
}

.game-card__specs > div:not(:first-child) {
  padding-left: 12px;
}

.game-card__specs > div:last-child {
  border-right: 0;
}

.game-card__specs dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.game-card__specs dd {
  margin-top: 4px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.game-card__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.game-card__todo {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
}

.game-card__todo span {
  color: var(--ochre);
  font-size: 10px;
}

.site-footer,
.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  line-height: 1.6;
}

/* -------------------------------------------------------------------------- */
/* Game page                                                                   */
/* -------------------------------------------------------------------------- */

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 84px;
  border-bottom: 1px solid var(--line);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  transition: color 150ms ease;
}

.back-link:hover {
  color: var(--accent);
}

.back-link span {
  font-size: 15px;
  line-height: 1;
}

.game-topbar__path {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.3);
  text-transform: none;
  letter-spacing: 0.02em;
}

.game-topbar__path strong {
  color: var(--ink);
  font-weight: 600;
}

.game-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 42px 0 28px;
}

.game-hero h1 {
  margin-top: 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(3rem, 6vw, 4.8rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.game-hero__lead {
  max-width: 650px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.game-hero__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  padding-bottom: 5px;
}

.query-warning {
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(154, 91, 42, 0.24);
  border-radius: 13px;
  color: #63472d;
  background: rgba(253, 245, 232, 0.8);
}

.query-warning__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
}

.query-warning__heading strong {
  font-size: 12px;
}

.query-warning ul {
  display: grid;
  gap: 3px;
  padding-left: 17px;
  list-style: disc;
}

.query-warning li {
  font-size: 11px;
  line-height: 1.65;
}

.query-warning p {
  margin-top: 8px;
  color: #82613f;
  font-size: 10px;
  line-height: 1.7;
}

.query-warning p strong {
  color: #6e4c2b;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 326px;
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}

.game-stage {
  min-width: 0;
}

.game-sidebar {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.board-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.board-panel__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 14px;
}

.board-panel__heading .panel__eyebrow {
  margin-top: 2px;
}

.panel__eyebrow {
  margin-bottom: 3px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.5;
}

.board-panel .panel__title {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.board-surface {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid #c7b99f;
  border-radius: 11px;
  background-color: #e6dbc4;
  background-image:
    radial-gradient(
      circle at 50% 42%,
      rgba(255, 255, 255, 0.22),
      transparent 55%
    ),
    linear-gradient(rgba(51, 42, 28, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 42, 28, 0.13) 1px, transparent 1px);
  background-position:
    center,
    -1px -1px,
    -1px -1px;
  background-size:
    auto,
    calc(100% / 12) calc(100% / 12),
    calc(100% / 12) calc(100% / 12);
  box-shadow:
    inset 0 0 70px rgba(79, 60, 30, 0.12),
    inset 0 0 0 10px rgba(255, 255, 255, 0.15);
}

.board-surface::before {
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(67, 53, 31, 0.2);
  border-radius: 5px;
  content: "";
  pointer-events: none;
}

.board-surface__coord {
  position: absolute;
  z-index: 1;
  color: rgba(72, 57, 35, 0.55);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.board-surface__coord--top {
  top: 13px;
  right: 16px;
}

.board-surface__coord--bottom {
  bottom: 13px;
  left: 16px;
}

.board-empty {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(78%, 390px);
  padding: 28px 24px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 15px;
  background: rgba(250, 246, 236, 0.78);
  box-shadow: 0 18px 45px rgba(66, 51, 28, 0.12);
  text-align: center;
  backdrop-filter: blur(10px);
}

.board-empty__glyph {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 13px;
  border-radius: 50%;
  color: var(--paper);
  background: var(--accent);
  box-shadow: 0 9px 24px rgba(36, 107, 87, 0.22);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1;
}

.board-empty__kicker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.5;
}

.board-empty__title {
  margin-top: 7px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.board-empty__text {
  max-width: 290px;
  margin: 9px 0 15px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.session-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 14px;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  line-height: 1.5;
}

.session-strip__label {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.session-strip code {
  max-width: 250px;
  overflow: hidden;
  color: var(--ink);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-strip strong {
  color: var(--ink);
  font-weight: 650;
}

.session-strip__divider {
  width: 1px;
  height: 13px;
  background: var(--line-strong);
}

.session-strip .tag {
  margin-left: auto;
}

/* -------------------------------------------------------------------------- */
/* Sidebar panels                                                              */
/* -------------------------------------------------------------------------- */

.panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.panel__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel__title {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.panel__hint {
  margin-top: 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.player-list {
  display: grid;
  gap: 7px;
}

.player {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(247, 244, 236, 0.7);
}

.player__avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.player__identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.player__identity strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__identity small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.player__tag {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.2;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.segment {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: rgba(247, 244, 236, 0.66);
  text-align: left;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease;
}

.segment:hover {
  border-color: var(--line-strong);
}

.segment--active {
  color: var(--paper);
  border-color: var(--ink);
  background: var(--ink);
}

.segment__meta {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.5;
}

.segment--active .segment__meta {
  color: #a7d0bd;
}

.segment__label {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.segment__hint {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segment--active .segment__hint {
  color: rgba(247, 243, 234, 0.62);
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.difficulty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 51px;
  padding: 6px 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(247, 244, 236, 0.62);
  transition:
    color 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease;
}

.difficulty:hover:not(:disabled) {
  border-color: var(--line-strong);
}

.difficulty__number {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.difficulty__label {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
}

.difficulty--active {
  color: var(--paper);
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 7px 16px rgba(36, 107, 87, 0.16);
}

.difficulty--active .difficulty__label {
  color: rgba(247, 243, 234, 0.72);
}

.difficulty:disabled {
  opacity: 0.38;
}

.difficulty--active:disabled {
  opacity: 0.7;
}

.control-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.control-actions .button {
  min-width: 0;
  min-height: 34px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 10px;
  white-space: nowrap;
}

.control-actions .button--wide {
  min-height: 39px;
  font-size: 11px;
}

.result-panel__copy {
  display: grid;
  gap: 5px;
}

.result-panel__copy strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.result-panel__copy p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.result-panel .tag--warning {
  margin-top: 12px;
}

.status-orb {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aaa194;
  box-shadow: 0 0 0 4px rgba(120, 116, 106, 0.08);
}

.status-orb--playing {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(36, 107, 87, 0.1);
}

.status-orb--finished {
  background: var(--ochre);
  box-shadow: 0 0 0 4px rgba(154, 91, 42, 0.1);
}

.game-footer {
  margin-top: 28px;
}

/* -------------------------------------------------------------------------- */
/* 404                                                                         */
/* -------------------------------------------------------------------------- */

.not-found {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  max-width: 720px;
  min-height: 58vh;
  padding: 64px 0;
}

.not-found__code {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: 0;
  color: rgba(36, 107, 87, 0.07);
  font-family: var(--serif);
  font-size: clamp(10rem, 27vw, 21rem);
  font-weight: 600;
  letter-spacing: -0.1em;
  line-height: 1;
  transform: translateY(-50%);
  user-select: none;
}

.not-found h1 {
  margin: 18px 0 16px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(2.7rem, 6vw, 4.8rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.05;
}

.not-found > p:not(.eyebrow, .not-found__hint) {
  max-width: 490px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.not-found .button {
  margin-top: 28px;
}

.not-found__hint {
  margin-top: 22px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.7;
}

.not-found__hint code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.4);
}

/* -------------------------------------------------------------------------- */
/* Shared platform additions                                                   */
/* -------------------------------------------------------------------------- */

.session-alert {
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(155, 62, 52, 0.28);
  border-radius: 13px;
  color: #6f2f2a;
  background: rgba(253, 242, 239, 0.9);
  overflow-wrap: anywhere;
}

.session-alert__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.session-alert__heading strong {
  font-size: 12px;
}

.session-alert__dismiss {
  margin-left: auto;
  padding: 5px 10px;
  border: 1px solid rgba(155, 62, 52, 0.28);
  border-radius: 999px;
  color: #6f2f2a;
  background: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 650;
}

.session-alert__dismiss:hover {
  background: rgba(255, 255, 255, 0.9);
}

.session-alert p {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.7;
}

.session-alert code {
  display: block;
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 7px;
  color: #5c3a35;
  background: rgba(255, 255, 255, 0.55);
  font-size: 9px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.session-alert__note {
  color: #825047;
  font-size: 10px !important;
}

.board-slot {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 18px;
}

/* 围棋棋盘自带提子/手数信息与停着按钮，棋盘面高度随内容增长。 */
.board-surface.board-surface--go {
  aspect-ratio: auto;
}

.board-surface--go .board-slot {
  height: auto;
  padding-bottom: 14px;
}

.board-surface--go .board-surface__coord--bottom {
  display: none;
}

.board-waiting {
  display: grid;
  gap: 7px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.board-waiting strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.board-waiting span {
  max-width: 250px;
  font-size: 11px;
  line-height: 1.7;
}

.board-hints {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.board-hint {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.4);
}

.board-hint span {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.5;
}

.board-hint strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.board-status > span:not(.tag) {
  min-width: 0;
}

.board-status__last {
  flex-basis: 100%;
  color: #7d6f5d;
  font-size: 9px;
}

.player--active {
  border-color: rgba(36, 107, 87, 0.32);
  background: rgba(36, 107, 87, 0.08);
  box-shadow: inset 3px 0 0 var(--accent);
}

.player--active .player__avatar {
  background: var(--accent);
}

.player--active .player__tag {
  color: var(--accent-strong);
  border-color: rgba(36, 107, 87, 0.28);
  background: rgba(255, 255, 255, 0.5);
}

.segment:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.segment:disabled:hover {
  border-color: var(--line);
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                  */
/* -------------------------------------------------------------------------- */

@media (max-width: 940px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 54px 0 46px;
  }

  .manifesto {
    width: min(100%, 560px);
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .game-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding-top: 34px;
  }

  .game-hero__badges {
    justify-content: flex-start;
    padding-bottom: 0;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: calc(100% - 32px);
    padding-bottom: 32px;
  }

  .site-header {
    min-height: 82px;
  }

  .hero {
    padding-top: 42px;
  }

  .hero__copy h1 {
    font-size: clamp(2.9rem, 13vw, 4.3rem);
  }

  .hero__lead {
    font-size: 14px;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .section-heading > p {
    max-width: 100%;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .game-sidebar {
    grid-template-columns: 1fr;
  }

  .game-topbar {
    min-height: 72px;
  }

  .site-footer,
  .game-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    margin-top: 44px;
  }

  .board-empty {
    width: 86%;
    padding: 22px 18px;
  }

  .board-empty__title {
    font-size: 23px;
  }

  .board-empty__text {
    margin-bottom: 12px;
  }

  .session-strip .tag {
    margin-left: 0;
  }

  .game-footer {
    margin-top: 18px;
  }

  .query-warning {
    margin-top: 6px;
  }
}

@media (max-width: 480px) {
  .site-header__note,
  .hero__copy .tag:last-child {
    display: none;
  }

  .game-card {
    padding: 18px;
  }

  .game-card__actions {
    grid-template-columns: 1fr;
  }

  .game-card__specs dt {
    font-size: 7px;
  }

  .game-card__specs dd {
    font-size: 11px;
  }

  .game-hero h1 {
    font-size: clamp(2.7rem, 15vw, 3.8rem);
  }

  .board-panel {
    padding: 12px;
  }

  .board-panel .panel__title {
    font-size: 19px;
  }

  .board-surface {
    aspect-ratio: 1 / 1.08;
  }

  .board-empty {
    width: 90%;
    padding: 18px 14px;
  }

  .board-empty__glyph {
    width: 44px;
    height: 44px;
    font-size: 21px;
    margin-bottom: 9px;
  }

  .board-empty__title {
    font-size: 21px;
  }

  .board-empty__text {
    font-size: 10px;
  }

  .board-surface__coord {
    font-size: 7px;
  }

  .board-hints {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-hint:last-child {
    grid-column: 1 / -1;
  }

  .session-alert {
    padding: 12px;
  }

  .session-alert__dismiss {
    margin-left: 0;
  }

  .game-topbar__path {
    display: none;
  }

  .not-found {
    padding: 48px 0;
  }

  .not-found__code {
    top: 38%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* -------------------------------------------------------------------------- */
/* PHP / JSON 版本新增                                                         */
/* -------------------------------------------------------------------------- */

[hidden] {
  display: none !important;
}

.board-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;
}

.status-orb--idle {
  background: #aaa194;
  box-shadow: 0 0 0 4px rgba(120, 116, 106, 0.08);
}

.recent-section {
  margin-top: 64px;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.recent-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    border-color 150ms ease,
    transform 150ms ease,
    background-color 150ms ease;
}

.recent-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
  transform: translateY(-1px);
}

.recent-card__glyph {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--paper);
  background: var(--accent);
  font-family: var(--serif);
  font-size: 18px;
}

.recent-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

.recent-card__body strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-card__body small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-card__go {
  flex: 0 0 auto;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.recent-empty {
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

/* 控件改为 3 列，保存按钮与悔棋/清空并排。 */
.control-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#save-status {
  min-height: 14px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
}

@media (max-width: 720px) {
  .recent-grid {
    grid-template-columns: 1fr;
  }

  .control-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #btn-clear {
    grid-column: 1 / -1;
  }
}
