/* ============ Chess Alchemist — shared styles ============ */
:root {
  --teal-950: #0a2b2b;
  --teal-900: #0f3838;
  --teal-850: #124343;
  --teal-800: #165151;
  --teal-700: #1e6363;
  --teal-600: #2a7676;
  --gold: #d9a441;
  --gold-bright: #f2c14e;
  --gold-deep: #b07f24;
  --gold-pale: #f7e3b0;
  --cream: #f3ead7;
  --cream-dim: #cfc4ab;
  --ink: #2b2014;
  --board-light: #f2e3c3;
  --board-dark: #bd8a5b;
  --good: #7fb069;
  --bad: #c94f4f;
  --radius: 12px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(242, 193, 78, .07), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(42, 118, 118, .25), transparent 60%),
    var(--teal-950);
  color: var(--cream);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

.serif { font-family: "Playfair Display", Georgia, "Times New Roman", serif; }

h1, h2, h3, .brand { font-family: "Playfair Display", Georgia, "Times New Roman", serif; }

.gold-text {
  background: linear-gradient(180deg, #f9dd8f 0%, var(--gold-bright) 35%, var(--gold-deep) 78%, #f3cd6d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { color: var(--gold-pale); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 12px 28px;
  background: rgba(10, 43, 43, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(217, 164, 65, .25);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.15rem; font-weight: 700; letter-spacing: .04em;
  color: var(--gold-bright); white-space: nowrap;
}
.brand .knight { font-size: 1.5rem; line-height: 1; }
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand .brand-by {
  font-family: Inter, -apple-system, sans-serif;
  font-size: .6rem; font-weight: 500; letter-spacing: .18em;
  text-transform: uppercase; color: var(--cream-dim);
}
.topbar nav { display: flex; gap: 22px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.topbar nav a { color: var(--cream); font-size: .95rem; letter-spacing: .02em; }
.topbar nav a:hover { color: var(--gold-bright); }
.topbar nav a.cta {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  color: var(--teal-950); font-weight: 700; padding: 8px 18px; border-radius: 8px;
}
.topbar nav a.cta:hover { filter: brightness(1.1); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 10px; border: none; cursor: pointer;
  font-size: 1rem; font-weight: 700; letter-spacing: .02em;
  transition: filter .15s, transform .1s;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  color: var(--teal-950);
  box-shadow: 0 6px 20px rgba(217, 164, 65, .35);
}
.btn-gold:hover { filter: brightness(1.08); color: var(--teal-950); }
.btn-outline {
  background: transparent; color: var(--gold-pale);
  border: 1.5px solid rgba(217, 164, 65, .55);
}
.btn-outline:hover { border-color: var(--gold-bright); background: rgba(217, 164, 65, .08); color: var(--gold-bright); }
.btn-ghost {
  background: var(--teal-800); color: var(--cream); border: 1px solid var(--teal-700);
  padding: 9px 16px; font-weight: 600; font-size: .92rem;
}
.btn-ghost:hover { background: var(--teal-700); }
.btn[disabled] { opacity: .45; cursor: default; pointer-events: none; }

/* ---------- landing ---------- */
.hero {
  max-width: 1150px; margin: 0 auto; padding: 72px 28px 56px;
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 56px; align-items: center;
}
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.3rem); line-height: 1.04; letter-spacing: .01em; }
.hero .tagline {
  margin-top: 10px; font-size: 1.25rem; color: var(--gold-pale);
  font-family: "Playfair Display", Georgia, serif; font-style: italic;
}
.hero .lead { margin-top: 22px; font-size: 1.08rem; color: var(--cream); max-width: 54ch; }
.hero .lead b { color: var(--gold-bright); }
.hero .actions { margin-top: 34px; display: flex; gap: 16px; flex-wrap: wrap; }
.hero .note { margin-top: 14px; font-size: .85rem; color: var(--cream-dim); }

.cover-wrap { position: relative; display: flex; justify-content: center; }
.cover-wrap img {
  width: 100%; max-width: 340px; border-radius: 6px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6), 0 0 0 1px rgba(217, 164, 65, .4), 0 0 60px rgba(242, 193, 78, .18);
  transform: rotate(2deg);
  transition: transform .3s;
}
.cover-wrap img:hover { transform: rotate(0deg) scale(1.02); }

.stats-band {
  border-top: 1px solid rgba(217, 164, 65, .25);
  border-bottom: 1px solid rgba(217, 164, 65, .25);
  background: rgba(15, 56, 56, .5);
}
.stats-band .inner {
  max-width: 1150px; margin: 0 auto; padding: 26px 28px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; text-align: center;
}
.stat .num { font-size: 2.1rem; font-weight: 800; font-family: "Playfair Display", Georgia, serif; }
.stat .lbl { font-size: .85rem; color: var(--cream-dim); letter-spacing: .06em; text-transform: uppercase; }

section.block { max-width: 1150px; margin: 0 auto; padding: 72px 28px 8px; }
section.block > h2 { font-size: 2rem; margin-bottom: 8px; }
section.block > .sub { color: var(--cream-dim); max-width: 70ch; margin-bottom: 34px; }

/* chapter cards */
.chapters-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px;
}
.ch-card {
  display: block; background: linear-gradient(160deg, var(--teal-850), var(--teal-900));
  border: 1px solid var(--teal-700); border-radius: var(--radius);
  padding: 18px 18px 14px; color: var(--cream);
  transition: border-color .15s, transform .15s, box-shadow .15s;
  position: relative; overflow: hidden;
}
.ch-card:hover {
  border-color: var(--gold); transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); color: var(--cream);
}
.ch-card .n {
  font-family: "Playfair Display", Georgia, serif; font-size: .8rem; color: var(--gold);
  letter-spacing: .14em; text-transform: uppercase;
}
.ch-card h3 { font-size: 1.18rem; margin: 2px 0 1px; color: var(--gold-pale); }
.ch-card .en { font-size: .8rem; color: var(--cream-dim); font-style: italic; margin-bottom: 8px; }
.ch-card p { font-size: .87rem; color: var(--cream-dim); line-height: 1.45; min-height: 3.8em; }
.ch-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: .82rem; color: var(--gold-bright); }
.ch-progress { height: 4px; background: var(--teal-950); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.ch-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); }

/* author */
.author-grid { display: grid; grid-template-columns: 300px 1fr; gap: 44px; align-items: start; }
.author-grid img {
  width: 100%; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(217, 164, 65, .35);
}
.author-grid h3 { font-size: 1.5rem; color: var(--gold-pale); margin-bottom: 4px; }
.author-grid .role { color: var(--gold); font-size: .95rem; margin-bottom: 18px; letter-spacing: .03em; }
.author-grid p { margin-bottom: 14px; color: var(--cream); max-width: 65ch; }
blockquote.coach-quote {
  margin: 22px 0; padding: 16px 22px; border-left: 3px solid var(--gold);
  background: rgba(217, 164, 65, .07); border-radius: 0 10px 10px 0;
  font-family: "Playfair Display", Georgia, serif; font-style: italic; font-size: 1.1rem; color: var(--gold-pale);
}

/* method cards */
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.m-card {
  background: linear-gradient(160deg, var(--teal-850), var(--teal-900));
  border: 1px solid var(--teal-700); border-radius: var(--radius); padding: 24px;
}
.m-card .icon { font-size: 1.9rem; margin-bottom: 10px; }
.m-card h3 { color: var(--gold-pale); font-size: 1.12rem; margin-bottom: 8px; }
.m-card p { font-size: .92rem; color: var(--cream-dim); }
.m-card ul { margin: 8px 0 0 18px; font-size: .92rem; color: var(--cream-dim); }
.m-card li { margin-bottom: 5px; }

/* download */
.download-box {
  margin: 26px 0 0; padding: 40px; text-align: center;
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(242, 193, 78, .12), transparent 70%),
    linear-gradient(160deg, var(--teal-850), var(--teal-900));
  border: 1px solid rgba(217, 164, 65, .4); border-radius: 16px;
}
.download-box h3 { font-size: 1.6rem; margin-bottom: 8px; }
.download-box p { color: var(--cream-dim); margin-bottom: 22px; }

/* ---- придбання книги ---- */
.buy-box {
  margin: 0 auto; max-width: 620px; padding: 34px 30px; text-align: center;
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(242, 193, 78, .12), transparent 70%),
    linear-gradient(160deg, var(--teal-850), var(--teal-900));
  border: 1px solid rgba(217, 164, 65, .4); border-radius: 16px;
}
.buy-box h3 { font-size: 1.45rem; margin-bottom: 8px; }
.buy-meta { color: var(--cream-dim); font-size: .92rem; margin-bottom: 22px; }
.buy-handle {
  margin-top: 14px; font-family: Georgia, serif; font-size: 1rem;
  color: var(--gold-pale); letter-spacing: .04em;
}

.peek-title {
  text-align: center; margin: 52px 0 20px; font-size: 1.15rem;
  color: var(--gold-pale); font-weight: 400; letter-spacing: .02em;
}
.book-peek {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px; max-width: 900px; margin: 0 auto;
}
.book-peek figure { margin: 0; }
.book-peek img {
  width: 100%; border-radius: 8px; display: block;
  border: 1px solid rgba(217, 164, 65, .3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  transition: transform .2s;
}
.book-peek img:hover { transform: translateY(-4px); }
.book-peek figcaption {
  margin-top: 10px; font-size: .82rem; color: var(--cream-dim);
  text-align: center; line-height: 1.4;
}

.footer-buy { margin-bottom: 20px; }


/* ============ кабінет ============ */
.cab-wrap { max-width: 1000px; margin: 0 auto; padding: 40px 24px 20px; }
.cab-loading { text-align: center; color: var(--cream-dim); padding: 60px 0; }
.cab-h1 { font-size: 2.2rem; }
.cab-lead { color: var(--cream); max-width: 62ch; margin: 12px 0 34px; font-size: 1.05rem; }
.cab-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.cab-sub { color: var(--cream-dim); font-size: .88rem; margin-top: 4px; }
.cab-h2 {
  font-size: 1.3rem; color: var(--gold-pale); margin: 44px 0 16px;
  padding-bottom: 8px; border-bottom: 1px solid rgba(217, 164, 65, .22);
}
.cab-hint { color: var(--cream); margin-bottom: 18px; line-height: 1.55; }
.cab-note { color: var(--cream-dim); font-size: .86rem; margin-top: 14px; line-height: 1.5; }
.cab-error {
  margin-top: 16px; padding: 12px 16px; border-radius: 8px;
  background: rgba(201, 79, 79, .15); border: 1px solid var(--bad); color: #f0b3b3;
}

/* картки-цифри */
.cab-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.cab-card {
  background: linear-gradient(160deg, var(--teal-850), var(--teal-900));
  border: 1px solid var(--teal-700); border-radius: var(--radius); padding: 18px 20px;
}
.cab-card-val { font-family: "Playfair Display", Georgia, serif; font-size: 2rem; font-weight: 800; line-height: 1.1; }
.cab-card-lbl { color: var(--cream); font-size: .92rem; margin-top: 2px; }
.cab-card-hint { color: var(--cream-dim); font-size: .8rem; margin-top: 4px; }

.cab-progress { height: 6px; background: var(--teal-950); border-radius: 3px; overflow: hidden; margin: 16px 0 20px; }
.cab-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); transition: width .4s; }

/* розділи книги */
.cab-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; }
.chip {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 8px; border: 1px solid var(--teal-700);
  background: var(--teal-900); color: var(--cream-dim); font-size: .85rem;
}
.chip:hover { border-color: var(--gold); color: var(--cream); }
.chip-on { color: var(--cream); }
.chip-n { color: var(--gold); font-family: "Playfair Display", Georgia, serif; width: 18px; flex: none; }
.chip-t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-v { font-size: .78rem; color: var(--gold-pale); flex: none; }
.chip i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--gold); }

/* місток тем */
.bridge-list { display: flex; flex-direction: column; gap: 8px; }
.bridge-row {
  display: grid; grid-template-columns: 34px 1fr auto auto; gap: 14px; align-items: center;
  padding: 12px 16px; border-radius: 10px;
  background: linear-gradient(160deg, var(--teal-850), var(--teal-900));
  border: 1px solid var(--teal-700);
}
.bridge-row.weak { border-color: rgba(217, 164, 65, .55); }
.br-ch {
  font-family: "Playfair Display", Georgia, serif; font-size: 1.2rem;
  color: var(--gold); text-align: center;
}
.br-title { color: var(--cream); font-weight: 600; }
.br-meta { color: var(--cream-dim); font-size: .8rem; margin-top: 2px; }
.br-perf {
  font-family: "Playfair Display", Georgia, serif; font-size: 1.15rem;
  color: var(--gold-pale); min-width: 52px; text-align: right;
}
.br-go { white-space: nowrap; }

/* активність lichess */
.act-title { color: var(--cream-dim); font-size: .85rem; margin: 22px 0 10px; }
.act-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.act {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 7px;
  font-size: .8rem; border: 1px solid var(--teal-700); background: var(--teal-900);
}
.act.win { color: #b9e2a8; border-color: rgba(127, 176, 105, .45); }
.act.lose { color: #f0b3b3; border-color: rgba(201, 79, 79, .4); }

/* екран гостя */
.cab-why { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 32px; }
.why-card {
  background: linear-gradient(160deg, var(--teal-850), var(--teal-900));
  border: 1px solid var(--teal-700); border-radius: var(--radius); padding: 22px;
}
.why-icon { font-size: 1.7rem; margin-bottom: 8px; }
.why-card h3 { color: var(--gold-pale); font-size: 1.05rem; margin-bottom: 6px; }
.why-card p { color: var(--cream-dim); font-size: .89rem; line-height: 1.5; }
.cab-login { text-align: center; padding: 32px 24px; border-radius: 16px;
  background: radial-gradient(600px 200px at 50% 0%, rgba(242, 193, 78, .1), transparent 70%),
              linear-gradient(160deg, var(--teal-850), var(--teal-900));
  border: 1px solid rgba(217, 164, 65, .4); }
.cab-login .note { margin-top: 14px; font-size: .84rem; color: var(--cream-dim); max-width: 52ch; margin-inline: auto; }

/* індикатор входу в тренажері */
.who { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--gold-pale); }

@media (max-width: 700px) {
  .bridge-row { grid-template-columns: 28px 1fr auto; }
  .br-go { grid-column: 1 / -1; text-align: center; }
}

footer {
  margin-top: 90px; padding: 34px 28px 44px;
  border-top: 1px solid rgba(217, 164, 65, .2);
  text-align: center; font-size: .84rem; color: var(--cream-dim);
}
footer .f-brand { color: var(--gold); font-family: "Playfair Display", Georgia, serif; font-size: 1rem; margin-bottom: 6px; }

/* ============ trainer ============ */
.trainer-layout {
  display: grid; grid-template-columns: 250px minmax(320px, 640px) 300px;
  gap: 22px; max-width: 1280px; margin: 0 auto; padding: 22px 20px 60px;
  justify-content: center; align-items: start;
}

.side-panel {
  background: linear-gradient(160deg, var(--teal-850), var(--teal-900));
  border: 1px solid var(--teal-700); border-radius: var(--radius);
  padding: 14px; position: sticky; top: 74px;
  max-height: calc(100vh - 96px); overflow-y: auto;
}
.side-panel h2 { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); padding: 4px 8px 10px; }
.ch-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border-radius: 8px; border: none; background: transparent;
  color: var(--cream); font-size: .88rem; cursor: pointer; text-align: left;
  font-family: inherit;
}
.ch-item:hover { background: var(--teal-800); }
.ch-item.active { background: var(--teal-700); color: var(--gold-pale); font-weight: 700; }
.ch-item .num { color: var(--gold); font-family: "Playfair Display", Georgia, serif; width: 20px; flex: none; text-align: right; }
.ch-item .cnt { margin-left: auto; font-size: .75rem; color: var(--cream-dim); }
.ch-item.active .cnt { color: var(--gold-pale); }

/* board */
.board-col { min-width: 0; }
.board-frame {
  position: relative; border-radius: 8px; padding: 10px;
  background: linear-gradient(160deg, #143d3d, #0e3030);
  border: 1px solid rgba(217, 164, 65, .45);
  box-shadow: var(--shadow);
}
#board {
  position: relative; width: 100%; aspect-ratio: 1/1; user-select: none;
  border-radius: 4px; overflow: hidden;
  background: var(--board-light);
  touch-action: none;
  container-type: inline-size;   /* щоб координати масштабувались від дошки, не від вікна */
}
#board .sq {
  position: absolute; width: 12.5%; height: 12.5%;
}
#board .sq.dark { background: var(--board-dark); }
#board .sq.hl-last { box-shadow: inset 0 0 0 100px rgba(242, 193, 78, .35); }
#board .sq.hl-sel { box-shadow: inset 0 0 0 100px rgba(242, 193, 78, .55); }
#board .sq.hl-hint { animation: hintPulse 1s ease-in-out infinite; }
#board .sq.hl-wrong { box-shadow: inset 0 0 0 100px rgba(201, 79, 79, .55); }
#board .sq.hl-check { background: radial-gradient(circle, rgba(201, 79, 79, .85) 20%, rgba(201, 79, 79, .25) 70%); }
@keyframes hintPulse {
  0%, 100% { box-shadow: inset 0 0 0 100px rgba(242, 193, 78, .15); }
  50% { box-shadow: inset 0 0 0 100px rgba(242, 193, 78, .6); }
}
/* можливі ходи — фоном, щоб ::after лишився за координатами */
#board .sq.dot {
  background-image: radial-gradient(circle, rgba(20, 61, 61, .45) 21%, transparent 22%);
}
#board .sq.dot.capture {
  background-image: radial-gradient(circle, transparent 60%, rgba(20, 61, 61, .5) 61%,
                                    rgba(20, 61, 61, .5) 76%, transparent 77%);
}
#board .piece {
  position: absolute; width: 12.5%; height: 12.5%;
  cursor: grab; z-index: 3;
  transition: transform .18s ease;
}
#board .piece svg { width: 100%; height: 100%; display: block; }
#board .piece.dragging { transition: none; z-index: 10; cursor: grabbing; pointer-events: none; }
#board .piece.no-anim { transition: none; }
/* ---- координати (стиль lichess: усередині дошки, контраст із клітинкою) ---- */
#board .sq[data-rank]::before,
#board .sq[data-file]::after {
  position: absolute;
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: max(9px, 1.9cqw);
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
  pointer-events: none;
}
#board .sq[data-rank]::before { content: attr(data-rank); top: 4.5%; left: 5%; }
#board .sq[data-file]::after  { content: attr(data-file); bottom: 4.5%; right: 5.5%; }
/* мітка завжди контрастна до клітинки, на якій стоїть */
#board .sq.dark[data-rank]::before,
#board .sq.dark[data-file]::after { color: var(--board-light); }
#board .sq:not(.dark)[data-rank]::before,
#board .sq:not(.dark)[data-file]::after { color: var(--board-dark); }
#board.shake { animation: shake .35s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

/* status under board */
.puzzle-bar {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap;
}
.turn-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem;
  background: var(--teal-800); border: 1px solid var(--teal-700);
}
.turn-badge .dot-ind { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #888; flex: none; }
.turn-badge.white .dot-ind { background: #f5f5f5; }
.turn-badge.black .dot-ind { background: #222; }
.turn-badge.success { background: rgba(127, 176, 105, .18); border-color: var(--good); color: #b9e2a8; }
.turn-badge.error { background: rgba(201, 79, 79, .18); border-color: var(--bad); color: #f0b3b3; }
.turn-badge.gold { background: rgba(217, 164, 65, .15); border-color: var(--gold); color: var(--gold-pale); }

.controls { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* right panel */
.info-panel {
  background: linear-gradient(160deg, var(--teal-850), var(--teal-900));
  border: 1px solid var(--teal-700); border-radius: var(--radius);
  padding: 18px; position: sticky; top: 74px;
}
.info-panel .p-num { font-family: "Playfair Display", Georgia, serif; font-size: 1.35rem; color: var(--gold-pale); }
.info-panel .p-theme { color: var(--gold); font-size: .9rem; margin-bottom: 2px; }
.info-panel .p-theme-en { color: var(--cream-dim); font-style: italic; font-size: .78rem; margin-bottom: 12px; }
.moves-list {
  min-height: 76px; background: var(--teal-950); border-radius: 8px;
  padding: 10px 12px; font-family: "Playfair Display", Georgia, serif; font-size: 1.02rem;
  color: var(--cream); line-height: 1.9;
}
.moves-list .mvnum { color: var(--cream-dim); font-size: .85rem; }
.moves-list .mv { padding: 1px 5px; border-radius: 4px; }
.moves-list .mv.last { background: rgba(242, 193, 78, .25); color: var(--gold-pale); }
.info-panel .progress-line { margin-top: 14px; font-size: .82rem; color: var(--cream-dim); }

.puzzle-nav {
  margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 5px; max-height: 240px; overflow-y: auto; padding: 2px;
}
.pz-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: .72rem; border-radius: 6px; cursor: pointer; border: 1px solid var(--teal-700);
  background: var(--teal-900); color: var(--cream-dim); font-family: inherit;
}
.pz-cell:hover { border-color: var(--gold); color: var(--gold-pale); }
.pz-cell.done { background: rgba(217, 164, 65, .8); color: var(--teal-950); font-weight: 700; border-color: var(--gold-deep); }
.pz-cell.tried { background: rgba(201, 79, 79, .35); color: var(--cream); }
.pz-cell.current { outline: 2px solid var(--gold-bright); color: var(--gold-bright); font-weight: 800; }

/* success overlay flare */
.flare {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; border-radius: 4px;
  background: radial-gradient(circle at 50% 40%, rgba(242, 193, 78, .35), transparent 60%);
  transition: opacity .4s;
}
.flare.on { opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .trainer-layout { grid-template-columns: minmax(0, 620px); }
  .side-panel { position: static; max-height: none; order: -1; }
  .side-panel .ch-list { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 6px; }
  .ch-item { white-space: nowrap; width: auto; }
  .ch-item .cnt { display: none; }
  .info-panel { position: static; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 34px; }
  .cover-wrap { order: -1; }
  .cover-wrap img { max-width: 240px; }
  .stats-band .inner { grid-template-columns: repeat(2, 1fr); }
  .author-grid { grid-template-columns: 1fr; }
  .author-grid img { max-width: 280px; }
  .topbar { padding: 10px 16px; gap: 12px; }
  .topbar nav { gap: 14px; }
  .topbar nav a:not(.cta) { display: none; }
  section.block { padding: 48px 18px 8px; }
}
