:root {
  color-scheme: dark;
  --bg: #07101f;
  --surface: #0d1a2d;
  --surface-2: #14233a;
  --ink: #f7f4ed;
  --muted: #aeb9cb;
  --accent: #d8ad54;
  --accent-2: #78a9ff;
  --line: rgba(255,255,255,.14);
  --light-square: #dce6ed;
  --dark-square: #496276;
  --sun-piece: #f8f1df;
  --sun-edge: #c9a24f;
  --moon-piece: #101b2a;
  --moon-edge: #7e9ab2;
  --radius: 24px;
  --shadow: 0 26px 70px rgba(0,0,0,.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); }
button, select, a { font: inherit; }
a { color: inherit; }
button, select { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 30; padding: .8rem 1rem; background: var(--ink); color: var(--bg); border-radius: 999px; }
.skip-link:focus { top: 1rem; }

.game-shell { min-height: 100vh; position: relative; overflow: hidden; }
.game-shell::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 15% 12%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 34%), radial-gradient(circle at 84% 25%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 32%); }
.site-header { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0; border-bottom: 1px solid var(--line); }
.brand-lockup { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; font-weight: 850; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: var(--bg); background: var(--accent); font-size: 1.15rem; font-weight: 950; }
.brand-lockup small { display: block; margin-top: .14rem; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .15em; }
.site-nav { display: flex; align-items: center; gap: 1rem; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 720; font-size: .9rem; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--ink); }
.nav-cta { padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 999px; }

.game-main { position: relative; z-index: 1; width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: clamp(42px, 6vw, 82px) 0 70px; }
.game-intro { display: grid; grid-template-columns: 1.15fr .85fr; align-items: end; gap: 2rem; margin-bottom: 34px; }
.eyebrow { margin: 0 0 .8rem; color: var(--accent); font-size: .76rem; font-weight: 900; text-transform: uppercase; letter-spacing: .18em; }
h1 { max-width: 820px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 7vw, 6.9rem); font-weight: 600; line-height: .88; letter-spacing: -.065em; }
h1 em { color: var(--accent); font-style: italic; }
.intro-copy { max-width: 490px; justify-self: end; }
.intro-copy > p { margin: 0 0 1.4rem; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.16rem); line-height: 1.65; }
.trust-row { display: flex; flex-wrap: wrap; gap: .55rem; }
.trust-row span { padding: .5rem .72rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .78rem; font-weight: 750; }

.game-layout { display: grid; grid-template-columns: minmax(290px, 1fr) 340px; gap: 24px; align-items: start; }
.board-panel, .side-panel { border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--shadow); }
.board-panel { padding: clamp(14px, 2.4vw, 28px); border-radius: calc(var(--radius) + 8px); }
.board-topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 16px; }
.turn-status { margin: 0; font-weight: 850; letter-spacing: -.01em; }
.autosave { color: var(--muted); font-size: .75rem; }
.checkers-board { display: grid; grid-template-columns: repeat(8, 1fr); width: 100%; aspect-ratio: 1; overflow: hidden; border: 7px solid color-mix(in srgb, var(--surface-2) 82%, black); border-radius: 18px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 22px 45px rgba(0,0,0,.28); }
.square { position: relative; display: grid; place-items: center; min-width: 0; padding: 0; border: 0; border-radius: 0; }
.square.light { background: var(--light-square); }
.square.dark { cursor: pointer; background: var(--dark-square); }
.square.dark:disabled { cursor: default; opacity: 1; }
.square.dark::after { content: ""; position: absolute; inset: 10%; border: 3px solid transparent; border-radius: 50%; pointer-events: none; transition: .18s ease; }
.square.can-move .piece { box-shadow: 0 0 0 3px var(--accent-2), 0 9px 15px rgba(0,0,0,.34); }
.square.selected::after { border-color: var(--accent); border-radius: 18%; }
.square.destination::after { inset: 34%; border: 0; background: color-mix(in srgb, var(--accent) 86%, white); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent); }
.square.hinted { animation: hintPulse 1s ease-in-out infinite alternate; }
.square.last-move { box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--accent-2) 58%, transparent); }
.piece { position: relative; z-index: 2; display: grid; place-items: center; width: 74%; aspect-ratio: 1; border-radius: 50%; transition: transform .17s ease, box-shadow .17s ease; }
.square:hover .piece { transform: translateY(-3px); }
.piece::before { content: ""; position: absolute; inset: 12%; border: 2px solid currentColor; border-radius: inherit; opacity: .34; }
.piece.sun { color: #755f35; background: radial-gradient(circle at 35% 28%, #fff, var(--sun-piece) 56%, #c9b88e); border: 4px solid var(--sun-edge); box-shadow: 0 9px 15px rgba(0,0,0,.3); }
.piece.moon { color: #c8d7e5; background: radial-gradient(circle at 35% 28%, #405064, var(--moon-piece) 58%, #050a11); border: 4px solid var(--moon-edge); box-shadow: 0 9px 15px rgba(0,0,0,.42); }
.piece i { position: relative; z-index: 2; font-style: normal; font-size: clamp(.9rem, 3vw, 2rem); }

.side-panel { display: grid; gap: 18px; padding: 22px; border-radius: var(--radius); }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: .42rem; }
.field span { color: var(--muted); font-size: .72rem; font-weight: 850; text-transform: uppercase; letter-spacing: .12em; }
select { width: 100%; padding: .75rem .8rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.coach-card { padding: 16px; border-left: 3px solid var(--accent); border-radius: 5px 15px 15px 5px; background: var(--surface-2); }
.coach-card h2 { margin: 0 0 .4rem; font-size: .72rem; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; }
.coach-card p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.5; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button { min-height: 44px; padding: .72rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: transparent; cursor: pointer; font-weight: 820; }
.button.primary { grid-column: 1 / -1; color: var(--bg); border-color: var(--accent); background: var(--accent); }
.button:hover:not(:disabled), .button:focus-visible { transform: translateY(-1px); border-color: var(--accent); }
.button:disabled { cursor: not-allowed; opacity: .44; }
.side-section { padding-top: 16px; border-top: 1px solid var(--line); }
.side-section h2 { margin: 0 0 .8rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; }
.achievements { display: flex; flex-wrap: wrap; gap: .45rem; }
.achievement { padding: .42rem .55rem; border-radius: 8px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); font-size: .74rem; font-weight: 800; }
.achievement.locked { color: var(--muted); background: var(--surface-2); }
.move-list { display: grid; gap: .45rem; max-height: 170px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.move-list li { display: grid; grid-template-columns: 2rem 1fr auto; gap: .5rem; color: var(--muted); font-size: .8rem; }
.move-list code { color: var(--ink); font-weight: 800; }

.feature-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.feature { min-height: 150px; padding: 22px; background: var(--surface); }
.feature b { display: block; color: var(--accent); font-size: 1.45rem; }
.feature h2 { margin: .65rem 0 .35rem; font-size: .95rem; }
.feature p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.sponsor-slot { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; margin-top: 24px; padding: 18px 22px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); text-decoration: none; }
.sponsor-slot strong { color: var(--ink); }
.sponsor-slot small { display: block; margin-bottom: .2rem; color: var(--accent); text-transform: uppercase; letter-spacing: .12em; }
.game-footer { position: relative; z-index: 1; width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 46px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.game-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: .8rem; }
.game-footer a { text-decoration: none; }

body[data-checkers-theme="jasons"] {
  color-scheme: light;
  --bg: #fff7e8;
  --surface: #fffdf7;
  --surface-2: #edf8f4;
  --ink: #27344c;
  --muted: #617086;
  --accent: #f28f74;
  --accent-2: #55a9a0;
  --line: rgba(39,52,76,.14);
  --light-square: #fff1cf;
  --dark-square: #72b9ad;
  --sun-piece: #fff7e7;
  --sun-edge: #ed8c73;
  --moon-piece: #5c6fa4;
  --moon-edge: #3c4d7a;
  --shadow: 0 24px 60px rgba(71,71,84,.14);
}
body[data-checkers-theme="jasons"] .game-shell::before { background: radial-gradient(circle at 8% 12%, rgba(255,193,124,.34), transparent 28%), radial-gradient(circle at 90% 20%, rgba(98,193,179,.27), transparent 30%); }
body[data-checkers-theme="jasons"] h1 { font-family: "Trebuchet MS", ui-rounded, system-ui, sans-serif; font-weight: 900; letter-spacing: -.055em; }
body[data-checkers-theme="jasons"] .brand-mark { background: var(--accent); color: white; border-radius: 50% 50% 46% 54%; transform: rotate(-3deg); }
body[data-checkers-theme="jasons"] .board-panel, body[data-checkers-theme="jasons"] .side-panel { background: rgba(255,253,247,.94); }

body[data-checkers-theme="townline"] {
  --bg: #061523;
  --surface: #0a2032;
  --surface-2: #102d42;
  --ink: #eff9ff;
  --muted: #a4bfce;
  --accent: #42d1c5;
  --accent-2: #2a7de1;
  --line: rgba(156,211,230,.18);
  --light-square: #dbe9ec;
  --dark-square: #327b82;
  --sun-piece: #effafa;
  --sun-edge: #35bfb7;
  --moon-piece: #10273a;
  --moon-edge: #3f8fe7;
}
body[data-checkers-theme="townline"] .game-shell::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 36vh; pointer-events: none; opacity: .45; background: linear-gradient(to top, rgba(4,13,22,.95), transparent), url("/townline/assets/townline-mountain-silhouette.svg") bottom center / cover no-repeat; }
body[data-checkers-theme="townline"] .brand-mark { color: white; background: linear-gradient(145deg, #2b80df, #38c8bd); clip-path: polygon(50% 0,100% 100%,50% 76%,0 100%); border-radius: 0; }
body[data-checkers-theme="townline"] h1 { font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-weight: 900; letter-spacing: -.075em; }

@keyframes hintPulse { to { box-shadow: inset 0 0 0 5px var(--accent); } }
@media (max-width: 920px) {
  .game-intro { grid-template-columns: 1fr; align-items: start; }
  .intro-copy { justify-self: start; }
  .game-layout { grid-template-columns: 1fr; }
  .side-panel { grid-template-columns: 1fr 1fr; }
  .coach-card, .action-grid { grid-column: span 1; }
  .feature-strip { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .site-header { align-items: flex-start; }
  .site-nav a:not(.nav-cta) { display: none; }
  .game-main { padding-top: 35px; }
  h1 { font-size: clamp(3.4rem, 18vw, 5rem); }
  .game-intro { margin-bottom: 24px; }
  .board-panel { padding: 9px; border-radius: 20px; }
  .checkers-board { border-width: 5px; border-radius: 13px; }
  .piece { width: 78%; border-width: 3px; }
  .side-panel { grid-template-columns: 1fr; }
  .feature-strip { grid-template-columns: 1fr; }
  .feature { min-height: auto; }
  .sponsor-slot { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
