:root {
  color-scheme: dark;
  --bg: #11100d;
  --bg-deep: #090a08;
  --surface: #181611;
  --surface-2: #211d17;
  --surface-3: #29241d;
  --cell: #25211b;
  --ink: #f2ead8;
  --muted: #9f9889;
  --muted-2: #6f6a60;
  --line: rgba(242, 234, 216, 0.09);
  --line-strong: rgba(242, 234, 216, 0.17);
  --mint: #65d5c4;
  --mint-pale: #a6e6da;
  --mint-deep: #285e56;
  --coral: #ee778f;
  --coral-pale: #f2acb8;
  --coral-deep: #63333d;
  --amber: #d9ad43;
  --danger: #ff676f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
  --ease-out: cubic-bezier(0.22, 0.78, 0.3, 1);
  --ease-ui: cubic-bezier(0.2, 0.7, 0.3, 1);
  --display: "Avenir Next", "Century Gothic", "Trebuchet MS", sans-serif;
  --body: "Avenir Next", "Trebuchet MS", sans-serif;
  --mono: "SFMono-Regular", "Roboto Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 4% 6%, rgba(101, 213, 196, 0.06), transparent 30rem),
    radial-gradient(circle at 92% 96%, rgba(238, 119, 143, 0.055), transparent 34rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button,
dialog {
  font: inherit;
}

button {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 40rem;
  height: 40rem;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}

.ambient-mint {
  top: -22rem;
  left: -18rem;
  background: rgba(101, 213, 196, 0.09);
}

.ambient-coral {
  right: -20rem;
  bottom: -24rem;
  background: rgba(238, 119, 143, 0.07);
}

.noise {
  position: fixed;
  z-index: -1;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  pointer-events: none;
}

.app-shell {
  min-height: 100vh;
}

.launch-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  gap: 16px;
  border-bottom: 1px solid rgba(101, 213, 196, 0.22);
  background: rgba(40, 94, 86, 0.48);
  color: var(--mint-pale);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.strip-button {
  min-height: 25px;
  padding: 0 12px;
  border: 1px solid rgba(101, 213, 196, 0.3);
  border-radius: 7px;
  background: var(--mint);
  color: #0b1714;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  transition:
    filter 140ms var(--ease-ui),
    transform 90ms var(--ease-ui);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 66px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 14, 12, 0.86);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.32em;
  cursor: default;
  transition:
    color 140ms var(--ease-ui),
    transform 90ms var(--ease-ui);
}

.brand-mark {
  display: grid;
  width: 22px;
  height: 22px;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  transform: rotate(45deg);
}

.brand-mark i {
  border-radius: 2px;
  background: var(--mint);
}

.brand-mark i:nth-child(2),
.brand-mark i:nth-child(3) {
  background: #d9d2bf;
}

.brand-mark i:nth-child(4) {
  background: var(--coral);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill,
.player-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(33, 29, 23, 0.7);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.13em;
}

.status-pill {
  gap: 8px;
  padding: 0 12px;
  color: var(--muted);
}

.status-pill i,
.online-note i,
.match-label i,
.panel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 14px rgba(101, 213, 196, 0.8);
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(33, 29, 23, 0.7);
  cursor: pointer;
  transition:
    border-color 140ms var(--ease-ui),
    background-color 140ms var(--ease-ui),
    transform 90ms var(--ease-ui);
}

.icon-button svg {
  width: 16px;
  fill: var(--muted);
}

.icon-button.muted svg {
  opacity: 0.38;
}

.player-chip {
  gap: 8px;
  padding: 0 10px 0 7px;
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0;
}

.mini-gem {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(217, 173, 67, 0.58);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, #f5db84 0 11%, transparent 12%),
    radial-gradient(circle, #9a7025, #2b2415 70%);
}

main {
  width: 100%;
}

.home-view,
.game-view {
  width: min(100% - 32px, 1480px);
  margin: 0 auto;
}

.home-view {
  padding: 18px 0 80px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 0.98fr);
  gap: 18px;
}

.hero-card,
.panel {
  border: 1px solid var(--line);
  background: rgba(24, 22, 17, 0.94);
}

.hero-card {
  position: relative;
  display: grid;
  min-height: 518px;
  grid-template-columns: minmax(360px, 1.06fr) minmax(330px, 0.94fr);
  overflow: hidden;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero-card::before {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(101, 213, 196, 0.2), transparent 38%),
    radial-gradient(circle at 100% 100%, rgba(238, 119, 143, 0.17), transparent 42%);
  content: "";
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 38px 12px 30px 34px;
}

.eyebrow {
  margin: 0;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.19em;
  line-height: 1.5;
}

.hero-copy h1 {
  margin: 12px 0 4px;
  color: #f7f0df;
  font-family: var(--display);
  font-size: clamp(64px, 6vw, 96px);
  font-weight: 600;
  letter-spacing: -0.075em;
  line-height: 0.96;
}

.hero-copy h1 span {
  color: var(--coral);
}

.hero-description {
  max-width: 520px;
  margin: 16px 0 22px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.primary-play,
.dialog-start {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(104deg, var(--mint), #ddd8c8 57%, var(--coral));
  color: #11130f;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition:
    filter 150ms var(--ease-ui),
    box-shadow 150ms var(--ease-ui),
    transform 90ms var(--ease-ui);
}

.primary-play {
  min-height: 72px;
  padding: 0 18px 0 20px;
}

.primary-play span,
.dialog-start span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.primary-play strong,
.dialog-start strong {
  font-size: 16px;
  font-weight: 700;
}

.primary-play small,
.dialog-start small {
  opacity: 0.7;
  font-size: 10px;
}

.primary-play i,
.dialog-start i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: rgba(17, 19, 15, 0.1);
  font-style: normal;
}

.mode-row {
  display: grid;
  margin-top: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-button {
  display: grid;
  min-height: 64px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(17, 16, 13, 0.62);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 140ms var(--ease-ui),
    background-color 140ms var(--ease-ui),
    transform 90ms var(--ease-ui);
}

.mode-button > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.mode-button strong {
  font-size: 12px;
}

.mode-button small {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-button i {
  color: var(--muted);
  font-style: normal;
}

.mode-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: rgba(101, 213, 196, 0.1);
  color: var(--mint);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
}

.mode-icon.gold {
  background: rgba(217, 173, 67, 0.1);
  color: var(--amber);
}

.online-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding-top: 20px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.preview-wrap {
  position: relative;
  z-index: 1;
  align-self: center;
  width: min(92%, 420px);
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 24px;
}

.preview-board {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 5px;
  padding: 8px;
  border: 5px solid #0a0a08;
  border-radius: 14px;
  background: #14120f;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.36),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.preview-cell {
  position: relative;
  border-radius: 5px;
  background: var(--cell);
}

.preview-cell.top {
  background: rgba(101, 213, 196, 0.28);
}

.preview-cell.bottom {
  background: rgba(238, 119, 143, 0.26);
}

.preview-cell.has-pawn::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 53%;
  aspect-ratio: 1;
  border: 2px solid #ded8c8;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(101, 213, 196, 0.1);
  content: "";
  transform: translate(-50%, -50%);
}

.preview-cell.has-pawn.ai::after {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(238, 119, 143, 0.1);
}

.preview-wall {
  position: absolute;
  z-index: 4;
  border-radius: 4px;
  background: #ede4d1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.preview-wall.one {
  top: 39%;
  right: 22%;
  width: 26%;
  height: 6px;
}

.preview-wall.two {
  top: 55%;
  left: 28%;
  width: 6px;
  height: 26%;
}

.preview-label {
  position: absolute;
  color: rgba(242, 234, 216, 0.32);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.18em;
}

.preview-label-top {
  top: 7px;
  right: 30px;
}

.preview-label-bottom {
  bottom: 7px;
  left: 30px;
}

.home-aside {
  display: grid;
  grid-template-rows: 0.88fr 1.12fr;
  gap: 18px;
}

.panel {
  border-radius: 18px;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.panel-heading h2 {
  margin: 5px 0 0;
  font-size: 18px;
  font-weight: 600;
}

.panel-dot.coral {
  background: var(--coral);
  box-shadow: 0 0 14px rgba(238, 119, 143, 0.7);
}

.stat-grid {
  display: grid;
  margin-top: 22px;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line);
}

.stat-grid div {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.stat-grid div + div {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.stat-grid strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
}

.stat-grid span,
.record-line span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.record-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
}

.record-line strong {
  color: var(--mint);
  font-size: 12px;
}

.brief-list {
  display: grid;
  margin: 20px 0 0;
  padding: 0;
  gap: 9px;
  list-style: none;
}

.brief-list li {
  display: grid;
  min-height: 72px;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 13, 10, 0.38);
}

.brief-list li > span {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.brief-list p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.brief-list strong {
  color: var(--ink);
}

.about-section {
  padding: 72px 4px 24px;
}

.about-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 60px;
  align-items: end;
}

.about-heading h2 {
  margin: 12px 0 0;
  font-family: var(--display);
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.about-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.72;
}

.rule-cards {
  display: grid;
  margin-top: 34px;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.rule-cards article {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(24, 22, 17, 0.72);
}

.rule-cards span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  background: rgba(101, 213, 196, 0.1);
  color: var(--mint);
  font-family: var(--mono);
  font-size: 10px;
}

.rule-cards h3 {
  margin: 20px 0 8px;
  font-size: 14px;
}

.rule-cards p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

footer {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Game */

.game-view {
  padding: 18px 0 42px;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) 350px;
  align-items: start;
  gap: 18px;
}

.board-column {
  min-width: 0;
}

.game-topline {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.live-match-title {
  display: grid;
  gap: 3px;
}

.live-match-title span {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.live-match-title strong {
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 500;
}

.back-button,
.game-actions button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(24, 22, 17, 0.86);
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color 140ms var(--ease-ui),
    background-color 140ms var(--ease-ui),
    color 140ms var(--ease-ui),
    opacity 140ms var(--ease-ui),
    transform 90ms var(--ease-ui);
}

.back-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 11px;
}

.match-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.match-label b {
  padding-left: 9px;
  border-left: 1px solid var(--line);
  color: var(--coral-pale);
  font-weight: 500;
}

.board-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.goal-caption {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.goal-caption-top {
  color: rgba(101, 213, 196, 0.68);
}

.goal-caption-bottom {
  color: rgba(238, 119, 143, 0.62);
}

.board-zoom-viewport {
  --board-scale: 1;
  width: min(
    calc(60vh * var(--board-scale)),
    calc(640px * var(--board-scale)),
    calc((100vw - 430px) * var(--board-scale)),
    100%
  );
  min-width: 500px;
  max-width: 100%;
  margin-inline: auto;
  overflow: hidden;
  border-radius: 18px;
  overscroll-behavior-inline: contain;
}

.board-zoom-surface {
  width: 100%;
  aspect-ratio: 1;
  margin-inline: auto;
  transition: width 180ms var(--ease-ui);
}

.board-frame {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  padding: 10px;
  border: 5px solid #090906;
  border-radius: 18px;
  background: #15130f;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.board-grid {
  --gutter: 8px;
  display: grid;
  width: 100%;
  height: 100%;
  touch-action: pan-x pan-y pinch-zoom;
  grid-template-columns: repeat(8, minmax(0, 1fr) var(--gutter)) minmax(0, 1fr);
  grid-template-rows: repeat(8, minmax(0, 1fr) var(--gutter)) minmax(0, 1fr);
}

.board-cell {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: var(--cell);
  cursor: default;
}

.board-cell.goal-ai {
  background: rgba(101, 213, 196, 0.28);
}

.board-cell.goal-human {
  background: rgba(238, 119, 143, 0.27);
}

.board-cell.legal {
  cursor: pointer;
}

.board-cell.legal::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(101, 213, 196, 0.64);
  box-shadow: 0 0 0 5px rgba(101, 213, 196, 0.06);
  content: "";
  transition:
    width 120ms var(--ease-ui),
    height 120ms var(--ease-ui),
    background-color 120ms var(--ease-ui),
    box-shadow 120ms var(--ease-ui);
}

.board-cell.legal:hover::before {
  width: 14px;
  height: 14px;
  background: var(--mint);
}

.board-frame.wall-previewing .board-cell.legal::before {
  opacity: 0.28;
}

.pawn {
  position: absolute;
  z-index: 6;
  width: 58%;
  aspect-ratio: 1;
  border: 2px solid #eee5d1;
  border-radius: 50%;
  box-shadow:
    0 0 0 4px rgba(101, 213, 196, 0.11),
    0 7px 16px rgba(0, 0, 0, 0.38);
}

.pawn::after {
  position: absolute;
  top: 20%;
  left: 25%;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  content: "";
}

.pawn-human {
  background: var(--mint);
}

.pawn-ai {
  background: var(--coral);
  box-shadow:
    0 0 0 4px rgba(238, 119, 143, 0.11),
    0 7px 16px rgba(0, 0, 0, 0.38);
}

.wall-slot {
  position: relative;
  z-index: 4;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  pointer-events: none;
  transition:
    background-color 120ms var(--ease-ui),
    box-shadow 120ms var(--ease-ui);
}

.wall-slot::before {
  position: absolute;
  border-radius: 5px;
  background: transparent;
  content: "";
}

.wall-slot.horizontal::before {
  inset: -14px 0;
}

.wall-slot.vertical::before {
  inset: 0 -14px;
}

.wall-slot.wall-preview {
  background: rgba(232, 223, 202, 0.82);
  box-shadow:
    0 0 0 2px rgba(101, 213, 196, 0.18),
    0 0 16px rgba(101, 213, 196, 0.34);
}

.wall-slot.wall-preview.preview-invalid {
  background: rgba(238, 119, 143, 0.64);
  box-shadow:
    0 0 0 2px rgba(238, 119, 143, 0.15),
    0 0 14px rgba(238, 119, 143, 0.22);
}

.wall-slot.placed {
  z-index: 5;
  background: #e8dfca;
  box-shadow:
    0 2px 7px rgba(0, 0, 0, 0.46),
    inset 0 1px rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.wall-slot.placed.ai-wall {
  background: var(--coral-pale);
}

.wall-slot.just-placed.horizontal {
  transform-origin: center;
  animation: wall-place-horizontal 180ms var(--ease-out);
}

.wall-slot.just-placed.vertical {
  transform-origin: center;
  animation: wall-place-vertical 180ms var(--ease-out);
}

.wall-slot.illegal {
  background: var(--danger) !important;
  animation: illegal-wall 220ms ease-out;
}

.wall-slot:focus-visible {
  z-index: 8;
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

.wall-tray {
  display: grid;
  width: min(60vh, 640px, calc(100vw - 430px));
  min-width: 500px;
  min-height: 76px;
  grid-template-columns: 1fr 110px 1fr;
  align-items: center;
  gap: 12px;
  margin: 10px auto 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(24, 22, 17, 0.9);
}

.board-zoom-controls {
  display: flex;
  width: max-content;
  min-height: 44px;
  align-items: center;
  margin: 0 auto 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(24, 22, 17, 0.94);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.board-zoom-label {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 0 12px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.board-zoom-controls button {
  display: grid;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mint);
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 140ms var(--ease-ui),
    color 140ms var(--ease-ui);
}

.board-zoom-controls button:hover:not(:disabled),
.board-zoom-controls button:focus-visible {
  background: rgba(101, 213, 196, 0.1);
  color: var(--ink);
}

.board-zoom-controls button:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: -3px;
}

.board-zoom-controls button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.42;
}

.board-zoom-controls output {
  display: grid;
  min-width: 64px;
  min-height: 44px;
  place-items: center;
  border-inline: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.orientation-button {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: rgba(13, 13, 10, 0.42);
  color: var(--muted);
  cursor: default;
  transition:
    border-color 160ms var(--ease-ui),
    background-color 160ms var(--ease-ui),
    color 160ms var(--ease-ui),
    transform 90ms var(--ease-ui);
}

.orientation-button.legend {
  border-color: rgba(255, 255, 255, 0.04);
}

.orientation-button.active {
  border-color: rgba(101, 213, 196, 0.45);
  background: rgba(40, 94, 86, 0.22);
  color: var(--ink);
}

.orientation-button small {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wall-sample {
  display: block;
  border-radius: 4px;
  background: #eee4cf;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition:
    filter 160ms var(--ease-ui),
    transform 160ms var(--ease-ui);
}

.orientation-button.active .wall-sample {
  filter: brightness(1.08);
}

.orientation-button.active .wall-sample.horizontal {
  transform: scaleX(1.07);
}

.orientation-button.active .wall-sample.vertical {
  transform: scaleY(1.07);
}

.wall-sample.horizontal {
  width: 62px;
  height: 7px;
}

.wall-sample.vertical {
  width: 7px;
  height: 46px;
}

.wall-tray.disabled {
  opacity: 0.52;
}

.wall-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.wall-count span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.wall-count strong {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 500;
}

.game-sidebar {
  display: grid;
  gap: 12px;
  padding-top: 56px;
}

.turn-panel {
  position: relative;
  overflow: hidden;
}

.turn-panel::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--mint);
  content: "";
  transition: background-color 180ms var(--ease-ui);
}

.turn-panel.ai-turn::before {
  background: var(--coral);
}

.turn-panel.ai-thinking::before {
  animation: thinking-line 1.1s ease-in-out infinite;
}

.turn-panel.turn-updated > .eyebrow,
.turn-panel.turn-updated .turn-indicator {
  animation: turn-crossfade 180ms var(--ease-out);
}

.combatant {
  display: grid;
  min-height: 74px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  opacity: 0.68;
  background: rgba(13, 13, 10, 0.42);
  transition:
    border-color 180ms var(--ease-ui),
    opacity 180ms var(--ease-ui),
    background-color 180ms var(--ease-ui);
}

.combatant.active {
  border-color: rgba(101, 213, 196, 0.38);
  opacity: 1;
}

.turn-panel.ai-turn .combatant:first-of-type {
  border-color: rgba(238, 119, 143, 0.38);
  opacity: 1;
}

.turn-panel.ai-turn #playerCombatant {
  border-color: var(--line);
  opacity: 0.68;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #12130f;
  font-size: 20px;
}

.avatar-ai {
  background: var(--coral);
}

.avatar-player {
  background: var(--mint);
}

.combatant > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.combatant small,
.combatant-walls span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.combatant strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combatant-walls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.combatant-walls b {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
}

.versus-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0 -4px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
}

.versus-line i {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.panel-heading.compact {
  align-items: center;
}

.panel-heading.compact h2 {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 500;
}

.move-count-value {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
}

.turn-indicator {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    border-color 180ms var(--ease-ui),
    color 180ms var(--ease-ui);
}

.turn-panel.ai-thinking .turn-indicator {
  border-color: rgba(238, 119, 143, 0.28);
  color: var(--coral-pale);
  animation: thinking-label 1.1s ease-in-out infinite;
}

.move-list {
  max-height: 206px;
  margin: 14px 0 0;
  overflow-y: auto;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.move-list li {
  display: grid;
  min-height: 36px;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.move-list li span:first-child {
  color: var(--muted-2);
}

.move-list li b {
  color: var(--ink);
  font-weight: 500;
}

.move-list li i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
}

.move-list li.ai i {
  background: var(--coral);
}

.move-list .empty-history {
  display: flex;
  min-height: 72px;
  justify-content: center;
  text-align: center;
}

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

.game-actions button {
  min-height: 44px;
  font-size: 11px;
}

.game-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.inline-rules {
  display: grid;
  gap: 0;
  padding: 4px 14px;
}

.inline-rules p {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.inline-rules p:last-child {
  border-bottom: 0;
}

.inline-rules b {
  min-width: 36px;
  color: var(--mint-pale);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

/* Dialogs and result */

dialog {
  width: min(460px, calc(100% - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(4, 5, 4, 0.76);
  backdrop-filter: blur(7px);
}

.dialog-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    radial-gradient(circle at 0 0, rgba(101, 213, 196, 0.1), transparent 44%),
    var(--surface);
  box-shadow: var(--shadow);
}

.dialog-card h2 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.dialog-intro {
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(13, 13, 10, 0.48);
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  transition:
    border-color 140ms var(--ease-ui),
    background-color 140ms var(--ease-ui),
    transform 90ms var(--ease-ui);
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 9px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.difficulty-option {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 13, 10, 0.44);
  cursor: pointer;
  transition:
    border-color 160ms var(--ease-ui),
    background-color 160ms var(--ease-ui),
    transform 90ms var(--ease-ui);
}

.difficulty-option.selected {
  border-color: rgba(101, 213, 196, 0.52);
  background: rgba(40, 94, 86, 0.22);
}

.difficulty-option span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.difficulty-option strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
}

.difficulty-option small {
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.35;
  text-align: left;
}

.dialog-start {
  width: 100%;
  min-height: 58px;
  margin-top: 16px;
  padding: 0 14px 0 16px;
}

.rules-card {
  width: min(520px, 100%);
}

.rules-list {
  display: grid;
  margin-top: 22px;
  gap: 9px;
}

.rules-list article {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.rules-list b {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 10px;
}

.rules-list h3 {
  margin: 0 0 5px;
  font-size: 13px;
}

.rules-list p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.result-overlay {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 5, 4, 0.76);
  backdrop-filter: blur(8px);
}

.result-overlay:not([hidden]) {
  animation: overlay-in 180ms ease-out;
}

.result-card {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0, rgba(101, 213, 196, 0.14), transparent 48%),
    var(--surface);
  text-align: center;
  box-shadow: var(--shadow);
}

.result-overlay:not([hidden]) .result-card {
  animation: result-card-in 260ms var(--ease-out);
}

.result-gem {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin: 0 auto 18px;
  border: 2px solid #f0e7d5;
  border-radius: 50%;
  background: var(--mint);
  color: #11130f;
  font-size: 28px;
}

.result-card .eyebrow {
  color: var(--muted);
}

.result-card h2 {
  margin: 8px 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 500;
}

.result-card > p:last-of-type {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.result-actions {
  display: grid;
  margin-top: 22px;
  grid-template-columns: 1fr;
  gap: 8px;
}

.result-actions button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(13, 13, 10, 0.46);
  font-size: 11px;
  cursor: pointer;
  transition:
    border-color 140ms var(--ease-ui),
    background-color 140ms var(--ease-ui),
    filter 140ms var(--ease-ui),
    transform 90ms var(--ease-ui);
}

.result-actions button:last-child {
  border-color: transparent;
  background: var(--mint);
  color: #11130f;
  font-weight: 700;
}

.toast {
  position: fixed;
  z-index: 110;
  right: 18px;
  bottom: 18px;
  max-width: min(330px, calc(100% - 32px));
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  opacity: 0;
  background: #211e18;
  color: var(--ink);
  font-size: 11px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 160ms var(--ease-ui),
    transform 160ms var(--ease-ui);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

dialog[open] .dialog-card {
  animation: dialog-in 200ms var(--ease-out);
}

@keyframes wall-place-horizontal {
  0% {
    opacity: 0.25;
    transform: scaleX(0.42);
  }
  100% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes wall-place-vertical {
  0% {
    opacity: 0.25;
    transform: scaleY(0.42);
  }
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes illegal-wall {
  0%,
  100% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-2px);
  }
  70% {
    transform: translateX(2px);
  }
}

@keyframes turn-crossfade {
  0% {
    opacity: 0;
    transform: translateY(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes thinking-line {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes thinking-label {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }
}

@keyframes result-card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
}

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

  .home-aside {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .game-layout {
    grid-template-columns: minmax(500px, 1fr) 310px;
  }

  .board-zoom-viewport,
  .wall-tray {
    width: min(
      calc(66vh * var(--board-scale, 1)),
      calc((100vw - 370px) * var(--board-scale, 1)),
      100%
    );
  }
}

@media (max-width: 820px) {
  .launch-strip {
    min-height: 34px;
  }

  .site-header {
    min-height: 56px;
    padding: 0 16px;
  }

  .status-pill {
    display: none;
  }

  .home-view,
  .game-view {
    width: calc(100% - 24px);
  }

  .home-view {
    padding-top: 12px;
  }

  .hero-card {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 26px 24px 20px;
  }

  .hero-copy h1 {
    font-size: 76px;
  }

  .preview-wrap {
    width: min(86vw, 460px);
  }

  .home-aside {
    grid-template-columns: 1fr;
  }

  .about-heading {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .rule-cards {
    grid-template-columns: 1fr;
  }

  .game-layout {
    display: block;
  }

  .board-zoom-viewport,
  .wall-tray {
    width: min(100%, 650px);
    min-width: 0;
  }

  .board-zoom-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .board-zoom-viewport::-webkit-scrollbar {
    display: none;
  }

  .board-zoom-surface {
    width: var(--board-zoom, 100%);
  }

  .game-sidebar {
    width: min(100%, 650px);
    margin: 12px auto 0;
    padding-top: 0;
  }
}

@media (max-width: 520px) {
  .launch-strip {
    justify-content: space-between;
    min-height: 44px;
    padding: 0 16px;
    font-size: 8px;
  }

  .strip-button {
    min-height: 36px;
    padding: 0 11px;
    font-size: 10px;
  }

  .brand {
    gap: 9px;
    min-height: 44px;
    font-size: 11px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .brand-mark {
    width: 19px;
    height: 19px;
  }

  .player-chip {
    display: none;
  }

  .home-view,
  .game-view {
    width: calc(100% - 32px);
  }

  .hero-card {
    border-radius: 18px;
  }

  .hero-copy {
    padding: 24px 18px 16px;
  }

  .hero-copy h1 {
    margin-top: 9px;
    font-size: 62px;
  }

  .hero-description {
    margin: 12px 0 18px;
    font-size: 13px;
  }

  .primary-play {
    min-height: 68px;
  }

  .mode-row {
    grid-template-columns: 1fr;
  }

  .online-note {
    padding-top: 16px;
  }

  .preview-wrap {
    width: 100%;
    padding: 18px;
  }

  .panel {
    padding: 16px;
  }

  .about-section {
    padding-top: 52px;
  }

  .about-heading h2 {
    font-size: 34px;
  }

  footer {
    min-height: 64px;
    justify-content: center;
    padding: 0 16px;
    text-align: center;
  }

  footer span:last-child {
    display: none;
  }

  .game-view {
    padding-top: 8px;
  }

  .game-topline {
    min-height: 40px;
  }

  .match-label span {
    display: none;
  }

  .board-stage {
    gap: 5px;
  }

  .board-frame {
    width: 100%;
    padding: 6px;
    border-width: 4px;
    border-radius: 13px;
  }

  .board-grid {
    --gutter: 5px;
  }

  .board-cell {
    border-radius: 5px;
  }

  .wall-slot.horizontal::before {
    inset: -17px 0;
  }

  .wall-slot.vertical::before {
    inset: 0 -17px;
  }

  .wall-tray {
    min-height: 68px;
    grid-template-columns: 1fr 76px 1fr;
    gap: 6px;
    padding: 7px;
    border-radius: 13px;
  }

  .orientation-button {
    min-height: 52px;
    gap: 8px;
  }

  .orientation-button small {
    display: none;
  }

  .wall-sample.horizontal {
    width: 54px;
    height: 6px;
  }

  .wall-sample.vertical {
    width: 6px;
    height: 42px;
  }

  .wall-count strong {
    font-size: 26px;
  }

  .game-sidebar {
    gap: 10px;
  }

  .turn-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 8px;
  }

  .turn-panel > .eyebrow,
  .versus-line {
    grid-column: 1 / -1;
  }

  .combatant {
    min-height: 72px;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
    margin-top: 12px;
    padding: 8px;
  }

  .avatar {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .combatant-walls {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .combatant-walls b {
    font-size: 17px;
  }

  .moves-panel {
    padding-bottom: 10px;
  }

  .move-list {
    max-height: 150px;
  }

  .dialog-card {
    padding: 24px 18px 18px;
  }

  .dialog-card h2 {
    font-size: 26px;
  }

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

  .difficulty-option {
    min-height: 66px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .difficulty-option small {
    grid-column: 1 / -1;
  }
}

@media (hover: hover) {
  .primary-play:hover,
  .dialog-start:hover {
    filter: brightness(1.05);
  }

  .mode-button:hover,
  .game-actions button:hover:not(:disabled),
  .back-button:hover,
  .dialog-close:hover,
  .result-actions button:hover {
    border-color: var(--line-strong);
    background: rgba(40, 36, 29, 0.8);
  }

  .orientation-button:hover:not(:disabled) {
    border-color: rgba(101, 213, 196, 0.28);
    color: var(--ink);
  }
}

.strip-button:active,
.brand:active,
.icon-button:active,
.primary-play:active,
.dialog-start:active,
.mode-button:active,
.back-button:active,
.game-actions button:not(:disabled):active,
.orientation-button:not(:disabled):active,
.difficulty-option:active,
.dialog-close:active,
.result-actions button:active {
  transform: translateY(1px) scale(0.99);
}

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

/* Search-first content and privacy controls */

.game-intro {
  display: grid;
  grid-template-columns: minmax(190px, 0.34fr) minmax(0, 1fr);
  align-items: end;
  gap: 32px;
  margin-bottom: 12px;
  padding: 4px 2px 14px;
  border-bottom: 1px solid var(--line);
}

.game-intro > .eyebrow {
  padding-bottom: 5px;
  background: transparent;
}

.game-intro h1 {
  max-width: 920px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(28px, 3.2vw, 46px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.game-intro div > p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.seo-content {
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
  padding: 88px 0 72px;
}

.content-lede {
  display: grid;
  grid-template-columns: minmax(180px, 0.4fr) minmax(0, 1fr);
  gap: 46px;
  align-items: start;
  padding-bottom: 34px;
}

.content-lede > .eyebrow,
.feature-band .eyebrow,
.strategy-notes .eyebrow,
.faq-heading .eyebrow,
.play-cta .eyebrow,
.consent-banner .eyebrow {
  background: transparent;
}

.content-lede h2,
.feature-band h2,
.strategy-notes h2,
.faq-heading h2,
.play-cta h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.content-lede h2 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
}

.content-lede div > p {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.rule-ledger {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  border-block: 1px solid var(--line-strong);
  list-style: none;
}

.rule-ledger li {
  display: grid;
  min-height: 190px;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  padding: 28px 24px;
}

.rule-ledger li + li {
  border-left: 1px solid var(--line);
}

.rule-ledger li > span {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.rule-ledger h3 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
}

.rule-ledger p,
.strategy-notes > div > p,
.strategy-list p,
.faq-list p,
.privacy-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

.game-figure {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(24, 22, 17, 0.9);
}

.game-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--surface-2);
}

.game-figure figcaption {
  padding: 15px 17px 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.game-figure-wide {
  display: grid;
  max-width: 920px;
  grid-template-columns: minmax(280px, 0.82fr) minmax(260px, 1.18fr);
  align-items: center;
  margin: 0 auto 82px;
}

.game-figure-wide figcaption {
  padding: 28px;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(20px, 2.7vw, 32px);
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.guide-section {
  padding: 94px 0 18px;
}

.guide-heading {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  gap: 54px;
  align-items: start;
}

.guide-heading > .eyebrow,
.device-guide > .eyebrow {
  background: transparent;
}

.guide-heading h2,
.device-guide h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.04;
}

.guide-heading p,
.device-guide div > p {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.78;
}

.guide-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 38px;
  margin-top: 42px;
  border-top: 1px solid var(--line-strong);
}

.guide-columns article {
  min-height: 240px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.guide-columns h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
}

.guide-columns p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.78;
}

.device-guide {
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1.58fr);
  gap: 58px;
  margin-bottom: 86px;
  padding: 50px 0;
  border-block: 1px solid var(--line-strong);
}

.feature-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 46px;
  margin-top: 72px;
  padding: 34px;
  border: 1px solid rgba(101, 213, 196, 0.24);
  border-radius: 20px;
  background:
    linear-gradient(118deg, rgba(40, 94, 86, 0.26), rgba(24, 22, 17, 0.92) 44%),
    var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.feature-band h2 {
  margin-top: 8px;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.1;
}

.feature-band ul {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-band li {
  display: flex;
  min-height: 82px;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.feature-band b {
  color: var(--mint-pale);
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 500;
}

.feature-band span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.strategy-notes {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 70px;
  padding: 104px 0 86px;
}

.strategy-notes h2 {
  margin-top: 10px;
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.03;
}

.strategy-notes > div > p {
  max-width: 440px;
  margin-top: 20px;
}

.strategy-list {
  border-top: 1px solid var(--line-strong);
}

.strategy-list article {
  display: grid;
  grid-template-columns: 66px minmax(180px, 0.7fr) minmax(220px, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 112px;
  border-bottom: 1px solid var(--line);
}

.strategy-list span {
  color: var(--coral-pale);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.strategy-list h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
}

.faq-section {
  display: grid;
  grid-template-columns: minmax(210px, 0.45fr) minmax(0, 1.55fr);
  gap: 58px;
  padding: 54px 0 64px;
  border-top: 1px solid var(--line-strong);
}

.faq-heading h2 {
  margin-top: 10px;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.04;
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  position: relative;
  padding: 20px 42px 20px 0;
  font-family: var(--display);
  font-size: 16px;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  position: absolute;
  top: 17px;
  right: 2px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 20px;
  content: "+";
}

.faq-list details[open] summary::after {
  content: "–";
}

.faq-list p {
  max-width: 700px;
  padding: 0 42px 20px 0;
}

.play-cta {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 28px 34px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    radial-gradient(circle at 0 50%, rgba(101, 213, 196, 0.14), transparent 36%),
    radial-gradient(circle at 100% 50%, rgba(238, 119, 143, 0.12), transparent 34%),
    rgba(24, 22, 17, 0.9);
}

.play-cta h2 {
  margin-top: 7px;
  font-size: clamp(28px, 3.8vw, 46px);
}

.play-cta button {
  display: flex;
  min-width: 230px;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--mint);
  color: #0b1714;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    filter 140ms var(--ease-ui),
    transform 90ms var(--ease-ui);
}

.privacy-note {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 30px;
  margin-top: 38px;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
}

.privacy-note h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.privacy-note p {
  max-width: 780px;
  font-size: 11px;
}

footer nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

footer a,
footer button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

footer a:hover,
footer button:hover {
  color: var(--mint-pale);
}

.consent-banner {
  position: fixed;
  z-index: 130;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(760px, calc(100% - 36px));
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0 0, rgba(101, 213, 196, 0.13), transparent 42%),
    #1d1a15;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.54);
}

.consent-banner h2 {
  margin: 6px 0 7px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
}

.consent-banner div > p:last-child {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.consent-banner a {
  color: var(--mint-pale);
}

.consent-actions {
  display: flex;
  gap: 8px;
}

.consent-actions button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(13, 13, 10, 0.46);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.consent-actions button:last-child {
  border-color: transparent;
  background: var(--mint);
  color: #0b1714;
  font-weight: 700;
}

.eyebrow,
.live-match-title span,
.goal-caption,
.wall-count span,
.combatant small,
.combatant-walls span,
.turn-indicator,
.inline-rules b {
  font-size: max(9px, 0.6rem);
}

.match-label,
.move-list li,
.orientation-button small {
  font-size: max(10px, 0.625rem);
}

.inline-rules p {
  font-size: 11px;
}

@media (min-width: 821px) and (max-height: 920px) {
  .game-view {
    padding-top: 10px;
  }

  .game-intro {
    grid-template-columns: 190px 1fr;
    margin-bottom: 7px;
    padding-block: 0 8px;
  }

  .game-intro h1 {
    font-size: 29px;
  }

  .game-intro div > p {
    display: none;
  }

  .board-zoom-viewport,
  .wall-tray {
    width: min(
      calc(51vh * var(--board-scale, 1)),
      calc(640px * var(--board-scale, 1)),
      calc((100vw - 430px) * var(--board-scale, 1)),
      100%
    );
    min-width: 380px;
  }

  .wall-tray {
    min-height: 62px;
    margin-top: 6px;
    padding: 7px;
  }

  .orientation-button {
    min-height: 46px;
  }

  .wall-sample.vertical {
    height: 38px;
  }

  .game-sidebar {
    padding-top: 48px;
  }
}

@media (max-width: 820px) {
  .game-intro {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 8px;
    padding: 4px 0 12px;
  }

  .game-intro h1 {
    font-size: clamp(27px, 7vw, 38px);
  }

  .game-intro div > p {
    margin-top: 6px;
    font-size: 12px;
  }

  .seo-content {
    padding-top: 64px;
  }

  .content-lede,
  .guide-heading,
  .device-guide,
  .strategy-notes,
  .faq-section {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .rule-ledger {
    grid-template-columns: 1fr;
  }

  .rule-ledger li {
    min-height: 0;
  }

  .rule-ledger li + li {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .guide-section {
    padding-top: 72px;
  }

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

  .guide-columns article {
    min-height: 0;
  }

  .device-guide {
    gap: 22px;
    margin-bottom: 66px;
  }

  .feature-band {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .feature-band ul {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 18px;
  }

  .feature-band li:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .strategy-notes {
    gap: 36px;
    padding-block: 76px 66px;
  }

  .faq-section {
    padding-top: 44px;
  }

  .play-cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .privacy-note {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 520px) {
  .seo-content {
    width: calc(100% - 32px);
    padding-block: 54px 52px;
  }

  .content-lede h2 {
    font-size: 36px;
  }

  .game-figure-grid {
    grid-template-columns: 1fr;
    margin-top: 36px;
  }

  .game-figure-wide {
    grid-template-columns: 1fr;
    margin-bottom: 60px;
  }

  .game-figure-wide figcaption {
    padding: 20px;
    font-size: 20px;
  }

  .guide-heading h2,
  .device-guide h2 {
    font-size: 34px;
  }

  .rule-ledger li {
    grid-template-columns: 34px 1fr;
    padding: 22px 8px;
  }

  .feature-band {
    margin-top: 52px;
    padding: 24px 20px;
  }

  .feature-band ul {
    grid-template-columns: 1fr 1fr;
  }

  .feature-band li {
    min-height: 70px;
    padding-left: 12px;
  }

  .strategy-list article {
    grid-template-columns: 52px 1fr;
    gap: 14px;
    padding: 17px 0;
  }

  .strategy-list p {
    grid-column: 2;
  }

  .play-cta {
    padding: 24px 20px;
  }

  .play-cta button {
    width: 100%;
    min-width: 0;
  }

  footer {
    min-height: 112px;
    flex-direction: column;
    gap: 14px;
    padding-block: 20px;
  }

  footer nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 16px;
  }

  .consent-banner {
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
  }

  .consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.language-switcher {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(33, 29, 23, 0.7);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.language-switcher a {
  color: var(--muted);
  text-decoration: none;
  transition: color 140ms var(--ease-ui);
}

.language-switcher a:hover {
  color: var(--ink);
}

.language-switcher a[aria-current="page"] {
  color: var(--mint-pale);
  font-weight: 700;
}

html[lang^="zh"] body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", var(--body);
}

html[lang^="zh"] h1,
html[lang^="zh"] h2,
html[lang^="zh"] h3,
html[lang^="zh"] .brand,
html[lang^="zh"] .live-match-title strong,
html[lang^="zh"] .combatant strong {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", var(--display);
}

@media (max-width: 520px) {
  .launch-strip {
    padding-inline: 10px;
    font-size: 9px;
  }

  .site-header {
    padding-inline: 10px;
  }

  .header-status {
    gap: 7px;
  }

  .language-switcher {
    min-height: 44px;
    gap: 2px;
    padding-inline: 4px;
    font-size: 11px;
  }

  .language-switcher a {
    display: inline-flex;
    min-width: 36px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .strip-button {
    min-height: 44px;
    padding-inline: 14px;
    font-size: 12px;
  }

  .home-view,
  .game-view {
    width: calc(100% - 12px);
  }

  .game-intro {
    padding-inline: 4px;
  }

  .game-intro h1 {
    font-size: clamp(30px, 8vw, 38px);
    line-height: 1.08;
  }

  .game-intro div > p {
    font-size: 13px;
    line-height: 1.6;
  }

  .live-match-title strong {
    font-size: 17px;
  }

  .board-frame {
    padding: 5px;
    border-width: 3px;
  }

  .wall-tray {
    min-height: 72px;
  }

  .wall-count span {
    font-size: 10px;
  }

  .wall-count strong {
    font-size: 29px;
  }

  .game-actions button {
    min-height: 48px;
    font-size: 12px;
  }

  .inline-rules p {
    min-height: 44px;
    font-size: 12px;
  }

  .inline-rules b {
    min-width: 40px;
    font-size: 10px;
  }

  .combatant strong {
    font-size: 15px;
  }

  .turn-indicator,
  .move-list li {
    font-size: 10px;
  }

  .seo-content {
    width: calc(100% - 24px);
  }

  .content-lede div > p,
  .rule-ledger p,
  .guide-heading p,
  .guide-columns p,
  .device-guide div > p,
  .strategy-notes > div > p,
  .strategy-list p,
  .faq-list p {
    font-size: 14px;
  }

  .faq-list summary {
    font-size: 17px;
  }
}
