@font-face {
  font-family: Vazirmatn;
  src: url("/fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --paper: #f6f3ea;
  --surface: #fffdf8;
  --ink: #203c32;
  --muted: #627065;
  --green: #174c3c;
  --green-hover: #103b2e;
  --felt: #245d4b;
  --line: #d9ddd0;
  --lime: #e0ecab;
  --orange: #c2643b;
  --danger: #a23830;
  --radius: 14px;
  --space: 24px;
  --shadow: 0 12px 28px #00000012;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.85;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-underline-offset: 5px;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}
::selection {
  background: var(--lime);
  color: var(--green);
}
input {
  caret-color: var(--green);
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.2rem, 4.3vw, 3.7rem);
  font-weight: 850;
  line-height: 1.5;
  letter-spacing: -0.025em;
}
h2 {
  font-size: 1.45rem;
  line-height: 1.6;
}
h3 {
  font-size: 1rem;
}
p {
  max-width: 70ch;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.site-header,
.site-footer,
main {
  width: min(1240px, calc(100% - 80px));
  margin-inline: auto;
}
.site-header {
  min-height: 106px;
  display: flex;
  align-items: center;
  gap: 60px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 28px;
  font-weight: 850;
  line-height: 1.3;
}
.brand svg {
  width: 37px;
  height: 37px;
  fill: var(--green);
}
.brand-caption {
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin-top: 5px;
  color: var(--muted);
}
nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
}
nav a {
  text-decoration: none;
}
nav a:hover {
  color: var(--orange);
}
.header-note {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 13px;
}
.header-account {
  margin-inline-start: auto;
  color: var(--green);
  font-weight: 650;
  max-width: 240px;
  overflow-wrap: anywhere;
}
.membership-note {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
}
.membership-note a {
  color: var(--green);
}
.auth-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
  padding-block: 20px;
}
.auth-copy {
  padding-block: 28px;
}
.auth-copy h1 {
  max-width: 11ch;
}
.auth-copy > p {
  margin-block: 18px;
  max-width: 43ch;
  color: var(--muted);
}
.account-benefits {
  padding-inline-start: 22px;
  margin-block: 28px 34px;
}
.account-benefits li + li {
  margin-top: 14px;
}
.auth-form-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}
.auth-form-panel > .muted {
  margin-top: 6px;
}
.auth-form-panel .form {
  margin-top: 24px;
}
.auth-form-panel .form .field-note {
  margin-top: -5px;
}
.account-check {
  display: flex;
  gap: 10px;
  align-items: start;
  font-size: 13px;
  margin-block: 8px;
  cursor: pointer;
}
.account-check input {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 3px;
  accent-color: var(--green);
}
.auth-switch {
  margin-block: 20px 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.account-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}
.account-welcome {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.account-welcome h1 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  overflow-wrap: anywhere;
}
.account-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 50%;
  color: var(--green);
  background: var(--lime);
}
.account-mark svg {
  width: 38px;
  height: 38px;
}
.account-mark svg,
.avatar svg,
.avatar-picker svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.avatar svg {
  width: 26px;
  height: 26px;
}
.account-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: none;
}
.account-tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--line);
}
.account-tab {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 12px 2px;
  color: var(--muted);
  font-weight: 650;
}
.account-tab[aria-selected="true"] {
  color: var(--green);
  border-bottom-color: var(--green);
}
.account-tab:hover {
  color: var(--green);
}
.account-panel {
  padding-block: 28px;
  min-height: 380px;
}
.account-panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.account-stats {
  margin-block: 12px 24px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.account-stats span {
  margin-inline: 8px;
}
.account-description {
  margin-block: 10px 24px;
}
.account-empty {
  padding-block: 36px 50px;
  max-width: 55ch;
}
.account-empty p {
  color: var(--muted);
  margin-block: 12px 24px;
}
.member-room-list,
.game-history-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}
.member-room-list li,
.game-history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
}
.history-game {
  min-width: 0;
  overflow-wrap: anywhere;
}
.history-game h3 {
  display: flex;
  align-items: center;
  gap: 16px;
}
.history-game p {
  margin-top: 4px;
}
.history-date {
  display: flex;
  align-items: end;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  flex: none;
}
.result-tag {
  font-size: 12px;
  padding: 1px 10px;
  border-radius: 20px;
  font-weight: 650;
}
.result-win {
  color: var(--green);
  background: var(--lime);
}
.result-loss {
  color: var(--danger);
  background: var(--paper);
}
.result-draw {
  color: var(--ink);
  background: var(--line);
}
.account-pagination {
  display: flex;
  justify-content: center;
  gap: 20px;
  align-items: center;
  margin-block: 28px;
}
.profile-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}
.profile-layout .form {
  max-width: 430px;
}
.password-section {
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 48px;
}
.avatar-picker {
  border: 0;
  padding: 0;
  margin: 8px 0 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.avatar-picker legend {
  margin-bottom: 12px;
}
.avatar-picker label {
  position: relative;
  cursor: pointer;
}
.avatar-picker input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.avatar-picker label > span {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.avatar-picker input:checked + span {
  border-color: var(--green);
  background: var(--lime);
}
.avatar-picker input:focus-visible + span {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}
.avatar-picker svg {
  width: 24px;
  height: 24px;
  flex: none;
}
.account-success {
  color: var(--green);
}
.bot-player .avatar svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bot-badge {
  display: inline-block;
  color: var(--green);
  background: var(--lime);
  padding: 0 7px;
  border-radius: 8px;
  font-size: 11px;
  margin-block: 3px;
}
.bot-remove {
  min-height: 40px;
}
.bot-manager {
  text-align: start;
  border-block: 1px solid var(--line);
  padding-block: 22px;
  margin-block: 24px;
}
.bot-manager-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.bot-manager-heading > span {
  color: var(--muted);
  font-size: 12px;
}
.waiting-panel .bot-manager p {
  margin: 10px 0 0;
  text-align: start;
  font-size: 13px;
  max-width: 65ch;
}
.bot-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-block: 18px;
}
.bot-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.bot-controls select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 46px;
  min-width: 120px;
  padding: 8px 12px;
  cursor: pointer;
}
.bot-controls select:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}
.bot-controls select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.waiting-panel .bot-manager .field-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}
.bot-table-note {
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 720px) {
  .bot-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: 12px;
  }
  .bot-controls > .outline {
    grid-column: 1 / -1;
  }
  .bot-controls select {
    width: 100%;
    min-width: 0;
  }
  .bot-controls .btn {
    padding-inline: 12px;
    font-size: 12px;
  }
  .bot-manager-heading {
    align-items: start;
  }
  .waiting-panel .bot-manager p {
    font-size: 12px;
  }
}
.classic-mini {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: none;
  color: var(--green);
}
.classic-mini svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.classic-preview {
  width: 100%;
  min-width: 0;
  pointer-events: none;
}
.classic-preview .chess-board,
.classic-preview .ludo-board,
.classic-preview .snakes-board {
  width: 100%;
  border-radius: 8px;
}
.classic-preview .ludo-base > span {
  display: none;
}
.classic-preview .race-token {
  width: 15px;
  height: 15px;
  font-size: 9px;
}
.classic-preview .square-coordinate,
.classic-preview .snake-number,
.classic-preview .transport-target {
  display: none;
}
.classic-game {
  margin-top: 24px;
}
.classic-game button {
  touch-action: manipulation;
}
.color-0 {
  --player-color: #ae4032;
  --player-light: #f8e7df;
}
.color-1 {
  --player-color: #237052;
  --player-light: #e7f0e3;
}
.color-2 {
  --player-color: #80600c;
  --player-light: #f4e5af;
}
.color-3 {
  --player-color: #366a98;
  --player-light: #e5edf6;
}
.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: min(100%, 560px);
  aspect-ratio: 1;
  margin-inline: auto;
  overflow: hidden;
  border: 6px solid var(--green);
  border-radius: 8px;
}
.chess-square {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  min-width: 0;
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
}
.chess-square.light {
  background: #f2eedf;
}
.chess-square.dark {
  background: #9aaa8a;
}
.chess-square:disabled {
  opacity: 1;
  cursor: default;
}
.chess-square:not(:disabled):hover {
  background: var(--lime);
}
.chess-square.selected {
  outline: 3px solid var(--orange);
  outline-offset: -3px;
}
.chess-square.last-chess:not(.selected) {
  background: var(--lime);
}
.chess-square:focus-visible {
  outline-offset: -4px;
  z-index: 2;
}
.chess-piece {
  width: 94%;
  height: 94%;
  object-fit: contain;
  pointer-events: none;
}
.square-coordinate {
  position: absolute;
  inset-block-end: 1px;
  inset-inline-start: 3px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.2;
  pointer-events: none;
}
.chess-target {
  position: absolute;
  width: 22%;
  height: 22%;
  border-radius: 50%;
  background: var(--green);
  pointer-events: none;
}
.chess-piece + .square-coordinate + .chess-target {
  width: 88%;
  height: 88%;
  background: none;
  border: 3px solid var(--green);
}
.chess-orientation {
  width: min(100%, 560px);
  margin: 0 auto 10px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.chess-help {
  width: min(100%, 560px);
  margin-inline: auto;
  line-height: 1.8;
}
.promotion-choice {
  width: min(100%, 560px);
  margin: 20px auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.promotion-choice > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.promotion-choice img {
  width: 28px;
  height: 28px;
}
.chess-controls {
  display: flex;
  gap: 20px;
  align-items: center;
  width: min(100%, 560px);
  margin: 16px auto 0;
}
.resign-confirm {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
}
.ludo-board {
  width: min(100%, 600px);
  aspect-ratio: 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  gap: 0;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.ludo-cell {
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: var(--surface);
}
.ludo-cell.home-lane,
.ludo-cell.start-square {
  background: var(--player-light);
}
.safe-square > span {
  display: block;
  width: 55%;
  height: 55%;
  border-radius: 50%;
  border: 2px solid var(--player-color, var(--muted));
}
.ludo-base {
  margin: 0;
  border: 8px solid var(--player-light);
  border-radius: 8px;
  background: var(--paper);
  position: relative;
}
.ludo-base > span {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--player-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px;
  font-weight: 650;
}
.ludo-base.unused-base {
  --player-light: var(--paper);
  --player-color: var(--muted);
  background: var(--paper);
}
.ludo-base.unused-base > span {
  font-size: 10px;
}
.ludo-center {
  grid-row: 7 / span 3;
  grid-column: 7 / span 3;
  width: 100%;
  height: 100%;
}
.center-0 {
  fill: #ae4032;
}
.center-1 {
  fill: #237052;
}
.center-2 {
  fill: #b49739;
}
.center-3 {
  fill: #366a98;
}
.race-token {
  position: absolute;
  z-index: 2;
  transform: translate(
    calc(-50% + var(--token-dx, 0px)),
    calc(-50% + var(--token-dy, 0px))
  );
  width: clamp(17px, 3vw, 25px);
  height: clamp(17px, 3vw, 25px);
  padding: 0;
  display: grid;
  place-items: center;
  line-height: 1;
  border-radius: 50%;
  color: white;
  background: var(--player-color);
  border: 1.5px solid var(--surface);
  font-size: 12px;
  font-weight: 750;
}
.movable-token {
  cursor: pointer;
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  z-index: 3;
}
.finish-count {
  position: absolute;
  z-index: 3;
  width: clamp(12px, 2vw, 18px);
  height: clamp(12px, 2vw, 18px);
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  background: var(--player-color);
  border: 1px solid var(--surface);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.movable-token:hover {
  outline-width: 3px;
}
.race-board-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-block: 12px 18px;
}
.dice-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding-block: 18px;
  border-top: 1px solid var(--line);
}
.die-result {
  flex: none;
}
.game-die {
  width: 54px;
  height: 54px;
  color: var(--green);
  display: block;
}
.game-die rect {
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 1.2;
}
.game-die circle {
  fill: currentColor;
}
.game-die path {
  stroke: var(--muted);
  stroke-width: 2;
}
.dice-copy {
  flex: 1;
  min-width: 0;
}
.dice-copy strong {
  font-size: 14px;
}
.dice-copy p {
  font-size: 12px;
  color: var(--muted);
}
.dice-panel .btn {
  flex: none;
}
.ludo-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.ludo-choices .btn {
  display: flex;
  flex-direction: column;
  padding-block: 10px;
  gap: 0;
}
.ludo-choices .btn > span {
  font-size: 12px;
  font-weight: 400;
}
.snakes-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  position: relative;
  isolation: isolate;
  width: min(100%, 600px);
  aspect-ratio: 1;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.snake-cell {
  position: relative;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 2px;
  background: var(--surface);
  min-width: 0;
}
.snake-cell.alternate {
  background: var(--paper);
}
.snake-cell.ladder-start {
  background: #e7f0e3;
}
.snake-cell.snake-start {
  background: #f8e7df;
}
.snake-cell.last-race {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}
.snake-number {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-start: 3px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
  z-index: 2;
}
.transport-target {
  position: absolute;
  inset-block-end: 1px;
  inset-inline-end: 3px;
  color: var(--green);
  font-size: 10px;
  font-weight: 650;
  z-index: 2;
  background: var(--surface);
  border-radius: 2px;
  padding-inline: 2px;
}
.snake-start .transport-target {
  color: var(--danger);
}
.transport-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.transport-line {
  fill: none;
  stroke-width: 0.6;
  opacity: 0.55;
}
.transport-line.up {
  stroke: #237052;
}
.transport-line.down {
  stroke: #ae4032;
}
.transport-map marker:first-child path {
  fill: #237052;
}
.transport-map marker:last-child path {
  fill: #ae4032;
}
.snake-occupants {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: absolute;
  inset: 10px 1px 1px;
  z-index: 3;
}
.snake-token {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  background: var(--player-color);
  color: white;
  border-radius: 50%;
  border: 1px solid var(--surface);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
}
.off-board {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.start-player {
  display: flex;
  align-items: center;
  gap: 6px;
}
.transport-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.transport-legend h3 {
  font-size: 13px;
}
.transport-legend p {
  font-size: 12px;
  line-height: 2.2;
  margin-top: 6px;
  color: var(--muted);
}
@media (max-width: 720px) {
  .classic-mini {
    width: 32px;
    height: 32px;
  }
  .classic-game {
    margin-top: 18px;
  }
  .chess-board {
    border-width: 3px;
  }
  .chess-help {
    font-size: 12px;
  }
  .ludo-base {
    border-width: 5px;
  }
  .ludo-base > span {
    font-size: 10px;
    padding: 2px;
  }
  .race-token {
    font-size: 10px;
    border-width: 1px;
  }
  .safe-square > span {
    border-width: 1px;
  }
  .dice-panel {
    gap: 12px;
    flex-wrap: wrap;
  }
  .dice-copy {
    min-width: 180px;
  }
  .dice-panel > .btn {
    width: 100%;
  }
  .dice-copy p {
    font-size: 12px;
  }
  .game-die {
    width: 44px;
    height: 44px;
  }
  .race-board-note {
    font-size: 11px;
  }
  .snake-number {
    font-size: 10px;
    inset-block-start: 1px;
    inset-inline-start: 2px;
  }
  .transport-target {
    font-size: 9px;
    inset-inline-end: 0;
    padding: 0;
  }
  .snake-token {
    width: 13px;
    height: 13px;
    font-size: 9px;
  }
  .snake-occupants {
    inset-block-start: 8px;
  }
  .transport-legend {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
@media (max-width: 760px) {
  .header-account {
    font-size: 12px;
    max-width: 120px;
  }
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0;
  }
  .auth-copy {
    padding: 0;
  }
  .auth-copy h1 {
    max-width: none;
    font-size: 2rem;
  }
  .auth-copy > p {
    margin-block: 12px;
  }
  .account-benefits {
    display: none;
  }
  .auth-form-panel {
    padding: 24px;
  }
  .account-heading {
    align-items: start;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 20px;
  }
  .account-mark {
    width: 52px;
    height: 52px;
  }
  .account-mark svg {
    width: 28px;
    height: 28px;
  }
  .account-welcome {
    gap: 12px;
  }
  .account-tabs {
    gap: 20px;
  }
  .account-tab {
    font-size: 13px;
  }
  .account-panel-title h2 {
    font-size: 1.2rem;
  }
  .account-stats {
    font-size: 13px;
  }
  .account-stats span {
    margin-inline: 4px;
  }
  .game-history-list li {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }
  .history-date {
    align-items: start;
    gap: 4px;
  }
  .member-room-list li {
    gap: 12px;
  }
  .member-room-list .btn {
    font-size: 12px;
    padding-inline: 12px;
    flex: none;
  }
  .profile-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .password-section {
    padding: 28px 0 0;
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }
  .avatar-picker label > span {
    gap: 6px;
    padding: 8px;
    font-size: 13px;
  }
}
main {
  min-height: calc(100dvh - 200px);
  padding-block: 42px 64px;
}
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
}
.skip-link {
  position: fixed;
  inset-block-start: 0;
  transform: translateY(-140%);
  inset-inline-start: 20px;
  background: var(--surface);
  padding: 10px;
  z-index: 30;
}
.skip-link:focus {
  transform: translateY(0);
  inset-block-start: 10px;
}
.intro {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: end;
  margin-bottom: 32px;
}
.intro p {
  color: var(--muted);
  margin-top: 6px;
  font-size: 16px;
}
.intro-aside {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 8px;
  white-space: nowrap;
  font-size: 13px;
}
.online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  margin-inline-end: 7px;
}
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 32px;
  align-items: start;
}
.library {
  min-width: 0;
}
.game-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.game-tab {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: start;
  color: var(--muted);
  min-height: 84px;
}
.game-tab[aria-selected="true"] {
  color: var(--green);
  border-color: var(--green);
}
.game-tab:hover {
  background: #e9ecdf;
}
.tab-name {
  font-size: 17px;
  font-weight: 750;
  display: block;
}
.tab-duration {
  font-size: 11px;
  white-space: nowrap;
}
.mini-board {
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(var(--cols), 1fr);
  width: 45px;
  height: 45px;
  flex-shrink: 0;
  direction: ltr;
}
.mini-board span {
  background: var(--line);
  border-radius: 2px;
  position: relative;
}
.mini-board .p1 {
  background: var(--green);
}
.mini-board .p2 {
  background: var(--orange);
}
.mini-board.connect-four span,
.mini-board.reversi span {
  border-radius: 50%;
}
.showcase {
  background: var(--green);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 28px;
  min-height: 320px;
  align-items: center;
  overflow: hidden;
}
.showcase h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
}
.showcase p {
  font-size: 14px;
  color: #d1dfcd;
  line-height: 2;
}
.showcase-meta {
  margin-top: 36px;
  font-size: 12px;
  color: #d1dfcd;
}
.showcase .board {
  box-shadow: none;
  pointer-events: none;
  background: var(--felt);
  padding: 12px;
}
.showcase .cell {
  min-height: 0;
}
.showcase .preview-tic {
  gap: 7px;
}
.showcase .preview-tic .cell {
  background: #ffffff0d;
}
.showcase .piece.cross:before,
.showcase .piece.cross:after {
  background: var(--lime);
}
.showcase .piece.ring {
  border-color: #e9b88e;
}
.showcase .cell .piece.disk.one {
  background: var(--lime);
}
.showcase .cell .piece.disk.two {
  background: #e9b88e;
}
.preview-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
  text-align: end;
}
.entry-panel {
  background: var(--surface);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.entry-panel h2 {
  margin-bottom: 4px;
}
.entry-panel p {
  font-size: 13px;
  color: var(--muted);
}
.form {
  margin-top: 22px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 7px;
}
input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 11px 14px;
  color: var(--ink);
  border-radius: 8px;
  min-height: 48px;
}
input::placeholder {
  color: #68746a;
  font-weight: 400;
}
input:hover {
  border-color: #9aab99;
}
input:focus {
  border-color: var(--green);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  padding: 12px 20px;
  min-height: 48px;
  background: var(--green);
  color: var(--surface);
  font-weight: 650;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.18s ease;
}
.btn:hover:enabled {
  background: var(--green-hover);
}
.btn.secondary {
  background: #e9eddf;
  color: var(--green);
}
.btn.secondary:hover:enabled {
  background: #dce4ce;
}
.btn.outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--green);
}
.btn.outline:hover:enabled {
  background: #e9eddf;
}
.btn.text {
  padding: 5px 0;
  background: none;
  color: var(--muted);
  min-height: 32px;
  font-size: 12px;
}
.btn.full {
  width: 100%;
  margin-top: 14px;
}
.btn.text:hover:enabled {
  background: transparent;
  color: var(--green);
  text-decoration: underline;
}
.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.field-note {
  font-size: 11px !important;
  margin-top: 9px !important;
}
.join-section {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 22px;
}
.join-section .form {
  margin-top: 12px;
}
.inline-form {
  display: flex;
  gap: 8px;
}
.inline-form input {
  min-width: 0;
  flex: 1;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
}
.inline-form button {
  flex-shrink: 0;
}
.error {
  color: var(--danger) !important;
  line-height: 1.8;
  font-size: 13px;
  margin-top: 10px;
  min-height: 0;
}
.rules-preview {
  margin-top: 30px;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.rules-preview h3 {
  font-size: 15px;
}
.rules-preview p {
  font-size: 13px;
  color: var(--muted);
}
.rules-preview a {
  font-size: 12px;
  display: inline-block;
  margin-top: 6px;
}
.resume {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.room-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.room-heading h1 {
  font-size: 30px;
}
.room-heading .subline {
  font-size: 12px;
  color: var(--muted);
}
.room-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}
.code-label {
  font-size: 11px;
  color: var(--muted);
}
.room-code {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 0.13em;
  font-variant-numeric: tabular-nums;
}
.connection {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.connection.offline {
  color: var(--danger);
}
.connection.offline .online-dot {
  background: var(--danger);
}
.room-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}
.arena {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.players {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
.player {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.player:last-child {
  justify-content: end;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e6ebdf;
  font-size: 15px;
  font-weight: 750;
  flex-shrink: 0;
}
.player.active .avatar {
  background: var(--green);
  color: var(--paper);
}
.player-name {
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
  max-width: 180px;
}
.player-caption {
  font-size: 11px;
  color: var(--muted);
}
.versus {
  color: #778272;
  font-size: 11px;
  padding: 0 8px;
  white-space: nowrap;
}
.status-strip {
  background: #e9eddf;
  border-radius: 8px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  min-height: 58px;
}
.status-strip.my-turn {
  background: var(--green);
  color: var(--paper);
}
.status-main {
  font-size: 15px;
  font-weight: 750;
}
.status-detail {
  font-size: 11px;
  opacity: 0.85;
}
.status-strip.finished {
  background: var(--lime);
  color: var(--green);
}
.board-wrap {
  width: min(100%, 440px);
  margin: auto;
}
.board {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 6px;
  direction: ltr;
  aspect-ratio: var(--ratio, 1);
  padding: 14px;
  background: #e3e9db;
  border-radius: 12px;
  position: relative;
}
.board.connect-four {
  background: var(--green);
  gap: 8px;
  --ratio: 7/6;
}
.board.reversi {
  background: var(--green);
  gap: 3px;
  padding: 9px;
}
.cell {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--surface);
  border-radius: 5px;
  opacity: 1 !important;
}
.cell:disabled {
  cursor: default;
}
.cell.legal {
  cursor: pointer;
}
.cell.legal:hover {
  background: #dce5cc;
}
.cell.legal:after {
  content: "";
  width: 11%;
  height: 11%;
  border-radius: 50%;
  background: #66866d;
  position: absolute;
}
.cell.last {
  outline: 2px solid var(--orange);
  outline-offset: -3px;
}
.cell.winning {
  background: var(--lime);
}
.connect-four .cell {
  border-radius: 50%;
  background: var(--paper);
}
.connect-four .cell.legal:after {
  background: var(--orange);
}
.connect-four .cell.legal:hover {
  background: #f0d9c3;
}
.connect-four .cell.column-target {
  cursor: pointer;
}
.connect-four .cell.column-target:hover {
  background: #f0d9c3;
}
.local-invite-note {
  max-width: none;
  padding: 12px 16px;
  margin-bottom: 22px;
  background: #e9eddf;
  color: var(--green);
  border-radius: 8px;
  font-size: 12px;
}
.reversi .cell {
  background: var(--felt);
  border-radius: 2px;
}
.reversi .cell.legal:hover {
  background: #37745e;
}
.reversi .cell.legal:after {
  background: #b5cf9e;
  width: 14%;
  height: 14%;
}
.piece {
  display: block;
  width: 65%;
  height: 65%;
  position: relative;
}
.piece.cross:before,
.piece.cross:after {
  content: "";
  position: absolute;
  width: 12%;
  height: 100%;
  background: var(--green);
  left: 44%;
  border-radius: 3px;
  transform: rotate(45deg);
}
.piece.cross:after {
  transform: rotate(-45deg);
}
.piece.ring {
  border: clamp(4px, 0.55vw, 8px) solid var(--orange);
  border-radius: 50%;
  width: 59%;
  height: 59%;
}
.piece.disk {
  border-radius: 50%;
  width: 82%;
  height: 82%;
  box-shadow: 0 2px 3px #00000026;
}
.piece.disk.one {
  background: var(--orange);
}
.piece.disk.two {
  background: var(--green);
}
.reversi .piece.disk.one {
  background: #142d25;
}
.reversi .piece.disk.two {
  background: #f0f0db;
}
.cell.new-piece .piece {
  animation: place-piece 0.35s var(--ease);
}
@keyframes place-piece {
  from {
    transform: scale(0.65) rotateY(80deg);
  }
  to {
    transform: scale(1) rotateY(0);
  }
}
.board-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
}
.turn-note {
  font-size: 12px;
  color: var(--orange);
  margin-top: 14px;
}
.waiting-panel {
  text-align: center;
  padding: 20px 10px;
}
.waiting-panel h2 {
  font-size: 21px;
  margin-block: 8px;
}
.waiting-panel p {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
  max-width: 40ch;
}
.waiting-pieces {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px;
}
.waiting-pieces span {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--green);
}
.waiting-pieces span:last-child {
  background: none;
  border: 2px dashed #9daa95;
}
.waiting-panel .invite-link {
  margin: 24px auto 14px;
  max-width: 420px;
  display: flex;
  gap: 8px;
}
.invite-link input {
  font-size: 11px;
  text-align: left;
  direction: ltr;
  min-width: 0;
}
.invite-link .btn {
  font-size: 12px;
  white-space: nowrap;
}
.room-join {
  max-width: 360px;
  margin: 25px auto 0;
  text-align: start;
}
.room-join .form {
  margin-top: 12px;
}
.result {
  margin-top: 22px;
  text-align: center;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.result p {
  font-size: 12px;
  color: var(--muted);
  margin: auto;
}
.result .btn {
  margin-top: 12px;
}
.room-sidebar {
  min-width: 0;
}
.rulebook {
  padding: 22px 0;
  border-block: 1px solid var(--line);
}
.rulebook h2 {
  font-size: 19px;
  margin-bottom: 16px;
}
.rulebook ol {
  padding-inline-start: 22px;
  margin: 0;
}
.rulebook li {
  font-size: 13px;
  margin-bottom: 12px;
  color: var(--muted);
  padding-inline-start: 5px;
}
.rulebook li::marker {
  color: var(--green);
  font-weight: 750;
}
.win-condition {
  margin-top: 18px;
  padding: 16px;
  background: #e8eddc;
  border-radius: 8px;
  font-size: 13px;
  color: var(--green);
}
.win-condition strong {
  display: block;
  margin-bottom: 4px;
}
.identity {
  font-size: 12px;
  margin-bottom: 20px;
  line-height: 1.9;
}
.identity strong {
  color: var(--green);
}
.history {
  margin-top: 28px;
}
.history summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  min-height: 40px;
}
.history ol {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  max-height: 260px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #a6b69c transparent;
}
.history li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
  padding-block: 8px;
}
.history .empty {
  font-size: 12px;
  color: var(--muted);
}
.room-bottom {
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.toast {
  position: fixed;
  inset-block-end: 24px;
  inset-inline: 24px;
  margin: auto;
  max-width: 460px;
  background: var(--green);
  color: var(--paper);
  padding: 15px 24px;
  box-shadow: var(--shadow);
  border-radius: 10px;
  z-index: 20;
  font-size: 13px;
}
.initial-loading {
  padding-block: 90px;
  text-align: center;
  max-width: none;
  color: var(--muted);
}
.recover {
  max-width: 500px;
  margin: 60px auto;
  text-align: center;
}
.recover p {
  margin: 15px auto;
  color: var(--muted);
}
.recover .btn {
  margin-top: 12px;
}
.danger-text {
  color: var(--danger) !important;
}
.reconnect-banner {
  background: #f4e2ca;
  color: #744120;
  font-size: 12px;
  padding: 10px 16px;
  margin-bottom: 20px;
  border-radius: 8px;
}
.score-count {
  font-variant-numeric: tabular-nums;
}
.spectator-note {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
@media (min-width: 1500px) {
  main {
    padding-top: 54px;
  }
  .showcase {
    min-height: 350px;
  }
}
@media (max-width: 1000px) {
  .site-header,
  .site-footer,
  main {
    width: calc(100% - 48px);
  }
  .site-header {
    gap: 35px;
  }
  .home-layout {
    gap: 24px;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr);
  }
  .showcase {
    grid-template-columns: 1fr;
    padding: 24px;
    gap: 20px;
  }
  .showcase-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 16px;
  }
  .showcase-copy h2 {
    margin: 0;
    font-size: 26px;
  }
  .showcase-meta {
    display: none;
  }
  .showcase .board {
    width: 220px;
    justify-self: center;
  }
  .entry-panel {
    padding: 24px;
  }
  .game-tab {
    padding-inline: 6px;
    gap: 8px;
  }
  .mini-board {
    width: 34px;
    height: 34px;
  }
  .tab-name {
    font-size: 15px;
  }
  .tab-duration {
    font-size: 11px;
  }
  .room-layout {
    grid-template-columns: minmax(0, 1fr) 265px;
    gap: 24px;
  }
  .arena {
    padding: 22px;
  }
  .room-tools {
    gap: 8px;
  }
  .header-note {
    display: none;
  }
}
@media (max-width: 720px) {
  .site-header,
  .site-footer,
  main {
    width: calc(100% - 32px);
  }
  .site-header {
    min-height: 82px;
    justify-content: space-between;
    gap: 12px;
  }
  .brand {
    font-size: 24px;
  }
  .brand svg {
    width: 30px;
    height: 30px;
  }
  .brand-caption {
    font-size: 11px;
  }
  nav {
    gap: 16px;
    font-size: 12px;
  }
  main {
    padding-block: 28px 40px;
  }
  .intro {
    display: block;
    margin-bottom: 24px;
  }
  .intro h1 {
    font-size: 35px;
  }
  .intro p {
    font-size: 13px;
    max-width: 36ch;
  }
  .intro-aside {
    margin-top: 18px;
    font-size: 11px;
    padding: 0;
  }
  .home-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .game-tab {
    min-height: 72px;
    padding: 6px 4px 12px;
    gap: 8px;
    justify-content: center;
  }
  .mini-board {
    width: 32px;
    height: 32px;
  }
  .tab-duration {
    font-size: 11px;
  }
  .tab-name {
    font-size: 14px;
  }
  .showcase {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 22px;
    min-height: 240px;
  }
  .showcase-copy {
    display: block;
  }
  .showcase-copy h2 {
    font-size: 26px;
    margin-bottom: 10px;
  }
  .showcase p {
    font-size: 11px;
  }
  .showcase .board {
    width: 100%;
    padding: 8px;
    gap: 4px;
  }
  .showcase .board.reversi {
    gap: 2px;
    padding: 5px;
  }
  .showcase-meta {
    display: block;
    margin-top: 22px;
    font-size: 11px;
  }
  .preview-note {
    font-size: 11px;
  }
  .rules-preview {
    grid-template-columns: 85px 1fr;
    gap: 15px;
    margin-top: 22px;
  }
  .rules-preview p {
    font-size: 12px;
  }
  .entry-panel {
    padding: 24px;
  }
  .entry-panel h2 {
    font-size: 21px;
  }
  .room-heading {
    align-items: start;
    gap: 12px;
    flex-wrap: wrap;
  }
  .room-heading h1 {
    font-size: 24px;
  }
  .room-tools {
    flex-wrap: wrap;
    justify-content: start;
    width: 100%;
  }
  .room-tools .btn {
    font-size: 11px;
    min-height: 38px;
    padding: 6px 12px;
  }
  .room-code {
    font-size: 16px;
  }
  .connection {
    margin-inline-start: auto;
  }
  .room-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .arena {
    padding: 18px;
  }
  .players {
    gap: 6px;
  }
  .avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  .player {
    gap: 8px;
  }
  .player-name {
    font-size: 12px;
    max-width: 110px;
  }
  .player-caption {
    font-size: 11px;
  }
  .versus {
    font-size: 11px;
    padding: 0;
  }
  .status-strip {
    padding: 11px 13px;
  }
  .status-main {
    font-size: 13px;
  }
  .status-detail {
    font-size: 11px;
  }
  .board {
    padding: 10px;
    gap: 5px;
  }
  .piece.ring {
    border-width: 6px;
  }
  .board.reversi {
    padding: 6px;
    gap: 3px;
  }
  .board-caption {
    font-size: 11px;
  }
  .waiting-panel {
    padding: 12px 0;
  }
  .waiting-panel h2 {
    font-size: 19px;
  }
  .waiting-panel .invite-link {
    flex-wrap: wrap;
  }
  .invite-link .btn {
    width: 100%;
  }
  .room-sidebar {
    padding-inline: 4px;
  }
  .rulebook {
    padding-block: 20px;
  }
  .room-bottom {
    margin-top: 16px;
    gap: 8px;
  }
  .room-bottom .small {
    font-size: 11px;
  }
  .site-footer {
    font-size: 11px;
    flex-wrap: wrap;
    gap: 4px;
  }
  .site-footer span {
    display: block;
  }
  .toast {
    inset-inline: 16px;
    inset-block-end: 16px;
  }
  .identity {
    margin-bottom: 16px;
  }
}
.mini-cards {
  width: 36px;
  height: 46px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  transform: rotate(-7deg);
}
.mini-cards svg {
  width: 25px;
  height: 25px;
}
.mini-cards svg,
.playing-card svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  direction: ltr;
  min-width: 0;
  padding: 30px 8px;
}
.card-preview .playing-card {
  width: 100px;
  min-width: 0;
  height: 154px;
}
.card-preview .playing-card:first-child {
  transform: rotate(-12deg) translateY(10px);
}
.card-preview .playing-card:last-child {
  transform: rotate(12deg) translateY(10px);
}
.playing-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 112px;
  height: 164px;
  min-height: 164px;
  flex-shrink: 0;
  padding: 8px;
  background: var(--surface);
  color: var(--green);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.5;
  position: relative;
  overflow: hidden;
}
.card-art {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background-repeat: no-repeat;
  background-position: var(--art-x) var(--art-y, 0%);
  flex-shrink: 0;
}
.farm-art {
  background-image: url("/images/cards/farm.webp");
  background-size: 200% 200%;
}
.treasure-art {
  background-image: url("/images/cards/treasure.webp");
  background-size: 500% 200%;
}
.court-art {
  background-image: url("/images/cards/court.webp");
  background-size: 300% 100%;
}
.illustrated-card .card-corner {
  height: 24px;
  align-self: stretch;
  text-align: start;
}
.illustrated-card[data-suit="hen"] .card-corner,
.illustrated-card[data-suit="rooster"] .card-corner,
.illustrated-card[data-suit="nest"] .card-corner,
.illustrated-card[data-suit="fox"] .card-corner {
  height: 10px;
}
.card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.standard-card {
  color: var(--ink);
  direction: ltr;
  padding: 8px 5px;
}
.standard-card .card-corner {
  position: absolute;
  top: 8px;
  left: 6px;
  z-index: 1;
}
.standard-card .card-corner svg {
  width: 12px;
  height: 12px;
}
.standard-card .card-corner.bottom-corner {
  top: auto;
  left: auto;
  bottom: 8px;
  right: 6px;
  transform: rotate(180deg);
}
.standard-card .card-rank {
  font-size: 16px;
  min-height: 18px;
  align-self: center;
}
.standard-card .card-art,
.card-pips {
  position: relative;
  width: calc(100% - 30px);
  margin: auto;
}
.standard-card .court-art {
  width: calc(100% - 16px);
}
.card-pips {
  height: 116px;
  display: block;
}
.pip {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
}
.playing-card .pip svg {
  width: 18px;
  height: 20px;
}
.playing-card .pip.reversed svg {
  transform: rotate(180deg);
}
.playing-card .ace-pip .pip svg {
  width: 42px;
  height: 48px;
}
.standard-card svg {
  fill: currentColor;
  stroke-width: 0.6;
}
.standard-card .card-name {
  font-size: 11px;
  position: absolute;
  bottom: 5px;
  left: 20px;
  right: 20px;
  text-align: center;
}
.card-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.choice-source {
  font-size: 12px;
  max-width: 112px;
  overflow-wrap: anywhere;
}
.multiplayer-roster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 16px;
  align-items: start;
}
.multiplayer-roster .player:last-child {
  justify-content: start;
}
.multiplayer-roster .player-name {
  max-width: 100%;
}
.player-resources {
  font-size: 12px;
  line-height: 1.8;
  margin-top: 2px;
}
.playing-card svg {
  width: 40px;
  height: 40px;
}
.playing-card.red-card {
  color: var(--danger);
}
.card-rank {
  align-self: flex-start;
  min-height: 20px;
  font-size: 18px;
  font-weight: 800;
}
.card-name {
  font-size: 12px;
  font-weight: 700;
}
.playing-card.compact {
  width: 80px;
  height: 120px;
  min-height: 120px;
  padding: 6px;
}
.playing-card.compact svg {
  width: 28px;
  height: 28px;
}
.playing-card.compact .card-rank {
  font-size: 14px;
}
.playing-card.compact .card-corner {
  height: 16px;
}
.playing-card.compact .card-name {
  font-size: 11px;
}
.card-table {
  padding: 12px 0 24px;
  min-width: 0;
}
.card-table ~ .turn-note {
  color: var(--ink);
  font-size: 14px;
}
.deck-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.hand-count {
  font-size: 12px;
  color: var(--muted);
}
.table-center {
  background: var(--felt);
  color: var(--surface);
  padding: 20px;
  border-radius: var(--radius);
  margin: 22px 0;
}
.table-center .empty {
  color: inherit;
}
.table-center h3 {
  font-size: 14px;
  margin-bottom: 12px;
}
.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.active-suit {
  margin-top: 12px;
}
.your-hand h3 {
  margin-top: 24px;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.card-actions .btn {
  min-height: 44px;
  white-space: normal;
  text-align: start;
  font-size: 13px;
}
.discard-options {
  width: 100%;
  padding-top: 10px;
}
.discard-options summary {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.discard-options > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
}
.farm-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin-top: 20px;
}
.farm-scores > div {
  display: grid;
  gap: 4px;
}
.farm-scores span {
  font-size: 14px;
}
.score-separator {
  margin-inline: 8px;
  color: var(--muted);
}
.treasure-bank {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.treasure-bank summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}
.oracle-peek {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
}
.oracle-peek h3 {
  font-size: 14px;
}
@media (max-width: 720px) {
  .game-tab {
    flex-direction: column;
    gap: 4px;
  }
  .mini-cards {
    width: 30px;
    height: 36px;
  }
  .mini-cards svg {
    width: 21px;
    height: 21px;
  }
  .game-tab .mini-board {
    height: 36px;
  }
  .tab-name {
    font-size: 13px;
  }
  .card-preview {
    padding-inline: 0;
  }
  .card-preview .playing-card + .playing-card {
    margin-left: -12px;
  }
  .card-preview .playing-card {
    width: 58px;
    height: 96px;
    min-height: 96px;
    padding: 5px;
  }
  .card-preview .playing-card svg {
    width: 28px;
    height: 28px;
  }
  .card-preview .playing-card .card-name {
    font-size: 11px;
  }
  .card-preview .card-corner {
    height: 16px;
  }
  .card-preview .standard-card .card-corner svg {
    width: 8px;
    height: 8px;
  }
  .card-preview .standard-card .card-rank {
    font-size: 12px;
    min-height: 12px;
  }
  .card-preview .card-pips {
    width: 60%;
    height: 58px;
  }
  .card-preview .playing-card .pip svg {
    width: 8px;
    height: 10px;
  }
  .card-table {
    padding: 8px 0 16px;
  }
  .card-table .playing-card {
    width: 88px;
    height: 132px;
    min-height: 132px;
    padding: 6px;
  }
  .card-table .card-pips {
    height: 92px;
  }
  .card-table .playing-card .pip svg {
    width: 14px;
    height: 16px;
  }
  .card-table .playing-card .ace-pip .pip svg {
    width: 30px;
    height: 36px;
  }
  .table-center {
    padding: 16px;
  }
  .card-table .playing-card.compact {
    width: 68px;
    height: 108px;
    min-height: 108px;
  }
  .your-hand .card-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .your-hand .playing-card {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 112 / 164;
  }
  .card-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .multiplayer-roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 10px;
  }
  .multiplayer-roster .player {
    align-items: start;
  }
  .multiplayer-roster .player-name {
    max-width: 100%;
  }
  .multiplayer-roster .player-caption {
    line-height: 1.8;
  }
  .farm-scores {
    gap: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .farm-scores span {
    font-size: 12px;
  }
  .farm-scores strong {
    overflow-wrap: anywhere;
  }
}
.table-reactions {
  margin: -6px 0 24px;
}
.reaction-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.reaction-label {
  color: var(--muted);
  font-size: 12px;
}
.quick-reaction-buttons {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.reaction-button,
.reaction-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.5;
}
.reaction-button:hover:enabled,
.reaction-chip:hover:enabled {
  background: #e9eddf;
}
.reaction-chip[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: var(--surface);
}
.reaction-emoji {
  font-size: 22px;
  line-height: 1.3;
}
.reaction-feed {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.reaction-feed:not(:empty) {
  margin-top: 12px;
}
.reaction-event {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e9eddf;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  animation: reaction-arrive 220ms var(--ease) both;
}
@keyframes reaction-arrive {
  from {
    transform: translateY(6px) scale(0.96);
  }
  to {
    transform: translateY(0) scale(1);
  }
}
.chat-unread {
  display: inline-grid;
  place-items: center;
  background: var(--green);
  color: var(--surface);
  border-radius: 50%;
  min-width: 24px;
  height: 24px;
  padding-inline: 5px;
  font-size: 12px;
  margin-inline-start: 6px;
  font-variant-numeric: tabular-nums;
}
.chat-unread[hidden] {
  display: none;
}
.conversation {
  margin-bottom: 24px;
  padding-inline: 4px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
  scroll-margin-top: 20px;
}
.conversation > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  min-height: 48px;
  font-size: 18px;
  font-weight: 750;
}
.conversation > summary::-webkit-details-marker {
  display: none;
}
.conversation svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  flex-shrink: 0;
}
.conversation[open] > summary > svg {
  transform: rotate(180deg);
}
.chat-note,
.chat-readonly {
  color: var(--muted);
  font-size: 12px;
  margin: 6px 0 12px;
}
.chat-log {
  max-height: 360px;
  min-height: 100px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--muted) var(--paper);
  padding-inline-end: 8px;
  margin-bottom: 16px;
}
.chat-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 16px 0;
}
.chat-message {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.chat-message.own-message {
  background: #e9eddf;
  border: 0;
  padding: 12px;
  border-radius: 8px;
  margin-block: 8px;
}
.message-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.message-top time {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}
.message-text {
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
  margin-top: 6px;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}
.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: start;
}
.reaction-chip {
  min-height: 36px;
  padding: 4px 8px;
}
.reaction-chip .reaction-emoji {
  font-size: 20px;
}
.message-reaction-picker {
  min-width: 0;
  flex: 1 1 84px;
}
.message-reaction-picker summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: start;
  cursor: pointer;
  font-size: 12px;
  gap: 4px;
}
.message-reaction-picker[open] {
  flex-basis: 100%;
}
.reaction-picker-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding-top: 6px;
}
.picker-choice {
  flex-direction: column;
  min-height: 58px;
  padding: 6px 2px;
  font-size: 11px;
}
.chat-form label {
  font-size: 13px;
  font-weight: 650;
  display: block;
  margin-bottom: 6px;
}
.chat-form textarea {
  display: block;
  width: 100%;
  min-height: 82px;
  max-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  caret-color: var(--green);
  font: inherit;
  font-size: 14px;
  line-height: 1.8;
  padding: 10px 12px;
}
.chat-form textarea::placeholder {
  color: var(--muted);
}
.chat-form textarea:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
  border-color: var(--green);
}
.chat-compose-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.chat-counter {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.chat-counter.over-limit {
  color: var(--danger);
}
.chat-new {
  width: 100%;
  margin-bottom: 10px;
}
.chat-back {
  display: none;
}
@media (min-width: 721px) and (max-width: 1050px) {
  .quick-reaction-buttons {
    flex-basis: 100%;
  }
  .reaction-button {
    flex-direction: column;
    padding-inline: 2px;
    gap: 2px;
  }
}
@media (max-width: 720px) {
  .reaction-toolbar {
    display: block;
  }
  .reaction-label {
    display: block;
    margin-bottom: 8px;
  }
  .quick-reaction-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .reaction-button {
    min-height: 44px;
  }
  .conversation {
    margin-bottom: 20px;
  }
  .chat-log {
    max-height: 320px;
  }
  .chat-back {
    display: inline-flex;
    margin-top: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.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;
}

/* Catalog illustrations are larger than interface glyphs: actual boards, pieces and objects. */
.game-tab .game-library-icon {
  display: block;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px #203c3210);
}
@media (max-width: 1100px) and (min-width: 721px) {
  .game-tab {
    gap: 9px;
  }
  .game-tab .game-library-icon {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }
}
@media (max-width: 720px) {
  .game-tab .game-library-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
  }
}
