:root {
  --bg: #f7f1e7;
  --card: #fffaf2;
  --text: #2f261d;
  --muted: #6d6254;
  --board-dark: #8b5a2b;
  --board-light: #e7c795;
  --red: #c23b32;
  --black: #1f2730;
  --gold: #f2c14e;
  --legal: rgba(79, 163, 119, 0.92);
  --shadow: 0 14px 34px rgba(67, 48, 26, 0.12);
  --radius: 26px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', Arial, sans-serif;
  background: radial-gradient(circle at 20% 0%, #fffdf7 0%, #fcf8f1 28%, #f4ebdd 100%);
  color: var(--text);
}
button, select { font: inherit; }
.site-header { background: #fffdf8; border-bottom: 1px solid #ecdfca; position: sticky; top: 0; z-index: 20; }
.header-inner, .footer-inner, .page-shell { max-width: 1360px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; flex-wrap: wrap; }
.brand-wrap { display: flex; flex-direction: column; gap: 4px; }
.brand { text-decoration: none; color: var(--text); font-size: 1.5rem; font-weight: 800; }
.tagline { color: var(--muted); font-weight: 700; letter-spacing: 0.14em; font-size: 0.8rem; }
.site-nav, .footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.site-nav a, .footer-links a, .breadcrumb-bar a { text-decoration: none; color: var(--text); font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover, .footer-links a:hover, .breadcrumb-bar a:hover, .brand:hover { opacity: 0.78; }
.page-shell { padding-top: 18px; padding-bottom: 46px; }
.breadcrumb-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 0.92rem; margin-bottom: 16px; }
.hero-card, .game-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-card { padding: 24px; margin-bottom: 22px; text-align: center; }
.eyebrow { margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; font-weight: 800; }
.hero-card h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; }
.hero-copy { margin: 12px auto 0; max-width: 760px; color: var(--muted); line-height: 1.6; }

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(250px, 22vw, 300px);
  gap: 18px;
  align-items: start;
}
.game-card { padding: 20px; }
.board-card { min-width: 0; }
.side-panel { width: 100%; max-width: 300px; justify-self: end; padding: 18px; margin-top: 72px; }
.game-toolbar { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-label, .mini-label, .field-label { font-size: 0.82rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.toolbar-value { font-size: 1.7rem; font-weight: 900; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.action-button { appearance: none; border: 0; border-radius: 999px; padding: 11px 16px; font-weight: 800; background: var(--text); color: #fff; cursor: pointer; transition: transform 0.15s ease, opacity 0.15s ease; }
.action-button.secondary { background: #efe1c4; color: var(--text); }
.action-button:hover { transform: translateY(-1px); }
.action-button:disabled { opacity: 0.48; cursor: not-allowed; transform: none; }
.status-banner { background: #f8f1e4; color: #5e523f; border-radius: 16px; padding: 9px 11px; font-weight: 800; min-height: 38px; display: flex; align-items: center; line-height: 1.35; }
.status-banner.capture { background: #fff3d8; color: #7b4b00; border-color: #ecc46d; }
.status-banner.finished { background: #ffe5df; color: #8b2b19; border-color: #efb4a6; }
.side-status-wrap { margin-top: 8px; }
.side-status { margin-top: 5px; border: 1px solid #eadcc3; background: #fffdf8; }

.board-scroll { overflow-x: auto; padding: 8px 0 10px; display: flex; justify-content: center; }
.checkers-board-wrap {
  box-sizing: content-box;
  width: min(100%, 720px);
  min-width: 320px;
  aspect-ratio: 1 / 1;
  padding: 14px;
  border: 8px solid #8f5c2a;
  border-radius: 30px;
  background:
    radial-gradient(circle at 18% 10%, rgba(255,255,255,0.26), transparent 28%),
    linear-gradient(135deg, #e2b772 0%, #bd8340 48%, #89531f 100%);
  box-shadow:
    inset 0 5px 0 rgba(255,255,255,0.22),
    inset 0 -9px 0 rgba(86, 49, 18, 0.22),
    0 22px 42px rgba(67, 48, 26, 0.24);
}
.checkers-board {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border-radius: 20px;
  overflow: hidden;
  background: #6c4320;
  box-shadow: inset 0 0 0 3px rgba(77, 45, 16, 0.36);
}
.square { position: relative; border: 0; padding: 0; margin: 0; cursor: pointer; min-height: 38px; }
.square.light { background: linear-gradient(135deg, #f0d6a6, var(--board-light)); cursor: default; }
.square.dark { background: linear-gradient(135deg, #9a6632, var(--board-dark)); }
.square.dark:hover { filter: brightness(1.04); }
.square.selected { box-shadow: inset 0 0 0 5px rgba(242, 193, 78, 0.95); }
.square.last-from::after, .square.last-to::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 12px;
  border: 2px dashed rgba(255,255,255,0.72);
  pointer-events: none;
}
.hint { position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; background: var(--legal); border: 3px solid rgba(255,255,255,0.92); z-index: 1; pointer-events: none; box-shadow: 0 2px 7px rgba(0,0,0,0.18); }
.hint.capture-hint { width: 72%; height: 72%; background: transparent; border: 4px solid rgba(79, 163, 119, 0.95); }
.piece { position: absolute; inset: 0; margin: auto; width: 72%; height: 72%; border-radius: 50%; border: 2px solid rgba(0,0,0,0.18); box-shadow: inset 0 6px 10px rgba(255,255,255,0.18), inset 0 -7px 10px rgba(0,0,0,0.18), 0 7px 12px rgba(0,0,0,0.25); display: grid; place-items: center; z-index: 2; font-weight: 900; font-size: clamp(1rem, 3vw, 1.65rem); color: #fff; transition: transform 0.14s ease, box-shadow 0.14s ease; }
.square.dark:hover .piece { transform: translateY(-1px); }
.piece.red { background: radial-gradient(circle at 35% 28%, #f09b8d 0%, #d84b41 42%, var(--red) 100%); }
.piece.black { background: radial-gradient(circle at 35% 28%, #646f7b 0%, #303b47 44%, var(--black) 100%); }
.piece.king::after { content: '♛'; color: var(--gold); text-shadow: 0 1px 1px rgba(0,0,0,0.35); font-size: 1.1em; }
.piece.ai-thinking { animation: thinkingPulse 0.75s ease-in-out infinite; }
@keyframes thinkingPulse { 0%,100% { box-shadow: inset 0 6px 10px rgba(255,255,255,0.18), inset 0 -7px 10px rgba(0,0,0,0.18), 0 7px 12px rgba(0,0,0,0.25); } 50% { box-shadow: 0 0 0 10px rgba(242,193,78,0.18), 0 7px 12px rgba(0,0,0,0.25); } }

.side-panel section + section { margin-top: 18px; padding-top: 18px; border-top: 1px solid #eadcc3; }
.side-panel h2 { margin: 0 0 10px; font-size: 1.15rem; }
.side-panel p, .side-panel li { color: var(--muted); line-height: 1.6; }
.side-panel ul { margin: 0; padding-left: 18px; }
.settings-panel { display: grid; gap: 8px; }
.select-input { width: 100%; border: 1px solid #e5d4b7; background: #fffdf8; border-radius: 14px; padding: 10px 12px; color: var(--text); font-weight: 700; }
.toggle-row { display: flex; align-items: center; gap: 9px; color: var(--muted); font-weight: 700; margin-top: 4px; }
.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score-card { border: 1px solid #eadcc3; border-radius: 16px; padding: 10px; background: #fffdf8; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.score-label { color: var(--muted); font-weight: 800; font-size: 0.86rem; }
.score-card strong { font-size: 1.45rem; }
.red-score strong { color: var(--red); }
.black-score strong { color: var(--black); }
.section-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.text-button { border: 0; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.text-button:hover { color: var(--text); }
.move-log { margin: 0; padding: 10px 10px 10px 32px; height: 180px; overflow-y: auto; background: #fffdf8; border: 1px solid #eadcc3; border-radius: 16px; color: var(--muted); }
.move-log li { margin-bottom: 7px; line-height: 1.45; }
.move-log li:last-child { color: var(--text); font-weight: 800; }
details summary { cursor: pointer; font-weight: 800; }
.site-footer { border-top: 1px solid #ecdfca; background: #fffdf8; }
.footer-inner { padding-top: 18px; padding-bottom: 18px; display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 0.95rem; }
.footer-brand { color: var(--text); font-weight: 800; margin-bottom: 4px; }
.footer-tagline { color: var(--muted); }

@media (max-width: 980px) {
  .game-layout { grid-template-columns: 1fr; }
  .side-panel { max-width: none; justify-self: stretch; margin-top: 0; }
}
@media (max-width: 640px) {
  .header-inner { justify-content: center; text-align: center; }
  .brand-wrap, .footer-brand-block { width: 100%; text-align: center; }
  .site-nav, .footer-links, .breadcrumb-bar { justify-content: center; }
  .page-shell { padding-top: 16px; padding-bottom: 28px; }
  .hero-card, .game-card { border-radius: 20px; padding: 14px; }
  .toolbar-value { font-size: 1.35rem; }
  .checkers-board-wrap { padding: 8px; border-width: 6px; }
  .hint { width: 12px; height: 12px; border-width: 2px; }
  .hint.capture-hint { border-width: 3px; }
  .move-log { height: 150px; }
  .footer-inner { justify-content: center; text-align: center; }
}
