/* Chess Assist AI website: near-black, warm gold accents, chunky 3D buttons
   and tiles with a darker bottom edge, rounded friendly type. */
:root {
  --bg: #131313;
  --bg-2: #181818;
  --panel: #1d1d1d;
  --panel-2: #242424;
  --panel-3: #2c2c2c;
  --edge: #0b0b0b; /* the darker "3D" bottom edge */
  --line: #2d2d2d;
  --line-hi: #3a3a3a;
  --text: #f2f2f2;
  --muted: #a7a7a7;
  --faint: #737373;
  --gold: #f5c242;
  --gold-hi: #ffd462;
  --gold-edge: #b98a14;
  --gold-soft: rgba(245, 194, 66, 0.14);
  --green: #6fcf7a;
  --red: #ef6b6b;
  --amber: #f5c242;
  --sq-light: #eef1f5;
  --sq-dark: #3c4b69;
  --radius: 16px;
  --side-w: 270px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15.5px/1.55 Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, .display { font-family: Nunito, system-ui, sans-serif; font-weight: 800; letter-spacing: -0.01em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.bg-grid { display: none; }

/* ---------------- Sidebar */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); z-index: 20;
  display: flex; flex-direction: column; gap: 16px; padding: 22px 18px;
  background: #101010; border-right: 1px solid #222;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 20px; font-weight: 800; letter-spacing: .01em; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand b { color: var(--gold); }
.nav { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid #222; }
.nav a, .nav-pro {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 14px; text-decoration: none;
  color: var(--text); font-weight: 800; font-size: 16px;
  background: var(--panel-2); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--edge);
  transition: background .12s, border-color .12s, transform .08s, box-shadow .08s;
}
.nav a:hover, .nav-pro:hover { background: var(--panel-3); }
.nav a:active, .nav-pro:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.nav a.active, .nav-pro.active { border-color: var(--gold); box-shadow: 0 4px 0 var(--gold-edge); background: #1a1a1a; }
.ico {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; font-size: 16px;
  background: #2f2f2f; color: var(--gold);
}
.nav a.active .ico, .nav-pro.active .ico { background: var(--gold); color: #1a1a1a; }
.nav-sep { height: 1px; background: #222; margin: 4px 2px; }
.tag { font-style: normal; margin-left: auto; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 8px; }
.tag.soon { background: var(--gold); color: #1a1a1a; }
.tag.save { background: var(--gold); color: #1a1a1a; }
.tag.save:empty { display: none; }
.side-bottom { margin-top: auto; display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid #222; }
.side-note { margin: 0 4px; color: var(--faint); font-size: 13px; font-weight: 700; }

.topbar { display: none; }
.scrim { display: none; }
.main { position: relative; z-index: 1; margin-left: var(--side-w); padding: 36px 44px 60px; max-width: calc(1240px + var(--side-w)); outline: none; }

@media (max-width: 920px) {
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 15; padding: 12px 16px;
    background: #101010; border-bottom: 1px solid #222;
  }
  .menu-btn { all: unset; cursor: pointer; font-size: 22px; padding: 4px 10px; border-radius: 10px; background: var(--panel-2); box-shadow: 0 3px 0 var(--edge); }
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(0, 0, 0, 0.55); }
  .main { margin-left: 0; padding: 22px 16px 48px; }
}

/* ---------------- Buttons & panels */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none;
  padding: 12px 20px; border-radius: 14px; font-weight: 800; font-size: 15px;
  background: var(--panel-3); color: var(--text); border: 0; box-shadow: 0 4px 0 var(--edge);
  transition: transform .08s, box-shadow .08s, background .12s, filter .12s;
}
.btn:hover { background: #343434; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.btn-glow { background: var(--gold); color: #1a1a1a; box-shadow: 0 4px 0 var(--gold-edge); }
.btn-glow:hover { background: var(--gold-hi); }
.btn-glow:active { box-shadow: 0 1px 0 var(--gold-edge); }
.btn-outline { background: transparent; color: var(--gold); border: 2px solid var(--gold); box-shadow: 0 4px 0 var(--gold-edge); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 13px; font-size: 14px; border-radius: 11px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn-ghost { background: transparent; box-shadow: none; }

.panel { background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 0 var(--edge); }
.panel.pad { padding: 22px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.grad-text { color: var(--gold); }
.muted { color: var(--muted); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 6px 0 4px; font-size: 34px; line-height: 1.1; }
.page-head p { margin: 0; color: var(--muted); font-size: 16px; }

/* ---------------- Home */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 30px; align-items: center; margin-bottom: 30px; }
.hero h1 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.05; margin: 12px 0 16px; }
.hero p { color: var(--muted); font-size: 17.5px; max-width: 560px; margin: 0 0 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-board { position: relative; border-radius: 20px; padding: 14px; }
.hero-board .board-svg { border-radius: 10px; }
.hero-chip {
  position: absolute; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; font-size: 14px; font-weight: 800;
  background: var(--panel-2); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--edge);
}
.hero-chip .dot-live { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.feature { padding: 22px; text-decoration: none; display: grid; gap: 8px; transition: transform .1s, border-color .12s; }
.feature:hover { border-color: var(--gold); transform: translateY(-2px); }
.feature .f-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; background: var(--gold); color: #1a1a1a; box-shadow: 0 3px 0 var(--gold-edge); }
.feature h3 { margin: 6px 0 0; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }
.feature .go { color: var(--gold); font-weight: 800; font-size: 14.5px; margin-top: 4px; }
.section-title { font-size: 24px; margin: 36px 0 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-top: 28px; }
.stat { padding: 16px 18px; }
.stat b { display: block; font-size: 28px; font-weight: 900; }
.stat span { color: var(--muted); font-size: 14px; font-weight: 700; }

/* ---------------- Openings */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.search {
  flex: 1; min-width: 200px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--panel); font-weight: 700;
}
.search:focus { border-color: var(--gold); outline: none; }
.search::placeholder { color: var(--faint); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  cursor: pointer; padding: 9px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel-2);
  color: var(--muted); font-weight: 800; font-size: 14px; box-shadow: 0 3px 0 var(--edge);
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); box-shadow: 0 3px 0 var(--gold-edge); }
.progress-pill { display: inline-flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 14px; font-weight: 800; }
.bar { height: 8px; border-radius: 999px; background: #2e2e2e; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.progress-pill .bar { width: 120px; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.course { overflow: hidden; display: flex; flex-direction: column; transition: transform .1s, border-color .12s; }
.course:hover { transform: translateY(-2px); border-color: var(--gold); }
.course .thumb { position: relative; display: block; padding: 14px 14px 0; }
.course .thumb .board-svg { border-radius: 10px; }
.course .badges { position: absolute; top: 22px; left: 22px; display: flex; gap: 6px; }
.badge { font-size: 11.5px; font-weight: 900; padding: 3px 9px; border-radius: 7px; letter-spacing: .02em; }
.badge.w { background: #f5f5f5; color: #1a1a1a; }
.badge.b { background: #111; color: #f5f5f5; border: 1px solid #444; }
.badge.lvl { background: var(--gold); color: #1a1a1a; }
.course .body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course h3 { margin: 0; font-size: 19px; }
.course p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.course .meta { display: flex; justify-content: space-between; color: var(--faint); font-size: 13px; font-weight: 800; }
.course .actions { display: flex; gap: 10px; margin-top: 6px; }
.course .actions .btn { flex: 1; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* Course page */
.course-page { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 26px; align-items: start; }
.back { display: inline-flex; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 800; margin-bottom: 16px; }
.back:hover { color: var(--gold); }
.lines { display: grid; gap: 12px; }
.line-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.line-row .num {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 900; flex: none;
  background: var(--panel-3); box-shadow: 0 3px 0 var(--edge);
}
.line-row.learned .num { background: var(--green); color: #102414; box-shadow: 0 3px 0 #3f8a48; }
.line-row .info { flex: 1; min-width: 0; }
.line-row .info b { display: block; font-size: 16px; }
.line-row .info span { color: var(--faint); font-size: 13px; font-family: ui-monospace, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.line-row .status { font-size: 12.5px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.line-row.learned .status { color: var(--green); }
.line-row .btns { display: flex; gap: 8px; }

/* Trainer */
.trainer { display: grid; grid-template-columns: minmax(0, 620px) minmax(280px, 1fr); gap: 26px; align-items: start; }
.board-wrap { position: relative; }
.board-svg { width: 100%; aspect-ratio: 1; display: block; user-select: none; touch-action: none; }
.board-svg.can-move { cursor: pointer; }
.sq-light { fill: var(--sq-light); }
.sq-dark { fill: var(--sq-dark); }
.coord { font-size: 0.19px; font-weight: 800; font-family: Nunito, sans-serif; }
.coord.on-light { fill: var(--sq-dark); }
.coord.on-dark { fill: var(--sq-light); }
.mark-last { fill: rgba(245, 194, 66, 0.42); }
.mark-hint { fill: rgba(245, 194, 66, 0.6); }
.mark-selected { fill: rgba(245, 194, 66, 0.6); }
.mark-good { fill: rgba(111, 207, 122, 0.6); }
.mark-bad { fill: rgba(239, 107, 107, 0.65); }
.mark-check { fill: rgba(239, 107, 107, 0.6); }
.dot { fill: rgba(17, 17, 17, 0.3); }
.dot-ring { fill: none; stroke: rgba(17, 17, 17, 0.3); stroke-width: 0.08; }
.board-svg .ghost { filter: drop-shadow(0 0.08px 0.1px rgba(0, 0, 0, 0.45)); }
.board-frame { padding: 10px; border-radius: 18px; }
.board-frame .board-svg { border-radius: 10px; overflow: hidden; }

.side { display: grid; gap: 14px; }
.side h2 { margin: 0; font-size: 23px; }
.mode-tabs { display: flex; gap: 8px; background: var(--panel); border: 2px solid var(--line); padding: 6px; border-radius: 14px; }
.mode-tabs button { all: unset; cursor: pointer; flex: 1; text-align: center; padding: 9px 10px; border-radius: 10px; font-weight: 800; color: var(--muted); }
.mode-tabs button[aria-pressed="true"] { background: var(--gold); color: #1a1a1a; box-shadow: 0 3px 0 var(--gold-edge); }
.coach { display: flex; gap: 12px; align-items: flex-start; }
.coach .avatar {
  width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 24px;
  background: var(--gold); color: #1a1a1a; box-shadow: 0 3px 0 var(--gold-edge);
}
.bubble { flex: 1; padding: 14px 16px; border-radius: 6px 16px 16px 16px; background: var(--panel-2); border: 2px solid var(--line); }
.bubble b { display: block; margin-bottom: 3px; font-size: 16px; font-weight: 800; }
.bubble p { margin: 0; color: var(--muted); }
.bubble.good { border-color: var(--green); }
.bubble.good b { color: var(--green); }
.bubble.bad { border-color: var(--red); }
.bubble.bad b { color: var(--red); }
.moves { display: flex; flex-wrap: wrap; gap: 4px 6px; font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; }
.moves span { padding: 2px 6px; border-radius: 6px; color: var(--faint); }
.moves span.done { color: var(--text); }
.moves span.now { background: var(--gold); color: #1a1a1a; font-weight: 700; }
.moves span.hidden { color: transparent; background: var(--panel-3); min-width: 28px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .btn { flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { padding: 12px; text-align: center; }
.kpi b { display: block; font-size: 23px; font-weight: 900; }
.kpi span { color: var(--faint); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* Puzzles */
.setup { display: grid; gap: 18px; max-width: 880px; }
.elo-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.elo-input {
  width: 130px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--gold); background: var(--panel-2);
  font-size: 26px; font-weight: 900; text-align: center; color: var(--gold); box-shadow: 0 4px 0 var(--gold-edge);
}
.elo-row input[type="range"] { flex: 1; min-width: 200px; accent-color: var(--gold); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.theme {
  cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--panel-2); font-weight: 800; text-align: left; color: var(--muted);
  box-shadow: 0 4px 0 var(--edge); transition: transform .08s, box-shadow .08s;
}
.theme span { font-size: 18px; width: 22px; text-align: center; color: var(--text); }
.theme:hover { color: var(--text); }
.theme:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.theme[aria-pressed="true"] { color: var(--text); border-color: var(--gold); box-shadow: 0 4px 0 var(--gold-edge); }
.theme-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-tags span { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 8px; background: var(--panel-3); color: var(--muted); }
.to-move { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.to-move i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid #555; }
.source { color: var(--faint); font-size: 13px; }
.source a { color: var(--muted); }

/* Extension / app / pro */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; align-items: center; }
.steps { display: grid; gap: 12px; counter-reset: step; }
.step { display: flex; gap: 14px; padding: 16px; }
.step::before {
  counter-increment: step; content: counter(step); flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 900; background: var(--gold); color: #1a1a1a; box-shadow: 0 3px 0 var(--gold-edge);
}
.step > div > b { display: block; font-size: 16px; }
.step p { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; }
.step code, .code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--panel-3); padding: 1px 6px; border-radius: 6px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check-list li::before { content: "✓"; color: var(--gold); font-weight: 900; }
.mock { aspect-ratio: 16 / 11; border-radius: 18px; padding: 16px; display: grid; grid-template-columns: 1fr 140px; gap: 12px; }
.mock .mini-panel { border-radius: 12px; padding: 12px; background: #1b1d21; border: 1px solid #34383e; display: grid; gap: 8px; align-content: start; font-size: 12px; }
.mock .mini-panel b { font-size: 15px; }
.mock .mini-panel .bar > i { background: #6fbf73; }
.phone {
  width: 260px; aspect-ratio: 9 / 19; border-radius: 40px; padding: 12px; margin: 0 auto; position: relative;
  background: #1f1f1f; border: 2px solid #333; box-shadow: 0 8px 0 var(--edge);
}
.phone .screen { height: 100%; border-radius: 30px; overflow: hidden; background: var(--bg); display: grid; align-content: start; gap: 10px; padding: 34px 14px 14px; }
.phone .notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 80px; height: 22px; border-radius: 12px; background: #000; }
.store-row { display: flex; gap: 12px; flex-wrap: wrap; }
.store { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 14px; background: var(--panel-2); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--edge); opacity: .8; cursor: not-allowed; }
.store b { display: block; font-size: 15px; }
.store small { color: var(--faint); font-size: 11px; display: block; }

.plans-toggle { display: inline-flex; gap: 6px; padding: 6px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel-2); }
.plans-toggle button { all: unset; cursor: pointer; padding: 8px 16px; border-radius: 10px; font-weight: 800; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; }
.plans-toggle button[aria-pressed="true"] { background: var(--gold); color: #1a1a1a; box-shadow: 0 3px 0 var(--gold-edge); }
.plans-toggle button[aria-pressed="true"] .tag.save { background: #1a1a1a; color: var(--gold); }
.price-card { position: relative; padding: 28px; display: grid; gap: 16px; overflow: hidden; border-color: var(--gold); box-shadow: 0 5px 0 var(--gold-edge); }
.price { display: flex; align-items: baseline; gap: 8px; }
.price .amount { font-size: 56px; font-weight: 900; line-height: 1; }
.price .per { color: var(--muted); font-weight: 800; }
.price .old { color: var(--faint); text-decoration: line-through; font-weight: 800; }
.billed { color: var(--muted); font-size: 14.5px; font-weight: 700; }
.fine { color: var(--faint); font-size: 13px; margin: 0; }
.faq { display: grid; gap: 12px; }
.faq details { padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 800; }
.faq p { margin: 8px 0 0; color: var(--muted); }

.footer { margin-top: 46px; padding-top: 20px; border-top: 1px solid #222; color: var(--faint); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

@media (max-width: 1100px) {
  .hero, .split, .course-page, .trainer { grid-template-columns: minmax(0, 1fr); }
  .hero-board { max-width: 480px; }
}
@media (max-width: 560px) {
  .page-head h1 { font-size: 28px; }
  .line-row { flex-wrap: wrap; }
  .line-row .btns { width: 100%; }
  .line-row .btns .btn { flex: 1; }
}
