/* Chess Revamped v2 — product UI */

:root {
  --bg-page: #0c1017;
  --bg-elevated: #141b26;
  --bg-card: #1a2332;
  --bg-card-hover: #212d40;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #a8b3c7;
  --text-muted: #7b8798;
  --accent: #e8b84a;
  --accent-hover: #f5cc62;
  --accent-dark: #111827;
  --danger: #f87171;
  --success: #4ade80;
  --warning: #fbbf24;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 16, 23, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.logo:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.logo-mark {
  background: var(--accent);
  color: var(--accent-dark);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.main-nav a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--accent);
  text-decoration: none;
}

/* Hero */

.hero-section {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(232, 184, 74, 0.15), transparent),
    linear-gradient(180deg, #121824 0%, var(--bg-page) 100%);
  padding: 64px 20px 56px;
  text-align: center;
}

.hero-content {
  max-width: 820px;
  margin: 0 auto;
}

.hero-eyebrow {
  margin: 0 0 10px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.hero-section h1 {
  margin: 0 0 14px;
  font-size: clamp(2.4rem, 6vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0 auto 24px;
  max-width: 640px;
  font-size: 1.12rem;
  color: var(--text-secondary);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.feature-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.play-button,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-dark);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.play-button:hover,
.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
  color: var(--accent-dark);
  transform: translateY(-1px);
}

.play-button:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-side:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.secondary-button,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--accent);
  border: 2px solid rgba(232, 184, 74, 0.55);
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.secondary-button:hover,
.btn-secondary:hover {
  background: rgba(232, 184, 74, 0.12);
  text-decoration: none;
  color: var(--accent-hover);
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.text-link {
  font-weight: 600;
}

/* Layout */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 48px;
}

.section-heading {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 28px;
}

.section-heading h2 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 4vw, 2rem);
}

.section-heading p {
  margin: 0;
  color: var(--text-secondary);
}

.section-cta {
  text-align: center;
  margin-top: 20px;
}

/* Ad slots */

.ad-slot {
  max-width: 970px;
  min-height: 90px;
  margin: 28px auto;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Game section */

.game-section {
  scroll-margin-top: 80px;
  padding-top: 12px;
}

.game-shell {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.game-shell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.game-shell-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.game-shell-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#playAgainBtn {
  display: none;
}

#playAgainBtn.is-visible {
  display: inline-flex;
}

.variant-info-card {
  margin: 16px 20px 0;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.variant-info-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.variant-info-header h3 {
  margin: 6px 0 0;
  font-size: 1.2rem;
}

.variant-info-tag,
.variant-card-tag {
  display: inline-block;
  background: rgba(232, 184, 74, 0.15);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
}

.variant-info-feel,
.variant-card-feel {
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.variant-info-description {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.variant-info-highlights {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.variant-info-note {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.setup-panel {
  margin: 16px 20px 0;
  padding: 18px;
  background: linear-gradient(135deg, rgba(232, 184, 74, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(232, 184, 74, 0.25);
  border-radius: var(--radius);
}

.setup-panel.is-hidden {
  display: none;
}

.setup-panel h4 {
  margin: 0 0 8px;
}

.setup-panel p {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.setup-side-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-side {
  flex: 1;
  min-width: 120px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
}

.btn-side-white:hover { border-color: #fff; }
.btn-side-black:hover { border-color: #888; }
.btn-side-random:hover { border-color: var(--accent); color: var(--accent); }

.game-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 260px;
  gap: 16px;
  padding: 16px 20px 20px;
  align-items: start;
}

/* —— Match Setup lobby (full-width above arena) —— */

.match-setup-panel {
  margin: 0 20px;
  padding: 16px 18px 14px;
  background: linear-gradient(180deg, rgba(232, 184, 74, 0.08), var(--bg-card));
  border-bottom: 1px solid var(--border-subtle);
}

.match-setup-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.match-setup-title {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
}

.match-setup-heading .setup-summary-text {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.setup-status-inline {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  flex: 1 1 auto;
  min-width: 160px;
}

.match-setup-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-setup-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px 14px;
  align-items: start;
}

.match-setup-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  padding-top: 8px;
}

.match-setup-controls {
  min-width: 0;
}

.match-setup-controls-wide {
  width: 100%;
}

.match-setup-advanced {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.panel-advanced-body-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.panel-advanced-body-inline .control-field {
  flex: 1 1 140px;
  min-width: 120px;
}

.mode-toggle-inline {
  display: inline-flex;
  max-width: 280px;
}

.side-picker-inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}

.side-picker-inline .side-btn {
  flex: 1 1 100px;
  min-width: 96px;
}

.time-control-picker-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: flex-start;
}

.chip-group-inline {
  display: inline-flex;
  flex-direction: column;
  margin-bottom: 0;
  vertical-align: top;
  min-width: 0;
}

.time-control-picker-inline .chip-group-inline {
  flex: 0 1 auto;
}

.variant-picker-horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-direction: row;
}

.variant-pill-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  min-height: auto;
  flex: 0 1 auto;
}

.variant-pill-compact .variant-pill-name {
  font-size: 0.84rem;
  font-weight: 700;
}

.variant-pill-compact .variant-pill-badge {
  font-size: 0.62rem;
  padding: 2px 6px;
}

.match-setup-panel.is-compact .match-setup-body {
  display: none;
}

.match-setup-panel.is-compact .match-setup-header {
  margin-bottom: 0;
  cursor: pointer;
}

.match-setup-panel.is-compact .match-setup-header:hover .match-setup-title {
  color: var(--text-primary);
}

/* —— Game Arena —— */

.game-arena {
  padding: 16px 20px 8px;
}

.arena-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 280px);
  gap: 16px;
  align-items: start;
}

.arena-main.game-center {
  margin: 0;
}

.arena-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arena-panel .move-history {
  max-height: 220px;
}

/* —— Secondary stack below arena —— */

.lobby-secondary-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding: 8px 20px 20px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.12);
}

.lobby-secondary-stack > .panel-card,
.lobby-secondary-stack > .lobby-secondary,
.lobby-secondary-stack > details {
  margin-bottom: 0;
}

.lobby-secondary-stack .lobby-secondary {
  grid-column: 1 / -1;
}

.lobby-secondary-stack .future-panel {
  grid-column: 1 / -1;
}

/* —— Legacy game setup (deprecated sidebar) —— */

.game-setup-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.game-setup-panel > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-bottom: 1px solid transparent;
}

.game-setup-panel[open] > summary {
  border-bottom-color: var(--border-subtle);
}

.game-setup-panel > summary::-webkit-details-marker {
  display: none;
}

.game-setup-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.game-setup-summary-title {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.setup-summary-text {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.35;
}

.game-setup-panel .setup-section,
.game-setup-panel .panel-advanced {
  padding: 0 14px;
}

.game-setup-panel .setup-section {
  padding-top: 14px;
  padding-bottom: 4px;
}

.game-setup-panel .setup-section:last-of-type {
  padding-bottom: 14px;
}

.setup-label {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.setup-note {
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.planned-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  background: transparent;
}

.chip-planned {
  opacity: 0.7;
  cursor: default;
}

.chip-group {
  margin-bottom: 10px;
}

.chip-group:last-child {
  margin-bottom: 0;
}

.chip-group-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 700;
}

.chip-row,
.ai-strength-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.option-chip {
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.option-chip:hover {
  border-color: rgba(232, 184, 74, 0.45);
  color: var(--text-primary);
}

.option-chip.active {
  border-color: var(--accent);
  background: rgba(232, 184, 74, 0.14);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px rgba(232, 184, 74, 0.25);
}

.option-chip-ai {
  flex: 1 1 calc(50% - 6px);
  min-width: 88px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
}

.option-chip-ai .chip-main {
  font-size: 0.8rem;
}

.option-chip-ai .chip-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.bot-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bot-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 6px;
  max-width: 100%;
}

.bot-premium-details,
.coach-premium-details {
  margin-top: 4px;
}

.bot-premium-details summary,
.coach-premium-details summary {
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
}

.bot-premium-details summary::-webkit-details-marker,
.coach-premium-details summary::-webkit-details-marker {
  display: none;
}

.bot-chip,
.coach-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
  min-width: 0;
}

.bot-chip:hover,
.coach-chip:hover {
  border-color: rgba(232, 184, 74, 0.45);
  color: var(--text-primary);
}

.bot-chip.active,
.coach-chip.active {
  border-color: var(--accent);
  background: rgba(232, 184, 74, 0.12);
  box-shadow: inset 0 0 0 1px rgba(232, 184, 74, 0.22);
}

.bot-chip-premium,
.coach-chip-premium,
.bot-chip.is-locked,
.coach-chip.is-locked {
  opacity: 0.68;
  cursor: not-allowed;
}

.bot-chip-name,
.coach-chip-name {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.bot-chip-elo {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
}

.setup-status {
  margin: 0;
  padding: 10px 14px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  border-top: 1px solid var(--border-subtle);
}

.setup-section-side {
  padding-bottom: 10px;
}

.setup-section-opponent {
  padding-top: 0;
}

.coach-panel-visible {
  border-color: rgba(232, 184, 74, 0.35);
  background: linear-gradient(180deg, rgba(232, 184, 74, 0.1), var(--bg-card));
}

.coach-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.coach-panel-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.coach-panel-heading h4 {
  margin: 0;
  font-size: 0.95rem;
}

.coach-badge-free {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(110, 180, 120, 0.2);
  color: #8fd4a0;
}

.coach-panel-sub {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.coach-tip-prominent {
  font-size: 0.86rem;
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  min-height: 3em;
}

.coach-picker-compact {
  margin-top: 8px;
}

.piece-lang-intro {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.piece-lang-hint {
  color: var(--text-muted);
  font-weight: 500;
}

.piece-lang-featured,
.piece-lang-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.piece-lang-chip {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.piece-lang-chip:hover {
  border-color: rgba(232, 184, 74, 0.45);
  color: var(--text-primary);
}

.piece-lang-chip.active {
  border-color: var(--accent);
  background: rgba(232, 184, 74, 0.12);
  color: var(--text-primary);
}

.piece-lang-more {
  margin-top: 8px;
}

.piece-lang-more summary {
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
}

.piece-lang-more summary::-webkit-details-marker {
  display: none;
}

.piece-lang-more .piece-lang-picker {
  margin-top: 8px;
}

.hero-lang-note {
  margin: 14px auto 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.5;
}

.arena-panel-coach {
  order: -1;
}

.coach-panel-card {
  padding: 0;
}

.coach-panel-card > summary {
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.coach-panel-card > summary::-webkit-details-marker {
  display: none;
}

.coach-panel-body {
  padding: 0 14px 14px;
}

.coach-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.coach-tip {
  margin: 0 0 6px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.coach-note {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.game-over-coach {
  width: 100%;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
  font-style: italic;
}

.time-control-picker {
  max-height: none;
}

.chip-row .option-chip {
  padding: 6px 9px;
  font-size: 0.78rem;
}

/* Legacy bot-card styles kept for compatibility */
.bot-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.bot-card:hover {
  border-color: rgba(232, 184, 74, 0.45);
  color: var(--text-primary);
}

.bot-card.active {
  border-color: var(--accent);
  background: rgba(232, 184, 74, 0.12);
  box-shadow: inset 0 0 0 1px rgba(232, 184, 74, 0.22);
}

.bot-card-premium,
.bot-card.is-locked {
  opacity: 0.72;
  cursor: not-allowed;
}

.bot-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.bot-card-name {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-primary);
}

.bot-card-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.bot-card-elo {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.bot-card-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(120, 160, 200, 0.18);
  color: #9ec5ef;
}

.toggle-chip {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.toggle-chip.is-on {
  border-color: var(--accent);
  background: rgba(232, 184, 74, 0.12);
  color: var(--text-primary);
}

.review-panel {
  width: 100%;
  max-width: 480px;
  margin-top: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.review-panel-inner h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.review-section {
  margin-bottom: 10px;
}

.review-section strong {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.review-section p,
.review-premium-msg,
.review-note {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.review-note {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.game-over-sub,
.game-over-hint {
  width: 100%;
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.game-over-hint {
  color: var(--accent);
  font-weight: 600;
}

.game-over-suggest-muted {
  font-size: 0.75rem;
  opacity: 0.85;
}

.board.is-ai-thinking {
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(232, 184, 74, 0.15),
    0 0 0 2px rgba(232, 184, 74, 0.12);
}

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

.side-btn {
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.side-btn-white.active {
  border-color: #f0f0f0;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.side-btn-black.active {
  border-color: #666;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.side-btn-random.active {
  border-color: var(--accent);
}

.side-btn:hover {
  border-color: rgba(232, 184, 74, 0.5);
}

.lobby-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.lobby-secondary > summary {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  list-style: none;
}

.lobby-secondary > summary::-webkit-details-marker {
  display: none;
}

.lobby-secondary .panel-card {
  margin: 0 10px 10px;
  border: none;
  background: var(--bg-elevated);
}

.game-shell.is-playing .match-setup-panel.is-compact {
  padding-bottom: 12px;
}

#aiSettingsPanel.is-hidden {
  display: none;
}

.game-setup-panel .panel-advanced {
  margin: 8px 0 14px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.panel-card h4 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.control-field {
  margin-bottom: 10px;
  text-align: left;
}

.control-field label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 600;
}

.control-field select,
.control-field button {
  width: 100%;
}

select,
button {
  font-family: inherit;
  font-size: 0.92rem;
}

select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 10px;
}

.variant-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.variant-pill {
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text-primary);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}

.variant-pill:hover {
  background: var(--bg-card-hover);
  border-color: rgba(232, 184, 74, 0.35);
}

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

.variant-pill.active {
  border-color: var(--accent);
  background: rgba(232, 184, 74, 0.12);
  box-shadow: inset 0 0 0 1px rgba(232, 184, 74, 0.25);
}

.variant-pill-name {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
}

.variant-pill-feel {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.variant-pill-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.variant-pill-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: rgba(232, 184, 74, 0.12);
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.variant-pill-best,
.variant-info-best,
.variant-card-best {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.variant-info-diff {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.mode-btn {
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.mode-btn:hover {
  border-color: rgba(232, 184, 74, 0.35);
  color: var(--text-primary);
}

.mode-btn.active {
  border-color: var(--accent);
  background: rgba(232, 184, 74, 0.12);
  color: var(--accent);
}

.panel-start .panel-help,
.panel-help {
  margin: 0 0 12px;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.panel-advanced {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 12px;
}

.panel-advanced summary {
  cursor: pointer;
  padding: 14px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  list-style: none;
}

.panel-advanced summary::-webkit-details-marker {
  display: none;
}

.panel-advanced-body {
  padding: 0 14px 14px;
}

.is-hidden {
  display: none !important;
}

.inline-stat {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-top: 8px;
}

.inline-stat-muted {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.stat-item.stat-wide {
  grid-column: 1 / -1;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 700;
}

.stats-note,
.future-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.future-note-muted {
  opacity: 0.85;
}

.future-panel h4 {
  margin-bottom: 8px;
}

.game-over-banner {
  width: 100%;
  max-width: 480px;
  background: rgba(232, 184, 74, 0.12);
  border: 1px solid rgba(232, 184, 74, 0.35);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.game-over-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.game-over-title {
  margin: 0;
  font-weight: 700;
  color: var(--text-primary);
}

.turn-display.is-ai {
  color: var(--text-muted);
  font-style: italic;
}

.control-field-compact {
  margin-top: 10px;
}

.stats-panel-card {
  padding-bottom: 12px;
}

.onboarding-banner {
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(232, 184, 74, 0.14), rgba(232, 184, 74, 0.06));
  border: 1px solid rgba(232, 184, 74, 0.35);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.onboarding-inner p {
  margin: 0 0 6px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.onboarding-steps {
  font-size: 0.88rem;
  color: var(--text-muted) !important;
}

.onboarding-dismiss {
  margin-top: 6px;
}

.ai-difficulty-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
}

.achievements-panel-card h4 {
  margin-bottom: 8px;
}

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

.achievement-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.achievement-item.is-unlocked {
  border-color: rgba(232, 184, 74, 0.45);
  color: var(--text-secondary);
  background: rgba(232, 184, 74, 0.08);
}

.achievement-item.is-locked {
  opacity: 0.55;
}

.achievement-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.achievement-title {
  font-weight: 600;
  line-height: 1.25;
}

.variant-pill-badge-soft {
  background: rgba(120, 160, 200, 0.2);
  color: #9ec5ef;
  border-color: rgba(120, 160, 200, 0.35);
}

.game-over-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.game-over-suggest {
  width: 100%;
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.game-over-link {
  font-size: 0.85rem;
}

.game-over-inner {
  flex-direction: column;
  align-items: stretch;
}

.game-shell-header h3 {
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 960px) {
  .mode-toggle {
    grid-template-columns: 1fr 1fr;
  }

  .game-over-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .game-over-inner .btn-primary {
    width: 100%;
  }
}

.rating-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
}

.game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.status-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}

.clock {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.clock-white { justify-self: start; }
.clock-black { justify-self: end; text-align: right; }

.turn-display {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
}

.turn-display.is-setup { color: var(--accent); }
.turn-display.is-check { color: var(--danger); }
.turn-display.is-over { color: var(--warning); }

.game-message {
  min-height: 22px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  max-width: 480px;
  width: 100%;
  line-height: 1.45;
  word-wrap: break-word;
}

.game-message.is-error { color: var(--danger); }
.game-message.is-success { color: var(--success); }
.game-message.is-warning { color: var(--warning); }

#board,
.board {
  width: min(100%, 480px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border: 5px solid #1b2430;
  border-radius: 8px;
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
  background: #1b2430;
}

.board.is-game-over {
  opacity: 0.92;
}

.square {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

@media (hover: hover) {
  .square:not(.selected):hover {
    filter: brightness(1.06);
  }

  .square.legal:hover::after,
  .square.capture:hover::after {
    transform: scale(1.12);
  }
}

.square:active {
  filter: brightness(0.96);
}

.square:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  z-index: 2;
}

.piece {
  width: 86%;
  height: 86%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.piece-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.piece-white .piece-svg {
  filter:
    drop-shadow(0 1px 0 rgba(0, 0, 0, 0.9))
    drop-shadow(0 2px 5px rgba(0, 0, 0, 0.28));
}

.piece-black .piece-svg {
  filter:
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.2))
    drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}

.selected {
  box-shadow: inset 0 0 0 4px rgba(232, 184, 74, 0.98);
  z-index: 2;
}

.selected::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(232, 184, 74, 0.22);
  pointer-events: none;
}

.legal::after {
  content: "";
  width: 30%;
  height: 30%;
  border-radius: 50%;
  position: absolute;
  pointer-events: none;
  transition: transform 0.12s ease;
}

.square-light.legal::after {
  background: rgba(20, 20, 20, 0.28);
  box-shadow: 0 0 0 2px rgba(20, 20, 20, 0.12);
}

.square-dark.legal::after {
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.capture::after {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  border: 4px solid rgba(248, 113, 113, 0.92);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12), inset 0 0 12px rgba(248, 113, 113, 0.15);
  pointer-events: none;
  transition: transform 0.12s ease;
}

.capture.legal::after {
  inset: 8%;
}

.in-check {
  background: radial-gradient(circle at center, rgba(248, 113, 113, 0.55), rgba(248, 113, 113, 0.18)) !important;
  box-shadow: inset 0 0 0 3px rgba(220, 38, 38, 0.85);
  animation: checkPulse 1.4s ease-in-out infinite;
}

@keyframes checkPulse {
  0%, 100% { box-shadow: inset 0 0 0 3px rgba(220, 38, 38, 0.85); }
  50% { box-shadow: inset 0 0 0 3px rgba(248, 113, 113, 1); }
}

.game-shell.is-game-over .board {
  filter: saturate(0.88);
}

.captured-group {
  margin-bottom: 10px;
}

.captured-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.captured {
  min-height: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.captured-piece {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.captured-piece .piece-svg {
  width: 100%;
  height: 100%;
}

.captured-empty,
.move-empty {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.move-history {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.85rem;
}

.move-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.move-number {
  color: var(--text-muted);
  font-weight: 700;
  margin-right: 4px;
}

.rules-panel ul,
.tips-panel .tip-text {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.rules-panel ul {
  padding-left: 18px;
  margin: 0 0 10px;
}

.variant-description {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.tip-text {
  margin-bottom: 10px;
  line-height: 1.5;
}

/* Variant overview */

.variants-overview-section,
.why-section {
  margin-top: 48px;
}

.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.variant-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
}

.variant-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.variant-card h3 {
  margin: 0 0 8px;
}

.variant-card p {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  flex: 1;
}

.variant-card ul {
  margin: 0 0 14px;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.variant-card-link {
  font-weight: 700;
  margin-top: auto;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.why-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
}

.why-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.why-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* Content / SEO */

.content-section,
.seo-section {
  margin-top: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 28px;
  text-align: left;
}

.content-section h1,
.content-section h2 {
  margin-top: 0;
}

.content-section p {
  color: var(--text-secondary);
}

.content-section h2 {
  text-align: center;
}

.content-page-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 56px;
}

.content-page-main .content-section {
  margin-top: 24px;
}

.content-page-main .content-section h2 {
  text-align: left;
  font-size: 1.15rem;
  margin-top: 1.5rem;
}

.content-page-main .content-section h2:first-of-type {
  margin-top: 0;
}

.content-page-main .page-hero + .ad-slot {
  margin-top: 8px;
}

.content-cta {
  margin-top: 20px;
}

.content-play-btn {
  display: inline-block;
  text-decoration: none;
}

.content-section ul {
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 20px;
}

.game-over-achievement {
  margin: 0;
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
}

/* Footer */

.site-footer {
  margin-top: 48px;
  padding: 32px 20px;
  background: #080b10;
  border-top: 1px solid var(--border-subtle);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 320px;
}

.footer-brand p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: flex-start;
}

.footer-nav a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
}

.footer-copy {
  max-width: var(--max-width);
  margin: 20px auto 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Promotion modal */

.promotion-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.promotion-modal.is-open {
  display: flex;
}

.promotion-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.promotion-modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 24px;
  min-width: min(90vw, 320px);
  text-align: center;
  box-shadow: var(--shadow);
}

.promotion-modal-content h4 {
  margin: 0 0 8px;
}

.promotion-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.promotion-option {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  cursor: pointer;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 96px;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.promotion-option:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.promotion-option .piece-svg {
  width: 52px;
  height: 52px;
}

.promotion-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Platform / monetization-ready messaging */

.platform-section {
  margin-top: 48px;
}

.platform-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.platform-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.platform-pill-muted {
  color: var(--text-muted);
  border-style: dashed;
}

.roadmap-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 22px 24px;
  max-width: 820px;
  margin: 0 auto;
  text-align: left;
}

.roadmap-card h3 {
  margin: 0 0 10px;
}

.roadmap-card p {
  margin: 0 0 12px;
  color: var(--text-secondary);
}

.roadmap-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.roadmap-grid {
  display: grid;
  gap: 10px;
}

.roadmap-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.roadmap-item.roadmap-muted {
  border-style: dashed;
  color: var(--text-muted);
}

.rating-note {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
}

.rating-card {
  gap: 4px;
}

/* Game-only page */

.game-only-page {
  background: var(--bg-page);
}

.game-only-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.game-only-hero {
  text-align: center;
  padding: 28px 20px;
  margin-bottom: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.game-only-hero h1 {
  margin: 0 0 8px;
}

.game-only-hero p {
  margin: 0;
  color: var(--text-secondary);
}

/* Legacy content pages (light sections on dark site) */

body:not(.game-only-page) .content-section a {
  color: var(--accent);
}

/* Variants detail page */

.page-hero {
  text-align: center;
  padding: 40px 20px 24px;
}

.page-hero h1 {
  margin: 0 0 10px;
}

.page-hero p {
  margin: 0 auto;
  max-width: 640px;
  color: var(--text-secondary);
}

.variant-detail-grid {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.variant-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 22px;
  text-align: left;
}

.variant-detail-card h2 {
  margin: 8px 0 10px;
  font-size: 1.3rem;
}

.variant-detail-card p {
  color: var(--text-secondary);
}

.variant-detail-card ul {
  color: var(--text-secondary);
  padding-left: 20px;
}

/* Mobile */

@media (max-width: 960px) {
  .game-shell {
    display: flex;
    flex-direction: column;
  }

  .match-setup-panel {
    order: 1;
    margin: 0;
    padding: 14px 16px;
  }

  .game-arena {
    order: 2;
  }

  .lobby-secondary-stack {
    order: 3;
  }

  .match-setup-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .match-setup-label {
    padding-top: 0;
  }

  .setup-status-inline {
    text-align: left;
    width: 100%;
  }

  .arena-layout {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }

  .arena-main.game-center {
    order: 1;
  }

  .arena-sidebar {
    order: 2;
    display: contents;
  }

  .arena-panel-captured {
    order: 2;
  }

  .arena-panel-rules {
    order: 3;
  }

  .arena-panel-history {
    order: 4;
  }

  .arena-panel-coach {
    order: 5;
  }

  .lobby-secondary-stack {
    order: 5;
    display: flex;
    flex-direction: column;
    padding: 12px 16px 20px;
  }

  .game-arena {
    display: flex;
    flex-direction: column;
    padding: 12px 16px 8px;
  }

  .side-picker-inline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .side-picker {
    grid-template-columns: 1fr;
  }

  .option-chip-ai {
    flex: 1 1 100%;
  }

  .status-bar {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .clock-white,
  .clock-black {
    justify-self: center;
    text-align: center;
  }

  .turn-display { order: -1; }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .main-nav {
    justify-content: center;
  }

  .hero-section {
    padding: 40px 16px 36px;
  }

  .game-shell-header {
    flex-direction: column;
    align-items: stretch;
  }

  .game-shell-actions {
    justify-content: stretch;
  }

  .game-shell-actions button {
    flex: 1;
  }

  .setup-side-buttons {
    flex-direction: column;
  }

  .footer-inner {
    flex-direction: column;
  }

  .ad-slot {
    min-height: 70px;
  }

  .game-message {
    font-size: 0.86rem;
    padding: 0 6px;
  }

  .game-over-banner {
    padding: 10px 12px;
  }

  .game-over-actions .btn-primary,
  .game-over-actions .btn-secondary {
    flex: 1 1 100%;
    text-align: center;
  }

  .game-over-suggest {
    font-size: 0.78rem;
  }

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