/* ==========================================================================
   Kvasir's Cup — look
   Deep amber glass, thin gold rules, a serif that behaves like an inscription.
   ========================================================================== */
:root {
  --ink: #0b0705;
  --ink2: #140d09;
  --panel: rgba(24, 15, 10, 0.72);
  --panel-solid: #1a1109;
  --cream: #f6ead6;
  --muted: #b7a48d;
  --dim: #7d6c5a;
  --gold: #ffd66b;
  --amber: #d99a3c;
  --amber-deep: #8a5a1e;
  --line: rgba(255, 214, 107, 0.18);
  --line-soft: rgba(255, 214, 107, 0.10);
  --good: #9fe0b0;
  --warn: #ffb45e;
  --bad: #ff8a72;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--ink); color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body { overflow-x: hidden; }
body.in-play { overflow: hidden; height: 100vh; height: 100dvh; }

button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; }

.screen { display: none; }
.screen.active { display: flex; }

/* ------------------------------------------------------------------ shells */
#app {
  position: relative; width: 100%; min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(1200px 700px at 72% -10%, rgba(255, 178, 66, 0.16), transparent 62%),
    radial-gradient(900px 600px at 8% 105%, rgba(140, 74, 30, 0.18), transparent 60%),
    linear-gradient(180deg, #100a07 0%, #0a0605 55%, #070403 100%);
}
#app::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  opacity: 0.05; mix-blend-mode: overlay;
}

/* -------------------------------------------------------------------- title */
#screenTitle {
  position: relative; z-index: 2;
  min-height: 100vh; min-height: 100dvh;
  padding: clamp(22px, 4vw, 56px) clamp(20px, 5vw, 72px);
  display: flex; align-items: center;
}
.hero {
  width: 100%; max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 5vw, 72px);
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--amber)); }
.hero h1 {
  font-size: clamp(40px, 6.2vw, 76px);
  line-height: 0.98; letter-spacing: -0.015em;
  background: linear-gradient(176deg, #fff6dd 4%, #ffd66b 42%, #c9862f 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 12px 40px rgba(255, 176, 60, 0.18));
}
.hero h1 em { font-style: italic; }
.hero .lede {
  margin: 18px 0 0; max-width: 46ch;
  font-size: clamp(15px, 1.35vw, 17px); line-height: 1.65; color: #d8c6ad;
}
.hero .lede b { color: var(--cream); font-weight: 600; }
.hero .kicker {
  margin: 22px 0 0; font-family: var(--serif); font-style: italic;
  font-size: 15px; color: var(--amber); opacity: 0.9;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.cta-note { margin-top: 18px; font-size: 12px; color: var(--dim); letter-spacing: 0.04em; }
.cta-note b { color: var(--muted); font-weight: 600; }

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 13px 26px; border-radius: 3px;
  border: 1px solid rgba(255, 214, 107, 0.34);
  background: linear-gradient(180deg, rgba(255, 214, 107, 0.14), rgba(255, 168, 60, 0.05));
  color: var(--cream); text-align: left;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(255, 214, 107, 0.7); background: linear-gradient(180deg, rgba(255, 214, 107, 0.22), rgba(255, 168, 60, 0.08)); }
.btn:active { transform: translateY(0); }
.btn .btn-main { font-family: var(--serif); font-size: 17px; letter-spacing: 0.01em; }
.btn .btn-sub { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber); }
.btn.primary {
  background: linear-gradient(180deg, #ffdd85, #d99a3c 62%, #b3762a);
  color: #241205; border-color: rgba(255, 236, 180, 0.6);
  box-shadow: 0 10px 34px rgba(217, 154, 60, 0.22);
}
.btn.primary .btn-sub { color: rgba(52, 26, 6, 0.7); }
.btn.primary:hover { box-shadow: 0 14px 40px rgba(217, 154, 60, 0.34); }
.btn.ghost {
  background: transparent; border-color: rgba(255, 255, 255, 0.14);
}
.btn.ghost .btn-main { font-size: 15px; }
.btn .sheen {
  position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg); animation: sheen 6.5s ease-in-out infinite;
}
@keyframes sheen { 0%, 62% { left: -60%; } 76%, 100% { left: 130%; } }

/* hero art */
.hero-art { position: relative; display: flex; justify-content: center; align-items: center; min-height: 320px; }
.hero-art .halo {
  position: absolute; width: min(84%, 420px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 90, 0.22), rgba(255, 150, 40, 0.06) 45%, transparent 68%);
  filter: blur(6px); animation: breathe 7s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.07); opacity: 1; } }
.hero-art svg { position: relative; width: min(100%, 340px); height: auto; filter: drop-shadow(0 30px 60px rgba(0,0,0,.55)); animation: float 8s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-.4deg); } 50% { transform: translateY(-12px) rotate(.5deg); } }
.hero-art .ring {
  position: absolute; bottom: 6%; width: 60%; height: 16px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 190, 90, 0.22), transparent 70%);
  filter: blur(4px);
}

.title-foot {
  display: flex; flex-wrap: wrap; gap: 18px 28px; margin-top: 34px;
  padding-top: 18px; border-top: 1px solid var(--line-soft);
  font-size: 11.5px; letter-spacing: 0.11em; text-transform: uppercase; color: var(--dim);
}
.title-foot b { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--cream); margin-top: 3px; }

/* ----------------------------------------------------------------- chapters */
#screenChapters {
  position: relative; z-index: 2; min-height: 100vh; min-height: 100dvh;
  flex-direction: column; padding: clamp(18px, 3vw, 42px) clamp(16px, 4vw, 56px) 56px;
}
.chapters-top {
  max-width: 1180px; width: 100%; margin: 0 auto 26px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
}
.chapters-top h2 { font-size: clamp(26px, 3.4vw, 40px); letter-spacing: -0.01em; }
.chapters-top p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
#chapterGrid { max-width: 1180px; width: 100%; margin: 0 auto; }
.act-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin: 30px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft);
}
.act-roman { font-family: var(--serif); font-size: 13px; letter-spacing: 0.22em; color: var(--amber); }
.act-name { font-family: var(--serif); font-size: 20px; }
.act-place { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.chap {
  position: relative; text-align: left; padding: 12px 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 3px;
  background: linear-gradient(165deg, rgba(255, 214, 107, 0.05), rgba(255, 255, 255, 0.012));
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
  display: grid; grid-template-columns: auto 1fr; gap: 4px 9px; align-items: center;
}
.chap:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(255, 214, 107, 0.45); background: linear-gradient(165deg, rgba(255, 214, 107, 0.12), rgba(255, 255, 255, 0.02)); }
.chap-n { font-family: var(--serif); font-size: 17px; color: var(--amber); grid-row: span 2; }
.chap-title { font-size: 12.5px; line-height: 1.3; color: var(--cream); }
.chap-stars { font-size: 11px; letter-spacing: 0.16em; color: var(--amber); }
.chap.done { border-color: rgba(255, 214, 107, 0.3); }
.chap.locked { opacity: 0.35; cursor: not-allowed; }
.chap.locked .chap-stars { letter-spacing: 0; }

/* --------------------------------------------------------------------- play */
#screenPlay {
  position: fixed; inset: 0; z-index: 3;
  flex-direction: column; background: #080504;
}
.hud {
  position: relative; z-index: 4;
  display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center;
  padding: 9px clamp(10px, 2vw, 22px);
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(12, 8, 6, 0.92), rgba(12, 8, 6, 0.58));
  backdrop-filter: blur(10px);
}
.hud-act { font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber); }
.hud-title { display: flex; align-items: baseline; gap: 9px; margin-top: 3px; }
.hud-num { font-family: var(--serif); font-size: 12px; letter-spacing: 0.14em; color: var(--dim); }
.hud-title h2 { font-size: clamp(15px, 1.9vw, 20px); letter-spacing: -0.005em; }
.hud-mid { display: flex; align-items: center; gap: clamp(10px, 2.4vw, 26px); }
.acc { min-width: 128px; }
.acc-label { display: flex; justify-content: space-between; font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin-bottom: 4px; }
.acc-label b { color: var(--cream); font-size: 11px; letter-spacing: 0.04em; }
.acc-bar { height: 3px; background: rgba(255, 255, 255, 0.09); border-radius: 2px; overflow: hidden; }
.acc-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #c9862f, #ffd66b); transition: width .25s ease, background .3s ease; }
.acc-bar i.good { background: linear-gradient(90deg, #7bbf8b, #b8f0c4); }
.acc-bar i.best { background: linear-gradient(90deg, #ffd66b, #fff3c0); box-shadow: 0 0 10px rgba(255, 214, 107, 0.6); }
.score { text-align: right; font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.score b { display: block; font-family: var(--serif); font-size: 18px; letter-spacing: 0; color: var(--cream); }
.hud-right { display: flex; gap: 6px; }
.ic {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04); font-size: 14px; line-height: 1;
  display: grid; place-items: center; transition: background .15s ease, transform .15s ease;
}
.ic:hover { background: rgba(255, 214, 107, 0.14); transform: translateY(-1px); }

.playbody { flex: 1 1 auto; min-height: 0; display: flex; }
.panel.recipe {
  width: clamp(216px, 22vw, 286px); flex: 0 0 auto;
  padding: 14px 14px 10px;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(20, 13, 9, 0.9), rgba(10, 6, 5, 0.75));
  display: flex; flex-direction: column; gap: 10px; overflow-y: auto;
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.panel-head span:last-child { color: var(--amber); letter-spacing: 0.06em; }
#recipeList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.rl {
  display: grid; grid-template-columns: 12px 1fr auto; gap: 3px 8px; align-items: center;
  padding: 6px 7px 7px; border-radius: 3px;
  border: 1px solid transparent; background: rgba(255, 255, 255, 0.028);
  transition: border-color .2s ease, background .2s ease;
}
.rl-swatch { width: 12px; height: 22px; border-radius: 2px; background: linear-gradient(180deg, var(--c), var(--d)); box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.rl-name { font-size: 12px; color: #e8dbc7; line-height: 1.2; }
.rl-drams { font-family: var(--serif); font-size: 12px; color: var(--cream); }
.rl-drams em { font-style: normal; font-size: 9px; color: var(--dim); margin-left: 2px; letter-spacing: 0.06em; }
.rl-bar { grid-column: 2 / 4; height: 2px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; }
.rl-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #b3762a, #ffd66b); transition: width .12s linear; }
.rl.hit { border-color: rgba(255, 214, 107, 0.5); background: rgba(255, 214, 107, 0.07); }
.rl.hit .rl-bar i { background: linear-gradient(90deg, #ffd66b, #fff6d5); box-shadow: 0 0 8px rgba(255, 214, 107, .7); }
.rl.over { border-color: rgba(255, 138, 114, 0.55); }
.rl.over .rl-bar i { background: linear-gradient(90deg, #c45a42, #ff8a72); }
.rl.miss .rl-name { color: #8a7663; }
.seal-note {
  display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--warn);
  border: 1px dashed rgba(255, 180, 94, 0.4); border-radius: 3px; padding: 7px 8px;
}
.seal-note b { font-family: var(--serif); }
.seal-note.sealed { border-style: solid; border-color: rgba(255, 180, 94, 0.75); background: rgba(255, 140, 50, 0.10); }
.seal-note.cracked { opacity: 0.55; text-decoration: line-through; }
.seal-icon { width: 10px; height: 10px; border-radius: 2px; background: linear-gradient(180deg, #b06a34, #5a2e16); }
.recipe-foot { margin-top: auto; font-size: 10.5px; line-height: 1.5; color: var(--dim); border-top: 1px solid var(--line-soft); padding-top: 8px; }
.recipe-foot b { color: var(--muted); font-weight: 600; }

.stagewrap { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; }
#canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.toolbar {
  flex: 0 0 auto; display: flex; gap: 8px; justify-content: flex-end; align-items: center;
  padding: 7px clamp(10px, 2vw, 22px);
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(0deg, rgba(12, 8, 6, 0.94), rgba(12, 8, 6, 0.62));
}
.tool {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: 2px; font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13); background: rgba(255, 255, 255, 0.035);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.tool em { font-style: normal; font-size: 10px; letter-spacing: .08em; color: var(--amber); border: 1px solid rgba(255,214,107,.3); border-radius: 8px; padding: 1px 5px; }
.tool:hover:not(:disabled) { background: rgba(255, 214, 107, 0.12); border-color: rgba(255, 214, 107, 0.4); transform: translateY(-1px); }
.tool:disabled { opacity: 0.32; cursor: not-allowed; }
.tool.on { border-color: rgba(159, 228, 255, 0.6); background: rgba(159, 228, 255, 0.12); }
.tool.primary { background: linear-gradient(180deg, #ffdd85, #cf9032); color: #241205; border-color: rgba(255, 236, 180, .55); font-weight: 600; }
.tool.primary em { color: #4a2a0a; border-color: rgba(74,42,10,.3); }
.tool.ghost { color: var(--muted); }

/* ------------------------------------------------------------------- toast */
.toast {
  position: absolute; left: 50%; bottom: 16px; transform: translate(-50%, 12px);
  max-width: min(88%, 520px); padding: 9px 16px; border-radius: 2px;
  background: rgba(12, 8, 6, 0.92); border: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.45; color: var(--cream); text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease;
  z-index: 9;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { border-color: rgba(255, 138, 114, 0.5); color: #ffd7cc; }
.toast.cool { border-color: rgba(159, 228, 255, 0.45); color: #dff4ff; }

/* ---------------------------------------------------------------- overlays */
.ov {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  padding: 18px; background: rgba(6, 4, 3, 0.74); backdrop-filter: blur(9px);
  animation: fadeIn .22s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.ov-card {
  position: relative; width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid rgba(255, 214, 107, 0.24); border-radius: 4px;
  background:
    radial-gradient(600px 260px at 50% -20%, rgba(255, 178, 66, 0.16), transparent 70%),
    linear-gradient(180deg, #1b1109, #0e0806 78%);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: rise .34s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
.ov-card.wide { width: min(680px, 100%); }
.ov-kicker { font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--amber); margin-bottom: 10px; }
.ov-card h2 { font-size: clamp(24px, 3.2vw, 34px); line-height: 1.12; letter-spacing: -0.01em; }
.ov-verse { margin: 12px 0 0; font-family: var(--serif); font-style: italic; font-size: 15px; line-height: 1.55; color: var(--amber); }
.ov-lore { margin: 14px 0 0; font-size: 14px; line-height: 1.7; color: #cdbca6; }
.ov-list { list-style: none; margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 7px 16px; }
.ov-list li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #dccbb5; }
.bl-swatch { width: 9px; height: 9px; border-radius: 2px; background: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); }
.bl-name { flex: 1 1 auto; }
.bl-dr { font-family: var(--serif); font-size: 12px; color: var(--cream); }
.ov-seal { margin-top: 14px; font-size: 12px; color: var(--warn); border-left: 2px solid rgba(255, 180, 94, 0.6); padding-left: 10px; }
.ov-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.ov-actions .btn { flex: 1 1 auto; align-items: center; text-align: center; }

/* pause + how */
.how-grid { display: grid; gap: 12px; margin-top: 18px; }
.how-step { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; }
.how-n { font-family: var(--serif); font-size: 15px; color: var(--amber); }
.how-step p { margin: 0; font-size: 13.5px; line-height: 1.6; color: #cdbca6; }
.how-step b { color: var(--cream); }
.how-keys { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--dim); line-height: 1.8; }
kbd { font: 11px/1 var(--serif); background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 3px; padding: 3px 6px; color: var(--cream); }

/* result */
#resStars { display: flex; gap: 8px; margin: 4px 0 14px; }
.star { font-size: clamp(34px, 6vw, 48px); line-height: 1; color: rgba(255, 255, 255, 0.10); transform: scale(.8); }
.star.on { color: var(--gold); text-shadow: 0 0 24px rgba(255, 200, 80, 0.55); animation: starPop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes starPop { 0% { transform: scale(.4) rotate(-18deg); opacity: 0; } 70% { transform: scale(1.16) rotate(4deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.res-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 0; padding: 14px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.res-stat span { display: block; font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.res-stat b { display: block; margin-top: 4px; font-family: var(--serif); font-size: 20px; color: var(--cream); }
#resGrades { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 5px; max-height: 190px; overflow-y: auto; }
.grade { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 8px; align-items: center; font-size: 12px; padding: 4px 6px; border-radius: 2px; background: rgba(255, 255, 255, 0.025); }
.g-swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.g-name { color: #dccbb5; }
.g-num { font-family: var(--serif); color: var(--cream); }
.g-tag { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.grade.perfect .g-tag { color: var(--gold); }
.grade.great .g-tag { color: var(--good); }
.grade.good .g-tag { color: var(--muted); }
.grade.off .g-tag { color: var(--bad); }
#resBest { margin-top: 12px; font-size: 11px; letter-spacing: 0.08em; color: var(--dim); }

/* ------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; min-height: 210px; }
  .hero-art svg { width: min(58%, 230px); }
  .hero h1 { font-size: clamp(36px, 10vw, 56px); }
  .title-foot { gap: 14px 20px; }
}

@media (max-width: 760px) {
  .hud { grid-template-columns: 1fr auto; gap: 8px; padding: 7px 11px; }
  .hud-mid { grid-column: 1 / -1; order: 3; justify-content: space-between; }
  .acc { flex: 1 1 auto; min-width: 0; }
  .score b { font-size: 15px; }
  .playbody { flex-direction: column; }
  .panel.recipe {
    width: 100%; border-right: none; border-bottom: 1px solid var(--line-soft);
    padding: 8px 10px; max-height: 31vh; gap: 6px;
  }
  #recipeList { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 2px; }
  .rl { min-width: 128px; flex: 0 0 auto; }
  .rl-name { font-size: 11px; }
  .recipe-foot { display: none; }
  .seal-note { font-size: 10px; padding: 5px 7px; }
  .toolbar { padding: 6px 8px; gap: 5px; overflow-x: auto; justify-content: flex-start; }
  .tool { padding: 7px 10px; font-size: 11px; white-space: nowrap; }
  .tool.ghost { display: none; }
  .tool.primary { margin-left: auto; }
}

@media (max-width: 420px) {
  .hud-title h2 { font-size: 14px; }
  .hud-num { display: none; }
  .chap { padding: 9px; }
  .chap-title { font-size: 11.5px; }
  .res-stats { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
