/* The club shell owns UI color; game boards keep their semantic resource and player palettes. */
:root {
  --paper: #eaf0f8;
  --surface: #ffffff;
  --ink: #14213b;
  --muted: #52627b;
  --green: #2859b8;
  --green-hover: #20499a;
  --felt: #1d3150;
  --line: #cbd6e5;
  --lime: #ffdaa4;
  --orange: #ad4c13;
  --danger: #b12d43;
  --radius: 10px;
  --shadow: 0 8px 22px #14213b0d;
  --club-navy: #14213b;
  --club-panel: #1d3150;
  --club-orange: #f5a14a;
  --club-orange-hover: #ffc07b;
  --club-blue: #3468d5;
  --club-light-blue: #e6eeff;
  --club-pale: #cad7ed;
}
body {
  background: var(--paper);
}
::selection {
  background: var(--club-orange);
  color: var(--club-navy);
}
:where(button, a, input, textarea, select, summary):focus-visible {
  outline-color: var(--club-blue);
}
input,
textarea,
select {
  caret-color: var(--club-blue);
}
.site-header {
  width: 100%;
  min-height: 94px;
  padding-inline: max(40px, calc((100% - 1240px) / 2));
  background: var(--club-navy);
  color: white;
  border-bottom: 4px solid var(--club-blue);
  gap: 52px;
}
.brand {
  font-weight: 900;
  font-size: 30px;
}
.brand svg {
  fill: var(--club-orange);
}
.brand svg rect:nth-child(2),
.brand svg rect:nth-child(3) {
  fill: #78a8f4;
}
.brand-caption {
  color: var(--club-pale);
}
.site-header nav a {
  padding-block: 8px;
  border-bottom: 2px solid transparent;
}
.site-header nav a:hover {
  color: var(--club-orange);
  border-bottom-color: var(--club-orange);
}
.header-account {
  color: white;
  border: 1px solid #6f86a6;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
}
.site-header :focus-visible {
  outline-color: var(--club-orange);
}
main {
  padding-top: 32px;
}
.intro {
  position: relative;
  background: var(--club-navy);
  color: white;
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 16px;
  align-items: center;
  overflow: hidden;
  gap: 30px;
}
.intro h1 {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.5;
  letter-spacing: -0.025em;
}
.intro p {
  color: var(--club-pale);
  font-size: 14px;
  margin-top: 4px;
}
.intro-aside {
  color: white;
  background: var(--club-panel);
  border: 1px solid #5c7598;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 7px;
}
.intro .online-dot {
  background: var(--club-orange);
}
.home-layout {
  grid-template-columns: minmax(0, 1.9fr) minmax(290px, 1fr);
  gap: 24px;
}
.library {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.game-tabs {
  padding: 12px;
  gap: 7px;
  background: #dbe4f1;
  border: 0;
  border-bottom: 1px solid #c4d1e4;
  margin-bottom: 0;
}
.game-tab {
  background: white;
  border: 1px solid #c5d1e3;
  border-bottom: 1px solid #c5d1e3;
  border-radius: 7px;
  color: var(--ink);
  min-height: 96px;
  padding: 11px 10px;
  gap: 10px;
  position: relative;
  transition:
    background 0.16s ease,
    border-color 0.16s ease;
}
.game-tab:hover {
  background: #f2f6ff;
  border-color: var(--club-blue);
}
.game-tab[aria-selected="true"] {
  background: var(--club-panel);
  color: white;
  border: 1px solid var(--club-panel);
}
.game-tab[aria-selected="true"] .tab-duration {
  color: #d0dcf0;
}
.game-tab:focus-visible {
  outline: 3px solid var(--club-blue);
  outline-offset: 1px;
  z-index: 1;
}
.game-tab .game-library-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  filter: none;
  border-radius: 6px;
}
.game-tab[aria-selected="true"] .game-library-icon {
  background: #f5f8ff;
}
.tab-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.7;
}
.tab-duration {
  font-size: 10px;
  color: var(--muted);
}
#game-preview {
  padding: 20px;
}
.showcase {
  background: var(--club-navy);
  border-radius: 8px;
  padding: 28px;
  min-height: 275px;
}
.showcase h2 {
  color: white;
}
.showcase p,
.showcase-meta {
  color: var(--club-pale);
}
.showcase .preview-tic .cell {
  background: #304768;
}
.showcase .piece.cross::before,
.showcase .piece.cross::after {
  background: var(--club-orange);
}
.showcase .piece.ring {
  border-color: #8cb8ff;
}
.preview-note {
  color: var(--muted);
}
.rules-preview {
  border-color: var(--line);
  margin-top: 22px;
  padding-top: 20px;
}
.rules-preview a {
  color: var(--green);
  font-weight: 700;
}
.entry-panel {
  background: var(--club-panel);
  color: white;
  border: 1px solid #2d4568;
  border-radius: 10px;
  padding: 26px;
  box-shadow: none;
  position: sticky;
  top: 22px;
}
.entry-panel h2 {
  color: white;
  font-weight: 850;
  font-size: 24px;
}
.entry-panel p,
.entry-panel .field-note,
.entry-panel .membership-note {
  color: var(--club-pale);
}
.entry-panel input {
  background: white;
  border-color: #e0e7f0;
  color: var(--club-navy);
}
.entry-panel input::placeholder {
  color: #64718a;
}
.entry-panel .join-section,
.entry-panel .membership-note,
.entry-panel .resume {
  border-color: #5c7393;
}
.entry-panel .membership-note a,
.entry-panel .resume a {
  color: #ffcc91;
}
.entry-panel .error {
  color: #ffc1bf !important;
}
.btn {
  border-radius: 6px;
  background: var(--club-blue);
  color: white;
  box-shadow: none;
  font-weight: 750;
}
.btn:hover:enabled {
  background: #2855b2;
}
.btn.secondary {
  background: var(--club-light-blue);
  color: #234a91;
}
.btn.secondary:hover:enabled {
  background: #d5e2ff;
}
.btn.outline {
  border-color: #a9bbd5;
  color: var(--green);
  background: transparent;
}
.btn.outline:hover:enabled {
  background: #e7effc;
}
.btn.text {
  background: transparent;
  color: var(--muted);
}
.btn.text:hover:enabled {
  background: transparent;
  color: var(--green);
}
#create-form .btn {
  background: var(--club-orange);
  color: var(--club-navy);
  font-weight: 850;
}
#create-form .btn:hover:enabled {
  background: var(--club-orange-hover);
}
.entry-panel .btn.secondary {
  background: #e6eeff;
  color: #14213b;
}
.entry-panel :focus-visible {
  outline-color: var(--club-orange);
}
input:hover,
textarea:hover,
select:hover {
  border-color: #839cc2;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--club-blue);
}
input::placeholder,
textarea::placeholder {
  color: #64718a;
}
.rulebook {
  color: var(--ink);
}
.rulebook li::marker {
  color: var(--club-blue);
  font-weight: 800;
}
.win-condition {
  background: var(--club-light-blue);
  color: var(--club-navy);
  border-radius: 6px;
  padding: 16px;
}
.room-heading {
  background: var(--club-navy);
  color: white;
  padding: 24px 26px;
  border-radius: 10px;
  gap: 22px;
}
.room-heading .subline,
.room-heading .code-label,
.room-heading .connection {
  color: var(--club-pale);
}
.room-heading .room-code {
  color: #ffbd72;
}
.room-heading .btn.outline {
  border-color: #627b9f;
  color: white;
}
.room-heading .btn.outline:hover:enabled {
  background: #304a70;
}
.room-heading .online-dot {
  background: #96c9ff;
}
.room-heading :focus-visible {
  outline-color: var(--club-orange);
}
.arena {
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 26px;
}
.room-layout {
  gap: 24px;
}
.status-strip {
  background: #e7eef9;
  color: var(--ink);
  border: 1px solid #cbd8ee;
  border-radius: 6px;
}
.status-strip.my-turn {
  background: var(--club-panel);
  color: white;
  border-color: var(--club-panel);
}
.status-strip.my-turn .status-main {
  color: #ffd39d;
}
.status-strip.finished {
  background: #ffdaa4;
  color: var(--club-navy);
  border-color: #edbd7c;
}
.avatar {
  background: #dce7fa;
  color: var(--club-navy);
}
.player.active .avatar {
  background: var(--club-blue);
  color: white;
}
.versus {
  color: var(--muted);
}
.turn-note {
  color: var(--muted);
}
.waiting-panel {
  background: #f0f5fd;
  border-radius: 8px;
}
.bot-manager {
  border-color: var(--line);
}
.bot-controls select {
  color: var(--ink);
  background: white;
  border-color: #a9bbd5;
}
.bot-badge {
  background: #e3ecff;
  color: #234a91;
}
.room-sidebar {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}
.room-sidebar .rulebook {
  border-color: var(--line);
}
.identity,
.identity strong {
  color: var(--muted);
}
.chat-message.own-message {
  background: #e6eeff;
}
.reaction-chip[aria-pressed="true"] {
  background: #d9e6ff;
  border-color: var(--club-blue);
  color: var(--ink);
}
.reaction-button:hover:enabled,
.reaction-chip:hover:enabled {
  background: #e8effc;
  border-color: #8ba8d8;
}
.reaction-event,
.chat-unread {
  background: var(--club-panel);
  color: white;
}
.chat-form textarea {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}
.auth-form-panel,
.account-panel {
  border-color: var(--line);
  box-shadow: none;
}
.account-mark {
  background: var(--club-panel);
  color: white;
}
.account-tab[aria-selected="true"] {
  color: var(--club-blue);
  border-color: var(--club-blue);
}
.account-tab:hover {
  background: var(--club-light-blue);
}
.account-success {
  background: #e6efff;
  color: var(--ink);
}
.site-footer {
  color: var(--muted);
  border-top-color: var(--line);
  padding-block: 24px;
}
.strategy-game {
  --st-ink: var(--ink);
  --st-paper: #f1f5fc;
  --st-line: var(--line);
  color: var(--ink);
}
.strategy-game .st-action {
  color: var(--ink);
  background: #f3f7ff;
  border-color: #afc2df;
}
.strategy-game .st-action:hover:not(:disabled) {
  background: #e3ecff;
  border-color: var(--club-blue);
}
.strategy-game .st-section-title > span,
.st-controls-heading p,
.st-map-caption,
.st-action-group summary span,
.st-empty {
  color: var(--muted);
}
.strategy-game .st-controls,
.strategy-game .st-action-group,
.st-resource-bank,
.st-awards,
.st-turn-note {
  border-color: var(--line);
}
.strategy-game .st-selection-detail {
  background: #edf3ff;
  border-color: #a7bee3;
}
.strategy-game .st-selection-detail:focus {
  outline-color: var(--club-blue);
}
.strategy-game .st-search input {
  background: white;
  border-color: #a9bbd5;
  color: var(--ink);
}
.strategy-game .st-event {
  background: #fff0db;
  color: var(--club-navy);
}
.strategy-game :focus-visible {
  outline-color: var(--club-blue);
}
.skip-link {
  background: white;
  color: var(--club-navy);
}
@media (min-width: 1400px) {
  .entry-panel {
    top: 24px;
  }
}
@media (max-width: 1100px) and (min-width: 721px) {
  .home-layout {
    grid-template-columns: minmax(0, 1.65fr) minmax(270px, 1fr);
    gap: 20px;
  }
  .game-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .entry-panel {
    padding: 22px;
  }
  .intro {
    padding: 16px 20px;
  }
  .room-heading {
    flex-wrap: wrap;
  }
}
@media (max-width: 720px) {
  .site-header {
    width: 100%;
    padding: 14px 16px;
    gap: 12px;
    min-height: 82px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 26px;
  }
  .header-account {
    font-size: 11px;
    padding: 6px 9px;
  }
  main {
    padding-top: 20px;
  }
  .intro {
    padding: 14px 16px;
    margin-bottom: 16px;
    display: block;
  }
  .intro h1 {
    font-size: 24px;
  }
  .intro p {
    font-size: 12px;
    line-height: 2;
    max-width: none;
  }
  .intro-aside {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .home-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .game-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 8px;
    gap: 5px;
  }
  .game-tab {
    padding: 9px 3px;
    gap: 5px;
    min-height: 110px;
    justify-content: start;
  }
  .game-tab .game-library-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }
  .tab-name {
    font-size: 11px;
    line-height: 1.8;
  }
  .tab-duration {
    font-size: 8px;
  }
  #game-preview {
    padding: 14px;
  }
  .showcase {
    padding: 18px;
    gap: 14px;
    min-height: 220px;
  }
  .showcase h2 {
    font-size: 24px;
  }
  .entry-panel {
    position: static;
    padding: 24px;
  }
  .room-heading {
    padding: 20px;
    align-items: start;
  }
  .room-heading h1 {
    font-size: 24px;
  }
  .room-heading .room-tools {
    flex-wrap: wrap;
  }
  .arena {
    padding: 16px;
  }
  .room-sidebar {
    padding: 18px;
  }
  .status-strip {
    padding: 12px;
  }
  .site-footer {
    gap: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .game-tab {
    transition: none;
  }
}

.library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: white;
}
.library-heading h2 {
  font-size: 17px;
  line-height: 1.7;
  font-weight: 850;
}
.library-heading h2 span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
}
.library-heading a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}
.library-heading svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.game-tabs {
  max-height: 590px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #6c88b3 #dbe4f1;
  overscroll-behavior: contain;
}
.entry-panel {
  scroll-margin-top: 24px;
}
@media (max-width: 720px) {
  .library-heading {
    padding: 14px;
  }
  .library-heading h2 {
    font-size: 16px;
  }
  .library-heading a {
    font-size: 11px;
  }
  .game-tabs {
    max-height: 370px;
  }
  .entry-panel:focus {
    outline: 3px solid var(--club-orange);
    outline-offset: 3px;
  }
}
/* Neutral grids and interface notices follow the club; named playing-piece colors stay literal. */
.board.tic-tac-toe {
  background: #dce6f5;
}
.tic-tac-toe .cell.legal::after {
  background: #7592bf;
}
.tic-tac-toe .cell.legal:hover {
  background: #e6eeff;
}
.connect-four .piece.disk.two {
  background: #31765c;
}
.connect-four .piece.disk.one {
  background: #c2643b;
}
/* Othello has its own felt palette so black discs stay distinct from the board. */
.board.reversi {
  background: #355d48;
  gap: 2px;
  padding: 9px;
  box-shadow: inset 0 1px 2px #ffffff26, 0 4px 12px #243b2926;
}
.reversi .cell {
  background: #6b9473;
  border-radius: 2px;
}
.reversi .cell.legal:hover {
  background: #a6c5a7;
}
.reversi .cell.legal::after {
  background: #355d48;
  width: 13%;
  height: 13%;
}
.reversi .piece.disk.one {
  background: radial-gradient(circle at 35% 28%, #414a4a, #202829 60%, #111819);
  border: 1px solid #131c1c;
  box-shadow: inset 0 1px 1px #ffffff40, 0 2px 3px #14291c66;
}
.reversi .piece.disk.two {
  background: radial-gradient(circle at 35% 28%, #ffffff, #f7f3e5 65%, #d7d5c7);
  border: 1px solid #405e45;
  box-shadow: inset 0 -1px 2px #8c93844d, 0 2px 3px #14291c66;
}
.reversi .cell.last {
  outline: 2px solid #5a3d17;
  outline-offset: -3px;
}
.reversi .cell:focus-visible {
  outline: 3px solid #173a2b;
  outline-offset: -4px;
}
.local-invite-note {
  background: #dfeaff;
  color: #254b8f;
}
.reconnect-banner {
  background: #ffebd1;
  color: #713609;
}
.room-heading .connection.offline {
  color: #ffc1b7;
}
.room-heading .connection.offline .online-dot {
  background: #ffa88d;
}
