/* Harvest Night Survivor — pumpkin orange, plum night, lantern gold, cream prose. */

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/fredoka-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/lora-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/lora-italic-latin.woff2') format('woff2');
}

:root {
  --ink: #2a1b3d;
  --plum: #3b2653;
  --night: #1c1230;
  --orange: #f2892f;
  --orange-dark: #c9621f;
  --gold: #ffc857;
  --cream: #f6ead0;
  --parchment: #f1e4c6;
  --parchment-dark: #e2d0a8;
  --leaf: #8fae5c;
  --red: #e0554a;
  --display: 'Fredoka', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--cream); }
body { font-family: var(--display); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; font-family: var(--serif); }

.app { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.icon { display: inline-block; vertical-align: middle; flex: none; }
.muted { color: rgba(42, 27, 61, 0.65); }
.gold { color: #a8641a; }

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1.5px solid currentColor;
  border-bottom-width: 3px;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  opacity: 0.9;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 2px solid rgba(246, 234, 208, 0.32);
  background: rgba(59, 38, 83, 0.78);
  color: var(--cream);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover, .btn:focus-visible { border-color: var(--cream); background: rgba(75, 50, 105, 0.9); transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: var(--orange);
  color: var(--ink);
  border-color: #ffd9b3;
  box-shadow: 0 5px 0 var(--orange-dark);
}
.btn.primary:hover, .btn.primary:focus-visible { background: #f79a45; border-color: #fff1dc; }
.btn.primary:active { box-shadow: 0 2px 0 var(--orange-dark); transform: translateY(3px); }
.btn.subtle { background: transparent; border-color: rgba(42, 27, 61, 0.25); color: var(--ink); }
.btn.subtle:hover { background: rgba(42, 27, 61, 0.08); border-color: var(--ink); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.big { font-size: 21px; padding: 16px 28px; border-radius: 18px; box-shadow: 0 7px 0 var(--orange-dark); }
.btn.big:active { box-shadow: 0 2px 0 var(--orange-dark); }
.key-hint { font-size: 12px; font-weight: 600; opacity: 0.7; margin-left: 6px; border: 1.5px solid rgba(42, 27, 61, 0.5); border-radius: 6px; padding: 1px 6px; }

/* ---- title ---- */
.screen { position: absolute; inset: 0; }
.title-screen { display: flex; align-items: center; pointer-events: none; }
.title-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(24, 15, 42, 0.9) 0%, rgba(24, 15, 42, 0.72) 28%, rgba(24, 15, 42, 0.25) 55%, rgba(24, 15, 42, 0) 72%);
  pointer-events: none;
}
.title-col {
  position: relative;
  margin-left: clamp(20px, 7vw, 110px);
  margin-top: -3vh;
  width: min(520px, 86vw);
  pointer-events: auto;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.eyebrow { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--gold); font-size: 17px; margin: 0 0 6px; letter-spacing: 0.01em; }
.title { font-weight: 700; font-size: clamp(46px, 6.6vw, 88px); line-height: 0.92; margin: 0 0 14px; color: var(--cream); letter-spacing: -0.015em; text-shadow: 0 4px 0 rgba(26, 16, 40, 0.6); }
.title span { display: block; color: var(--orange); }
.tagline { font-family: var(--serif); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.5; margin: 0 0 22px; color: rgba(246, 234, 208, 0.92); max-width: 440px; }
.title-char { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(59, 38, 83, 0.75); border: 1.5px solid rgba(246, 234, 208, 0.25); margin-bottom: 18px; font-size: 15px; }
.title-char i { font-family: var(--serif); color: rgba(246, 234, 208, 0.75); margin-left: 4px; }
.chip-portrait { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 40%, #5a3d7a, #2a1b3d); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.chip-portrait canvas { width: 44px; height: 44px; }
.title-actions { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.title-menu { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.title-menu .btn { background: rgba(59, 38, 83, 0.6); }
.title-stats { display: flex; flex-wrap: wrap; gap: 18px; font-size: 14px; color: rgba(246, 234, 208, 0.85); }
.title-stats .stat { display: inline-flex; align-items: center; gap: 6px; }
.title-stats b { color: var(--gold); font-size: 16px; }
.title-stats .icon { color: var(--gold); }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---- HUD ---- */
.hud { position: absolute; inset: 0; pointer-events: none; transition: opacity 0.3s ease; }
.hud.is-hidden { opacity: 0; }
.hud-tl { position: absolute; top: 14px; left: 14px; display: flex; gap: 10px; align-items: flex-start; }
.portrait { width: 60px; height: 60px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #6b4a8a, #2a1b3d); border: 3px solid var(--parchment); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); overflow: hidden; flex: none; }
.portrait canvas { width: 100%; height: 100%; display: block; }
.bars { display: flex; flex-direction: column; gap: 5px; padding-top: 4px; }
.bar { display: block; position: relative; height: 15px; border-radius: 999px; background: rgba(20, 12, 34, 0.8); border: 1.5px solid rgba(246, 234, 208, 0.35); overflow: hidden; width: 190px; }
.bar .fill { position: absolute; inset: 0; width: 100%; transform-origin: left; transition: width 0.12s linear; }
.bar.hp .fill { background: linear-gradient(180deg, #f0685a, #c53f36); }
.bar.hp .fill.low { animation: pulse 0.9s ease-in-out infinite; }
.bar.xp { height: 9px; width: 150px; }
.bar.xp .fill { background: linear-gradient(180deg, #ffd36a, #e0a12f); }
.bar-text { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 10px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6); letter-spacing: 0.02em; }
.bar.xp .bar-text { font-size: 9px; padding-left: 8px; }
.charms { display: flex; gap: 4px; min-height: 18px; flex-wrap: wrap; max-width: 200px; }
.charm { width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: rgba(20, 12, 34, 0.75); border: 1.5px solid var(--c, var(--gold)); color: var(--c, var(--gold)); }
@keyframes pulse { 50% { filter: brightness(1.35); } }

.hud-tr { position: absolute; top: 12px; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.chapter { display: flex; align-items: center; gap: 8px; }
.chapter .moon { width: 26px; height: 26px; display: inline-flex; filter: drop-shadow(0 0 6px rgba(255, 236, 180, 0.35)); }
.chapter-name { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--cream); }
.wave { font-size: 12px; font-weight: 600; color: var(--gold); letter-spacing: 0.04em; }
.clock { font-size: 34px; font-weight: 700; line-height: 1; color: var(--cream); text-shadow: 0 3px 0 rgba(26, 16, 40, 0.7); font-variant-numeric: tabular-nums; }
.counters { display: flex; align-items: center; gap: 14px; font-size: 15px; font-weight: 600; }
.seeds { display: inline-flex; align-items: center; gap: 5px; color: var(--gold); }
.seed-icon { display: inline-flex; color: var(--gold); }
.light { display: inline-flex; align-items: center; gap: 5px; }
.light .bar { width: 86px; height: 10px; }
.light .fill { background: linear-gradient(180deg, #ffe08a, #f2a93b); }
.light.gloom .fill { background: linear-gradient(180deg, #c9b1ff, #8f6fd0); }
.light.dark .fill { background: #5a4580; }

.boss-bar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: min(480px, 46vw); text-align: center; }
.boss-name { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 17px; color: #ffd9b3; text-shadow: 0 2px 0 rgba(26, 16, 40, 0.8); margin-bottom: 4px; }
.bar.boss { width: 100%; height: 12px; border-color: #ffd9b3; }
.bar.boss .fill { background: linear-gradient(180deg, #ff8a6b, #c53f36); }

.hud-bc { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; }
.slots { display: flex; gap: 6px; }
.slot { width: 42px; height: 42px; border-radius: 12px; background: rgba(20, 12, 34, 0.78); border: 2px solid rgba(246, 234, 208, 0.3); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--cream); position: relative; }
.slot.evolved { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 10px rgba(255, 200, 87, 0.35); }
.slot .pips { position: absolute; bottom: -7px; font-size: 6px; letter-spacing: 1px; color: var(--gold); }
.slot.empty { border-style: dashed; opacity: 0.4; }
.dash-ind { position: relative; width: 46px; height: 46px; display: grid; place-items: center; }
.dash-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--dash, 0) * 360deg), rgba(246, 234, 208, 0.18) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); }
.dash-ind .seed-icon { color: rgba(246, 234, 208, 0.75); }
.dash-ind.ready .seed-icon { color: var(--gold); }
.dash-ind.rolling .seed-icon { color: #fff; transform: scale(1.15); }
.dash-key { position: absolute; bottom: -15px; font-size: 9px; font-weight: 600; color: rgba(246, 234, 208, 0.6); letter-spacing: 0.04em; }
.hud-bl { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 14px; font-size: 12px; color: rgba(246, 234, 208, 0.7); }
.hud-bl kbd { font-size: 10px; min-width: 18px; padding: 0 4px; line-height: 15px; border-width: 1px; border-bottom-width: 2px; }

.banner { position: absolute; left: 0; right: 0; top: 24%; display: flex; justify-content: center; opacity: 0; transform: translateY(10px) scale(0.96); transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); text-align: center; }
.banner.show { opacity: 1; transform: none; }
.banner-inner { padding: 10px 30px; }
.banner-title { font-weight: 700; font-size: clamp(30px, 5vw, 58px); line-height: 1; color: var(--cream); text-shadow: 0 0 24px rgba(255, 200, 87, 0.35), 0 4px 0 rgba(26, 16, 40, 0.8); letter-spacing: -0.01em; }
.banner-sub { font-family: var(--serif); font-style: italic; font-size: clamp(15px, 1.8vw, 22px); color: var(--gold); margin-top: 8px; }
.banner.wave .banner-title { font-size: clamp(22px, 3vw, 34px); color: var(--gold); }
.banner.boss .banner-title { color: #ffb39a; text-shadow: 0 0 28px rgba(217, 83, 79, 0.5), 0 4px 0 rgba(26, 16, 40, 0.8); }
.banner.bossphase .banner-title { font-size: clamp(22px, 3vw, 34px); color: #ffd36a; }

/* ---- touch ---- */
.touch { position: absolute; inset: 0; pointer-events: none; }
.touch.is-hidden { display: none; }
.stick { position: absolute; left: 24px; bottom: 36px; width: 124px; height: 124px; border-radius: 50%; border: 2px solid rgba(246, 234, 208, 0.35); background: rgba(20, 12, 34, 0.35); pointer-events: auto; touch-action: none; opacity: 0; transition: opacity 0.15s ease; }
.stick.active { opacity: 1; }
.knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffd9b3, var(--orange)); box-shadow: 0 3px 0 var(--orange-dark); }
.touch-dash { position: absolute; right: 22px; bottom: 96px; width: 76px; height: 76px; border-radius: 50%; border: 2px solid #ffd9b3; background: var(--orange); color: var(--ink); font-weight: 700; font-size: 15px; box-shadow: 0 5px 0 var(--orange-dark); pointer-events: auto; touch-action: none; }

/* ---- overlays ---- */
.ui { position: absolute; inset: 0; pointer-events: none; }
.ui .screen { pointer-events: auto; }
.overlay { display: grid; place-items: center; background: rgba(20, 12, 36, 0.58); padding: 16px; overflow: auto; touch-action: pan-y pan-x; }
.overlay * { touch-action: auto; }
.panel { background: var(--parchment); color: var(--ink); border-radius: 22px; padding: 26px 28px; width: min(640px, 100%); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.35); animation: panelIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }
.panel.wide { width: min(860px, 100%); }
.panel h2, .overlay-head h2, .levelup-head h2 { font-family: var(--serif); font-weight: 700; font-size: clamp(26px, 3.4vw, 36px); margin: 0 0 8px; line-height: 1.1; }
.panel h3, .overlay-head h3 { font-family: var(--display); font-weight: 600; font-size: 18px; margin: 18px 0 8px; }
.panel p, .overlay-head p { margin: 0 0 10px; line-height: 1.5; font-size: 15px; }
.panel .eyebrow { color: #a8641a; }
.panel-head { margin-bottom: 14px; }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.overlay-head { margin-bottom: 12px; }
.overlay-head .pouch { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #a8641a; }
.overlay-foot { margin-top: 20px; display: flex; justify-content: flex-start; }
.group { border-bottom: 1.5px solid rgba(42, 27, 61, 0.18); padding-bottom: 4px; }

/* pause */
.pause-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.pause-col { display: flex; flex-direction: column; gap: 8px; }
.pause-col .btn { justify-content: flex-start; }
.run-facts { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.run-facts dt { font-weight: 600; color: rgba(42, 27, 61, 0.7); }
.run-facts dd { margin: 0; }

/* level-up */
.levelup { width: min(820px, 100%); text-align: center; color: var(--cream); }
.levelup-head { margin-bottom: 18px; }
.levelup-head h2 { font-size: clamp(28px, 4vw, 44px); }
.levelup-head .eyebrow { color: var(--gold); margin-bottom: 2px; }
.levelup-head .muted { color: rgba(246, 234, 208, 0.75); font-size: 14px; }
.levelup-head kbd { font-size: 11px; }
.cards { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.card {
  --c: var(--orange);
  position: relative;
  width: 236px;
  min-height: 318px;
  padding: 24px 18px 18px;
  border-radius: 22px;
  background: var(--parchment);
  color: var(--ink);
  border: 3px solid var(--c);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
  animation: cardIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.card:nth-child(2) { animation-delay: 0.07s; }
.card:nth-child(3) { animation-delay: 0.14s; }
.card:hover, .card:focus-visible { transform: translateY(-12px) scale(1.03); box-shadow: 0 22px 0 rgba(0, 0, 0, 0.3), 0 26px 50px rgba(0, 0, 0, 0.4); outline: none; }
.card:focus-visible { box-shadow: 0 0 0 4px var(--gold), 0 22px 0 rgba(0, 0, 0, 0.3); }
.card.evolved { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 200, 87, 0.35), 0 10px 0 rgba(0, 0, 0, 0.35); }
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) scale(0.9); } to { opacity: 1; transform: none; } }
.card-key { position: absolute; top: -12px; left: -12px; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--cream); font-weight: 700; font-size: 14px; display: grid; place-items: center; border: 2px solid var(--cream); }
.card-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 22%, white); color: var(--ink); border: 2.5px solid var(--c); }
.card-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: var(--c); padding: 3px 10px; border-radius: 999px; }
.card-name { font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.1; color: var(--ink); }
.card .pips { color: #a8641a; font-size: 9px; letter-spacing: 2px; }
.card .lv { font-size: 12px; font-weight: 600; color: rgba(42, 27, 61, 0.7); }
.card-desc { font-size: 14.5px; line-height: 1.4; color: rgba(42, 27, 61, 0.85); margin-top: auto; }

/* results */
.results { align-items: start; }
.results-body { width: min(720px, 100%); margin: auto; color: var(--cream); animation: panelIn 0.4s ease both; }
.results-head { text-align: center; margin-bottom: 14px; }
.results-head h2 { font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 5vw, 56px); margin: 0 0 6px; color: #ffb39a; text-shadow: 0 4px 0 rgba(26, 16, 40, 0.8); }
.results-head h2.dawn { color: #ffe08a; text-shadow: 0 0 30px rgba(255, 220, 130, 0.5), 0 4px 0 rgba(26, 16, 40, 0.8); }
.results-sub { font-family: var(--serif); font-style: italic; font-size: clamp(16px, 2vw, 20px); margin: 0 0 6px; color: var(--gold); }
.results-meta { font-size: 14px; color: rgba(246, 234, 208, 0.8); margin: 0; }
.new-best { display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 999px; background: var(--gold); color: var(--ink); font-weight: 700; font-size: 12px; }
.ledger { background: var(--parchment); color: var(--ink); border-radius: 20px; padding: 18px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.ledger-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 7px 0; border-bottom: 1px dashed rgba(42, 27, 61, 0.2); font-size: 15px; }
.ledger-row.big { font-size: 22px; font-weight: 700; }
.ledger-row.big span { font-family: var(--serif); font-weight: 500; font-size: 17px; }
.ledger-row small { font-weight: 500; color: rgba(42, 27, 61, 0.6); }
.ledger-section { padding-top: 8px; }
.ledger-section h3 { margin: 6px 0 6px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(42, 27, 61, 0.6); }
.kill-row { display: inline-flex; justify-content: space-between; gap: 10px; min-width: 150px; padding: 3px 10px; margin: 2px 4px 2px 0; border-radius: 8px; background: rgba(42, 27, 61, 0.07); font-size: 13.5px; }
.boss-row, .build-row { display: flex; flex-wrap: wrap; gap: 6px; }
.boss-mark, .build-item { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 8px; background: rgba(42, 27, 61, 0.08); font-size: 12px; }
.boss-mark { color: rgba(42, 27, 61, 0.35); }
.boss-mark.won { color: #2f7a44; background: rgba(143, 174, 92, 0.25); }
.build-item.evolved { color: #a8641a; background: rgba(255, 200, 87, 0.35); }
.build-item.charm { color: var(--c); }
.build-item em { font-style: normal; font-weight: 700; }
.results-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }

/* bestiary */
.entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.entry { display: flex; gap: 12px; padding: 10px; border-radius: 14px; background: rgba(42, 27, 61, 0.05); align-items: flex-start; }
.entry.boss { background: rgba(242, 137, 47, 0.12); }
.entry-portrait { width: 64px; height: 64px; border-radius: 12px; background: radial-gradient(circle at 50% 40%, #4d3568, #2a1b3d); flex: none; display: grid; place-items: center; overflow: hidden; }
.entry-portrait canvas { width: 64px; height: 64px; }
.entry.unknown .entry-portrait canvas { filter: brightness(0.25); }
.entry-text h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 17px; }
.entry .lore { font-size: 13.5px; line-height: 1.45; margin: 0 0 4px; }
.entry .tally { font-size: 12px; font-weight: 600; color: #a8641a; margin: 0; }

/* unlocks */
.unlock-list { display: flex; flex-direction: column; gap: 6px; }
.unlock-row { display: grid; grid-template-columns: 36px 1fr auto auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(42, 27, 61, 0.05); }
.u-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(242, 137, 47, 0.18); color: #a8641a; }
.u-text { display: flex; flex-direction: column; gap: 2px; }
.u-text b { font-size: 15px; }
.u-text small { font-size: 13px; color: rgba(42, 27, 61, 0.7); }
.unlock-row .pips { color: #a8641a; letter-spacing: 2px; font-size: 11px; }
.unlock-row .btn svg { vertical-align: -2px; }

/* characters */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.char-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 12px 12px; border-radius: 18px; background: rgba(42, 27, 61, 0.05); border: 2.5px solid transparent; transition: transform 0.15s ease, border-color 0.15s ease; }
.char-card:hover { transform: translateY(-3px); }
.char-card.selected { border-color: var(--orange); background: rgba(242, 137, 47, 0.12); }
.char-card.locked .char-portrait canvas { filter: grayscale(0.8) brightness(0.6); }
.char-portrait { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 40%, #6b4a8a, #2a1b3d); display: grid; place-items: center; }
.char-portrait canvas { width: 96px; height: 96px; }
.char-card h3 { margin: 0; font-family: var(--serif); font-size: 18px; }
.char-card h3 i { display: block; font-size: 13px; font-weight: 400; color: rgba(42, 27, 61, 0.7); }
.perk { font-size: 12.5px; line-height: 1.35; margin: 0; min-height: 34px; }
.weapon-line { font-size: 12.5px; margin: 0; display: inline-flex; align-items: center; gap: 4px; color: #a8641a; }

/* how to play */
.howto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: start; margin: 0; }
.keys dt { white-space: nowrap; }
.keys dt span { font-size: 12px; color: rgba(42, 27, 61, 0.6); margin: 0 2px; }
.keys dd { margin: 0; font-size: 14px; line-height: 1.45; }
.mouse { font-weight: 600; }

/* ---- responsive ---- */
@media (max-width: 760px) {
  .title-screen { align-items: flex-start; }
  .hud-tl { top: 10px; left: 10px; gap: 8px; }
  .portrait { width: 48px; height: 48px; }
  .bar { width: 118px; height: 13px; }
  .bar.xp { width: 90px; }
  .charms { max-width: 120px; }
  .hud-tr { top: 8px; right: 10px; gap: 2px; }
  .chapter { flex-direction: row-reverse; }
  .chapter .moon { display: none; }
  .chapter-name { font-size: 11px; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wave { font-size: 10px; }
  .clock { font-size: 24px; }
  .counters { font-size: 13px; gap: 8px; }
  .light .bar { width: 64px; }
  .hud-bc { bottom: 10px; }
  .touch-dash { bottom: 104px; }
  .title-screen::before { background: linear-gradient(180deg, rgba(24, 15, 42, 0.92) 0%, rgba(24, 15, 42, 0.75) 40%, rgba(24, 15, 42, 0.1) 75%); }
  .title-col { margin: 4vh auto 0; width: min(520px, 90vw); }
  .title { font-size: clamp(38px, 11vw, 60px); }
  .title-actions .btn.big { width: 100%; }
  .pause-grid, .howto-grid { grid-template-columns: 1fr; }
  .hud-bl { display: none; }
  .bar { width: 140px; }
  .bar.xp { width: 110px; }
  .clock { font-size: 26px; }
  .boss-bar { top: auto; bottom: 74px; width: min(420px, 70vw); }
  .card { width: min(300px, 88vw); min-height: 0; }
  .cards { gap: 12px; }
  .entries { grid-template-columns: 1fr; }
  .unlock-row { grid-template-columns: 32px 1fr auto; }
  .unlock-row .pips { display: none; }
}
@media (pointer: coarse) {
  .key-hint, .dash-ind, .hud-bl { display: none; }
}
@media (max-height: 400px) {
  .eyebrow { font-size: 14px; margin-bottom: 2px; }
  .tagline { font-size: 13px; margin-bottom: 8px; }
  .title-menu .btn { min-height: 32px; padding: 4px 10px; font-size: 13px; }
  .title-stats { font-size: 11px; }
}
@media (max-height: 520px) {
  .title-col { margin-top: 2vh; }
  .title { font-size: clamp(32px, 7vh, 52px); margin-bottom: 6px; }
  .tagline { margin-bottom: 10px; font-size: 14px; }
  .title-char { display: none; }
  .title-menu { margin-bottom: 10px; }
  .title-menu .btn { min-height: 36px; padding: 6px 12px; font-size: 14px; }
  .btn.big { font-size: 17px; padding: 10px 20px; }
  .title-stats { font-size: 12px; gap: 10px; }
  .card { min-height: 0; padding: 14px 12px 12px; width: min(240px, 30vw); }
  .card-icon { width: 48px; height: 48px; }
  .card-desc { font-size: 12.5px; }
  .levelup-head { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .panel, .results-body, .title-col { animation: none; }
  .btn, .card { transition: none; }
  .bar.hp .fill.low { animation: none; }
  .banner { transition: opacity 0.2s ease; transform: none; }
}
