/* Square One Chess Homework — friendly, readable, kid-and-parent proof. */
:root {
  --navy: #1f2a44;
  --navy-soft: #2c3a5c;
  --gold: #e8a33d;
  --gold-soft: #fdf3df;
  --cream: #faf7f1;
  --ink: #22304a;
  --muted: #6b7688;
  --line: #e4e0d6;
  --green: #2e7d4f;
  --green-soft: #e6f4ea;
  --red: #b3261e;
  --red-soft: #fdecea;
  --blue-soft: #e8f0fe;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(31, 42, 68, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
}
a { color: var(--navy); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; }
h1 { font-size: 2rem; margin: 0.2em 0 0.4em; }
h2 { font-size: 1.35rem; margin: 1.2em 0 0.5em; }
h3 { font-size: 1.1rem; margin: 1em 0 0.4em; }
p { margin: 0.4em 0 0.8em; }
.muted { color: var(--muted); font-size: 0.92rem; }
.small { font-size: 0.85rem; }
.container { max-width: 1020px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }

/* Header */
.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1.2rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; }
.brand-mark { font-size: 1.9rem; line-height: 1; color: var(--gold); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; }
.brand-text small { font-size: 0.8rem; color: #c9d2e4; letter-spacing: 0.04em; }
.topnav { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.topnav a, .topnav button.linklike {
  color: #dbe2f0; text-decoration: none; background: none; border: 0;
  font: inherit; font-size: 0.95rem; padding: 0.45rem 0.7rem; border-radius: 8px; cursor: pointer;
}
.topnav a:hover, .topnav button.linklike:hover { background: var(--navy-soft); color: #fff; }
.topnav a.active { background: var(--navy-soft); color: #fff; }
.topnav .chip {
  background: var(--gold); color: var(--navy); font-weight: 700;
  padding: 0.35rem 0.7rem; border-radius: 999px; font-size: 0.9rem;
}

/* Cards, grids, buttons */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin-bottom: 1rem;
}
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.btn {
  display: inline-block; background: var(--navy); color: #fff; border: 0;
  padding: 0.65rem 1.2rem; border-radius: 10px; font-size: 1rem; font-weight: 600;
  cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { background: var(--navy-soft); }
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.gold:hover { background: #f0b45c; }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.small { padding: 0.4rem 0.8rem; font-size: 0.9rem; }
.btn.danger { background: var(--red); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btnrow { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; }

/* Badges and pills */
.pill {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--blue-soft); color: var(--navy);
  margin-right: 0.3rem; vertical-align: middle;
}
.pill.gold { background: var(--gold-soft); color: #8a5a12; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.gray { background: #eef0f3; color: var(--muted); }

/* Forms */
label { display: block; font-weight: 600; margin: 0.7rem 0 0.25rem; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; padding: 0.6rem 0.7rem; border: 1.5px solid #c9ced8; border-radius: 9px;
  font: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
textarea { min-height: 90px; resize: vertical; }
.field-error { color: var(--red); font-size: 0.9rem; margin-top: 0.3rem; }
.help { color: var(--muted); font-size: 0.88rem; margin-top: 0.25rem; }
.radio-row { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 0; }
.radio-row label {
  display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 400;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 0.55rem 0.7rem; cursor: pointer; margin: 0;
}
.radio-row label.picked { border-color: var(--gold); background: var(--gold-soft); }
.radio-row label.correct { border-color: var(--green); background: var(--green-soft); }
.radio-row label.wrong { border-color: var(--red); background: var(--red-soft); }
.check { font-weight: 700; }

/* Assignment list */
.assign { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.assign h3 { margin-top: 0; }
.assign .meta { margin: 0.2rem 0 0.6rem; }
.lock { font-size: 1.1rem; }
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.8rem 0 1.2rem; }
.filters select { width: auto; padding: 0.45rem 0.6rem; }
.progress { font-size: 0.9rem; color: var(--muted); }

/* Chess boards */
.board-wrap { max-width: 520px; margin: 0.5rem auto; }
.board-wrap.small { max-width: 260px; }
.board-wrap .board { width: 100%; }
.board-wrap .board img { max-width: none; }
.square-selected { box-shadow: inset 0 0 0 4px var(--gold); }
.square-lastmove { box-shadow: inset 0 0 0 4px rgba(232, 163, 61, 0.55); }
.feedback { border-radius: 10px; padding: 0.7rem 0.9rem; margin: 0.7rem 0; font-weight: 600; }
.feedback.good { background: var(--green-soft); color: var(--green); }
.feedback.try { background: var(--gold-soft); color: #8a5a12; }
.feedback.info { background: var(--blue-soft); color: var(--navy); }
.movelist { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.6rem 0; }
.movelist button {
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  padding: 0.25rem 0.5rem; font: inherit; font-size: 0.9rem; cursor: pointer;
}
.movelist button.current { background: var(--navy); color: #fff; border-color: var(--navy); }
.note-box { background: var(--gold-soft); border-left: 4px solid var(--gold); padding: 0.6rem 0.9rem; border-radius: 0 10px 10px 0; margin: 0.7rem 0; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--gold-soft); }
.tablewrap { overflow-x: auto; }

/* Tabs */
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.8rem 0 1.2rem; }
.tabs button {
  border: 1.5px solid var(--navy); background: #fff; color: var(--navy);
  border-radius: 999px; padding: 0.45rem 1rem; font: inherit; font-weight: 600; cursor: pointer;
}
.tabs button.active { background: var(--navy); color: #fff; }

/* Hero */
.hero { text-align: center; padding: 1.6rem 0.5rem 1rem; }
.hero h1 { font-size: 2.3rem; }
.hero p.lede { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin: 0.4rem auto 1rem; }
.tier-price { font-size: 2rem; font-weight: 800; color: var(--navy); }
.tier-price small { font-size: 1rem; font-weight: 400; color: var(--muted); }
.tick { color: var(--green); font-weight: 700; }

/* Toast + modal */
.toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 0.7rem 1.1rem; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 100; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(31, 42, 68, 0.5); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal { background: #fff; border-radius: var(--radius); padding: 1.4rem; max-width: 520px; width: 100%; box-shadow: var(--shadow); }
.footer { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 1rem; border-top: 1px solid var(--line); }
.callout { background: var(--blue-soft); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 0.8rem 0; }
@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  .hero h1 { font-size: 1.9rem; }
  .topnav a, .topnav button.linklike { padding: 0.4rem 0.45rem; font-size: 0.88rem; }
}
