@font-face { font-family: Almendra; src: url(./fonts/almendra-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: Alegreya; src: url(./fonts/alegreya-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Alegreya; src: url(./fonts/alegreya-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: Alegreya; src: url(./fonts/alegreya-400i.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Alegreya; src: url(./fonts/alegreya-700i.woff2) format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --ink: #1b1430;
  --night: #17122b;
  --night2: #2a2152;
  --parch: #f4e7ca;
  --parch2: #e8d6ab;
  --parch3: #cdb582;
  --gold: #eeb93f;
  --ember: #e4572e;
  --moss: #5f9e4f;
  --sun-bg: #ffe6a0;
  --sun-ink: #6b3a00;
  --shadow-bg: #40317c;
  --shadow-ink: #efe9ff;
  --display: Almendra, 'Palatino Linotype', Palatino, Georgia, serif;
  --text: Alegreya, 'Iowan Old Style', Palatino, Georgia, serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--ink); font-family: var(--text); overflow: hidden; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
sup { font-size: .68em; line-height: 0; vertical-align: .55em; }
i { font-style: italic; }
.math { font-weight: 700; white-space: nowrap; }

#app { position: fixed; inset: 0; overflow: hidden; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.screen[data-active] { display: flex; }
.sky { position: absolute; inset: 0; z-index: 0; background:
  radial-gradient(1.5px 1.5px at 12% 18%, #fff 60%, transparent), radial-gradient(1.5px 1.5px at 72% 9%, #fff 60%, transparent),
  radial-gradient(1px 1px at 33% 30%, #fff 60%, transparent), radial-gradient(2px 2px at 88% 27%, #ffeeb0 60%, transparent),
  radial-gradient(1px 1px at 55% 14%, #fff 60%, transparent), radial-gradient(1.5px 1.5px at 22% 45%, #cfd8ff 60%, transparent),
  radial-gradient(1px 1px at 92% 52%, #fff 60%, transparent), radial-gradient(1px 1px at 6% 62%, #fff 60%, transparent),
  linear-gradient(#17122b, #2a2152 70%, #40305e); }

/* ---- title */
#title { align-items: center; justify-content: center; }
.title-scene { position: absolute; left: 0; right: 0; bottom: 0; height: 45%; z-index: 0; }
.title-scene svg { width: 100%; height: 100%; display: block; }
.title-inner { overflow-y: auto; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: min(92vw, 400px); max-height: 100%; padding: 10px 0; }
.title-owl { width: clamp(72px, 16vh, 124px); animation: bob 3.4s ease-in-out infinite; }
.logo { font: 700 clamp(46px, 13vw, 70px)/1 var(--display); color: var(--gold); margin: 4px 0 0; letter-spacing: .01em; text-shadow: 0 3px 0 #7c4a10, 0 0 26px rgba(238, 185, 63, .4); }
.tagline { color: #e9e1ff; margin: 6px 0 clamp(10px, 3vh, 24px); font-size: 18px; font-style: italic; }
.menu { display: flex; flex-direction: column; gap: 9px; width: 100%; }
.btn { display: block; width: 100%; padding: 11px 16px; border-radius: 10px; background: var(--parch); box-shadow: 0 4px 0 var(--parch3), 0 6px 14px rgba(0, 0, 0, .35); font-weight: 700; font-size: 19px; text-align: center; transition: transform .08s, box-shadow .08s; }
.btn small { display: block; font-weight: 400; font-size: 14.5px; opacity: .75; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--parch3); }
.btn.primary { background: var(--gold); box-shadow: 0 4px 0 #9c6c14, 0 6px 16px rgba(238, 185, 63, .35); font-size: 21px; }
.btn.primary:active { box-shadow: 0 1px 0 #9c6c14; }
.btn[disabled] { opacity: .45; cursor: default; }
.credit { margin-top: 14px; color: #bfb6e8; font-size: 15px; }
.link { color: #cfc6f5; text-decoration: underline; font-size: 15.5px; padding: 6px; }

/* ---- lessons */
.lesson-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.icon { width: 38px; height: 38px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 17px; line-height: 1; }
.lesson-prog { flex: 1; display: flex; gap: 5px; }
.lesson-prog i { flex: 1; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .18); }
.lesson-prog i.on { background: var(--gold); }
.owl-row { position: relative; z-index: 2; display: flex; align-items: flex-start; gap: 8px; padding: 0 12px; width: 100%; max-width: 620px; margin: 0 auto; }
.owl { width: 62px; flex: none; }
.speech { flex: 1; background: var(--parch); border-radius: 12px; padding: 10px 13px; font-size: 18px; line-height: 1.28; position: relative; box-shadow: 0 3px 10px rgba(0, 0, 0, .3); min-height: 58px; }
.speech::before { content: ''; position: absolute; left: -9px; top: 18px; border: 6px solid transparent; border-right: 9px solid var(--parch); border-left: 0; }
.speech b { color: #8a3b0a; }
.lesson-body { position: relative; z-index: 2; flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 620px; margin: 8px auto 0; padding: 0 10px 10px; gap: 8px; overflow-y: auto; }
.lesson-body > .btn { flex: none; margin-top: auto; }

.lesson-body .bench { background: var(--parch); border-radius: 12px; padding: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.lesson-body .bench { flex: 1 0 auto; }
.lesson-body .loom { min-height: 100px; }

/* area model */
.area-wrap { flex: 1; min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.area { display: grid; gap: 3px; }
.area .hd { display: flex; align-items: center; justify-content: center; color: var(--gold); font-weight: 700; font-size: 20px; }
.piece { border-radius: 4px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; line-height: 1; overflow: hidden; background: #5a4a94; color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); transition: background .2s; }
.piece.ask { animation: ask 1.4s ease-in-out infinite; }
.piece.on { background: var(--sun-bg); color: var(--sun-ink); }
.piece.p2.on { background: #ffc857; }
.piece.p1.on { background: #ffe6a0; }
.piece.p0.on { background: #fff4d2; }
.area-sum { margin-top: 10px; color: #fff; font-size: 21px; text-align: center; min-height: 30px; font-weight: 700; }
.area-check { width: 100%; background: rgba(255, 255, 255, .1); border-radius: 10px; padding: 8px 12px; font-size: 18px; color: #fff; text-align: center; line-height: 1.5; }
.area-check b { color: var(--gold); }
input[type=range] { width: min(100%, 340px); accent-color: var(--gold); height: 34px; margin: 2px 0; }

/* ---- the bench: loom, spell line, message bar, keypad */
.bench { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.loom { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.grid { display: grid; gap: 4px; width: min(100%, 460px); }
.hdr { display: flex; align-items: center; justify-content: center; font-weight: 700; color: #4b3214; font-size: clamp(17px, 4.6vw, 22px); padding: 2px; border-radius: 7px; background: var(--parch2); min-height: 32px; white-space: nowrap; transition: background .15s, transform .15s; }
.hdr.neg { background: #b7a9e4; color: #241a50; }
.hdr.lit { background: var(--gold); color: var(--ink); transform: scale(1.06); }
.hdr.neg.lit { background: #7c64e0; color: #fff; }
.hdr.corner { background: none; font-size: 20px; color: var(--parch3); }
.cell { position: relative; display: flex; align-items: center; justify-content: center; min-height: clamp(40px, 8.4vh, 66px); background: #fff9ea; border: 2px dashed var(--parch3); border-radius: 9px; font-weight: 700; font-size: clamp(19px, 5.4vw, 26px); white-space: nowrap; transition: background .15s, opacity .25s, transform .15s, box-shadow .15s; }
.cell.active { border: 3px solid var(--gold); background: #fff; box-shadow: 0 0 0 3px rgba(238, 185, 63, .3); }
.cell.typing { color: #555; }
.cell.sun { background: var(--sun-bg); color: var(--sun-ink); border: 2px solid #d99c26; }
.cell.shadow { background: var(--shadow-bg); color: var(--shadow-ink); border: 2px solid #231a50; }
.cell.pop { animation: pop .28s ease-out; }
.cell.bad { animation: shake .3s; background: #ffd6cc; border-color: var(--ember); }
.cell.glow { box-shadow: 0 0 0 3px #fff, 0 0 12px 5px var(--gold); transform: scale(1.04); z-index: 1; }
.cell.spent { opacity: .3; }
.cell.pickable { cursor: pointer; }
.spell-slots { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; min-height: 42px; font-weight: 700; font-size: clamp(20px, 5.6vw, 25px); }
.spell-slots:empty { display: none; }
.slot { display: inline-flex; align-items: center; gap: 3px; padding: 4px 9px; min-height: 40px; border-radius: 8px; background: rgba(120, 90, 30, .12); }
.slot .box { min-width: 28px; height: 30px; padding: 0 5px; border: 2px dashed #9a7b3c; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: #fff9ea; }
.slot.active { background: rgba(238, 185, 63, .5); }
.slot.active .box { border: 2px solid var(--ink); background: #fff; }
.slot.done { background: var(--sun-bg); color: var(--sun-ink); }
.slot.done.neg { background: var(--shadow-bg); color: var(--shadow-ink); }
.slot.gone { background: none; text-decoration: line-through; opacity: .5; }
.final { display: block; padding: 2px 8px; text-align: center; color: #5a2b00; }
.msg { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 5px 12px; border-radius: 10px; background: var(--parch2); text-align: center; font-size: 17.5px; line-height: 1.18; }
.msg.eq { font-size: 22px; font-weight: 700; }
.msg.err { background: #ffd9c9; color: #6a1c00; }
.msg.good { background: #d9edc4; color: #24480f; }
.pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.key { height: clamp(40px, 6vh, 50px); border-radius: 9px; background: #fff9ea; box-shadow: 0 3px 0 var(--parch3); font-weight: 700; font-size: 22px; transition: transform .05s; }
.key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--parch3); }
.key.neg { background: #b7a9e4; box-shadow: 0 3px 0 #6b5aa8; }
.key.del { background: var(--parch2); }
.pows { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr 1fr; gap: 5px; }
.pows .key { background: var(--gold); box-shadow: 0 3px 0 #9c6c14; }
.pows .key.num { background: #cfe6b4; box-shadow: 0 3px 0 #7da25b; font-size: 18px; }
.pad.coef .pows { grid-template-columns: 1fr; }
.pad.coef .pows .key:not(.num) { display: none; }
.pad.coef .pows .key.num { font-size: 21px; }
.pad.nudge .num { animation: shake .3s; }
.slot.bad { animation: shake .3s; }
.pad.off { opacity: .4; pointer-events: none; }

/* ---- battle */
#battle { background: var(--parch); }
.stage { position: relative; flex: 0 0 auto; height: 40%; min-height: 200px; overflow: hidden; transition: height .3s ease; }
#battle.weaving .stage { height: 23%; min-height: 136px; }
.scene { position: absolute; inset: 0; z-index: 0; }
.scene svg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 75%; }
.hud { position: relative; z-index: 3; display: flex; align-items: center; gap: 7px; padding: 6px 8px 2px; }
.you { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hpbar { position: relative; height: 18px; border-radius: 9px; background: #120d24; overflow: hidden; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.hpbar i { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(#ff8a6a, #d3381c); transition: transform .3s ease; }
.hpbar span { position: absolute; inset: 0; color: #fff; font-size: 13.5px; font-weight: 700; line-height: 18px; text-align: center; text-shadow: 0 1px 2px #000; }
#you-fill { background: linear-gradient(#a6e37b, #47963a); }
.focus { display: flex; align-items: center; gap: 5px; color: #fff; font-size: 14px; height: 16px; }
.focus b { color: var(--gold); min-width: 34px; font-size: 15px; }
.focus span { display: flex; gap: 2px; }
.focus span i { width: 10px; height: 6px; border-radius: 2px; background: rgba(255, 255, 255, .22); }
.focus span i.on { background: var(--gold); box-shadow: 0 0 5px var(--gold); }
.focus.hot b { animation: pop .3s; }
.swift { position: relative; z-index: 3; height: 4px; margin: 3px 10px 0; border-radius: 2px; background: rgba(255, 255, 255, .15); opacity: 0; }
.swift i { display: block; height: 100%; background: #8ee6ff; border-radius: 2px; transform-origin: left; }
#battle.weaving .swift { opacity: 1; }
.foe { position: absolute; z-index: 2; left: 0; right: 0; top: 60px; bottom: 4px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 10px; }
.foe-art { height: 100%; aspect-ratio: 1; max-width: 46%; flex: none; display: flex; align-items: center; justify-content: center; }
.foe-art svg { width: 100%; height: 100%; animation: bob 2.6s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .45)); }
.foe-art.boss { max-width: 54%; }
.eye { animation: blink 4.6s infinite; }
.foe-art.hit { animation: hit .3s; }
.foe-art.lunge svg { animation: lunge .42s ease-in; }
.foe-art.dead svg { animation: die .8s forwards; }
.foe-art.enter svg { animation: enter .5s ease-out; }
.foe-info { flex: 1; max-width: 240px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.foe-name { font: 700 clamp(19px, 5vw, 24px)/1.05 var(--display); color: #fff; text-shadow: 0 2px 3px #000; }
.foe-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ward { background: rgba(23, 18, 43, .85); border: 1.5px solid var(--gold); color: #fff; font-size: 14.5px; font-weight: 700; border-radius: 13px; padding: 2px 9px; }
.ward:empty { display: none; }
.clock { color: #ffd9c9; font-size: 14.5px; text-shadow: 0 1px 2px #000; }
#battle.weaving .foe { top: 62px; }
.cast-line { position: absolute; z-index: 4; left: 0; right: 0; bottom: 8px; text-align: center; font-size: clamp(22px, 6.6vw, 32px); font-weight: 700; color: #fff; text-shadow: 0 2px 8px #000, 0 0 16px var(--gold); pointer-events: none; }
.work { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 7px 9px 9px; background: var(--parch); border-top: 4px solid var(--parch3); }
.rule { flex: none; text-align: center; font-size: 16.5px; line-height: 1.2; padding: 4px 6px; }
.rule b { color: #8a3b0a; }
.hand { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; align-content: center; overflow-y: auto; padding: 3px; }
.scroll { position: relative; min-height: 58px; padding: 7px 9px; border-radius: 9px; font-weight: 700; font-size: clamp(19px, 5vw, 23px); white-space: nowrap; background: #fff9ea; box-shadow: 0 3px 0 var(--parch3), 0 0 0 1.5px var(--parch3); transition: transform .12s, background .12s, box-shadow .12s; }
.scroll::before, .scroll::after { content: ''; position: absolute; top: 5px; bottom: 5px; width: 5px; border-radius: 3px; background: var(--parch3); }
.scroll::before { left: 3px; } .scroll::after { right: 3px; }
.scroll.picked { background: var(--gold); transform: translateY(-3px) rotate(-1deg); box-shadow: 0 5px 0 #9c6c14, 0 0 0 2px #9c6c14; }
.scroll[disabled] { opacity: .4; }
.weave-btn { flex: none; }
.bolt { position: absolute; z-index: 20; font-weight: 700; font-size: 26px; color: #fff; text-shadow: 0 0 10px var(--gold), 0 0 22px var(--ember), 0 1px 2px #000; white-space: nowrap; pointer-events: none; }
.bolt.neg { text-shadow: 0 0 10px #a78bff, 0 0 22px #5a3bff, 0 1px 2px #000; }
.dmg { position: absolute; z-index: 21; font: 700 44px var(--display); color: #fff; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ember), 0 0 12px rgba(0, 0, 0, .7); pointer-events: none; }
.dmg.small { font-size: 26px; text-shadow: 0 2px 0 #666; }
.dmg.heal { color: #a6f58c; text-shadow: 0 2px 0 #1e6a12; }
.spark { position: absolute; z-index: 19; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; }
#fx { position: absolute; inset: 0; z-index: 20; pointer-events: none; overflow: hidden; }
.flash { position: absolute; inset: 0; background: radial-gradient(transparent 40%, rgba(214, 40, 10, .75)); animation: fade .35s forwards; }
.banner { position: absolute; left: 0; right: 0; top: 24%; text-align: center; font: 700 clamp(34px, 11vw, 52px)/1 var(--display); color: var(--gold); text-shadow: 0 3px 0 #7c4a10, 0 0 22px rgba(0, 0, 0, .8); animation: banner 1.2s forwards; }
.banner small { display: block; font: 700 19px var(--text); color: #fff; margin-top: 4px; }
.shake { animation: shakeBig .32s; }

/* ---- reward + modal panels */
.panel-wrap { position: relative; z-index: 2; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px; gap: 10px; overflow-y: auto; }
.panel { background: var(--parch); border-radius: 14px; padding: 16px; width: min(100%, 460px); box-shadow: 0 8px 26px rgba(0, 0, 0, .5); line-height: 1.3; font-size: 18px; }
.panel h2 { font: 700 29px/1.05 var(--display); margin: 0 0 6px; color: #5a2b00; }
.panel p { margin: 6px 0; }
.panel-head { font: 700 clamp(30px, 8vw, 40px)/1.05 var(--display); color: var(--gold); text-align: center; text-shadow: 0 2px 0 #7c4a10; }
.panel-sub { color: #fff; text-align: center; font-size: 18px; margin-top: -4px; }
.boons { display: flex; flex-direction: column; gap: 8px; width: min(100%, 460px); }
.boon { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--parch); border-radius: 12px; padding: 10px 13px; box-shadow: 0 4px 0 var(--parch3); }
.boon:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--parch3); }
.boon > span { font-size: 28px; }
.boon b { display: block; font-size: 19px; }
.boon small { font-size: 16px; }
.road { display: flex; gap: 6px; align-items: center; justify-content: center; }
.road i { width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.road i.done { background: var(--gold); }
.road i.now { background: #fff; box-shadow: 0 0 8px #fff; }
.road i.boss { border-radius: 3px; transform: rotate(45deg); }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; margin: 8px 0; }
.stats b { text-align: right; }
.panel .btn + .btn, .panel-wrap > .btn + .btn { margin-top: 8px; }
.panel-wrap > .btn { width: min(100%, 460px); }
#modal { position: absolute; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; padding: 14px; background: rgba(13, 9, 30, .72); }
#modal[data-open] { display: flex; }
#modal .panel { max-height: 100%; overflow-y: auto; }
.m-head { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.m-head > div { width: 62px; flex: none; }
.m-head h2 { margin: 0; }
.tip { background: rgba(238, 185, 63, .28); border-radius: 8px; padding: 7px 10px; margin-top: 8px; }
.book h3 { font: 700 21px var(--display); margin: 14px 0 3px; color: #5a2b00; }
.book h3:first-of-type { margin-top: 6px; }
.book p { margin: 2px 0; }
.book .ex { font-weight: 700; display: block; margin: 3px 0; }
.signs { display: grid; grid-template-columns: auto auto; gap: 1px 14px; justify-content: start; font-weight: 700; }
.tierpick { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.bench.casting .pad { display: none; }
.bench.casting .final { font-size: 1.25em; }

/* ---- wide screens and sideways phones: scene beside the bench */
@media (min-aspect-ratio: 5/4) {
  #battle { flex-direction: row; }
  .stage, #battle.weaving .stage { flex: 0 0 46%; height: 100%; }
  .work { border-top: 0; border-left: 4px solid var(--parch3); }
  .foe, #battle.weaving .foe { flex-direction: column; top: 62px; bottom: 40px; }
  .foe-art, .foe-art.boss { height: auto; flex: 1; min-height: 0; max-width: 90%; }
  .foe-info { flex: none; width: min(90%, 300px); max-width: none; align-items: stretch; }
  .work > * { width: min(100%, 560px); margin-left: auto; margin-right: auto; }
  .work { padding: 12px; }
}
@media (max-height: 600px) {
  .key { height: 36px; font-size: 19px; }
  .msg { min-height: 40px; font-size: 16px; }
  .cell { min-height: 34px; }
  .speech { font-size: 16px; padding: 6px 10px; min-height: 0; }
  .owl { width: 44px; }
  .scroll { min-height: 46px; }
  .btn { padding: 8px 12px; font-size: 17px; }
  .btn small { display: none; }
  .title-owl { display: none; }
  .logo { font-size: 40px; }
  .tagline { margin: 2px 0 8px; font-size: 16px; }
  .menu { gap: 6px; }
  .credit { margin-top: 6px; }
}

@media (max-height: 500px) and (min-aspect-ratio: 5/4) {
  .lesson-body { max-width: 860px; }
  .owl-row { max-width: 860px; }
  .lesson-body .bench { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto auto; column-gap: 10px; }
  .lesson-body .bench .pad { grid-column: 2; grid-row: 1 / 4; align-self: center; }
  .lesson-body .bench .loom, .lesson-body .bench .spell-slots, .lesson-body .bench .msg { grid-column: 1; }
  .lesson-top { padding: 3px 12px; }
}

/* ---- motion */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes shakeBig { 0%, 100% { transform: none; } 20% { transform: translate(-7px, 3px); } 40% { transform: translate(6px, -4px); } 60% { transform: translate(-5px, -2px); } 80% { transform: translate(4px, 3px); } }
@keyframes hit { 0% { filter: brightness(3); transform: translateX(0); } 40% { transform: translateX(10px); } 100% { filter: brightness(1); transform: translateX(0); } }
@keyframes lunge { 0%, 100% { transform: none; } 45% { transform: translateY(-8px) scale(.94); } 70% { transform: translateY(12px) scale(1.28); } }
@keyframes die { 0% { transform: none; opacity: 1; filter: brightness(2.5); } 100% { transform: scale(.25) rotate(40deg) translateY(50px); opacity: 0; filter: brightness(4); } }
@keyframes enter { 0% { transform: translateX(120px) scale(.7); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 1; } to { opacity: 0; } }
@keyframes banner { 0% { transform: scale(.4); opacity: 0; } 18% { transform: scale(1.1); opacity: 1; } 28% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes ask { 0%, 100% { background: #5a4a94; } 50% { background: #8470d0; } }
@media (prefers-reduced-motion: reduce) {
  .foe-art svg, .title-owl, .eye, .piece.ask { animation: none; }
  .shake { animation: none; }
}
