/* K ROZZ: her room, at night. */
:root {
  --night: #1d1330;      /* base: the room with the lamp off */
  --night-2: #261a3f;    /* raised surfaces */
  --glass: #2a2d55;      /* the window */
  --lavender: #b98cf0;   /* brand */
  --blossom: #ffc2e2;    /* hearts, accents */
  --lamp: #ffd9a8;       /* warm fairy-light glow, used sparingly */
  --ivory: #f6eedf;      /* text */
  --ivory-dim: #cfc4d9;  /* secondary text */
  --display: "Fredoka", "Zen Kaku Gothic New", system-ui, sans-serif;
  --body: "Zen Kaku Gothic New", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --measure: 62ch;
  --deck-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ivory);
  font: 400 1.0625rem/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--deck-h) + 24px);
}
img, video { max-width: 100%; display: block; }
a { color: var(--blossom); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
p { margin: 0; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ivory); color: var(--night); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1rem/1 var(--display); letter-spacing: 0.01em;
  padding: 15px 26px; border-radius: 999px; border: 0; cursor: pointer; text-decoration: none;
  transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease;
}
.btn:active { transform: scale(.97); }
.btn--glow { background: var(--lavender); color: var(--night); box-shadow: 0 0 0 0 rgba(185,140,240,.0); }
.btn--glow:hover { background: #c9a3f6; box-shadow: 0 0 32px rgba(185,140,240,.45); }
.btn--quiet { background: transparent; color: var(--ivory); box-shadow: inset 0 0 0 1.5px rgba(246,238,223,.45); }
.btn--quiet:hover { box-shadow: inset 0 0 0 1.5px var(--ivory); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Header */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  background: linear-gradient(to bottom, rgba(29,19,48,.85), rgba(29,19,48,0));
  transition: background-color .3s ease, padding .3s ease;
}
.top.is-scrolled { background: rgba(29,19,48,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding-block: 12px; }
.top__logo img { width: clamp(118px, 13vw, 170px); height: auto; }
.top__nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); }
.top__nav a { color: var(--ivory); text-decoration: none; font: 500 1rem var(--display); }
.top__nav a:hover { color: var(--blossom); }
.bag-btn {
  font: 600 1rem var(--display); color: var(--night); background: var(--ivory);
  border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center;
}
.bag-btn__count { background: var(--lavender); border-radius: 999px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: .8rem; padding: 0 6px; }
@media (max-width: 640px) { .top__nav a { display: none; } }

section[id] { scroll-margin-top: 92px; }

/* Her room */
.room { position: relative; height: 100svh; min-height: 560px; overflow: hidden; isolation: isolate; }
.room__video, .room__rain, .room__shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.room__video { object-fit: cover; object-position: 50% 40%; z-index: -3; }
.room__rain { z-index: -2; pointer-events: none; }
.room__shade {
  z-index: -1;
  background:
    radial-gradient(120% 90% at 85% 30%, rgba(29,19,48,0) 40%, rgba(29,19,48,.55) 100%),
    linear-gradient(to top, var(--night) 0%, rgba(29,19,48,.55) 28%, rgba(29,19,48,0) 55%);
}
.room__copy {
  position: absolute; left: var(--gutter); bottom: calc(var(--deck-h) + clamp(28px, 6vh, 70px));
  max-width: min(560px, calc(100% - 2 * var(--gutter)));
}
.room__title {
  font-size: clamp(2.2rem, min(6.4vw, 8.5vh), 5.2rem); font-weight: 700; line-height: .98;
  color: var(--ivory);
  text-shadow: 0 2px 30px rgba(29,19,48,.6);
}
.room__sub { margin-top: 18px; color: var(--ivory); max-width: 40ch; text-shadow: 0 1px 12px rgba(29,19,48,.8); }
.room__actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }

/* Shop */
.shop { padding: clamp(72px, 10vw, 140px) var(--gutter) 40px; }
.shop__head { display: grid; gap: 14px; max-width: var(--measure); margin-bottom: clamp(32px, 5vw, 56px); }
.shop__head p { color: var(--ivory-dim); }
.shop__grid { display: grid; gap: clamp(28px, 4vw, 48px) clamp(18px, 3vw, 36px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

.item { all: unset; cursor: pointer; display: grid; gap: 14px; }
.item__stage {
  aspect-ratio: 1 / 1; border-radius: 28px 28px 28px 8px; overflow: hidden;
  background: radial-gradient(90% 70% at 50% 35%, #3a2a5c, var(--night-2));
  display: grid; place-items: center;
}
.item__stage img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.item:hover .item__stage img, .item:focus-visible .item__stage img { transform: scale(1.035); }
.item__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.item__name { font: 600 1.15rem/1.25 var(--display); }
.item__price { color: var(--lamp); font-weight: 500; white-space: nowrap; }
.threads { display: flex; gap: 6px; }
.thread { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(246,238,223,.35); }

.shop__soon { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 220px) 1fr; gap: 32px; align-items: center; padding: 32px; border-radius: 28px; background: var(--night-2); }
.shop__soon img { width: 100%; height: auto; }
.shop__soon h3 { font-size: 1.6rem; margin-bottom: 10px; }
.shop__soon p { color: var(--ivory-dim); max-width: 48ch; }
@media (max-width: 640px) { .shop__soon { grid-template-columns: 1fr; text-align: center; } .shop__soon img { max-width: 180px; margin: 0 auto; } }

/* Music */
.music {
  margin-top: clamp(60px, 8vw, 110px);
  padding: clamp(60px, 8vw, 110px) var(--gutter);
  background: linear-gradient(180deg, var(--glass), var(--night));
  display: grid; gap: clamp(32px, 6vw, 80px); grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start;
}
.music__intro { display: grid; gap: 18px; justify-items: start; position: sticky; top: 110px; }
.music__intro p { color: var(--ivory-dim); max-width: 46ch; }
.tracks { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.tracks li { counter-increment: t; }
.track {
  all: unset; box-sizing: border-box; width: 100%; cursor: pointer;
  display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: 14px;
  padding: 18px 6px; border-bottom: 1px solid rgba(246,238,223,.12);
}
.track::before { content: counter(t, decimal-leading-zero); font: 500 .95rem var(--display); color: var(--lavender); }
.track__name { font: 500 1.2rem/1.3 var(--display); }
.track__len { color: var(--ivory-dim); font-size: .95rem; font-variant-numeric: tabular-nums; }
.track:hover .track__name { color: var(--blossom); }
.track[aria-current="true"] .track__name { color: var(--blossom); }
.track[aria-current="true"]::before { content: "♥"; color: var(--blossom); }
@media (max-width: 860px) { .music { grid-template-columns: 1fr; } .music__intro { position: static; } }

/* Story */
.story {
  padding: clamp(80px, 10vw, 150px) var(--gutter);
  display: grid; gap: clamp(28px, 5vw, 64px); align-items: center;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 4fr);
}
.story__sketch { margin: 0; transform: rotate(-3deg); }
.story__sketch img { background: #f3ead9; padding: 22px; border-radius: 4px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.story__sketch figcaption { margin-top: 12px; color: var(--ivory-dim); font-size: .95rem; transform: rotate(3deg); }
.story__copy { display: grid; gap: 18px; max-width: var(--measure); }
.story__copy p { color: var(--ivory-dim); }
.story__final { margin: 0; }
.story__final img { border-radius: 8px 28px 28px 28px; box-shadow: 0 0 80px rgba(255,194,226,.15); }
@media (max-width: 900px) { .story { grid-template-columns: 1fr 1fr; } .story__copy { grid-column: 1 / -1; grid-row: 1; } }

/* Game */
.play {
  padding: clamp(70px, 9vw, 130px) var(--gutter) 0;
  display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}
.play__art { display: block; border-radius: 22px 22px 22px 6px; overflow: hidden; box-shadow: 0 0 0 4px var(--night-2), 0 0 70px rgba(185,140,240,.25); }
.play__art img { width: 100%; height: auto; image-rendering: pixelated; transition: transform .5s ease; }
.play__art:hover img, .play__art:focus-visible img { transform: scale(1.03); }
.play__copy { display: grid; gap: 16px; justify-items: start; max-width: 46ch; }
.play__copy p { color: var(--ivory-dim); }
.play__meta { font-size: .95rem; color: var(--lamp) !important; }
@media (max-width: 860px) { .play { grid-template-columns: 1fr; } }

/* Fans page */
.fans-page { padding-bottom: 24px; }
.fans-page .top { position: sticky; }
.fans-hero { position: relative; padding: clamp(48px, 7vw, 100px) var(--gutter); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.fans-hero h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1; }
.fans-hero__copy { display: grid; gap: 20px; max-width: 54ch; }
.fans-hero__copy p { color: var(--ivory-dim); }
.fans-hero__patch { width: 100%; height: auto; max-width: 360px; justify-self: center; filter: drop-shadow(0 0 40px rgba(255,194,226,.25)); }
.fans-hero__art { position: absolute; right: 30%; top: 22%; width: 34px; image-rendering: pixelated; opacity: .9; }
.wall { margin: 0 var(--gutter); padding: clamp(28px, 4vw, 48px); border-radius: 28px 28px 28px 8px; background: linear-gradient(135deg, var(--night-2), var(--glass)); display: grid; gap: 14px; max-width: 900px; }
.wall p { color: var(--ivory-dim); max-width: 64ch; }
.rules, .inst { padding: clamp(56px, 7vw, 96px) var(--gutter) 0; display: grid; gap: 18px; max-width: 1000px; }
.rules__cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 48px); }
.rules h3 { font-size: 1.3rem; margin-bottom: 8px; color: var(--blossom); }
.rules ul, .rules__text ul { margin: 0; padding-left: 1.2em; color: var(--ivory-dim); display: grid; gap: 8px; }
.rules__credit code { background: var(--night-2); padding: 4px 8px; border-radius: 8px; color: var(--lamp); font-size: .95rem; }
.rules__full { background: var(--night-2); border-radius: 18px; padding: 16px 20px; }
.rules__full summary { cursor: pointer; font: 600 1.05rem var(--display); }
.rules__text { display: grid; gap: 12px; margin-top: 14px; }
.rules__text h4 { font: 600 1.05rem var(--display); margin: 10px 0 0; color: var(--ivory); }
.inst p { color: var(--ivory-dim); }
.inst__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.inst__list li { counter-increment: s; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) minmax(0, 300px) auto; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 16px; background: var(--night-2); }
.inst__list li::before { content: counter(s, decimal-leading-zero); color: var(--lavender); font: 500 .95rem var(--display); }
.inst__list span { font: 500 1.05rem var(--display); }
.inst__list audio { width: 100%; height: 36px; }
@media (max-width: 760px) {
  .fans-hero { grid-template-columns: 1fr; } .fans-hero__patch { max-width: 220px; } .fans-hero__art { display: none; }
  .rules__cols { grid-template-columns: 1fr; }
  .inst__list li { grid-template-columns: 2rem 1fr auto; } .inst__list audio { grid-column: 1 / -1; }
}

/* Footer */
.foot { padding: 40px var(--gutter) 30px; display: grid; justify-items: center; gap: 12px; text-align: center; color: var(--ivory-dim); }
.foot__patch { width: 92px; height: auto; }
.foot__links { display: flex; gap: 22px; }
.foot__legal { font-size: .8rem; color: #8f84a8; max-width: 52ch; }

/* The turntable */
.deck {
  position: fixed; z-index: 30; left: 50%; bottom: 14px; transform: translateX(-50%);
  width: min(560px, calc(100% - 24px)); height: var(--deck-h);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 0 18px 0 12px; border-radius: 999px;
  background: rgba(38,26,63,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px rgba(0,0,0,.4), inset 0 0 0 1px rgba(246,238,223,.08);
}
.deck__platter { position: relative; width: 66px; height: 66px; margin-right: 14px; }
.deck__record {
  width: 100%; height: 100%; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 31%, rgba(255,255,255,.06) 31.5% 32%, transparent 32.5%),
    repeating-radial-gradient(circle, #19121f 0 1.5px, #231a2b 1.5px 3px),
    #19121f;
  display: grid; place-items: center;
  animation: spin 1.8s linear infinite; animation-play-state: paused;
  box-shadow: 0 0 0 2px rgba(185,140,240,.25);
}
.deck__label { width: 44%; height: 44%; border-radius: 50%; object-fit: cover; }
.deck__arm {
  position: absolute; right: -14px; top: -4px; width: 5px; height: 44px; border-radius: 3px;
  background: linear-gradient(var(--ivory-dim), #8f86a3);
  transform-origin: 50% 6px; transform: rotate(-28deg); transition: transform .6s cubic-bezier(.5,0,.2,1);
}
.deck__arm::before { content: ""; position: absolute; top: -2px; left: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--ivory-dim); }
.deck.is-playing .deck__record { animation-play-state: running; }
.deck.is-playing .deck__arm { transform: rotate(4deg); }
@keyframes spin { to { transform: rotate(360deg); } }

.deck__info { min-width: 0; display: grid; gap: 8px; }
.deck__now { font: 500 1rem/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck__bar { height: 4px; border-radius: 4px; background: rgba(246,238,223,.14); overflow: hidden; }
.deck__bar span { display: block; height: 100%; width: 0; background: var(--blossom); }
.deck__controls { display: flex; gap: 4px; align-items: center; }
.deck__btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--ivory); cursor: pointer; display: grid; place-items: center; }
.deck__btn svg { width: 20px; height: 20px; fill: currentColor; }
.deck__btn--main { width: 48px; height: 48px; background: var(--lavender); color: var(--night); }
.deck__btn--main .i-pause, .deck.is-playing .deck__btn--main .i-play { display: none; }
.deck.is-playing .deck__btn--main .i-pause { display: block; }
@media (max-width: 480px) { .deck__btn:not(.deck__btn--main) { display: none; } }

/* Dialogs */
dialog { border: 0; padding: 0; color: var(--ivory); background: var(--night-2); }
dialog::backdrop { background: rgba(15,9,26,.72); backdrop-filter: blur(4px); }
.sheet__close {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(246,238,223,.12); color: var(--ivory); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.sheet { width: min(980px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border-radius: 28px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* While a sheet or the bag is open, the page behind stays put */
body.is-locked { position: fixed; left: 0; right: 0; overflow: hidden; }
.sheet[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sheet__media { background: radial-gradient(90% 70% at 50% 35%, #3a2a5c, var(--night-2)); min-height: 320px; }
.sheet__media img { width: 100%; height: 100%; object-fit: cover; }
.sheet__body { padding: clamp(24px, 4vw, 44px); display: grid; gap: 16px; align-content: start; }
.sheet__body h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); padding-right: 44px; }
.sheet__price { color: var(--lamp); font-size: 1.2rem; }
.sheet__desc { color: var(--ivory-dim); }
.sheet__desc p + p { margin-top: .8em; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
legend { font: 600 1rem var(--display); margin-bottom: 8px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  box-shadow: inset 0 0 0 1.5px rgba(246,238,223,.25);
}
.choice input:checked + span { box-shadow: inset 0 0 0 2px var(--lavender); background: rgba(185,140,240,.14); }
.choice input:focus-visible + span { outline: 3px solid var(--lamp); outline-offset: 2px; }
.choice input:disabled + span { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.sheet__msg { min-height: 1.4em; color: var(--blossom); }
.sheet__media { overflow: hidden; }
/* Phones: the card stacks (full image, then details) and the whole card scrolls */
@media (max-width: 760px) {
  .sheet { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .sheet[open] { display: block; }
  .sheet__close {
    position: sticky; top: 12px; z-index: 3;
    display: block; margin: 12px 12px -52px auto;
    background: rgba(29,19,48,.75); backdrop-filter: blur(6px);
  }
  .sheet__media { min-height: 0; aspect-ratio: 1 / 1; }
  .sheet__media img { width: 100%; height: 100%; object-fit: cover; }
  .sheet__body { padding: 24px 22px 28px; }
}

.bag { margin: 0 0 0 auto; height: 100svh; max-height: 100svh; width: min(440px, 100%); border-radius: 28px 0 0 28px; }
.bag[open] { display: grid; grid-template-rows: auto 1fr auto; }
.bag__head { position: relative; padding: 26px 24px 10px; }
.bag__head h3 { font-size: 1.6rem; }
.bag__items { list-style: none; margin: 0; padding: 8px 24px; overflow: auto; overscroll-behavior: contain; display: grid; gap: 18px; align-content: start; }
.line { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: center; }
.line img { width: 76px; height: 92px; object-fit: cover; border-radius: 14px; background: var(--night); }
.line__name { font: 600 1rem/1.3 var(--display); }
.line__meta { color: var(--ivory-dim); font-size: .9rem; }
.qty { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; }
.qty button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(246,238,223,.12); color: var(--ivory); cursor: pointer; }
.line__price { color: var(--lamp); }
.bag__empty { padding: 10px 32px 40px; display: grid; justify-items: center; gap: 16px; text-align: center; color: var(--ivory-dim); align-content: start; }
.bag__empty img { width: 170px; height: auto; }
.bag__foot { padding: 20px 24px 28px; border-top: 1px solid rgba(246,238,223,.12); display: grid; gap: 10px; }
.bag__total { display: flex; justify-content: space-between; font: 600 1.15rem var(--display); }
.bag__note { color: var(--ivory-dim); font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .deck__record { animation: none; }
  .room__video { display: none; }
  .room { background: url(/assets/her-room.jpg) 50% 40% / cover; }
  * { transition-duration: .01ms !important; }
}
.sheet__body h3:focus { outline: none; }
