/* Storytime — Neo-Kabukicho shoujo. Phone-first; two columns from 900px. */
:root {
  color-scheme: dark;
  --ink: #fff4fb; --dim: #c9b5d6; --mute: #8f7fa6;
  --glass: rgba(26, 14, 44, .72); --glass2: rgba(44, 24, 70, .78); --line: rgba(255, 190, 235, .18);
  --rose: #ff8fd0; --rose2: #ffc1e6; --gold: #ffd36b; --gold2: #e2b54c; --mint: #7fe0c4; --lilac: #b79cf2; --crimson: #ff5a7a;
  --sky-a: #1a1030; --sky-b: #5b2a6e; --neon: #ff5fb0;
  --r: 16px; --gap: 12px;
  --t-elegant: #f1e3c4; --t-street: #7fe0c4; --t-cute: #ff9fd4; --t-edgy: #b79cf2; --t-traditional: #ff7a6a; --t-glam: #ffd36b;
  --display: 'Bodoni Moda', 'Didot', Georgia, serif; --body: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.45 var(--body); color: var(--ink); overflow-x: hidden;
  background: radial-gradient(120% 80% at 70% 10%, var(--sky-b), var(--sky-a) 60%, #07040f); background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 50; pointer-events: none; }
body.no-gl #bg { display: none; }
#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.booting { margin: auto; color: var(--dim); font-family: var(--display); font-style: italic; }
button { font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--glass2); border-radius: 999px; padding: 9px 16px; transition: transform .12s, background .2s, border-color .2s; }
button:hover:not(:disabled) { border-color: var(--rose); }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: linear-gradient(135deg, #ff6fbf, #c04bff); border-color: transparent; font-weight: 800; box-shadow: 0 6px 24px rgba(255, 80, 190, .35); }
button.ghost { background: transparent; }
button.big { font-size: 1.15rem; padding: 14px 34px; }
button.wide { width: 100%; border-radius: var(--r); text-align: left; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.muted { color: var(--mute); }
.bad { color: var(--crimson); }
.gold { color: var(--gold); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: .01em; margin: .2em 0 .3em; }
h2 small, h4 small { font-family: var(--body); font-weight: 400; color: var(--mute); font-size: .7em; }
h4 { margin: 18px 0 8px; font-size: .85rem; text-transform: uppercase; letter-spacing: .14em; color: var(--rose2); }
.kicker { font-size: .72rem; text-transform: uppercase; letter-spacing: .3em; color: var(--rose2); margin: 0; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; margin: 2px 3px 2px 0; white-space: nowrap; }
.chip.taboo { text-decoration: line-through; opacity: .8; }
.t-elegant { color: var(--t-elegant); } .t-street { color: var(--t-street); } .t-cute { color: var(--t-cute); }
.t-edgy { color: var(--t-edgy); } .t-traditional { color: var(--t-traditional); } .t-glam { color: var(--t-glam); }

/* bars */
.bar { position: relative; height: 14px; background: rgba(0, 0, 0, .4); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); min-width: 80px; }
.bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--rose), var(--gold)); border-radius: 999px; transition: width .5s cubic-bezier(.2, .9, .3, 1.2); }
.bar b { position: relative; font-size: .62rem; padding-left: 8px; line-height: 14px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.bar.poise i { background: linear-gradient(90deg, #7ad7ff, #c08cff); }
.bar.comp i { background: linear-gradient(90deg, #ff6f9c, #ffb0d8); }
.bar.xp { width: 90px; height: 8px; } .bar.xp b { display: none; }
.bar.aff i { background: linear-gradient(90deg, #ff6f9c, #ff2f7f); }
.bar.st i { background: linear-gradient(90deg, var(--lilac), var(--rose)); }

/* HUD + tabs */
.hud { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(10, 5, 20, .85), rgba(10, 5, 20, .4)); backdrop-filter: blur(8px); font-size: .8rem; }
.hud > div { display: flex; flex-direction: column; gap: 2px; }
.hud-m { align-items: center; } .hud-r { align-items: flex-end; }
.hud .day { text-transform: capitalize; color: var(--rose2); } .hud .loc { color: var(--dim); font-size: .72rem; }
.hud .yen { font-weight: 800; color: var(--gold); font-size: .95rem; } .hud .face small { color: var(--mute); }
.hud .lvl { font-weight: 800; }
.icon { padding: 2px 10px; font-size: .9rem; }
.tabs { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(6, 1fr); padding: 6px 4px; padding-bottom: max(6px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(10, 5, 20, .92), rgba(10, 5, 20, .6)); backdrop-filter: blur(8px); margin-top: auto; }
.tabs button { border: 0; background: none; border-radius: 12px; padding: 4px 0; font-size: .66rem; display: flex; flex-direction: column; align-items: center; color: var(--dim); position: relative; }
.tabs button span { font-size: 1.2rem; line-height: 1.2; }
.tabs button.on { color: var(--ink); background: rgba(255, 143, 208, .14); }
.tabs em { position: absolute; top: 0; right: 18%; background: var(--rose); color: #2a0f2a; font-style: normal; font-weight: 800; border-radius: 999px; padding: 0 5px; font-size: .6rem; }

/* layout */
.view { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 8px 14px 20px; }
.view > section { display: grid; gap: var(--gap); }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; }
.doll-wrap { width: min(62vw, 300px); aspect-ratio: 1 / 2; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .55)) drop-shadow(0 0 22px rgba(255, 143, 208, .18)); cursor: pointer; }
.doll-wrap.big { width: min(70vw, 340px); }
.doll-wrap.sm { width: min(30vw, 150px); }
.doll-wrap svg { width: 100%; height: 100%; display: block; }
.doll-wrap.walk { animation: walk 1.2s ease-out both; }
@keyframes walk { from { transform: translateX(-30%) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.doll .twinkle { animation: twinkle 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes twinkle { 0%, 100% { opacity: .9; transform: scale(1); } 50% { opacity: .3; transform: scale(.5); } }
#crescent { animation: moonpulse 3s ease-in-out infinite; }
@keyframes moonpulse { 0%, 100% { opacity: 1; } 50% { opacity: .78; } }
.panel { background: var(--glass); border: 1px solid var(--line); border-radius: 22px; padding: 14px; backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.panel.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px; }
.panel.full { grid-column: 1 / -1; }
.loc-title { text-align: center; margin-top: -10px; }
.loc-title h2 { font-size: 1.7rem; margin: 0; text-shadow: 0 2px 18px var(--neon); }
.loc-title p { margin: 0; color: var(--dim); font-style: italic; font-family: var(--display); }
@media (min-width: 900px) {
  .view > section { grid-template-columns: minmax(320px, 420px) 1fr; align-items: start; }
  .view > section.map, .view > section.friends, .view > section.journal, .view > section.result { grid-template-columns: 1fr; }
  .stage { position: sticky; top: 70px; }
  .doll-wrap { width: 340px; }
}

/* title */
.title { min-height: 100vh; align-content: center; justify-items: center; padding: 20px 0; }
.title-art img { width: min(88vw, 520px); border-radius: 26px; box-shadow: 0 30px 90px rgba(0, 0, 0, .6), 0 0 60px rgba(255, 120, 200, .25); display: block;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.title-card { text-align: center; max-width: 540px; margin-top: -40px; position: relative; }
.title h1 { font-size: clamp(2.6rem, 10vw, 4.4rem); line-height: .95; margin: 6px 0 10px; background: linear-gradient(180deg, #fff, var(--rose2) 60%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 18px rgba(255, 100, 200, .4)); }
.title h1 span { display: block; font-size: .36em; font-style: italic; font-weight: 600; letter-spacing: .08em; -webkit-text-fill-color: var(--gold); }
.title .blurb { color: var(--dim); }
.title .row { justify-content: center; }
.title .fine { font-size: .75rem; color: var(--mute); margin-top: 16px; }
@media (min-width: 900px) { .title { grid-template-columns: auto auto; gap: 40px; } .title-card { margin-top: 0; text-align: left; } .title .row { justify-content: flex-start; } }

/* hub */
.hint { background: rgba(255, 211, 107, .1); border: 1px solid rgba(255, 211, 107, .35); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; font-size: .85rem; }
.hint button { padding: 3px 12px; margin-left: 6px; }
.event { border: 1px solid var(--line); border-radius: 18px; padding: 12px; margin-bottom: 10px; background: linear-gradient(160deg, rgba(255, 143, 208, .08), rgba(0, 0, 0, .15)); }
.event.ev-story { border-color: rgba(255, 211, 107, .5); background: linear-gradient(160deg, rgba(255, 211, 107, .12), rgba(255, 120, 200, .06)); }
.event.locked { opacity: .78; }
.event p { margin: 4px 0 8px; color: var(--dim); font-size: .86rem; }
.ev-head { display: flex; gap: 8px; align-items: center; } .ev-head h3 { margin: 0; font-size: 1.12rem; }
.badge { font-size: .62rem; text-transform: uppercase; letter-spacing: .12em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.badge.story { color: #2a1400; background: var(--gold); border-color: var(--gold); font-weight: 800; }
.dress .lbl, .ev-foot { font-size: .72rem; color: var(--mute); }
.dress .lbl { margin-right: 6px; text-transform: uppercase; letter-spacing: .1em; }
.ev-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.grade-pill { color: var(--g); border: 1px solid var(--g); border-radius: 999px; padding: 1px 9px; font-weight: 800; }
.job { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.job p { margin: 2px 0; font-size: .8rem; color: var(--dim); } .job small { color: var(--mute); font-size: .72rem; }
.shop-btn { margin: 4px 0 6px; background: linear-gradient(135deg, rgba(255, 211, 107, .18), rgba(255, 120, 200, .15)); }
.shop-btn small { display: block; color: var(--dim); }

/* map */
.map h2 { text-align: center; font-size: 1.8rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.loc-card { position: relative; border-radius: 18px; aspect-ratio: 4 / 3; overflow: hidden; padding: 0; text-align: left; display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(160deg, var(--sky-b), var(--sky-a)); border: 1px solid var(--line); }
.loc-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.loc-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 4, 16, .9), transparent 60%); }
.loc-card .nm, .loc-card .sub { position: relative; z-index: 1; padding: 0 12px; }
.loc-card .nm { font-family: var(--display); font-weight: 800; font-size: 1.05rem; text-shadow: 0 0 12px var(--neon); }
.loc-card .sub { font-size: .7rem; color: var(--dim); padding-bottom: 10px; }
.loc-card.here { border-color: var(--rose); box-shadow: 0 0 0 2px var(--rose) inset; }
.loc-card.locked { filter: grayscale(.8) brightness(.55); }

/* mirror + shop */
.target { display: flex; flex-direction: column; gap: 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--rose2); }
.target select { font: inherit; text-transform: none; letter-spacing: 0; font-size: .9rem; padding: 9px 12px; border-radius: 12px; background: var(--glass2); color: var(--ink); border: 1px solid var(--line); }
.score { margin: 12px 0; padding: 12px; border-radius: 16px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.score-top { display: flex; align-items: center; gap: 14px; }
.grade { font-family: var(--display); font-weight: 800; font-size: 2.6rem; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; color: var(--g);
  border: 2px solid var(--g); box-shadow: 0 0 24px color-mix(in srgb, var(--g) 50%, transparent), inset 0 0 18px color-mix(in srgb, var(--g) 30%, transparent); }
.grade.huge { font-size: 6rem; width: 160px; height: 160px; margin: 10px auto; animation: pop .7s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(.2) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }
.score .total { font-size: 1.8rem; font-family: var(--display); display: block; line-height: 1; }
.score small { color: var(--mute); font-size: .72rem; }
.tagbars { display: grid; gap: 3px; margin: 10px 0; }
.tb { display: grid; grid-template-columns: 110px 1fr 56px; align-items: center; gap: 8px; font-size: .74rem; }
.tb i { height: 7px; border-radius: 999px; background: currentColor; opacity: .85; transition: width .4s; }
.tb em { font-style: normal; color: var(--dim); text-align: right; }
.parts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .75rem; color: var(--dim); }
.parts b { color: var(--ink); margin-left: 3px; } .parts small { display: block; color: var(--mute); font-size: .66rem; }
.slots { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.slots button { padding: 5px 12px; font-size: .78rem; text-transform: capitalize; white-space: nowrap; }
.slots button.on { background: var(--rose); color: #2a0f2a; font-weight: 800; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.item { position: relative; border-radius: 16px; text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 10px; background: rgba(0, 0, 0, .28); overflow: hidden; }
.item .sw { height: 34px; border-radius: 10px; background: linear-gradient(120deg, var(--hair, var(--c1)) 0 55%, var(--c2) 55%); border: 1px solid rgba(255, 255, 255, .2); }
.item .nm { font-weight: 800; font-size: .84rem; line-height: 1.2; }
.item .meta { font-size: .64rem; color: var(--mute); text-transform: capitalize; }
.item .chips .chip { font-size: .62rem; padding: 0 6px; }
.item .price { font-weight: 800; color: var(--gold); font-size: .82rem; margin-top: auto; }
.item .price i { font-style: normal; font-size: .72rem; margin-left: 4px; } .item .price i.up { color: var(--mint); } .item .price i.dn { color: var(--crimson); }
.item.worn { border-color: var(--rose); box-shadow: 0 0 0 1px var(--rose) inset; }
.worn-tag { position: absolute; top: 8px; right: 8px; font-size: .58rem; background: var(--rose); color: #2a0f2a; font-weight: 800; padding: 1px 6px; border-radius: 999px; }
.item.r-fine { border-color: rgba(127, 224, 196, .35); } .item.r-rare { border-color: rgba(183, 156, 242, .55); }
.item.r-couture { border-color: rgba(255, 143, 208, .75); } .item.r-mythic { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 211, 107, .3); }
.worn-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 8px; max-width: 360px; }
.mini { font-size: .68rem; padding: 3px 9px; }
.tryon { color: var(--dim); font-size: .8rem; margin: 6px 0 0; }

/* entrance / duel / result */
.entrance .panel, .result .panel { max-width: 520px; margin: 0 auto; width: 100%; }
.total-line b { font-size: 1.4rem; font-family: var(--display); }
.perks { list-style: none; padding: 0; margin: 6px 0 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.perks li { background: rgba(255, 255, 255, .07); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .85rem; }
.duel { min-height: calc(100vh - 30px); grid-template-rows: auto 1fr auto; }
.duel-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 6px; }
.side { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.side .who { width: 100%; display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: center; }
.vs { font-family: var(--display); font-weight: 800; font-size: 2.2rem; color: var(--gold); text-shadow: 0 0 20px var(--neon); text-align: center; align-self: center; }
.vs small { display: block; font-family: var(--body); font-size: .62rem; color: var(--dim); font-weight: 400; }
.kira { display: flex; gap: 3px; justify-content: center; align-items: center; }
.kira i { width: 9px; height: 9px; transform: rotate(45deg); background: rgba(255, 255, 255, .12); border-radius: 2px; }
.kira i.on { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.kira span { font-size: .66rem; color: var(--dim); margin-left: 4px; }
.weak { display: flex; flex-wrap: wrap; justify-content: center; }
.log { align-self: end; min-height: 90px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 10px; background: rgba(0, 0, 0, .35); border-radius: 16px; border: 1px solid var(--line); font-size: .85rem; }
.log p { margin: 0; animation: fadein .4s both; } .log p.crit { color: var(--gold); font-weight: 800; } .log p.foe { color: #b9dcff; } .log p.good { color: var(--mint); }
.log i { color: var(--mute); font-style: normal; font-size: .78rem; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.moves { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 900px) { .moves { grid-template-columns: repeat(3, 1fr); } .duel-top .doll-wrap.sm { width: 200px; } }
.move { border-radius: 16px; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 0 6px; padding: 10px 12px; background: rgba(20, 10, 34, .82); }
.move b { color: var(--ink); font-size: .9rem; } .move small { grid-column: 1; font-size: .68rem; } .move em { color: var(--gold); font-style: normal; font-weight: 800; }
.move .cost { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: .78rem; color: var(--gold); font-weight: 800; }
.move:not(:disabled):hover { border-color: currentColor; box-shadow: 0 0 18px color-mix(in srgb, currentColor 35%, transparent); }
.portrait { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 2px solid var(--rose2); background: #2a1640; box-shadow: 0 0 20px rgba(255, 143, 208, .3); }
.portrait.lg { width: min(34vw, 180px); height: min(34vw, 180px); border-radius: 24px; }
.portrait.xl { width: min(60vw, 340px); height: auto; aspect-ratio: 1; border-radius: 28px; }
.crest { display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--hue) 80%, white), color-mix(in srgb, var(--hue) 60%, black)); }
.crest span { font-family: 'Shippori Mincho', var(--display); font-size: 2.4em; color: rgba(255, 255, 255, .9); text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.portrait.lg.crest span { font-size: 4.5rem; }
.result.win h2 { color: var(--gold); } .result h2 { font-size: 1.5rem; }
.float { position: fixed; z-index: 60; pointer-events: none; font-family: var(--display); font-weight: 800; font-size: 2rem; transform: translate(-50%, -50%); animation: floaty 1.2s ease-out forwards; text-shadow: 0 2px 10px #000; }
.float.dmg { color: var(--rose2); } .float.crit { color: var(--gold); font-size: 2.8rem; } .float.hurt { color: #9fd8ff; } .float.heal { color: var(--mint); }
@keyframes floaty { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }

/* bunny / friends / journal */
.stats { display: grid; gap: 6px; }
.stat { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 8px; font-size: .82rem; }
.stat button { padding: 0 12px; font-weight: 800; background: var(--rose); color: #2a0f2a; }
.pts { font-style: normal; background: var(--rose); color: #2a0f2a; border-radius: 999px; padding: 1px 8px; font-size: .7rem; letter-spacing: 0; text-transform: none; }
.tree { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.branch h5 { margin: 0 0 6px; font-family: var(--display); font-size: 1rem; } .branch h5 small { display: block; font-family: var(--body); font-weight: 400; color: var(--mute); font-size: .66rem; }
.skill { width: 100%; border-radius: 14px; text-align: left; padding: 8px; margin-bottom: 6px; display: flex; flex-direction: column; font-size: .74rem; }
.skill small { color: var(--dim); font-size: .64rem; }
.skill.known { background: linear-gradient(135deg, rgba(255, 143, 208, .35), rgba(192, 140, 255, .3)); border-color: var(--rose); opacity: 1; }
.b-steel .skill.known { background: linear-gradient(135deg, rgba(122, 215, 255, .3), rgba(80, 90, 140, .4)); }
.b-moon .skill.known { background: linear-gradient(135deg, rgba(255, 211, 107, .35), rgba(255, 143, 208, .2)); }
.movelist p { margin: 3px 0; font-size: .8rem; color: var(--dim); } .movelist b { color: var(--ink); }
.npcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.npc { display: flex; gap: 10px; align-items: center; text-align: left; border-radius: 18px; padding: 8px; }
.npc .portrait { width: 56px; height: 56px; flex: none; } .npc span { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.npc small { color: var(--mute); font-size: .66rem; } .npc.on { border-color: var(--rose); }
.npc-detail { display: grid; grid-template-columns: auto 1fr; gap: 16px; margin-top: 14px; align-items: start; }
@media (max-width: 600px) { .npc-detail { grid-template-columns: 1fr; justify-items: center; } }
.chapters li { margin: 6px 0; color: var(--dim); } .chapters li.done { color: var(--mint); } .chapters li.cur { color: var(--gold); }
.chapters em { color: var(--mute); font-style: normal; font-size: .8rem; }
.howto li { margin: 6px 0; color: var(--dim); } .howto b { color: var(--ink); }

/* scene (visual novel) */
.scene { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(8, 3, 18, .9), rgba(8, 3, 18, .2) 60%); cursor: pointer; animation: fadein .3s both; }
.scene-cast { flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.scene-cast .portrait.xl { animation: fadein .5s both; border-radius: 28px 28px 0 0; border-bottom: 0;
  -webkit-mask-image: linear-gradient(180deg, #000 75%, transparent); mask-image: linear-gradient(180deg, #000 75%, transparent); }
.scene-box { position: relative; width: min(100%, 760px); background: rgba(22, 10, 40, .92); border: 1px solid rgba(255, 190, 235, .4); border-radius: 22px; padding: 22px 20px 18px; box-shadow: 0 0 40px rgba(255, 120, 200, .18); }
.scene-box.narr { font-style: italic; font-family: var(--display); font-size: 1.05rem; }
.scene-box p { margin: 0; font-size: 1rem; line-height: 1.6; animation: fadein .35s both; }
.speaker { position: absolute; top: -14px; left: 18px; background: linear-gradient(135deg, #ff6fbf, #c04bff); padding: 2px 14px; border-radius: 999px; font-weight: 800; font-size: .85rem; }
.next { position: absolute; right: 16px; bottom: 6px; font-size: .62rem; color: var(--mute); animation: twinkle 1.6s infinite; }
.choices { display: grid; gap: 8px; }
.choices button { text-align: left; border-radius: 14px; padding: 12px 14px; background: rgba(255, 143, 208, .1); }
.choices button:hover { background: rgba(255, 143, 208, .25); }

/* toasts */
#toasts { position: fixed; z-index: 70; top: 64px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(92vw, 440px); }
.toast { background: rgba(24, 12, 42, .94); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; font-size: .82rem; animation: fadein .3s both; transition: opacity .5s, transform .5s; text-align: center; }
.toast.out { opacity: 0; transform: translateY(-10px); }
.toast.gold { border-color: var(--gold); color: var(--gold); } .toast.pink { border-color: var(--rose); } .toast.bad { border-color: var(--crimson); color: #ffc2cc; }

/* the doll gallery (shot hook) */
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; padding: 30px; align-items: end; min-height: 100vh; }
.gallery .doll-wrap { width: 100%; }
.gallery.one { grid-template-columns: 1fr; justify-items: center; padding: 0; align-items: start; }
.gallery.one .doll-wrap { width: 1100px; margin-top: -40px; }

/* ── cycle-2 layout fixes (phone first: the panel must start above the fold) ── */
.v-hub .doll-wrap, .v-bunny .doll-wrap { width: min(40vw, 300px); }
.v-mirror .doll-wrap, .v-shop .doll-wrap { width: min(42vw, 300px); }
.v-hub .loc-title { margin-top: 0; }
.duel-top .doll-wrap.sm { width: min(34vw, 200px); }
.duel .portrait.lg { width: min(34vw, 170px); height: min(34vw, 170px); }
.side .who b { position: relative; z-index: 1; display: block; margin-top: 4px; }
.duel .bar { height: 16px; } .duel .bar b { line-height: 16px; font-size: .68rem; }
@media (max-width: 899px) {
  .v-mirror > section, .v-shop > section { grid-template-columns: 1fr; }
  .v-mirror .stage, .v-shop .stage { flex-direction: row; align-items: flex-end; justify-content: center; gap: 8px; }
  .v-mirror .worn-list { flex-direction: column; align-items: flex-start; max-width: 46vw; }
}
@media (min-width: 900px) { .v-hub .doll-wrap, .v-bunny .doll-wrap, .v-mirror .doll-wrap, .v-shop .doll-wrap { width: 340px; } }
/* grid items default to min-width:auto, so one nowrap strip (.slots) widened the whole column */
.view > section > * { min-width: 0; }
html, body { max-width: 100%; }
.bar b { color: #fff; text-shadow: 0 0 3px #000, 0 1px 2px #000; }
.title-card { background: linear-gradient(180deg, rgba(14, 6, 28, .2), rgba(14, 6, 28, .78) 30%); border-radius: 26px; padding: 18px 16px; backdrop-filter: blur(6px); }
.v-entrance .doll-wrap { width: min(40vw, 300px); }
.bar.st { height: 16px; } .bar.st b { line-height: 16px; font-size: .66rem; }
@media (min-width: 900px) {
  .view > section.duel { grid-template-columns: 1fr; max-width: 980px; margin: 0 auto; }
  .duel-top { max-width: 760px; margin: 0 auto; width: 100%; }
  .duel .portrait.lg { width: 200px; height: 200px; }
}

/* ══ LAYOUT v2 (dev cycle 3): the stage owns the screen ═══════════════════════════════════════
   Phone: Bunny + backdrop fill the viewport, the panel is a bottom sheet (peek ⇄ open).
   Desktop: left nav rail, Bunny sized to viewport HEIGHT on a full-bleed stage, glass panel right.
   Cinematic screens (entrance/duel/result/scene): letterbox bars, no chrome. */
:root { --hud-h: 58px; --tabs-h: 62px; --rail-w: 84px; --peek: 40vh; }
#letterbox i { position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 40; transition: height .6s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
#letterbox i:first-child { top: 0; } #letterbox i:last-child { bottom: 0; }
body.cine #letterbox i { height: 5.5vh; }
.handle { display: none; }

@media (max-width: 899px) {
  .v-hub, .v-mirror, .v-shop { padding: 0; }
  .v-hub > section, .v-mirror > section, .v-shop > section { display: block; }
  .v-hub .stage, .v-mirror .stage, .v-shop .stage {
    position: fixed; left: 0; right: 0; top: var(--hud-h); bottom: calc(var(--peek) - 18px); z-index: 2;
    display: flex; flex-direction: row; align-items: flex-end; justify-content: center; pointer-events: none; }
  .v-hub .stage > *, .v-mirror .stage > *, .v-shop .stage > * { pointer-events: auto; }
  .v-hub .doll-wrap, .v-mirror .doll-wrap, .v-shop .doll-wrap { height: 100%; width: auto; max-width: 70vw; }
  .v-hub .loc-title { position: absolute; left: 14px; top: 10px; text-align: left; max-width: 46vw; }
  .v-hub .loc-title h2 { font-size: 1.35rem; } .v-hub .loc-title p { font-size: .78rem; }
  .v-mirror .worn-list { position: absolute; right: 8px; top: 8px; align-items: flex-end; max-width: 40vw; }
  .v-shop .tryon { position: absolute; left: 12px; top: 8px; }
  .sheet { position: fixed; left: 0; right: 0; bottom: var(--tabs-h); z-index: 4; border-radius: 26px 26px 0 0;
    max-height: calc(100vh - var(--hud-h) - var(--tabs-h) - 12px); overflow-y: auto; overscroll-behavior: contain;
    transform: translateY(calc(100% - var(--peek) + var(--tabs-h))); transition: transform .45s cubic-bezier(.2, .8, .2, 1);
    padding-top: 26px; background: linear-gradient(180deg, rgba(30, 14, 52, .9), rgba(16, 8, 30, .96)); }
  body[data-sheet="open"] .sheet { transform: none; }
  .sheet .handle { display: block; position: sticky; top: -26px; margin: -26px auto 6px; width: 100%; height: 26px; border: 0; background: none; padding: 0; z-index: 3; }
  .sheet .handle i { display: block; width: 46px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .35); margin: 10px auto; }
  body[data-sheet="peek"] .sheet { overflow: hidden; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabs-h); }
  .hud { position: fixed; left: 0; right: 0; top: 0; }
  .v-bunny, .v-friends, .v-journal, .v-map { padding-top: calc(var(--hud-h) + 6px); padding-bottom: calc(var(--tabs-h) + 10px); }
  .v-bunny .stage { display: none; }
}

@media (min-width: 900px) {
  #app { padding-left: var(--rail-w); }
  body.cine #app, body[data-screen="title"] #app { padding-left: 0; }
  .tabs { position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail-w); height: auto; display: flex; flex-direction: column; justify-content: center; gap: 6px;
    padding: 10px 6px; margin: 0; background: linear-gradient(90deg, rgba(10, 5, 20, .88), rgba(10, 5, 20, .5)); border-right: 1px solid var(--line); }
  .tabs button { padding: 10px 0; font-size: .7rem; }
  .tabs button span { font-size: 1.45rem; }
  .tabs em { right: 14px; }
  .hud { background: linear-gradient(180deg, rgba(10, 5, 20, .7), transparent); }
  .view { max-width: none; padding: 0 28px 24px; }
  .view > section.hub, .view > section.mirror, .view > section.bunny { grid-template-columns: minmax(0, 1fr) minmax(420px, 560px); gap: 28px; }
  .v-hub .stage, .v-mirror .stage, .v-shop .stage, .v-bunny .stage { position: sticky; top: var(--hud-h); height: calc(100vh - var(--hud-h) - 10px); justify-content: flex-end; }
  .v-hub .doll-wrap, .v-mirror .doll-wrap, .v-shop .doll-wrap, .v-bunny .doll-wrap { height: min(82vh, 860px); width: auto; }
  .v-hub .loc-title { position: absolute; left: 0; top: 8px; text-align: left; margin: 0; }
  .v-hub .loc-title h2 { font-size: clamp(2rem, 3.6vw, 3.4rem); line-height: 1; }
  .panel { max-height: calc(100vh - var(--hud-h) - 24px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,143,208,.4) transparent; }
  .v-hub .panel, .v-mirror .panel, .v-shop .panel, .v-bunny .panel { margin-top: 6px; }
  .v-mirror .worn-list { position: absolute; left: 0; bottom: 30px; flex-direction: column; align-items: flex-start; }
}

/* ══ cinematics (dev cycles 2 + 5): sprites from the owner's sheets ═══════════════════════════ */
.spr { display: block; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .55)); }
.title-hero .hero { height: min(70vh, 640px); width: auto; filter: drop-shadow(0 0 40px rgba(255, 80, 120, .35)) drop-shadow(0 20px 40px #000); animation: fadein 1s both; }
.lookbook { display: flex; gap: 6px; justify-content: center; margin: 14px 0 0; }
.lookbook figure { margin: 0; width: 15%; max-width: 74px; aspect-ratio: 1 / 1.6; border-radius: 14px; overflow: hidden; position: relative;
  background: linear-gradient(180deg, rgba(255, 143, 208, .22), rgba(40, 14, 60, .6)); border: 1px solid var(--line);
  animation: lookIn .6s calc(var(--i) * 90ms + .3s) both cubic-bezier(.2, 1.4, .4, 1); }
.lookbook .look { position: absolute; bottom: 0; left: 50%; height: 100%; width: auto; transform: translateX(-50%); }
@keyframes lookIn { from { opacity: 0; transform: translateY(16px) scale(.9); } to { opacity: 1; transform: none; } }
/* entrance: she struts in from the left; the outfit (doll) takes over centre-stage */
.v-entrance .stage { position: relative; min-height: 46vh; }
.strut { position: absolute; bottom: 0; left: 50%; height: min(62vh, 560px); animation: strut 1.7s cubic-bezier(.3, .6, .4, 1) both, strutOut .4s 1.65s both; z-index: 2; }
.strut .walker { height: 100%; width: auto; transform: translateX(-50%); }
@keyframes strut { from { transform: translateX(-70vw); } to { transform: translateX(0); } }
@keyframes strutOut { to { opacity: 0; filter: brightness(3) blur(4px); } }
.doll-wrap.after-strut { animation: dollIn .7s 1.7s both cubic-bezier(.2, 1.3, .4, 1); }
@keyframes dollIn { from { opacity: 0; transform: scale(.85); filter: brightness(2.4); } to { opacity: 1; transform: none; filter: none; } }
.v-entrance .grade.huge { animation-delay: 1.75s; }
/* result: the victory dance beside the stamp */
.result-row { display: flex; align-items: flex-end; justify-content: center; gap: 8px; }
.victor { height: min(38vh, 340px); width: auto; animation: fadein .6s .2s both; }
.victor.dim { filter: grayscale(.4) brightness(.8) drop-shadow(0 12px 26px #000); height: min(30vh, 260px); }
/* VN expression portraits */
.scene-cast .face { height: min(52vh, 420px); width: auto; animation: faceIn .35s both; -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent); mask-image: linear-gradient(180deg, #000 80%, transparent); }
@keyframes faceIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* chapter title card */
.chapter-card { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(10, 2, 20, .92), rgba(10, 2, 20, .98)); animation: cardOut .8s 2.6s forwards; }
.chapter-card .kanji { font-family: 'Shippori Mincho', serif; font-size: clamp(3rem, 14vw, 7rem); color: #ff4a6a; letter-spacing: .1em; text-shadow: 0 0 40px rgba(255, 60, 100, .6);
  animation: brush 1.1s cubic-bezier(.6, 0, .2, 1) both; -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%); mask-image: linear-gradient(90deg, #000 45%, transparent 55%); -webkit-mask-size: 260% 100%; mask-size: 260% 100%; }
.chapter-card .num { text-transform: uppercase; letter-spacing: .5em; font-size: .8rem; color: var(--rose2); animation: fadein .6s .8s both; }
.chapter-card h2 { font-size: clamp(2rem, 7vw, 3.6rem); margin: 0; background: linear-gradient(180deg, #fff, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: fadein .7s 1s both; }
.chapter-card .where { font-family: var(--display); font-style: italic; color: var(--dim); animation: fadein .7s 1.3s both; }
@keyframes brush { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; } to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@keyframes cardOut { to { opacity: 0; visibility: hidden; } }
/* the manga cut-in panel */
.cutin { position: fixed; inset: 0; z-index: 45; pointer-events: none; display: flex; align-items: center; }
.cutin .panel-strip { position: relative; width: 100%; height: 42vh; background: #0b0614; clip-path: polygon(0 14%, 100% 0, 100% 86%, 0 100%);
  animation: stripIn .28s cubic-bezier(.2, .9, .2, 1) both; overflow: hidden; border-top: 4px solid var(--c); box-shadow: 0 0 60px var(--c); }
.cutin .tone { position: absolute; inset: 0; opacity: .35; background-image: radial-gradient(circle, var(--c) 1.4px, transparent 1.6px); background-size: 9px 9px; }
.cutin .tone::after { content: ''; position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 30% 50%, transparent 0 3deg, rgba(255, 255, 255, .12) 3deg 4deg); }
.cutin .cut { position: absolute; left: 4%; bottom: -4%; height: 112%; width: auto; animation: cutSlide .9s ease-out both; filter: drop-shadow(0 0 18px var(--c)); }
.cutin b { position: absolute; right: 5%; top: 50%; transform: translateY(-50%) skewX(-12deg); font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 6vw, 3.6rem);
  color: #fff; text-shadow: 0 0 20px var(--c), 3px 3px 0 #000; letter-spacing: .02em; animation: fadein .3s .12s both; text-align: right; max-width: 55%; }
.cutin.out .panel-strip { animation: stripOut .35s ease-in forwards; }
@keyframes stripIn { from { transform: translateX(-100%) skewX(-10deg); } to { transform: none; } }
@keyframes stripOut { to { transform: translateX(100%) skewX(-10deg); opacity: 0; } }
@keyframes cutSlide { from { transform: translateX(-8%) scale(1.05); } to { transform: translateX(4%) scale(1); } }
@media (min-width: 900px) { .title-hero .hero { height: min(82vh, 760px); } .lookbook figure { max-width: 92px; } }
@media (prefers-reduced-motion: reduce) { .strut, .cutin .panel-strip, .chapter-card .kanji { animation-duration: .01s !important; } }
/* cycle 5b fixes */
.v-entrance .stage { min-height: 62vh; justify-content: flex-end; }
.strut { height: min(56vh, 540px); }
.scene { background: linear-gradient(0deg, rgba(8, 3, 18, .96), rgba(8, 3, 18, .78) 55%, rgba(8, 3, 18, .6)); backdrop-filter: blur(8px) saturate(1.2); -webkit-backdrop-filter: blur(8px) saturate(1.2); }
.result-row { flex-wrap: nowrap; max-width: 100%; }
.result-row .grade.huge { flex: none; }
@media (max-width: 600px) {
  .result-row .grade.huge { width: 112px; height: 112px; font-size: 4.2rem; }
  .victor { height: 30vh; }
}
.result-row .grade.huge { margin: 0 0 18px; }
.result-row { width: 100%; justify-content: center; gap: 4px; }
@media (max-width: 600px) { .victor { height: 26vh; } .result-row .grade.huge { width: 96px; height: 96px; font-size: 3.6rem; } }
/* cycle 11: chapter stills, crisp portraits, a stage that breathes */
.chapter-card.has-still { background: #05020c; }
.chapter-card .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; animation: kenburns 4s ease-out both;
  -webkit-mask-image: radial-gradient(ellipse at 40% 50%, #000 40%, transparent 85%); mask-image: radial-gradient(ellipse at 40% 50%, #000 40%, transparent 85%); }
.chapter-card > :not(.still) { position: relative; }
@keyframes kenburns { from { transform: scale(1.12) translateX(2%); } to { transform: scale(1); } }
.scene-cast .face.crisp { height: min(56vh, 460px); }
.v-hub .doll-wrap svg, .v-mirror .doll-wrap svg { animation: breathe 3.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.008) translateY(-1px); } }
@media (prefers-reduced-motion: reduce) { .doll-wrap svg { animation: none !important; } }
/* cycles 12–13: duel cinematography */
.shake { animation: shake .32s cubic-bezier(.36, .07, .19, .97); }
.shake-hard { animation: shakeHard .5s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake { 10%, 90% { transform: translate(-1px, 1px); } 30%, 70% { transform: translate(-4px, -2px); } 50% { transform: translate(4px, 2px); } }
@keyframes shakeHard { 10%, 90% { transform: translate(-3px, 2px) rotate(-.4deg); } 25% { transform: translate(9px, -4px) rotate(.6deg); } 50% { transform: translate(-8px, 5px) rotate(-.5deg); } 75% { transform: translate(6px, -2px); } }
#you.shake, #foe.shake { animation: flinch .35s ease-out; }
@keyframes flinch { 30% { transform: scale(.94, 1.04) translateX(-6px); filter: brightness(1.8) saturate(.6); } 100% { transform: none; filter: none; } }
.duel .portrait.lg { box-shadow: 0 0 0 2px var(--neon), 0 0 28px var(--neon), 0 0 70px color-mix(in srgb, var(--neon) 40%, transparent); border-color: #fff; }
@media (max-width: 899px) {
  .duel { grid-template-rows: auto 1fr auto; gap: 8px; padding-top: 6vh; }
  .duel-top { grid-template-columns: 1fr auto 1fr; align-items: end; }
  .duel-top .doll-wrap.sm { width: auto; height: 40vh; }
  .duel .portrait.lg { width: 36vw; height: 36vw; }
  .vs { font-size: 2.6rem; transform: rotate(-8deg); }
  .log { min-height: 74px; font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) { .shake, .shake-hard, #you.shake, #foe.shake { animation: none !important; } }
@media (max-width: 899px) {
  .duel-top { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .duel .portrait.lg { width: min(32vw, 100%); height: auto; aspect-ratio: 1; }
  .side .who { min-width: 0; }
}
/* the klein stills frame Bunny on the left third (cine.yaml prompts) — crop toward her on tall screens */
.chapter-card .still { object-position: 24% 30%; }

/* ══ STUNNING UI (Effort 002, cycles I–N) ═════════════════════════════════════════════════════ */
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
/* panels: a slow animated gradient rim drawn with a mask, so the glass stays glass */
/* `.panel:not(.sheet)`: a bare `.panel { position: relative }` here came AFTER the bottom-sheet rule
   at equal specificity and silently un-fixed the phone sheet (caught by the playtest). */
.panel:not(.sheet) { position: relative; }
.panel::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--spin), transparent 0 55%, var(--neon) 70%, var(--gold) 78%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; animation: spin 9s linear infinite; }
@keyframes spin { to { --spin: 360deg; } }
/* primary buttons: a light sweep */
button.primary { position: relative; overflow: hidden; }
button.primary::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-20deg); animation: sweep 3.2s ease-in-out infinite; }
@keyframes sweep { 0%, 60% { left: -60%; } 100% { left: 130%; } }
/* the location's kanji, a towering watermark behind Bunny */
.kanji-mark { position: absolute; z-index: 0; right: 4%; top: 6%; writing-mode: vertical-rl; font-family: 'Shippori Mincho', serif; font-weight: 700;
  font-size: clamp(5rem, 22vh, 13rem); line-height: 1; letter-spacing: .05em; color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--neon) 55%, transparent);
  text-shadow: 0 0 40px color-mix(in srgb, var(--neon) 25%, transparent); opacity: .5; pointer-events: none; animation: kanjiIn 1.2s ease-out both; }
@keyframes kanjiIn { from { opacity: 0; transform: translateY(20px); letter-spacing: .4em; } to { opacity: .5; } }
.stage .doll-wrap { position: relative; z-index: 1; }
/* Bunny wears the location's neon as a rim light */
.v-hub .doll-wrap, .v-mirror .doll-wrap, .v-shop .doll-wrap { filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .55)) drop-shadow(0 0 2px var(--neon)) drop-shadow(0 0 18px color-mix(in srgb, var(--neon) 45%, transparent)); }
.v-hub .stage::after, .v-mirror .stage::after { content: ''; position: absolute; z-index: 0; left: 50%; bottom: 0; width: 70%; height: 16%; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--neon) 40%, transparent), transparent 70%); filter: blur(6px); pointer-events: none; }
/* HUD: XP ring + trend chip */
.lvl.ring { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(var(--gold) var(--p), rgba(255, 255, 255, .12) 0); position: relative; }
.lvl.ring::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #170b26; }
.lvl.ring b { position: relative; font-family: var(--display); font-size: 1rem; }
.hud .trend { font-size: .64rem; border: 1px solid currentColor; border-radius: 999px; padding: 0 8px; margin-top: 2px; white-space: nowrap; animation: pulseChip 2.6s ease-in-out infinite; }
@keyframes pulseChip { 50% { box-shadow: 0 0 12px currentColor; } }
/* friends at this haunt */
.friends-here { display: grid; gap: 6px; margin: 8px 0; }
.hang { display: flex; align-items: center; gap: 10px; border-radius: 18px; text-align: left; padding: 6px 12px 6px 6px; position: relative; overflow: hidden; }
.hang .portrait { width: 44px; height: 44px; flex: none; }
.hang span { display: flex; flex-direction: column; } .hang small { color: var(--rose2); font-size: .7rem; }
.hang .aff { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--a); background: linear-gradient(90deg, #ff6f9c, #ff2f7f); }
.req-btn { margin: 4px 0; background: linear-gradient(135deg, rgba(255, 211, 107, .16), rgba(120, 60, 200, .2)); }
/* tailoring */
.stars { font-style: normal; color: var(--gold); font-size: .72rem; letter-spacing: 1px; text-shadow: 0 0 6px var(--gold); }
.atelier { font-size: .76rem; color: var(--gold); margin: 6px 0; }
.items { position: relative; }
.tailor-btn { font-size: .66rem; padding: 2px 8px; margin-top: -4px; justify-self: start; background: rgba(255, 211, 107, .14); border-color: rgba(255, 211, 107, .4); }
/* 3D tilt (desktop pointer) */
.item, .cover { transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out, box-shadow .25s; }
.item.tilting, .cover.tilting { transition: transform .05s; box-shadow: 0 18px 40px rgba(0, 0, 0, .45), 0 0 20px color-mix(in srgb, var(--rose) 30%, transparent); }
/* duel tells */
.tells { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.intent { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 8px 12px; border-radius: 14px; background: rgba(10, 4, 22, .75); border: 1px solid rgba(122, 215, 255, .4); font-size: .8rem; animation: telegraph 1.6s ease-in-out infinite; }
.intent b { grid-row: span 2; font-size: 1.4rem; } .intent small { color: var(--mute); font-size: .66rem; }
.intent.i-hit { border-color: rgba(255, 90, 122, .6); } .intent.i-mend { border-color: rgba(127, 224, 196, .5); }
@keyframes telegraph { 50% { box-shadow: 0 0 18px rgba(255, 90, 122, .25); } }
.rhythm { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px 12px; border-radius: 14px; background: rgba(10, 4, 22, .75); border: 1px solid var(--line); font-size: .7rem; }
.rhythm i { width: 10px; height: 18px; border-radius: 3px; background: rgba(255, 255, 255, .1); transform: skewX(-12deg); }
.rhythm i.on { background: linear-gradient(180deg, var(--gold), var(--rose)); box-shadow: 0 0 8px var(--gold); }
.rhythm b { font-family: var(--display); color: var(--gold); margin-left: 4px; } .rhythm small { width: 100%; color: var(--mute); font-size: .62rem; }
.move.stale { opacity: .7; border-style: dashed; }
.move.suggest { box-shadow: 0 0 0 1px #7ad7ff, 0 0 18px rgba(122, 215, 255, .5); animation: telegraph 1.6s ease-in-out infinite; }
@media (max-width: 600px) { .tells { grid-template-columns: 1fr; } }
/* requests */
.reqs { display: grid; gap: 8px; }
.req { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 16px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.req .portrait { width: 48px; height: 48px; } .req p { margin: 2px 0; font-size: .8rem; color: var(--dim); } .req small { color: var(--mute); font-size: .66rem; margin-left: 6px; }
.req .rw { font-size: .7rem; color: var(--gold); } .req em { font-style: normal; color: var(--mint); font-size: 1.4rem; }
.req.done { opacity: .55; }
/* Moon Magazine covers */
.covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cover { position: relative; margin: 0; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: linear-gradient(160deg, var(--sky-b), var(--sky-a)); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.cover .mast { position: absolute; top: 4%; left: 0; right: 0; text-align: center; font-family: var(--display); font-weight: 800; font-size: 2.6rem; letter-spacing: .12em; color: #fff; mix-blend-mode: screen; text-shadow: 0 0 18px var(--neon); z-index: 2; }
.cover .issue { position: absolute; top: 19%; left: 0; right: 0; text-align: center; font-size: .55rem; letter-spacing: .3em; text-transform: uppercase; color: var(--rose2); z-index: 2; }
.cover .cdoll { position: absolute; inset: 14% 10% -4% 10%; z-index: 1; filter: drop-shadow(0 0 10px var(--neon)); }
.cover .cdoll svg { width: 100%; height: 100%; }
.cover .line { position: absolute; z-index: 3; left: 6%; font-family: var(--display); font-weight: 800; color: #fff; text-shadow: 0 2px 6px #000; max-width: 55%; line-height: 1.05; }
.cover .l1 { bottom: 22%; font-size: .95rem; } .cover .l2 { bottom: 10%; font-size: .62rem; font-family: var(--body); color: var(--gold); }
.cover .l3 { top: 30%; right: 6%; left: auto; font-size: .7rem; background: #ff2f7f; padding: 2px 6px; transform: rotate(6deg); }
/* the speaker glows with the loudness of the line (audio.js voiceLevel → --vu) */
.vu { filter: drop-shadow(0 0 calc(4px + var(--vu) * 26px) color-mix(in srgb, var(--rose) 80%, transparent)) brightness(calc(1 + var(--vu) * .18)); transform: scale(calc(1 + var(--vu) * .015)); transition: filter .05s; }
body.speaking .scene-box { box-shadow: 0 0 calc(20px + var(--vu) * 50px) rgba(255, 120, 200, calc(.15 + var(--vu) * .4)); }
@media (prefers-reduced-motion: reduce) { .panel::before, button.primary::after, .hud .trend, .intent, .move.suggest { animation: none !important; } }
.cover .issue { top: auto; bottom: 3%; font-size: .5rem; color: rgba(255, 255, 255, .7); }
.cover .cdoll { inset: 20% 14% -2% 30%; }
.cover .l1 { bottom: 26%; } .cover .l2 { bottom: 9%; }
.cover .l3 { top: auto; bottom: 46%; left: 6%; right: auto; transform: rotate(-6deg); }
.cover .l3 { bottom: 60%; }

/* the HUD grew (trend chip + XP ring): the layout's notion of its height must follow */
:root { --hud-h: 86px; }
@media (max-width: 899px) { .hud { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; } }
.hud-btns { display: flex; gap: 4px; } .icon.lang { font-size: .62rem; padding: 2px 8px; }
.npc .haunt { color: var(--rose2); font-size: .62rem; }
.npc.bonded { border-color: #ff6f9c; box-shadow: 0 0 16px rgba(255, 111, 156, .25); }
.bondmark { font-style: normal; font-size: .8rem; }
