/* FUTARI QUEST — HEART EDITION (loaded last)
   Pink as the lead colour: bright rose, blush and white, with a little champagne gold. Game logic unchanged. */
:root {
  --h-ink: #3a1d2b; --h-ink-2: #5a3446; --h-muted: #7a5566;
  --h-rose: #d6336c; --h-rose-deep: #a8204f; --h-berry: #8a1c45;
  --h-blush: #ffe4ee; --h-blush-2: #fff1f6; --h-paper: #fffafc;
  --h-line: rgba(214, 51, 108, .26);
  --h-gold: #c99a5b;
  --h-btn: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0) 52%), linear-gradient(105deg, #c42a60 0%, #d6336c 30%, #b8225a 60%, #cc2f66 100%);
  --h-shine: linear-gradient(105deg, #d6336c, #ff7aa6 30%, #ffd0de 45%, #f05a8c 60%, #c42a60);
  --h-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- ground ---------- */
html:not(#_) body { background: radial-gradient(ellipse 80% 45% at 85% -5%, rgba(255, 168, 197, .45), transparent 70%), radial-gradient(ellipse 70% 40% at -10% 100%, rgba(255, 214, 228, .8), transparent 70%), var(--h-paper) !important; background-attachment: fixed !important; color: var(--h-ink) !important; }
html:not(#_) body :is(h1, h2, h3) { color: var(--h-ink); }
html:not(#_) .eyebrow, html:not(#_) .chapter, html:not(#_) .partner-focus-label, html:not(#_) .presence-eyebrow { color: var(--h-rose-deep) !important; letter-spacing: .16em; }

/* ---------- header ---------- */
html:not(#_) body > header { position: sticky; top: 0; z-index: 40; flex-wrap: wrap; background: rgba(255, 250, 252, .9) !important; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 0 !important; box-shadow: 0 10px 30px -26px rgba(168, 32, 79, .6); }
html:not(#_) body > header::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--h-shine); background-size: 200% 100%; animation: h-flow 6s linear infinite; }
@keyframes h-flow { to { background-position: 200% 0; } }
html:not(#_) body > header .logo { color: var(--h-rose) !important; }
html:not(#_) body > header .logo span { color: var(--h-ink) !important; }
html:not(#_) body > header .logo small { color: var(--h-rose-deep) !important; }
html:not(#_) #home { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--h-line) !important; background: #fff !important; color: var(--h-ink) !important; box-shadow: 0 8px 18px -12px rgba(168, 32, 79, .5); }
html:not(#_) body > footer { background: linear-gradient(180deg, transparent, var(--h-blush-2)) !important; color: var(--h-muted) !important; }
html:not(#_) body > footer span { color: var(--h-ink-2) !important; }

/* ---------- buttons ---------- */
html:not(#_) #app :is(button[data-a="setup"], button[data-a="start"], button[data-a="resume"], button[data-a="next"], .person > button[data-a="choose"], .h-cta) { position: relative; overflow: hidden; isolation: isolate; min-height: 52px; padding: 12px 24px; border: 0 !important; border-radius: 999px !important; background: var(--h-btn) !important; color: #fff !important; font-weight: 700; letter-spacing: .05em; box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 0 rgba(120, 10, 50, .25), 0 14px 28px -14px rgba(196, 42, 96, .85) !important; transition: transform .15s var(--h-ease), box-shadow .15s !important; }
html:not(#_) #app :is(button[data-a="setup"], button[data-a="start"], button[data-a="next"], .h-cta)::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 34%; z-index: -1; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent); transform: skewX(-20deg); animation: h-sweep 3.6s 1s ease-in-out infinite; pointer-events: none; }
@keyframes h-sweep { 0% { left: -60%; } 30%, 100% { left: 130%; } }
html:not(#_) #app button:active { transform: scale(.97); }
html:not(#_) #app button.quiet, html:not(#_) #app .archive button { background: #fff !important; color: var(--h-ink) !important; border: 1px solid var(--h-line) !important; border-radius: 999px !important; min-height: 44px; }
html:not(#_) :is(a, button, select, input, summary):focus-visible { outline: 3px solid var(--h-rose) !important; outline-offset: 3px; }

/* ---------- cards ---------- */
html:not(#_) #app .panel, html:not(#_) #app :is(.rpg-panel, .journal, .sidequests, .edition-guide, .presence-preview, .discovery-shelf, .ending-head) { background: linear-gradient(165deg, #fff 60%, #fff3f8) !important; border: 1px solid var(--h-line) !important; border-radius: 26px !important; box-shadow: 0 26px 50px -40px rgba(168, 32, 79, .55) !important; }
html:not(#_) .field select, html:not(#_) .field input { min-height: 48px; border-radius: 14px; border: 1px solid var(--h-line); background: #fff; color: var(--h-ink); }
html:not(#_) .field select:invalid, html:not(#_) #gender:has(option[value=""]:checked) { border-color: var(--h-rose); box-shadow: 0 0 0 3px rgba(214, 51, 108, .18); }

/* the scene's three choices */
html:not(#_) .choices { display: grid; gap: 12px; }
html:not(#_) .choice { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 14px 16px !important; border-radius: 20px !important; border: 1.5px solid transparent !important; background: linear-gradient(#fff, #fff7fa) padding-box, linear-gradient(120deg, #ffb3cb, #d6336c 50%, #ffb3cb) border-box !important; color: var(--h-ink) !important; text-align: left; box-shadow: 0 12px 24px -18px rgba(168, 32, 79, .8) !important; transition: transform .14s var(--h-ease), box-shadow .14s !important; }
html:not(#_) .choice .idx { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--h-btn); color: #fff !important; font-weight: 700; box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px rgba(214, 51, 108, .4); }
html:not(#_) .choice small { display: block; margin-top: 4px; color: var(--h-rose-deep) !important; }
html:not(#_) .choice:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -16px rgba(168, 32, 79, .8) !important; }
html:not(#_) .choice.h-picked { background: linear-gradient(#ffeaf1, #ffd9e6) padding-box, linear-gradient(120deg, #d6336c, #ff8db0, #d6336c) border-box !important; transform: scale(.98); }

/* feedback */
html:not(#_) .chosen-answer { border-radius: 18px !important; background: var(--h-blush) !important; border: 1px solid var(--h-line) !important; }
html:not(#_) .chosen-answer span { color: var(--h-rose-deep) !important; }
html:not(#_) .result-note { border-radius: 18px !important; background: #fff !important; border: 1px solid var(--h-line) !important; color: var(--h-ink) !important; }
html:not(#_) .deltas { display: flex; flex-wrap: wrap; gap: 8px; }
html:not(#_) .deltas span { padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; background: #fff; border: 1px solid var(--h-line); color: var(--h-ink); }
html:not(#_) .deltas span.h-up { background: #ffe4ee; border-color: #f08fb0; color: var(--h-berry); }
html:not(#_) .deltas span.h-down { background: #f4eef1; color: #6a4b58; }
.h-teaser { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(90deg, rgba(255, 228, 238, .9), rgba(255, 255, 255, 0)); border-left: 3px solid var(--h-rose); }
.h-teaser b { flex: none; font-size: 11px; letter-spacing: .18em; color: var(--h-rose-deep); }
.h-teaser span { min-width: 0; font-size: 14px; font-weight: 600; color: var(--h-ink); }

/* stats / meters */
html:not(#_) .bar { background: #f6dde6 !important; border-radius: 999px; overflow: hidden; }
html:not(#_) .bar i { background: var(--h-shine) !important; }
html:not(#_) .skill { border-color: var(--h-line) !important; background: #fff !important; color: var(--h-ink-2) !important; }
html:not(#_) .skill.ready { background: var(--h-blush) !important; color: var(--h-berry) !important; }

/* ---------- encounter: profile cards, swipeable on phones ---------- */
html:not(#_) .person { border-radius: 22px !important; border: 1px solid var(--h-line) !important; background: #fff !important; box-shadow: 0 18px 34px -28px rgba(168, 32, 79, .7) !important; }
html:not(#_) .person h3 small { color: var(--h-rose-deep) !important; }
html:not(#_) .candidate-count { font-weight: 600; color: var(--h-ink-2) !important; }
.h-swipe-hint { display: none; }
@media (max-width: 700px) {
  html:not(#_) .candidates { display: flex !important; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding: 4px 4px 14px; margin: 0 -4px; scrollbar-width: none; }
  html:not(#_) .candidates::-webkit-scrollbar { display: none; }
  html:not(#_) .candidates > .person { flex: 0 0 84%; scroll-snap-align: center; }
  .h-swipe-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 2px 8px; font-size: 12.5px; color: var(--h-muted); }
  .h-swipe-hint b { font-variant-numeric: tabular-nums; color: var(--h-rose-deep); }
}

/* ---------- heart HUD (chapter progress + relationship) ---------- */
.h-hud { display: none; flex: 1 1 100%; order: 9; align-items: center; gap: 12px; padding: 8px 0 2px; margin-top: 6px; border-top: 1px solid rgba(214, 51, 108, .15); min-width: 0; }
.h-hud.on { display: flex; }
.h-hearts { display: flex; gap: 3px; flex: none; }
.h-hearts i { width: 13px; height: 12px; background: #f3cad8; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21.5 2.6 12.3A6 6 0 0 1 12 4.6a6 6 0 0 1 9.4 7.7Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21.5 2.6 12.3A6 6 0 0 1 12 4.6a6 6 0 0 1 9.4 7.7Z'/%3E%3C/svg%3E") center / contain no-repeat; transition: background .3s; }
.h-hearts i.done { background: var(--h-rose); }
.h-hearts i.now { background: #ff8db0; animation: h-beat 1.1s ease-in-out infinite; }
@keyframes h-beat { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.3); } }
.h-hud .h-q { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--h-rose-deep); white-space: nowrap; }
.h-hud .h-bond { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.h-hud .h-bond small { font-size: 11px; color: var(--h-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.h-hud .h-meter { width: 72px; height: 8px; border-radius: 999px; background: #f6dde6; overflow: hidden; flex: none; }
.h-hud .h-meter i { display: block; height: 100%; background: var(--h-shine); transition: width .6s var(--h-ease); }
.h-hud .h-bond b { font-size: 13px; color: var(--h-ink); font-variant-numeric: tabular-nums; }

/* ---------- transitions & feedback ---------- */
.h-in { animation: h-in .38s var(--h-ease) both; }
@keyframes h-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.h-flip { animation: h-flip .45s var(--h-ease) both; transform-origin: 50% 0; }
@keyframes h-flip { from { opacity: 0; transform: perspective(900px) rotateX(-14deg) translateY(10px); } to { opacity: 1; transform: none; } }
.h-pop { position: fixed; z-index: 90; pointer-events: none; font-size: 22px; color: var(--h-rose); animation: h-pop .8s var(--h-ease) forwards; text-shadow: 0 2px 8px rgba(214, 51, 108, .4); }
@keyframes h-pop { from { opacity: 1; transform: translate(-50%, -50%) scale(.6); } to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% - 70px)) scale(1.2); } }
.h-chapter-card { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; pointer-events: none; }
.h-chapter-card div { padding: 16px 26px; border-radius: 22px; background: rgba(255, 255, 255, .96); border: 1px solid var(--h-line); box-shadow: 0 30px 60px -30px rgba(168, 32, 79, .7); text-align: center; animation: h-card .9s var(--h-ease) forwards; }
.h-chapter-card small { display: block; font-size: 11px; letter-spacing: .2em; color: var(--h-rose-deep); font-weight: 700; }
.h-chapter-card strong { display: block; margin-top: 4px; font-size: 18px; color: var(--h-ink); }
@keyframes h-card { 0% { opacity: 0; transform: scale(.9); } 20%, 65% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.04); } }

/* ---------- smartphones ---------- */
@media (max-width: 860px) {
  html:not(#_) .layout { display: flex !important; flex-direction: column; gap: 14px; }
  html:not(#_) .layout > div { order: 1; }
  html:not(#_) .layout > .sidebar { order: 2; }
  html:not(#_) .play-top { margin-bottom: 8px; }
  html:not(#_) .play-top h1 { font-size: 18px !important; }
  html:not(#_) .quest-card h2 { font-size: 22px !important; line-height: 1.5 !important; }
  html:not(#_) .quest-card .body { font-size: 15px; line-height: 1.85; }
}
@media (max-width: 600px) {
  html:not(#_) body > header { padding: 10px 14px !important; }
  html:not(#_) body > header .header-note { display: none !important; }
  .h-hud { gap: 8px; }
  .h-hearts i { width: 10px; height: 9px; }
  .h-hud .h-bond small { max-width: 64px; }
  .h-hud .h-meter { width: 46px; }
}
@media (max-width: 360px) {
  .h-hearts { gap: 2px; }
  .h-hearts i { width: 8px; height: 8px; }
  .h-hud .h-bond small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html:not(#_) body > header::before, html:not(#_) #app button::after { animation: none !important; }
  .h-hearts i.now, .h-in, .h-flip { animation: none !important; }
  .h-pop, .h-chapter-card { display: none !important; }
  html:not(#_) .choice { transition: none !important; }
}
html:not(#_) .person > button[data-a="choose"] { width: 100%; margin-top: 10px; white-space: nowrap; font-size: 14px; }
html:not(#_) .person { display: flex !important; flex-direction: column; }
html:not(#_) .person > div { flex: 1; }
@media (max-width: 700px) { html:not(#_) .candidates > .person { padding: 16px !important; } html:not(#_) .person svg { max-width: 96px; } }
/* setup: skill options */
html:not(#_) .rpg-roles { background: var(--h-blush-2) !important; border: 1px solid var(--h-line) !important; border-radius: 20px !important; }
html:not(#_) .rpg-roles label > span { background: #fff !important; border: 1px solid var(--h-line) !important; border-radius: 14px !important; color: var(--h-ink) !important; }
html:not(#_) .rpg-roles input:checked + span { background: var(--h-blush) !important; border-color: var(--h-rose) !important; box-shadow: 0 0 0 2px rgba(214, 51, 108, .3) !important; }
html:not(#_) .rpg-roles input:checked + span::after { background: var(--h-btn) !important; color: #fff !important; }
html:not(#_) .rpg-roles * { color: var(--h-ink); }
html:not(#_) details > summary { min-height: 44px; display: flex; align-items: center; }
/* readable small text (the original muted greys/roses were below 4.5:1) */
html:not(#_) #app :is(.small, small, .partner-focus-value, .episode-kicker, .episode-dots) { color: var(--h-muted) !important; }
html:not(#_) #app :is(.level, .rpg-level, .rpg-item, .edition-how small, .rpg-head span) { color: var(--h-rose-deep) !important; }
html:not(#_) #app [class*="rpg"] span:not(.bar):not([class]) { color: var(--h-rose-deep); }
html:not(#_) #app .rpg-map span:not([class]) { color: #fff !important; background: var(--h-rose-deep) !important; }
html:not(#_) #app .level { background: var(--h-blush) !important; }
html:not(#_) #app .choice small { color: var(--h-rose-deep) !important; }
html:not(#_) body > header .header-note { color: var(--h-muted) !important; }
/* phones: less chrome above the scene so the choices come into view sooner */
@media (max-width: 600px) {
  html:not(#_) .play-top { display: flex; justify-content: flex-end; margin: 0 0 6px !important; }
  html:not(#_) .play-top h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  html:not(#_) .partner-focus { display: grid !important; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding-bottom: 10px !important; margin-bottom: 12px !important; }
  html:not(#_) .partner-focus-art { width: 64px !important; height: 64px !important; border-radius: 50%; overflow: hidden; }
  html:not(#_) .partner-focus-art svg { width: 100% !important; height: 100% !important; }
  html:not(#_) .partner-focus h2 { font-size: 20px !important; margin: 2px 0 !important; }
  html:not(#_) .partner-focus p { font-size: 12.5px !important; margin: 2px 0 !important; }
  html:not(#_) #app .panel.quest-card { padding: 18px 16px 20px !important; }
}

/* ===== slimmer chrome while playing: one header row, compact partner strip ===== */
.h-lv { font-size: 11px; font-weight: 700; color: var(--h-rose-deep); white-space: nowrap; padding: 3px 10px; border-radius: 999px; background: var(--h-blush); }
.h-lv:empty { display: none; }
html.h-playing:not(#_) #app .play-top { display: none !important; }
html.h-playing:not(#_) body > header .header-note { display: none !important; }
@media (min-width: 701px) {
  html.h-playing:not(#_) body > header { flex-wrap: nowrap; padding-top: 10px !important; padding-bottom: 10px !important; gap: 18px; }
  html.h-playing:not(#_) .h-hud { flex: 1 1 auto; order: 0; margin: 0; padding: 0; border-top: 0; }
  html.h-playing:not(#_) body > header #home { order: 1; }
}
/* the person you met: a slim strip, not a big card, so the scene starts right away */
html:not(#_) .partner-focus { display: grid !important; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding-bottom: 12px !important; margin-bottom: 14px !important; }
html:not(#_) .partner-focus-art { width: 64px !important; height: 64px !important; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(214, 51, 108, .45); }
html:not(#_) .partner-focus-art svg { width: 100% !important; height: 100% !important; }
html:not(#_) .partner-focus h2 { font-size: 20px !important; margin: 2px 0 !important; }
html:not(#_) .partner-focus p { font-size: 12.5px !important; margin: 2px 0 !important; line-height: 1.6 !important; }
/* keep the swipe row inside the screen (it must not widen the page) */
html:not(#_) .layout > div, html:not(#_) #app .quest-card, html:not(#_) .candidates { min-width: 0; max-width: 100%; }
html:not(#_) #app { max-width: 100vw; overflow-x: clip; }
/* phones: the HUD must fit in one line within the screen */
.h-hud, .h-hud .h-bond { min-width: 0; }
html:not(#_) body > header { max-width: 100vw; overflow-x: clip; }
@media (max-width: 700px) { .h-lv { display: none !important; } }
@media (max-width: 430px) { .h-hud .h-bond small { display: none; } }
/* phones while playing: one slim header row (logo mark · hearts · quest · bond · home) */
@media (max-width: 700px) {
  html.h-playing:not(#_) body > header { flex-wrap: nowrap; gap: 8px; padding: 8px 10px !important; }
  html.h-playing:not(#_) body > header .logo { flex: none; font-size: 20px; }
  html.h-playing:not(#_) body > header .logo span { display: none !important; }
  html.h-playing:not(#_) .h-hud { flex: 1 1 auto; order: 0; margin: 0; padding: 0; border-top: 0; gap: 6px; }
  html.h-playing:not(#_) .h-hud .h-meter { display: none; }
  html.h-playing:not(#_) .h-hud .h-bond b::before { content: "♥ "; color: var(--h-rose); }
  html.h-playing:not(#_) .h-hud .h-q { font-size: 10.5px; letter-spacing: .08em; }
  html.h-playing:not(#_) body > header #home { order: 1; flex: none; min-height: 40px; padding: 0 12px; font-size: 13px; }
}
@media (max-width: 400px) {
  html.h-playing:not(#_) .h-hearts { gap: 1px; }
  html.h-playing:not(#_) .h-hearts i { width: 8px; height: 8px; }
}
.h-hud .h-bond b { white-space: nowrap; }
