/* Gambit Academy — map of lessons + lesson player. Visual-first: big board, tiny captions, gold feedback. */
:root {
  --ac-bg: #050a18; --ac-card: #0a1530; --ac-card2: #0f1d3d; --ac-edge: rgba(226,200,132,.16);
  --ac-gold: #dfbd62; --ac-gold2: #f4dc95; --ac-green: #34d399; --ac-red: #f87171; --ac-blue: #4aa3ff;
  --ac-text: #f1f5f9; --ac-dim: #9fb0c8; --ac-out: cubic-bezier(.23,1,.32,1);
  --ac-sq-l: #ecd9b0; --ac-sq-d: #a9703a;
}
.ac-page { max-width: 760px; margin: 0 auto; padding: 8px 16px 140px; color: var(--ac-text); }

/* ───────── map ───────── */
.ac-hero { display: flex; align-items: center; gap: 14px; padding: 18px; margin: 8px 0 18px; border-radius: 22px;
  background: radial-gradient(120% 140% at 100% 0%, rgba(245,184,46,.18), transparent 55%), linear-gradient(180deg, var(--ac-card), #040e24); border: 1px solid var(--ac-edge); }
.ac-hero h1 { font-size: 24px; font-weight: 900; line-height: 1.1; }
.ac-hero p { color: var(--ac-dim); font-size: 13px; margin-top: 4px; }
.ac-hero .ac-ring { margin-left: auto; position: relative; width: 62px; height: 62px; flex: none; }
.ac-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ac-ring circle { fill: none; stroke-width: 6; }
.ac-ring .bg { stroke: rgba(255,255,255,.1); } .ac-ring .fg { stroke: var(--ac-gold); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ac-out); }
.ac-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 900; }

.ac-course { margin: 26px 0 8px; }
.ac-course-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: linear-gradient(90deg, var(--cc, #4aa3ff), color-mix(in srgb, var(--cc, #4aa3ff) 55%, #020815)); box-shadow: 0 10px 26px rgba(0,0,0,.35); }
.ac-course-head .em { font-size: 30px; }
.ac-course-head b { display: block; font-size: 17px; font-weight: 900; color: #fff; }
.ac-course-head small { color: rgba(255,255,255,.8); font-size: 12px; }
.ac-path { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 0 6px; position: relative; }
.ac-node { position: relative; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; border: 0; color: #fff; font-size: 32px;
  background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--cc) 70%, #fff), var(--cc)); box-shadow: 0 7px 0 color-mix(in srgb, var(--cc) 45%, #000), 0 14px 26px rgba(0,0,0,.4);
  transition: transform .14s var(--ac-out), box-shadow .14s var(--ac-out); }
.ac-node:nth-child(4n+2) { transform: translateX(-46px); } .ac-node:nth-child(4n+4) { transform: translateX(46px); }
.ac-node:active { box-shadow: 0 2px 0 color-mix(in srgb, var(--cc) 45%, #000), 0 8px 16px rgba(0,0,0,.4); }
.ac-node:nth-child(4n+2):active { transform: translateX(-46px) translateY(5px); } .ac-node:nth-child(4n+4):active { transform: translateX(46px) translateY(5px); }
.ac-node:nth-child(4n+1):active, .ac-node:nth-child(4n+3):active { transform: translateY(5px); }
.ac-node.locked { filter: grayscale(1) brightness(.55); cursor: not-allowed; }
.ac-node.current { animation: acPulse 1.6s ease-in-out infinite; }
@keyframes acPulse { 50% { box-shadow: 0 7px 0 color-mix(in srgb, var(--cc) 45%, #000), 0 0 0 10px color-mix(in srgb, var(--cc) 30%, transparent), 0 14px 26px rgba(0,0,0,.4); } }
.ac-stars { position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%); display: flex; gap: 1px; font-size: 14px; letter-spacing: 1px; white-space: nowrap; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
.ac-stars i { font-style: normal; opacity: .28; } .ac-stars i.on { opacity: 1; }
.ac-node-t { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); width: 130px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--ac-dim); pointer-events: none; line-height: 1.2; }
.ac-path { row-gap: 56px; padding-bottom: 28px; }
.ac-lock { position: absolute; right: -4px; top: -4px; font-size: 18px; }

/* ───────── lesson player ───────── */
.ls-wrap { max-width: 560px; margin: 0 auto; padding: 10px 14px 250px; min-height: 100dvh; display: flex; flex-direction: column; gap: 12px; color: var(--ac-text); }
.ls-top { display: flex; align-items: center; gap: 12px; }
.ls-x, .ls-snd { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 18px; color: var(--ac-text); background: rgba(55,138,221,.12); border: 1px solid var(--ac-edge); cursor: pointer; text-decoration: none; transition: transform .14s var(--ac-out); }
.ls-x:active, .ls-snd:active { transform: scale(.93); }
.ls-bar { flex: 1; height: 14px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.ls-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--ac-gold), var(--ac-gold2)); transition: width .5s var(--ac-out); }
.ls-cap { text-align: center; min-height: 64px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.ls-cap .big { font-size: 24px; font-weight: 900; line-height: 1.15; text-wrap: balance; }
.ls-cap .small { color: var(--ac-dim); font-size: 13px; }
.ls-stage { position: relative; width: 100%; aspect-ratio: 1; }
.ls-board { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); border-radius: 14px; overflow: hidden; border: 4px solid #4a2a10; box-shadow: 0 0 0 2px #2a1608, 0 22px 40px -14px rgba(0,0,0,.75); touch-action: manipulation; user-select: none; }
.ls-sq { position: relative; display: grid; place-items: center; cursor: pointer; }
.ls-sq.l { background: var(--ac-sq-l); } .ls-sq.d { background: var(--ac-sq-d); }
.ls-sq .co { position: absolute; font-size: 9px; font-weight: 800; opacity: .75; pointer-events: none; }
.ls-sq .co.r { top: 2px; left: 3px; } .ls-sq .co.f { bottom: 1px; right: 3px; }
.ls-sq.l .co { color: var(--ac-sq-d); } .ls-sq.d .co { color: var(--ac-sq-l); }
.ls-sq.hl::before { content: ''; position: absolute; inset: 0; background: rgba(245,184,46,.5); animation: acGlow 1.2s ease-in-out infinite; }
.ls-sq.sel::before { content: ''; position: absolute; inset: 0; background: rgba(74,163,255,.55); }
.ls-sq.ok::before { content: ''; position: absolute; inset: 0; background: rgba(52,211,153,.6); }
.ls-sq.bad::before { content: ''; position: absolute; inset: 0; background: rgba(248,113,113,.6); }
.ls-sq.dot::after { content: ''; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(20,20,30,.38); box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
.ls-sq.dot.cap::after { width: 86%; height: 86%; background: transparent; border: 5px solid rgba(239,68,68,.75); box-shadow: none; }
@keyframes acGlow { 50% { background: rgba(245,184,46,.18); } }
.ls-pc { position: relative; z-index: 2; width: 104%; height: 104%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 4px 3px rgba(0,0,0,.45)); transition: transform .28s var(--ac-out); }
.ls-pc.pop { animation: acPop .35s var(--ac-out); }
@keyframes acPop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.ls-pc.shake { animation: acShake .35s; }
@keyframes acShake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.ls-arrows { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.ls-meet { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; background: radial-gradient(80% 70% at 50% 35%, #4a6fb0, #17294f); border: 2px solid var(--ac-edge); }
.ls-meet canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
.ls-meet .nm { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 22px; font-weight: 900; text-shadow: 0 2px 8px #000; }
.ls-meet .hint { position: absolute; top: 10px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--ac-dim); }
.ls-fb { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 12px 16px 18px; transform: translateY(110%); transition: transform .3s var(--ac-out); }
.ls-fb.on { transform: none; }
.ls-fb .in { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px min(150px, 30vw); border-radius: 18px; background: rgba(8,26,22,.97); border: 1px solid rgba(52,211,153,.5); }
.ls-fb.bad .in { background: rgba(40,12,16,.97); border-color: rgba(248,113,113,.5); }
.ls-fb .ic { font-size: 28px; } .ls-fb b { flex: 1; font-size: 16px; }
.ls-btn { border: 0; cursor: pointer; padding: 13px 22px; border-radius: 14px; font-family: inherit; font-weight: 900; font-size: 15px; color: #0a1020; background: linear-gradient(90deg, var(--ac-gold), var(--ac-gold2)); box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 14px 26px -12px rgba(223,189,98,.7); transition: transform .12s var(--ac-out), box-shadow .12s var(--ac-out); }
.ls-btn:active { transform: translateY(1px); filter: brightness(.97); }
.ls-btn.ghost { background: rgba(255,255,255,.1); color: var(--ac-text); box-shadow: none; }
.ls-actions { display: flex; justify-content: flex-end; gap: 10px; min-height: 56px; padding-left: min(150px, 30vw); }
.ls-done { text-align: center; padding: 26px 8px; }
.ls-done .stars { font-size: 52px; letter-spacing: 6px; margin: 8px 0 12px; }
.ls-done .stars i { font-style: normal; opacity: .25; display: inline-block; transform: scale(.6); transition: transform .5s var(--ac-out), opacity .5s; } .ls-done .stars i.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .ls-sq.hl::before, .ac-node.current { animation: none; } .ls-pc { transition: none; } }

/* ───────── theory card & finish seal ───────── */
.ls-theory { list-style: none; margin: 0; padding: 14px 16px; border-radius: 16px; background: linear-gradient(180deg, var(--ac-card2), var(--ac-card)); border: 1px solid var(--ac-edge); display: grid; gap: 9px; }
.ls-theory li { position: relative; padding-left: 22px; font-size: 15px; line-height: 1.4; }
.ls-theory li::before { content: ''; position: absolute; left: 2px; top: .5em; width: 9px; height: 9px; border-radius: 50%; background: var(--ac-gold); box-shadow: 0 0 0 3px rgba(245,184,46,.18); }
.ls-theory[hidden] { display: none; }
.ls-done .seal { width: 108px; height: 108px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--cc, #4aa3ff) 60%, #fff), var(--cc, #4aa3ff)); box-shadow: 0 8px 0 rgba(0,0,0,.35), 0 22px 40px rgba(0,0,0,.5); }
.ls-done .seal img, .ls-done .seal svg { width: 60%; height: 60%; }
.ls-done h2 { font-size: 26px; font-weight: 900; }
.ls-done .stars { font-size: 46px; color: var(--ac-gold); letter-spacing: 8px; margin: 8px 0 12px; }
.ls-done .stars i { font-style: normal; opacity: .22; display: inline-block; transform: scale(.6); transition: transform .5s var(--ac-out), opacity .5s; }
.ls-done .stars i.on { opacity: 1; transform: none; }
/* map nodes carry a drawn icon instead of an emoji */
.ac-node img, .ac-node svg { width: 46%; height: 46%; filter: drop-shadow(0 2px 1px rgba(0,0,0,.35)); pointer-events: none; }
.ac-course-head .ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; }
.ac-course-head .ic img, .ac-course-head .ic svg { width: 100%; height: 100%; }

/* ───────── category tabs ───────── */
.ac-tabs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; scroll-snap-type: x proximity; }
.ac-tabs::-webkit-scrollbar { display: none; }
.ac-tab { flex: none; scroll-snap-align: start; display: grid; grid-template-columns: 34px auto; grid-template-rows: auto auto; column-gap: 9px; align-items: center; text-align: left; padding: 8px 14px 8px 8px; border-radius: 18px; cursor: pointer; color: var(--ac-text);
  background: rgba(55,138,221,.07); border: 1px solid var(--ac-edge); transition: transform .16s var(--ac-out), background .16s, border-color .16s; }
.ac-tab:active { transform: scale(.97); }
.ac-tab .i { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--cc); }
.ac-tab .i img, .ac-tab .i svg { width: 62%; height: 62%; }
.ac-tab .t { font-size: 13.5px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.ac-tab small { color: var(--ac-dim); font-size: 11px; }
.ac-tab.on { background: color-mix(in srgb, var(--cc) 22%, #061330); border-color: var(--cc); box-shadow: 0 6px 18px color-mix(in srgb, var(--cc) 28%, transparent); }
@media (hover: hover) and (pointer: fine) { .ac-tab:not(.on):hover { background: rgba(55,138,221,.14); } }
.ac-stars i { font-size: 15px; color: var(--ac-gold); }

/* the board id is "acBoard": main.css styles #board with !important mobile sizes, so never reuse that id here */
.ls-sq { min-width: 0; min-height: 0; }
/* під нижньою навігацією (там, де вона є) панель результату стоїть над нею, а не під нею */
body:has(.bnav) .ls-fb { bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }

/* Слот для 3D-тренера (плитка до пояса): місце зарезервоване в потоці сторінки, тому тренер нічого не закриває */
.coach-slot { flex: none; width: 92px; height: 92px; }
.coach-slot.sm { width: 68px; height: 68px; }
.ls-capRow { display: flex; align-items: center; gap: 10px; }
.ls-capRow .ls-cap { flex: 1; min-width: 0; }
@media (min-width: 700px) { .coach-slot { width: 112px; height: 112px; } .coach-slot.sm { width: 80px; height: 80px; } }

/* Широкий екран: тренер — більший квадрат у правій колонці (над списком тем), підпис і чат відкриваються під ним */
.coach-slot.side { display: none; }
@media (min-width: 1000px) {
  .coach-slot.side { display: block; position: fixed; top: 84px; left: calc(50% + 304px); width: 170px; height: 170px; z-index: 4; }
  .ls-capRow .coach-slot:not(.side) { display: none; }
  .coach-slot.sm { width: 96px; height: 96px; }
}

/* ───────── Redesign: shared Academy chrome (learn.html, checkers-puzzles.html) ───────── */
.ac-top { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.ac-mode { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--border, rgba(255,255,255,.1)); flex: 1; max-width: 360px; }
.ac-mode button, .ac-mode a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border: 0; border-radius: 11px; cursor: pointer; font: inherit; font-weight: 800; font-size: 15px; color: var(--ac-dim); background: transparent; text-decoration: none; transition: background .18s, color .18s; }
.ac-mode button:hover:not(.on), .ac-mode a:hover:not(.on) { color: var(--ac-text); background: rgba(255,255,255,.05); }
.ac-mode button.on, .ac-mode a.on { background: linear-gradient(135deg, #f1d27a, #b8860b); color: #241606; box-shadow: 0 10px 22px -12px rgba(212,175,55,.8); }
.ac-top .coach-slot { margin-left: auto; }
.ac-head { margin: 0 0 20px; }
.ac-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #d4af37; }
.ac-eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #d4af37; box-shadow: 0 0 0 3px rgba(212,175,55,.18); }
.ac-title { margin: 10px 0 0; font-family: var(--lx-display, 'Bodoni Moda'), Georgia, serif; font-weight: 700; font-size: clamp(32px, 5.5vw, 48px); line-height: 1.05; letter-spacing: -.01em; text-wrap: balance; color: var(--ac-text); }
.ac-sub { margin: 10px 0 0; max-width: 56ch; font-size: 15px; line-height: 1.5; color: var(--ac-dim); }
.ac-gamesw { display: inline-flex; gap: 4px; padding: 4px; margin-top: 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--border, rgba(255,255,255,.1)); }
.ac-gamesw a { display: flex; align-items: center; justify-content: center; min-height: 44px; min-width: 110px; padding: 8px 20px; border-radius: 11px; font-weight: 800; font-size: 14px; color: var(--ac-dim); text-decoration: none; transition: background .18s, color .18s; }
.ac-gamesw a:hover:not(.on) { color: var(--ac-text); background: rgba(255,255,255,.05); }
.ac-gamesw a.on { background: linear-gradient(135deg, #f1d27a, #b8860b); color: #241606; }
.ac-gamesw a:focus-visible, .ac-mode a:focus-visible { outline: 2px solid #d4af37; outline-offset: 2px; }
@media (max-width: 560px) { .ac-top { margin-bottom: 16px; } .ac-mode { max-width: none; } .ac-head { margin-bottom: 18px; } .ac-title { font-size: 34px; } .ac-gamesw { display: flex; } .ac-gamesw a { flex: 1; } }
/* lesson player: serif caption, right-hand course list clear of the coach bubble */
.ls-cap .big { font-family: var(--lx-display, 'Bodoni Moda'), Georgia, serif; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .ac-mode button, .ac-mode a, .ac-gamesw a, .lc-card, .tr-card { transition: none; } .lc-card:hover, .tr-card:hover { transform: none; } }
