/* ==========================================================================
   CHECKERS / DRAUGHTS GUIDE - THEMED SYSTEM
   ========================================================================== */

:root {
  --bg-dark: #140906;
  --table-felt-1: #2a140b;
  --table-felt-2: #160a05;
  --table-felt-3: #0e0503;
  --panel-bg: rgba(22, 10, 5, 0.88);
  --panel-border: rgba(255, 255, 255, 0.18);
  
  --wood-dark: #1b0d06;
  --wood-mid: #381a0b;
  --wood-light: #592910;
  
  --gold: #ffc95a;
  --crimson: #e45b55;
  --ink: #f4f0e7;
  --muted: #c2b3aa;
  
  --font-sans: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --header-height: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body.checkers-app {
  font-family: var(--font-sans);
  background: radial-gradient(circle at 50% 10%, var(--table-felt-1) 0%, var(--table-felt-2) 47%, var(--table-felt-3) 100%);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}

.app-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-height);
  background: rgba(20, 9, 6, 0.94); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--panel-border);
}
.header-inner { max-width: 1400px; margin: 0 auto; height: 100%; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-tile { font-size: 2rem; font-weight: 900; background: var(--crimson); border: 2px solid var(--gold); border-radius: 50%; width: 46px; height: 46px; display: grid; place-items: center; color: #fff; }
.brand-text h1 { font-size: 1.35rem; font-weight: 800; color: var(--ink); }
.brand-text .badge { font-size: 0.72rem; font-weight: 900; background: var(--gold); color: #151b1a; padding: 2px 8px; border-radius: 99px; }
.brand-text .subtitle { font-size: 0.8rem; color: var(--muted); }

.header-search { flex: 0 1 400px; position: relative; display: flex; align-items: center; }
.header-search input { width: 100%; padding: 10px 16px 10px 42px; background: rgba(3, 15, 12, 0.75); border: 1px solid var(--panel-border); border-radius: 99px; color: var(--ink); }
.search-icon { position: absolute; left: 14px; opacity: 0.6; }

.table-outer-wrapper { max-width: 1400px; margin: 20px auto; padding: 0 20px; }
.table-wood-frame { position: relative; background: linear-gradient(145deg, var(--wood-dark), var(--wood-mid), var(--wood-dark)); border-radius: 28px; padding: 18px; border: 4px solid var(--wood-light); box-shadow: 0 28px 80px rgba(0,0,0,0.75); }
.table-corner { position: absolute; width: 28px; height: 28px; border: 3.5px solid var(--gold); }
.corner-tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.corner-tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.corner-bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.corner-br { bottom: 12px; right: 12px; border-left: none; border-top: none; }
.table-felt-mat { background: linear-gradient(135deg, rgba(42,20,11,0.95), rgba(22,10,5,0.98)); border-radius: 20px; padding: 24px; border: 1px solid var(--panel-border); }

.table-mode-tabs { display: flex; flex-wrap: wrap; gap: 8px; background: rgba(3, 15, 12, 0.85); border: 1px solid var(--panel-border); padding: 10px; border-radius: 16px; margin-bottom: 24px; }
.table-tab { flex: 0 0 auto; padding: 9px 16px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--panel-border); color: var(--muted); font-weight: 800; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
.table-tab.active { background: var(--gold); color: #151b1a; border-color: var(--gold); box-shadow: 0 4px 14px rgba(255, 201, 90, 0.4); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }
.content-block { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 20px; padding: 28px; }
.tool-block { border-color: rgba(255, 201, 90, 0.4); background: radial-gradient(circle at 50% 20%, rgba(42,20,11,0.95), rgba(22,10,5,0.98)); }

.block-header { margin-bottom: 20px; }
.header-tag { font-size: 0.72rem; font-weight: 900; color: var(--gold); text-transform: uppercase; }
.block-header h2 { font-size: 1.55rem; font-weight: 900; color: var(--ink); }
.block-header p { color: var(--muted); font-size: 0.92rem; }

/* Checkers Board 8x8 */
.board-container { display: flex; justify-content: center; margin: 20px 0; }
.checkers-board-box { width: 100%; max-width: 480px; aspect-ratio: 1; border: 6px solid var(--wood-light); border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
.checkersboard { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); width: 100%; height: 100%; }
.sq { display: grid; place-items: center; user-select: none; }
.sq.light { background: #f0d9b5; }
.sq.dark { background: #b58863; }

.chip { width: 80%; height: 80%; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 4px 0 rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.3); font-size: 1.2rem; }
.chip.red { background: linear-gradient(145deg, #ff6b6b, #c92a2a); border: 2px solid #ff8787; color: #fff; }
.chip.black { background: linear-gradient(145deg, #343a40, #141517); border: 2px solid #495057; color: #fff; }

.piece-selector-grid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.piece-btn { padding: 8px 14px; border-radius: 8px; background: rgba(255,255,255,0.06); border: 1px solid var(--panel-border); color: var(--muted); font-weight: 800; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
.piece-btn.active { background: var(--gold); color: #151b1a; border-color: var(--gold); }

.piece-detail-card { background: rgba(22, 10, 5, 0.8); border: 1px solid var(--panel-border); border-radius: 14px; padding: 20px; }
.detail-header { display: flex; align-items: center; gap: 14px; }
.piece-avatar { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; background: #c92a2a; border: 2px solid var(--gold); color: #fff; }

.callout-box { display: flex; gap: 14px; padding: 18px; border-radius: 14px; }
.danger-callout { background: rgba(255, 201, 90, 0.12); border: 1px solid rgba(255, 201, 90, 0.35); }
.callout-icon { font-size: 1.8rem; }

.text-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.info-card { background: rgba(22, 10, 5, 0.7); border: 1px solid var(--panel-border); border-radius: 14px; padding: 18px; }
.info-card.highlight-card { background: rgba(42, 20, 11, 0.4); border-color: rgba(255, 201, 90, 0.4); }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }

/* ---- Phones. Added after a measured audit: these pages had no media query, so
   the nested table chrome took 180px of a 390px screen and the diagrams
   overflowed the page. Give the content its width back. ---- */
@media (max-width: 720px) {
  .header-inner { padding: 0 12px; gap: 10px; }
  .table-outer-wrapper { margin: 12px auto; padding: 0 10px; }
  .table-wood-frame { padding: 8px; }
  .table-felt-mat { padding: 12px; }
  .table-content-area { padding: 0; }
  .content-block { padding: 14px; }
  .block-header h2 { font-size: 1.15rem; }
  .text-card-grid { grid-template-columns: 1fr; gap: 12px; }
  .table-mode-tabs { padding: 6px; gap: 6px; }
}
