/* ============================================================================
   Our Spring Hours — Definitive Edition
   Theming: [data-part="1"] warm paper UI, [data-part="2"|"3"] dark ink UI.
   ========================================================================== */
:root {
  --fs: 1;
  --box-a: 0.93;
  --ink: #0d0e12;
  --cream: #f3e8d2;
  --gold: #e6a939;
  --coral: #ff6f8f;
  --panel: #17171c;
  --panel-2: #212128;
  --line: #34333d;
  --text: #ebe6da;
  --muted: #9b968a;
  --display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-part="1"], [data-part="4"] {
  --box-bg: rgba(253, 246, 233, var(--box-a));
  --box-text: #2f2a3a;
  --box-edge: #eaddbd;
  --narr: #5a5266;
  --accent: #e6a939;
  --accent-2: #e0435f;
  --d: "Baloo 2", "Nunito", system-ui, sans-serif;
}
[data-part="2"] {
  --box-bg: rgba(21, 21, 26, var(--box-a));
  --box-text: #e9e4d8;
  --box-edge: #3b3a44;
  --narr: #b7b0a0;
  --accent: #d98b3f;
  --accent-2: #a52a2f;
  --d: "Oswald", "Nunito", system-ui, sans-serif;
}
[data-part="3"] {
  --box-bg: rgba(14, 15, 21, var(--box-a));
  --box-text: #ece8dc;
  --box-edge: #46444f;
  --narr: #bdb7a8;
  --accent: #e9d9a6;
  --accent-2: #8a1c1c;
  --d: "Oswald", "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #000; overflow: hidden; }
body { font-family: var(--body); color: var(--text); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

#app { position: fixed; inset: 0; overflow: hidden; background: #000; user-select: none; -webkit-user-select: none; }
#stage { position: absolute; inset: 0; overflow: hidden; }

/* ------------------------------------------------------------ background */
.bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; will-change: opacity, transform; transform: scale(1.04);
}
.bg.kb { animation: kb 46s ease-in-out infinite alternate; }
body.no-kb .bg.kb { animation: none; }
@keyframes kb { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.12) translate(-1.2%, -0.8%); } }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
#vignette {
  position: absolute; inset: 0; z-index: 4; pointer-events: none; transition: background 400ms ease;
  background:
    linear-gradient(180deg, rgba(4, 4, 8, .42) 0%, rgba(4, 4, 8, 0) 22%, rgba(4, 4, 8, 0) 52%, rgba(4, 4, 8, .55) 82%, rgba(2, 2, 4, .86) 100%);
}
.choosing #vignette {
  background: radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, .7) 100%);
}
#tint { position: absolute; inset: 0; z-index: 9; pointer-events: none; opacity: 0; }
#tint.flash { animation: flash 700ms ease-out; }
#tint.pulse { animation: pulse 1500ms ease-in-out; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 0; } 30% { opacity: .8; } 60% { opacity: .15; } 80% { opacity: .65; } }
#stage.shake { animation: shake 600ms cubic-bezier(.36, .07, .19, .97); }
@keyframes shake {
  10%, 90% { transform: translate(calc(var(--shake) * -.2), 0); }
  20%, 80% { transform: translate(calc(var(--shake) * .6), calc(var(--shake) * .2)); }
  30%, 50%, 70% { transform: translate(calc(var(--shake) * -1), calc(var(--shake) * -.4)); }
  40%, 60% { transform: translate(var(--shake), calc(var(--shake) * .4)); }
}

/* ---------------------------------------------------------------- sprites */
#sprites { position: absolute; inset: 0; z-index: 5; pointer-events: none; transition: opacity 600ms ease; }
#sprites.faded { opacity: 0; }
.spr {
  position: absolute; bottom: calc(var(--dlg, 22vh) - 1vh); height: min(calc(var(--h) * .64), calc(100vh - var(--dlg, 22vh) - 70px)); transform: translate(-50%, 28px); opacity: 0;
  transition: left 520ms cubic-bezier(.3, .8, .3, 1), opacity 380ms ease, transform 420ms cubic-bezier(.3, .8, .3, 1), filter 300ms ease;
  filter: brightness(.9);
}
.spr img {
  height: 100%; width: auto; display: block; max-width: none; pointer-events: none;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .5));
  -webkit-mask-image: linear-gradient(to top, transparent 0, #000 16%);
  mask-image: linear-gradient(to top, transparent 0, #000 16%);
}
.spr.in { opacity: 1; transform: translate(-50%, 0); }
.spr.out { opacity: 0; transform: translate(-50%, 18px); }
.spr.speaking { filter: brightness(1.05) saturate(1.05); transform: translate(-50%, -8px) scale(1.025); z-index: 2; }
.spr.dim { filter: brightness(.5) saturate(.65); }

/* ------------------------------------------------------------ dialogue box */
#dialog {
  position: absolute; z-index: 7; left: 50%; bottom: calc(2.4vh + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); width: min(94%, 1060px); min-height: 22vh;
  background: var(--box-bg); color: var(--box-text);
  border: 1px solid var(--box-edge); border-radius: 20px;
  padding: 30px 34px 26px; box-shadow: 0 22px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity 300ms ease, transform 300ms ease;
}
[data-part="2"] #dialog, [data-part="3"] #dialog { border-radius: 8px; border-left: 4px solid var(--accent); }
#dialog.hide-box { opacity: 0; pointer-events: none; transform: translate(-50%, 14px); }
#dialog.narration { border-left: 4px solid var(--accent); }
#dialog.narration #text { color: var(--narr); }
#nameplate {
  position: absolute; left: 24px; top: -19px; padding: 6px 24px 7px; border-radius: 12px 12px 12px 3px;
  font-family: var(--d); font-weight: 700; font-size: calc(18px * var(--fs)); letter-spacing: .02em;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c, #888) 82%, #fff), var(--c, #888));
  color: var(--ct, #1a1520); box-shadow: 0 8px 16px rgba(0, 0, 0, .3);
  opacity: 0; transform: translateY(4px); transition: opacity 200ms, transform 200ms;
}
#nameplate.on { opacity: 1; transform: none; }
[data-part="2"] #nameplate, [data-part="3"] #nameplate { border-radius: 3px; text-transform: uppercase; letter-spacing: .08em; font-size: calc(15px * var(--fs)); }
#text {
  font-weight: 600; font-size: calc(clamp(16px, 1.05vw + 9px, 21px) * var(--fs)); line-height: 1.6;
  min-height: 4.8em; white-space: pre-wrap;
}
#text .c { visibility: hidden; }
#text .c.on { visibility: visible; }
#text .c.i { font-style: italic; }
#text .c.b { font-weight: 800; }
#more {
  position: absolute; right: 22px; bottom: 10px; font-size: 18px; color: var(--accent); opacity: 0;
}
#more.on { opacity: 1; animation: bob 1.1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }
#clickzone { position: absolute; inset: 0; z-index: 6; cursor: pointer; }

/* -------------------------------------------------------------------- HUD */
#hud { position: absolute; z-index: 8; top: 12px; right: 12px; display: flex; gap: 6px; opacity: .72; transition: opacity 200ms; }
#hud:hover { opacity: 1; }
#hud button {
  background: rgba(10, 10, 14, .62); border: 1px solid rgba(255, 255, 255, .16); color: #eee; border-radius: 999px;
  padding: 7px 13px; font-size: 13px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center;
  backdrop-filter: blur(6px); transition: background 150ms, transform 150ms;
}
#hud button:hover { background: rgba(40, 40, 50, .85); transform: translateY(-1px); }
#hud button.active { background: var(--accent); color: #1a1520; border-color: transparent; }
.ui-hidden #hud, .ui-hidden #dialog, .ui-hidden #choices, .ui-hidden #banner, .ui-hidden #toasts, .ui-hidden #sprites { opacity: 0 !important; pointer-events: none !important; }
.choosing #hud [data-act="auto"], .choosing #hud [data-act="skip"] { opacity: .4; }

#banner {
  position: absolute; z-index: 8; top: 64px; left: 50%; transform: translate(-50%, -12px); opacity: 0; text-align: center;
  padding: 12px 34px 14px; color: #fff; transition: opacity 600ms ease, transform 600ms ease; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .0), rgba(0, 0, 0, .55) 30%, rgba(0, 0, 0, .55) 70%, rgba(0, 0, 0, 0));
}
#banner.on { opacity: 1; transform: translate(-50%, 0); }
#banner .bt { font-family: var(--d); font-weight: 700; font-size: clamp(18px, 2.2vw, 28px); letter-spacing: .05em; text-shadow: 0 2px 12px rgba(0, 0, 0, .7); }
#banner .bs { font-size: clamp(13px, 1.3vw, 17px); color: var(--accent); margin-top: 2px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }

#toasts { position: absolute; z-index: 8; left: 20px; bottom: calc(26vh + 10px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: rgba(10, 10, 14, .78); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 700;
  border-left: 4px solid var(--accent); opacity: 0; transform: translateX(-12px); transition: opacity 300ms, transform 300ms;
}
.toast.on { opacity: 1; transform: none; }

/* ----------------------------------------------------------------- choices */
#choices {
  position: absolute; z-index: 8; left: 50%; top: 42%; transform: translate(-50%, -46%); width: min(92%, 720px);
  display: flex; flex-direction: column; gap: 12px; opacity: 0; pointer-events: none; transition: opacity 300ms, transform 300ms;
}
#choices.on { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.choice {
  display: flex; align-items: center; gap: 14px; text-align: left; font-weight: 700; font-size: calc(clamp(15px, .9vw + 9px, 19px) * var(--fs));
  color: var(--box-text); background: var(--box-bg); border: 1px solid var(--box-edge); border-left: 6px solid var(--accent);
  border-radius: 14px; padding: 15px 20px; box-shadow: 0 12px 28px rgba(0, 0, 0, .4);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}
[data-part="2"] .choice, [data-part="3"] .choice { border-radius: 6px; }
.choice:hover, .choice:focus-visible { transform: translateX(6px); border-left-color: var(--accent-2); background: color-mix(in srgb, var(--box-bg) 88%, var(--accent) 12%); }
.choice .num {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800;
  background: var(--accent); color: #1a1520;
}

/* --------------------------------------------------------------------- card */
#card {
  position: absolute; inset: 0; z-index: 30; background: #000; opacity: 0; pointer-events: none; transition: opacity 700ms ease;
  display: grid; place-items: center; text-align: center; padding: 6vh 8vw; cursor: pointer;
}
#card.on { opacity: 1; pointer-events: auto; }
#card .cl { font-size: clamp(20px, 2.4vw, 32px); line-height: 1.6; max-width: 26em; margin: 0; color: #efe8d8; font-weight: 600; opacity: 0; transition: opacity 900ms ease; font-style: italic; }
#card .cl.on { opacity: 1; }
#card.part { background: radial-gradient(ellipse at 50% 45%, #1b1822, #000 75%); }
#card .cp-eyebrow { font-family: var(--d); letter-spacing: .4em; text-transform: uppercase; color: var(--accent); font-size: clamp(13px, 1.3vw, 18px); opacity: 0; animation: fadeUp 1.2s .3s forwards; }
#card .cp-title { font-family: var(--d); font-weight: 800; font-size: clamp(38px, 7vw, 92px); line-height: 1.05; margin: 14px 0 12px; color: var(--cream); text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent); opacity: 0; animation: fadeUp 1.4s .9s forwards; }
#card .cp-sub { max-width: 30em; margin: 0 auto; color: #bdb5a2; font-size: clamp(14px, 1.4vw, 19px); opacity: 0; animation: fadeUp 1.4s 1.8s forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------- title */
#title { position: absolute; inset: 0; z-index: 20; display: none; place-items: center; text-align: center; padding: 3vh 5vw; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 40%, rgba(8, 8, 16, .25) 0%, rgba(6, 6, 12, .82) 78%, rgba(3, 3, 8, .96) 100%); }
.on-title #title { display: grid; }
.on-title #dialog, .on-title #hud, .on-title #choices, .on-title #sprites, .on-title #clickzone, .on-title #banner, .on-title #toasts { display: none; }
.title-wrap { max-width: 640px; width: 100%; color: var(--cream); animation: fadeUp 1.2s ease both; }
.eyebrow { font-family: var(--d); font-weight: 600; letter-spacing: .24em; text-transform: uppercase; font-size: 12px; color: var(--gold); margin: 0 0 10px; }
.logo { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: clamp(46px, 9vw, 96px); line-height: .98; margin: 0; text-shadow: 0 0 40px rgba(255, 140, 170, .38), 0 6px 22px rgba(0, 0, 0, .6); }
.edition { font-family: "Oswald", sans-serif; letter-spacing: .5em; text-transform: uppercase; color: var(--coral); font-size: clamp(12px, 1.6vw, 17px); margin: 8px 0 0; font-weight: 600; }
.tagline { color: #e4d8bf; opacity: .88; margin: 16px auto 22px; max-width: 460px; font-weight: 600; line-height: 1.5; }
.foot { margin: 18px auto 0; font-size: 12px; color: #c9bd9f; opacity: .7; max-width: 480px; line-height: 1.5; }
.foot.dim { opacity: .45; margin-top: 8px; }
.menu-col { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.menu-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ----------------------------------------------------------------- buttons */
.btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 10px 22px; font-weight: 700; font-size: 15px;
  transition: transform 150ms, background 150ms, border-color 150ms;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); border-color: #55535f; background: #2a2a33; }
.btn.primary { background: linear-gradient(180deg, #ffd873, var(--gold) 55%, #cf8f22); color: #2c1b0a; border-color: transparent; box-shadow: 0 8px 22px rgba(230, 169, 57, .3); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffe08a, #efb44a 55%, #d99a2b); }
.btn.big { min-width: min(320px, 88vw); padding: 14px 30px; font-size: 18px; font-family: var(--display); }
.btn.big small { display: block; font-size: 12px; font-weight: 600; opacity: .75; font-family: var(--body); margin-top: 1px; }
.btn.small { padding: 7px 16px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { background: #4a1d20; border-color: #7a2c30; color: #ffd9d9; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.title-wrap .menu-row .btn { background: rgba(20, 20, 28, .6); }

/* ------------------------------------------------------------------- modal */
#modal { position: absolute; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(4, 4, 10, .72); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); padding: 2vh 3vw; }
#modal.on { display: grid; }
#modalCard {
  width: min(560px, 100%); max-height: 92vh; display: flex; flex-direction: column; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: hidden; animation: fadeUp 240ms ease both; user-select: text;
}
#modalCard[data-wide="1"] { width: min(940px, 100%); }
.m-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.m-title { flex: 1; margin: 0; font-family: "Baloo 2", sans-serif; font-size: 22px; font-weight: 700; color: var(--cream); }
.m-x { padding: 4px 12px; }
.m-body { padding: 18px 20px 22px; overflow-y: auto; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.m-body h3 { margin: 12px 0 2px; font-family: "Baloo 2", sans-serif; font-size: 16px; color: var(--gold); letter-spacing: .04em; }
.m-body p { margin: 0; line-height: 1.55; }

.parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.part-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.part-card.p1 { border-top: 4px solid #e6a939; } .part-card.p2 { border-top: 4px solid #d98b3f; } .part-card.p3 { border-top: 4px solid #e9d9a6; }
.pc-roman { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 34px; color: var(--gold); line-height: 1; }
.pc-name { font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 20px; color: var(--cream); }
.pc-sub { color: var(--muted); font-size: 13.5px; line-height: 1.45; flex: 1; }
.pc-done { color: #8fd18a; font-size: 12.5px; font-weight: 800; } .pc-note { font-size: 12px; color: var(--muted); }
.preset { text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; transition: transform 150ms, border-color 150ms; }
.preset:hover { transform: translateX(4px); border-color: var(--gold); }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.slot-wrap { position: relative; }
.slot { width: 100%; display: flex; gap: 12px; text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; transition: transform 150ms, border-color 150ms; align-items: stretch; }
.slot:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--gold); }
.slot.empty { opacity: .6; } .slot:disabled { cursor: not-allowed; opacity: .45; }
.slot-thumb { flex: none; width: 112px; height: 72px; border-radius: 8px; background: #111 center/cover; position: relative; border: 1px solid #000; }
.slot-thumb .badge { position: absolute; left: 4px; top: 4px; background: rgba(0, 0, 0, .72); color: var(--gold); font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.slot-meta { min-width: 0; font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; }
.slot-name { font-weight: 800; color: var(--cream); font-size: 13.5px; }
.slot-ch { color: #cfc8b8; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-snip { color: var(--muted); font-style: italic; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slot-date { color: #77737a; font-size: 11.5px; margin-top: auto; }
.slot-del { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(0, 0, 0, .6); color: #ddd; font-size: 11px; opacity: 0; transition: opacity 150ms; }
.slot-wrap:hover .slot-del, .slot-del:focus-visible { opacity: 1; }
.slot-del:hover { background: #7a2c30; }
.file { color: var(--muted); }

.opts h3:first-child { margin-top: 0; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid #25242c; }
.opt-l { font-weight: 700; } .opt-l small { display: block; color: var(--muted); font-weight: 600; margin-top: 2px; max-width: 30em; }
.seg { display: inline-flex; background: #101014; border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex-wrap: wrap; }
.seg-b { background: transparent; border: none; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.seg-b.on { background: var(--gold); color: #2c1b0a; }
.range { display: flex; align-items: center; gap: 10px; } .range input { width: 160px; accent-color: var(--gold); }
.range-val { width: 42px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.tog { width: 48px; height: 26px; border-radius: 999px; border: 1px solid var(--line); background: #101014; position: relative; padding: 0; transition: background 200ms; flex: none; }
.tog .knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #8a8690; transition: transform 200ms, background 200ms; }
.tog.on { background: color-mix(in srgb, var(--gold) 35%, #101014); }
.tog.on .knob { transform: translateX(22px); background: var(--gold); }

.log { display: flex; flex-direction: column; gap: 12px; }
.log-e { padding-bottom: 10px; border-bottom: 1px solid #26252d; }
.log-who { font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 2px; }
.log-t { line-height: 1.55; color: #ddd7ca; white-space: pre-wrap; }
.log-e.choice .log-t { color: var(--gold); font-weight: 700; }

.bond { display: flex; flex-direction: column; gap: 6px; }
.bond-h { display: flex; justify-content: space-between; font-weight: 800; }
.bond-r { color: var(--muted); font-weight: 700; font-size: 13px; }
.bar { height: 10px; border-radius: 99px; background: #0e0e12; border: 1px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; transition: width 400ms; }

.end-row { display: flex; gap: 14px; align-items: center; padding: 8px 0; opacity: .55; }
.end-row.got { opacity: 1; }
.end-thumb { flex: none; width: 104px; height: 58px; border-radius: 8px; background: #111 center/cover; display: grid; place-items: center; font-weight: 800; color: #555; border: 1px solid #000; }
.end-t { font-weight: 800; color: var(--cream); }
.memgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.mem { margin: 0; } .mem-img { aspect-ratio: 16 / 9; border-radius: 10px; background: #111 center/cover; border: 1px solid #000; }
.mem.locked .mem-img { background: repeating-linear-gradient(45deg, #15151a, #15151a 8px, #1a1a20 8px, #1a1a20 16px); }
.mem figcaption { font-size: 12.5px; font-weight: 700; margin-top: 5px; color: #cfc8b8; }
.castgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cast { display: flex; gap: 12px; align-items: flex-end; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; overflow: hidden; }
.cast img { width: 74px; height: 92px; object-fit: contain; object-position: bottom; flex: none; }
.cast-n { font-weight: 800; font-size: 16px; }
.credits h3 { margin: 0 0 6px; color: var(--cream); font-size: 20px; } .credits h4 { margin: 16px 0 3px; color: var(--gold); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.credits p { color: #cfc8b8; line-height: 1.6; margin: 0; }

/* ------------------------------------------------------------------ ending */
#ending { position: absolute; inset: 0; z-index: 25; display: none; overflow-y: auto; background: radial-gradient(ellipse at 50% 50%, rgba(8, 6, 16, .35) 0%, rgba(6, 5, 12, .9) 75%, rgba(4, 3, 8, .97) 100%); }
#ending.on { display: block; animation: fadeIn 1.2s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.end-card { min-height: 100%; max-width: 680px; margin: 0 auto; padding: 8vh 24px 6vh; display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; color: var(--cream); }
.end-card .eyebrow { color: var(--gold); }
.end-title { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: clamp(28px, 5vw, 50px); margin: 4px 0 26px; text-shadow: 0 0 30px rgba(255, 150, 170, .3); line-height: 1.1; }
[data-part="2"] .end-title, [data-part="3"] .end-title { font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: .04em; text-shadow: 0 0 30px rgba(217, 139, 63, .35); }
.end-card.kind-true .end-title { background: linear-gradient(90deg, #ffe08a, #ff9fb4, #ffe08a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.end-body p { font-weight: 600; font-size: clamp(15.5px, 1.2vw + 9px, 18px); line-height: 1.75; color: #e9dcc4; margin: 0 0 16px; opacity: 0; animation: fadeUp 1.2s ease forwards; }
.unlock { margin: 6px 0 0; color: var(--gold); font-weight: 800; letter-spacing: .06em; opacity: 0; animation: fadeUp 1s ease forwards; }
.end-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 22px; opacity: 0; animation: fadeUp 1s ease forwards; }
.castPanel { margin-top: 10px; width: min(480px, 100%); background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; opacity: 0; animation: fadeUp 1s ease forwards; }
.castPanelTitle { margin: 0 0 8px; font-family: "Oswald", sans-serif; letter-spacing: .2em; text-transform: uppercase; font-size: 12px; color: var(--gold); }
.castRow { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 14.5px; font-weight: 700; border-bottom: 1px solid #1f1e25; }
.castRow:last-child { border-bottom: none; }
.castRow.fallen .castStatusText { color: #d97a7a; } .castRow.alive .castStatusText { color: #a9d79a; }

/* -------------------------------------------------------------- responsive */
@media (max-width: 760px) {
  #dialog { padding: 26px 18px 20px; border-radius: 14px; min-height: 24vh; }
  #nameplate { left: 14px; }
  #hud { top: 8px; right: 8px; gap: 4px; } #hud button { padding: 7px 10px; } #hud button span { display: none; }
  #banner { top: 56px; } #toasts { left: 10px; bottom: calc(30vh + 6px); }
  .opt { flex-direction: column; align-items: flex-start; gap: 8px; } .range input { width: 56vw; }
  .slots { grid-template-columns: 1fr; }
}
@media (max-aspect-ratio: 1/1) { .spr { height: min(calc(var(--h) * .5), calc(100vh - var(--dlg, 22vh) - 70px)); } }
@media (max-height: 480px) { #dialog { min-height: 30vh; padding-top: 22px; } #text { min-height: 3.4em; } .spr { height: min(calc(var(--h) * .55), calc(100vh - var(--dlg, 22vh) - 60px)); } }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body.no-fx #tint { display: none; }

/* bonus story button on the title screen */
.btn.bonus { background: linear-gradient(135deg, #ffe8a3, #e0a93b); color: #4a2d08; border-color: rgba(255,255,255,.5); }
.btn.bonus small { opacity: .8; }
.btn.bonus.locked { background: rgba(255,255,255,.08); color: rgba(255,255,255,.5); border-style: dashed; cursor: not-allowed; }
[data-part="4"] .end-title { text-shadow: 0 0 30px rgba(255, 214, 120, .5); }
.btn.bonus:not(.locked):hover, .btn.bonus:not(.locked):focus-visible { background: linear-gradient(135deg, #fff3c4, #f0b845); color: #3a2204; filter: brightness(1.04); transform: translateY(-1px); }
.btn.bonus:not(.locked):hover small, .btn.bonus:not(.locked):hover span { color: #3a2204; opacity: 1; }

.title-wrap .btn.blossom { display: flex; flex-direction: column; align-items: center; gap: 2px; background: linear-gradient(135deg, rgba(255,150,190,.38), rgba(255,200,120,.30)); border-color: rgba(255,190,210,.6); color: #fff; }
.title-wrap .btn.blossom small { font-size: .72em; opacity: .9; }
.title-wrap .btn.blossom:hover { background: linear-gradient(135deg, rgba(255,150,190,.6), rgba(255,200,120,.5)); color: #fff; }
