/* 星轨与白猫 · 归乡 — official site.
   Layout: a painted title scene, then cream "paper" sections edged with lace, one per topic; a starry-night
   palette for dark mode. Colours come from the game's own menus (berry, cream, lilac, gold, plum ink). */
:root {
  --bg: #fff6f0;
  --bg-2: #fbebe6;
  --paper: #fffdf9;
  --paper-2: #fff3f6;
  --ink: #4a2f41;
  --ink-soft: #7c6070;
  --berry: #c24f7a;
  --berry-2: #e07d9f;
  --berry-ink: #ffffff;
  --plum: #6a3450;
  --lilac: #a98bd6;
  --lilac-soft: #efe6fa;
  --gold: #c8972f;
  --gold-soft: #f4e2b2;
  --leaf: #5b9a5e;
  --line: rgba(194, 79, 122, 0.22);
  --line-gold: rgba(200, 151, 47, 0.45);
  --shadow: rgba(110, 48, 82, 0.16);
  --shadow-2: rgba(110, 48, 82, 0.28);
  --glass: rgba(255, 252, 248, 0.82);
  --hero-ink: #4a2f41;
  --hero-fade: rgba(255, 246, 240, 0);
  --dot: rgba(194, 79, 122, 0.10);

  --f-round: "Site Round", "Nunito", "PingFang SC", "Hiragino Maru Gothic ProN", "Microsoft YaHei", sans-serif;
  --f-body: "Site Body", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --f-elegant: "Site Elegant", "Songti SC", "Noto Serif SC", Georgia, serif;

  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --top: env(safe-area-inset-top, 0px);
  --bar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1932; --bg-2: #221e3d; --paper: #2a2549; --paper-2: #322b55;
    --ink: #f7ede8; --ink-soft: #cdbccc; --berry: #f08db1; --berry-2: #f6a9c4; --berry-ink: #2a1730;
    --plum: #3a1f3a; --lilac: #c4adf2; --lilac-soft: #393264; --gold: #f0c96a; --gold-soft: #4d4127;
    --leaf: #8fcf8f; --line: rgba(240, 141, 177, 0.26); --line-gold: rgba(240, 201, 106, 0.42);
    --shadow: rgba(0, 0, 0, 0.36); --shadow-2: rgba(0, 0, 0, 0.5); --glass: rgba(34, 30, 61, 0.84);
    --hero-ink: #fff6f0; --hero-fade: rgba(28, 25, 50, 0); --dot: rgba(240, 201, 106, 0.08);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1932; --bg-2: #221e3d; --paper: #2a2549; --paper-2: #322b55;
  --ink: #f7ede8; --ink-soft: #cdbccc; --berry: #f08db1; --berry-2: #f6a9c4; --berry-ink: #2a1730;
  --plum: #3a1f3a; --lilac: #c4adf2; --lilac-soft: #393264; --gold: #f0c96a; --gold-soft: #4d4127;
  --leaf: #8fcf8f; --line: rgba(240, 141, 177, 0.26); --line-gold: rgba(240, 201, 106, 0.42);
  --shadow: rgba(0, 0, 0, 0.36); --shadow-2: rgba(0, 0, 0, 0.5); --glass: rgba(34, 30, 61, 0.84);
  --hero-ink: #fff6f0; --hero-fade: rgba(28, 25, 50, 0); --dot: rgba(240, 201, 106, 0.08);
  color-scheme: dark;
}

/* faces per language (the game's own: round for titles, elegant for quotes; system faces for running text) */
:root:lang(zh-Hans) { --f-round: "Round ZH", "PingFang SC", "Microsoft YaHei", sans-serif; --f-elegant: "Elegant ZH", "Songti SC", "SimSun", serif; }
:root:lang(zh-Hant) { --f-round: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; --f-body: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif; --f-elegant: "Songti TC", "PMingLiU", serif; }
:root:lang(ja) { --f-round: "Round JA", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif; --f-body: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif; --f-elegant: "Elegant JA", "Hiragino Mincho ProN", "Yu Mincho", serif; }
:root:lang(ko) { --f-round: "Round KO", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; --f-body: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif; --f-elegant: "Elegant KO", "AppleMyungjo", "Batang", serif; }
:root:lang(en), :root:lang(es), :root:lang(fr), :root:lang(de), :root:lang(it), :root:lang(pt), :root:lang(pl), :root:lang(ru) {
  --f-round: "Round Latin", "Nunito", "Avenir Next Rounded", "Trebuchet MS", sans-serif;
  --f-body: "Round Latin", "Nunito", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-elegant: "Elegant Latin", "Lora", Georgia, serif;
}
:root:lang(ar) { --f-round: "Round AR", "Geeza Pro", "Segoe UI", sans-serif; --f-body: "Round AR", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", sans-serif; --f-elegant: "Elegant AR", "Al Nile", "Times New Roman", serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + var(--top) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.75;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.6px), radial-gradient(var(--dot) 1.2px, transparent 1.6px);
  background-size: 28px 28px; background-position: 0 0, 14px 14px;
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: var(--top); z-index: 60; background: var(--glass); }
:root:lang(ar) body { line-height: 1.9; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--berry); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lilac); outline-offset: 3px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.wrap-wide { width: 100%; max-width: 1360px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }

/* ——— top bar ——— */
.bar {
  position: sticky; top: var(--top); z-index: 50; height: var(--bar-h);
  background: var(--glass); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.bar::after { /* lace under the bar */
  content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 9px; pointer-events: none;
  background: radial-gradient(circle at 8px 0, var(--glass) 6.5px, transparent 7px) 0 0 / 16px 9px repeat-x;
  opacity: .95;
}
.bar .wrap-wide { height: 100%; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; flex-shrink: 1; }
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 0 2px var(--gold-soft), 0 3px 10px var(--shadow); }
.brand span { font-family: var(--f-round); font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--plum); }
:root[data-theme="dark"] .brand span { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand span { color: var(--ink); } }
.nav { display: flex; gap: 2px; margin-inline-start: auto; }
.nav a {
  font-family: var(--f-round); font-size: 16px; text-decoration: none; color: var(--ink); padding: 8px 12px; border-radius: 999px;
  white-space: nowrap; transition: background .2s, color .2s;
}
.nav a:hover, .nav a[aria-current="true"] { background: var(--lilac-soft); color: var(--berry); }
.tools { display: flex; align-items: center; gap: 8px; margin-inline-start: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 10px; border-radius: 999px; cursor: pointer;
  background: var(--paper); border: 1.5px solid var(--line-gold); box-shadow: 0 2px 8px var(--shadow); color: var(--ink);
  font-family: var(--f-round); font-size: 15px; white-space: nowrap;
}
.pill:hover { border-color: var(--gold); }
.pill svg, .icon-btn svg { width: 20px; height: 20px; flex: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--paper); border: 1.5px solid var(--line-gold); box-shadow: 0 2px 8px var(--shadow); color: var(--berry);
}
.icon-btn:hover { border-color: var(--gold); }
.menu-btn { display: none; }
.theme-btn .moon { display: block; } .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: none; } :root[data-theme="dark"] .theme-btn .sun { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .moon { display: none; } :root:not([data-theme="light"]) .theme-btn .sun { display: block; } }

@media (max-width: 980px) {
  .nav { display: none; }
  .menu-btn { display: grid; }
  .tools { margin-inline-start: auto; }
}
@media (max-width: 420px) {
  .brand span { display: none; }
  .pill .lang-now { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
}

/* ——— buttons ——— */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 28px;
  border-radius: 999px; font-family: var(--f-round); font-size: 18px; text-decoration: none; cursor: pointer; border: 0;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s;
}
.btn.primary {
  color: #fff; background: linear-gradient(180deg, #e98cab 0%, #c24f7a 58%, #a83e68 100%);
  box-shadow: 0 0 0 2px #f6dca0, 0 0 0 4px rgba(200, 151, 47, .55), 0 8px 20px rgba(150, 50, 90, .35), inset 0 2px 0 rgba(255, 255, 255, .45);
  text-shadow: 0 1px 0 rgba(110, 30, 70, .45);
}
.btn.primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn.primary::after { /* a little star on the button */
  content: ""; width: 14px; height: 14px; background: #fff7d6; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: twinkle 2.4s ease-in-out infinite;
}
.btn.soft {
  color: var(--ink); background: var(--glass); border: 1.5px dashed var(--line-gold); box-shadow: 0 4px 14px var(--shadow);
}
.btn[disabled], .btn[aria-disabled="true"] { cursor: default; }
.btn.primary[aria-disabled="true"] { filter: saturate(.55) brightness(1.08); opacity: .9; }
.btn.primary[aria-disabled="true"]:hover { transform: none; }
.btn.primary[aria-disabled="true"]::after { animation: none; opacity: .6; }
.btn .tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--lilac-soft); color: var(--berry); font-family: var(--f-body); }

/* ——— hero: the title screen, painted layers ——— */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; justify-items: center;
  background: #cfe0f6 url("img/hero-sky.webp") center 30% / cover no-repeat;
}
.hero::before { /* evening wash in the night palette */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(40, 30, 80, 0) 0%, rgba(40, 30, 80, 0) 100%);
}
:root[data-theme="dark"] .hero::before { background: linear-gradient(180deg, rgba(30, 22, 70, .66) 0%, rgba(60, 36, 90, .38) 55%, rgba(40, 30, 80, .1) 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero::before { background: linear-gradient(180deg, rgba(30, 22, 70, .66) 0%, rgba(60, 36, 90, .38) 55%, rgba(40, 30, 80, .1) 100%); } }
.hero-land { position: absolute; left: 0; right: 0; bottom: 0; top: 0; z-index: -1; pointer-events: none; }
.hero-far { position: absolute; left: 50%; bottom: calc(min(25vw, 360px) - 10px); width: max(100%, 1000px); transform: translateX(-50%); }
.hero-mid { position: absolute; left: 50%; bottom: 0; width: max(100%, 1000px); transform: translateX(-50%); }
.hero-group {
  position: relative; z-index: 1; grid-row: 2; align-self: end; justify-self: center;
  width: min(520px, 92vw); margin-top: 6px; margin-bottom: -2px; filter: drop-shadow(0 8px 14px rgba(70, 40, 60, .28));
}
.hero-inner {
  position: relative; z-index: 2; width: 100%; max-width: 760px; text-align: center; grid-row: 1;
  padding: calc(26px + 1vw) var(--gutter-r) 6px var(--gutter-l);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
@media (min-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); grid-template-rows: auto; align-items: center; min-height: clamp(640px, 86svh, 860px); padding-inline: max(24px, 3vw); }
  .hero-inner { grid-column: 1; grid-row: 1; align-self: center; padding-block: 34px 120px; }
  .hero-group { grid-column: 2; grid-row: 1; width: min(100%, 620px); margin: 0; }
}
.whisper {
  margin: 0; font-family: var(--f-elegant); font-size: clamp(15px, 1.5vw, 18px); letter-spacing: .02em;
  color: var(--hero-ink); padding: 4px 16px; border-radius: 999px; background: var(--glass);
  box-shadow: 0 2px 10px var(--shadow); text-wrap: balance;
}
.logo { margin: 0; display: flex; flex-direction: column; align-items: center; position: relative; }
.logo-arc { width: clamp(210px, 25vw, 360px); margin-bottom: calc(clamp(210px, 25vw, 360px) * -0.13); pointer-events: none; }
.logo-name {
  position: relative; display: inline-block; font-family: var(--f-round); font-weight: 800; line-height: 1.15;
  font-size: clamp(40px, 6.2vw, 86px); letter-spacing: .02em; padding: 0 .12em;
  color: #fff; background: linear-gradient(180deg, #ffffff 8%, #fdf1fb 42%, #e3cdf6 78%, #cdb4ee 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-wrap: balance;
}
.logo-name::before, .logo-name::after {
  content: attr(data-text); position: absolute; inset: 0; padding: inherit; z-index: -1;
  -webkit-text-fill-color: transparent; color: transparent; background: none; pointer-events: none;
}
.logo-name::before { -webkit-text-stroke: .2em #6a3450; filter: drop-shadow(0 .06em 0 #4c2238) drop-shadow(0 .12em .18em rgba(60, 20, 50, .45)); }
.logo-name::after { -webkit-text-stroke: .1em #e2b65c; }
:root:lang(en) .logo-name, :root:lang(es) .logo-name, :root:lang(fr) .logo-name, :root:lang(de) .logo-name, :root:lang(it) .logo-name,
:root:lang(pt) .logo-name, :root:lang(pl) .logo-name, :root:lang(ru) .logo-name { font-size: clamp(34px, 4.8vw, 70px); }
:root:lang(ar) .logo-name { line-height: 1.5; }
.logo-ribbon {
  position: relative; margin-top: 2px; width: clamp(190px, 21vw, 280px); aspect-ratio: 873 / 110;
  background: url("img/logo-ribbon.webp") center / contain no-repeat; display: grid; place-items: center;
}
.logo-ribbon span {
  font-family: var(--f-elegant); font-size: clamp(14px, 1.45vw, 19px); color: #fffaf0; letter-spacing: .28em; padding-inline-start: .28em;
  text-shadow: 0 1px 0 #8f4762, 0 0 6px rgba(143, 71, 98, .6); margin-top: -2px; white-space: nowrap;
}
:root:lang(ar) .logo-ribbon span { letter-spacing: 0; padding: 0; }
.lead {
  text-wrap: pretty;
  margin: 8px 0 0; max-width: 36em; font-size: clamp(15px, 1.35vw, 17px); line-height: 1.85; color: var(--hero-ink);
  background: var(--glass); padding: 14px 20px; border-radius: 18px; box-shadow: 0 6px 22px var(--shadow);
  border: 1px solid var(--line-gold);
}
.tags { margin: 2px 0 0; font-size: 13.5px; color: var(--hero-ink); letter-spacing: .06em; padding: 3px 14px; border-radius: 999px; background: var(--glass); }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 8px; }
.badge {
  margin: 4px 0 0; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #fff; padding: 4px 12px; border-radius: 999px;
  background: rgba(106, 52, 80, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ffd27a; box-shadow: 0 0 8px #ffd27a; }
.sparkles { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.sparkles i {
  position: absolute; width: 10px; height: 10px; background: #fff8dc; opacity: .9;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: twinkle 3.2s ease-in-out infinite;
}
.petals i {
  position: absolute; top: -20px; width: 12px; height: 9px; border-radius: 80% 0 80% 0; background: #f7c4d6; opacity: .85;
  clip-path: none; animation: fall linear infinite;
}
@keyframes twinkle { 0%, 100% { transform: scale(.6); opacity: .35; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes fall {
  0% { transform: translate3d(0, -20px, 0) rotate(0); }
  100% { transform: translate3d(-120px, 105vh, 0) rotate(560deg); }
}
@media (max-width: 700px) {
  .hero-inner { padding-top: 20px; }
  .whisper { font-size: 14px; border-radius: 18px; }
  .tags { font-size: 12.5px; letter-spacing: .02em; }
  .lead { font-size: 15px; padding: 12px 14px; }
  .btn { min-height: 48px; padding: 0 22px; font-size: 17px; }
}

/* ——— sections ——— */
section.band { position: relative; padding-block: clamp(56px, 8vw, 104px); }
section.band.alt { background: var(--bg-2); }
section.band.alt::before, section.band.alt::after { /* scalloped edges */
  content: ""; position: absolute; left: 0; right: 0; height: 14px; pointer-events: none;
  background: radial-gradient(circle at 12px 14px, var(--bg-2) 10px, transparent 10.5px) 0 0 / 24px 14px repeat-x;
}
section.band.alt::before { top: -13px; }
section.band.alt::after { bottom: -13px; transform: scaleY(-1); }
.head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: clamp(26px, 4vw, 44px); }
.kicker {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-round); font-size: 14px; letter-spacing: .18em;
  color: var(--berry); padding: 4px 16px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line);
}
:root:lang(ar) .kicker { letter-spacing: 0; }
.kicker::before, .kicker::after {
  content: ""; width: 9px; height: 9px; background: var(--gold);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
h2.title {
  margin: 0; font-family: var(--f-round); font-weight: 800; font-size: clamp(30px, 4.2vw, 48px); line-height: 1.2;
  color: var(--plum); text-wrap: balance; position: relative;
}
:root[data-theme="dark"] h2.title { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) h2.title { color: var(--ink); } }
h2.title::after { /* a gold flourish under titles */
  content: ""; display: block; width: 120px; height: 12px; margin: 10px auto 0;
  background:
    radial-gradient(circle, var(--gold) 3px, transparent 3.5px) center / 12px 12px no-repeat,
    linear-gradient(90deg, transparent, var(--gold) 30%, transparent 46%, transparent 54%, var(--gold) 70%, transparent) center / 100% 2px no-repeat;
}
.head .sub { margin: 0; max-width: 40em; color: var(--ink-soft); font-size: 16.5px; }
h3 { font-family: var(--f-round); color: var(--plum); font-weight: 800; }
:root[data-theme="dark"] h3 { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) h3 { color: var(--ink); } }

/* framed picture: paper mat, thin gold line */
.frame {
  position: relative; background: var(--paper); padding: 8px; border-radius: var(--r-md);
  box-shadow: 0 0 0 1px var(--line-gold), 0 10px 28px var(--shadow);
}
.frame img { border-radius: calc(var(--r-md) - 6px); width: 100%; height: auto; }
.zoom { cursor: zoom-in; }
.zoom:focus-visible { outline-offset: 5px; }

/* ——— story ——— */
.story-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.story-text p { margin: 0 0 1.1em; font-size: 17px; max-width: 34em; }
.story-text p:first-child::first-letter { font-family: var(--f-round); color: var(--berry); }
.book { position: relative; }
.book-stage { position: relative; aspect-ratio: 1672 / 941; border-radius: calc(var(--r-md) - 6px); overflow: hidden; background: var(--lilac-soft); }
.book-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.book-stage img.on { opacity: 1; }
.book-cap { min-height: 6.6em; margin: 14px 6px 4px; font-family: var(--f-elegant); font-size: 16.5px; line-height: 1.8; color: var(--ink); }
.book-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px 2px; }
.dots { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.dots button { width: 11px; height: 11px; border-radius: 50%; border: 0; padding: 0; background: var(--line); cursor: pointer; }
.dots button[aria-current="true"] { background: var(--berry); box-shadow: 0 0 0 3px var(--lilac-soft); }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line-gold); background: var(--paper); color: var(--berry);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 3px 10px var(--shadow); flex: none;
}
.round-btn:hover { border-color: var(--gold); }
.round-btn svg { width: 20px; height: 20px; }
:root[dir="rtl"] .round-btn svg { transform: scaleX(-1); }
.book-label { position: absolute; top: 18px; inset-inline-start: 18px; z-index: 2; font-family: var(--f-round); font-size: 13px; color: #fff; background: rgba(106, 52, 80, .6); padding: 3px 12px; border-radius: 999px; }

.places { margin-top: clamp(40px, 6vw, 64px); }
.places h3, .chapters h3 { text-align: center; font-size: 24px; margin: 0 0 6px; }
.places .sub, .chapters .sub { text-align: center; color: var(--ink-soft); margin: 0 auto 22px; max-width: 40em; }
.postcards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.postcard { background: var(--paper); padding: 7px 7px 10px; border-radius: 14px; box-shadow: 0 0 0 1px var(--line-gold), 0 6px 16px var(--shadow); transform: rotate(var(--tilt, 0deg)); transition: transform .25s; }
.postcard:hover { transform: rotate(0) translateY(-3px); }
.postcard img { border-radius: 9px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.postcard span { display: block; text-align: center; margin-top: 8px; font-family: var(--f-round); font-size: 14.5px; color: var(--ink); line-height: 1.35; }
@media (max-width: 980px) { .postcards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .postcards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

.chapters { margin-top: clamp(48px, 7vw, 76px); }
.ch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.ch {
  display: flex; flex-direction: column; background: var(--paper); border-radius: var(--r-md); overflow: hidden;
  box-shadow: 0 0 0 1px var(--line-gold), 0 8px 22px var(--shadow); min-width: 0;
}
.ch .pic { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.ch .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ch:hover .pic img { transform: scale(1.04); }
.ch .when { position: absolute; top: 10px; inset-inline-start: 10px; font-size: 12.5px; color: #fff; padding: 2px 10px; border-radius: 999px; background: rgba(106, 52, 80, .62); }
.ch .body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.ch h4 { margin: 0; font-family: var(--f-round); font-size: 17.5px; color: var(--berry); line-height: 1.4; }
.ch p { margin: 0; font-size: 15px; line-height: 1.75; color: var(--ink); }
.ch.more { background: linear-gradient(160deg, #3b2b63, #6a3a6d 70%, #8b4d76); color: #fff; justify-content: center; text-align: center; padding: 26px 18px; position: relative; }
.ch.more h4 { color: #ffd9e8; }
.ch.more p { color: #f8eaf2; }
.ch.more .when { position: static; align-self: center; margin-bottom: 4px; background: rgba(255, 255, 255, .16); }
.ch.more .door { width: 74px; height: 96px; margin: 0 auto 10px; border-radius: 37px 37px 8px 8px; border: 2px solid #f0c96a; box-shadow: 0 0 22px rgba(240, 201, 106, .55), inset 0 0 22px rgba(196, 173, 242, .55); background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, .85), rgba(196, 173, 242, .35) 45%, transparent 70%); }
@media (max-width: 980px) { .ch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .story-grid { grid-template-columns: minmax(0, 1fr); } .story-text p { font-size: 16px; } }
@media (max-width: 520px) { .ch-grid { grid-template-columns: minmax(0, 1fr); } }

/* ——— people ——— */
.duo { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; margin-bottom: clamp(40px, 6vw, 64px); }
.hero-card {
  position: relative; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 12px; align-items: end;
  background: var(--paper); border-radius: var(--r-lg); padding: 22px 22px 0; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line-gold), 0 12px 30px var(--shadow);
}
.hero-card::before { content: ""; position: absolute; inset: auto -10% -30% -10%; height: 70%; background: radial-gradient(ellipse at 30% 100%, var(--lilac-soft), transparent 70%); pointer-events: none; }
.hero-card .art { position: relative; align-self: end; display: flex; justify-content: center; }
.hero-card .art img { width: 100%; max-width: 250px; height: auto; transition: opacity .35s; }
.hero-card.cat .art img { max-width: 240px; margin-bottom: 18px; }
.hero-card .txt { position: relative; padding-bottom: 22px; align-self: center; min-width: 0; }
.hero-card .name { margin: 0; font-family: var(--f-round); font-size: 34px; color: var(--berry); line-height: 1.2; }
.hero-card .full { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); letter-spacing: .04em; }
.hero-card .role { display: inline-block; margin: 10px 0 8px; font-size: 13.5px; padding: 3px 12px; border-radius: 999px; background: var(--lilac-soft); color: var(--plum); }
:root[data-theme="dark"] .hero-card .role { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-card .role { color: var(--ink); } }
.hero-card p.text { margin: 0; font-size: 15.5px; line-height: 1.8; }
.looks { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.looks button { font-family: var(--f-round); font-size: 14px; padding: 6px 14px; min-height: 36px; border-radius: 999px; border: 1.5px solid var(--line-gold); background: var(--paper); cursor: pointer; color: var(--ink); }
.looks button[aria-pressed="true"] { background: var(--berry); color: var(--berry-ink); border-color: var(--berry); }
@media (max-width: 980px) { .duo { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .hero-card { grid-template-columns: minmax(0, 1fr); padding-top: 18px; } .hero-card .art img { max-width: 210px; } .hero-card .txt { order: -1; } }

.subhead { text-align: center; margin: 0 0 6px; font-size: 26px; }
.subnote { text-align: center; margin: 0 auto 24px; color: var(--ink-soft); max-width: 40em; }
.cast { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.who {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 14px; cursor: pointer;
  background: var(--paper); border: 0; border-radius: var(--r-md); text-align: center; min-width: 0;
  box-shadow: 0 0 0 1px var(--line-gold), 0 8px 20px var(--shadow); transition: transform .22s ease, box-shadow .22s ease;
}
.who:hover { transform: translateY(-4px); box-shadow: 0 0 0 1.5px var(--gold), 0 14px 26px var(--shadow-2); }
.who .stand { position: relative; width: 100%; aspect-ratio: 400 / 600; overflow: hidden; display: flex; justify-content: center; align-items: flex-start; }
.who .stand::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: 4%; height: 60%; border-radius: 50%; background: radial-gradient(ellipse at 50% 80%, var(--lilac-soft), transparent 70%); }
.who .stand img { position: relative; width: 92%; height: auto; margin-top: 2px; }
.who .nm { font-family: var(--f-round); font-size: 18px; color: var(--berry); line-height: 1.3; }
.who .rl { font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); min-height: 2.9em; }
@media (max-width: 1100px) { .cast { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 720px) { .cast { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; } .who .nm { font-size: 16px; } }
@media (max-width: 440px) { .cast { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.town { margin-top: clamp(40px, 6vw, 64px); }
.town-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.towner { display: flex; flex-direction: column; background: var(--paper); border-radius: var(--r-md); overflow: hidden; box-shadow: 0 0 0 1px var(--line-gold), 0 6px 16px var(--shadow); min-width: 0; }
.towner .bust { aspect-ratio: 1 / 1; overflow: hidden; background: radial-gradient(circle at 50% 65%, var(--lilac-soft), var(--paper-2) 70%); }
.towner .bust img { width: 100%; height: auto; transform: translateY(2%); }
.towner .t { padding: 10px 14px 16px; }
.towner .nm { margin: 0; font-family: var(--f-round); font-size: 17px; color: var(--berry); }
.towner .rl { margin: 0 0 4px; font-size: 12.5px; color: var(--ink-soft); }
.towner p.tx { margin: 0; font-size: 14px; line-height: 1.7; }
@media (max-width: 1100px) { .town-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .town-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .towner p.tx { font-size: 13.5px; } }

/* ——— gameplay ——— */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: -6px 0 34px; }
.chip { font-family: var(--f-round); font-size: 15px; text-decoration: none; color: var(--ink); padding: 8px 16px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--line-gold); box-shadow: 0 3px 10px var(--shadow); }
.chip:hover { color: var(--berry); border-color: var(--gold); }
.group { margin-bottom: clamp(44px, 6vw, 70px); }
.group > h3 { display: flex; align-items: center; gap: 12px; font-size: 25px; margin: 0 0 18px; }
.group > h3::before { content: ""; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--berry) var(--ico) center / 20px no-repeat; box-shadow: 0 0 0 3px var(--gold-soft); }
.group > h3::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--line-gold), transparent); }
:root[dir="rtl"] .group > h3::after { background: linear-gradient(270deg, var(--line-gold), transparent); }
.feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.feat { display: flex; flex-direction: column; background: var(--paper); border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 0 0 1px var(--line-gold), 0 10px 26px var(--shadow); min-width: 0; }
.feat .shot { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--lilac-soft); }
.feat .shot img { width: 100%; height: 100%; object-fit: cover; }
.feat .shot.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: var(--paper); }
.feat .shot.pair figure { margin: 0; position: relative; overflow: hidden; }
.feat .shot.pair figcaption { position: absolute; left: 8px; bottom: 8px; font-family: var(--f-round); font-size: 13px; color: #fff; background: rgba(106, 52, 80, .65); padding: 2px 10px; border-radius: 999px; }
.feat .body { padding: 18px 22px 22px; }
.feat h4 { margin: 0 0 6px; font-family: var(--f-round); font-size: 21px; color: var(--berry); line-height: 1.35; }
.feat p { margin: 0; font-size: 15.5px; line-height: 1.85; }
.feat .strip { display: flex; gap: 6px; margin-top: 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.feat .strip img { width: 58px; height: auto; flex: none; border-radius: 10px; background: var(--paper-2); box-shadow: 0 0 0 1px var(--line); }
.abilities { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.abilities span { font-family: var(--f-round); font-size: 14px; padding: 5px 12px; border-radius: 999px; background: var(--lilac-soft); color: var(--plum); }
:root[data-theme="dark"] .abilities span { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .abilities span { color: var(--ink); } }
.views { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.views div { padding: 10px 12px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line); }
.views b { display: block; font-family: var(--f-round); color: var(--berry); font-weight: 400; font-size: 16px; }
.views span { font-size: 13.5px; line-height: 1.6; }
.feat.wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.feat.wide .shot { aspect-ratio: auto; min-height: 100%; }
.feat.wide .shot.pair { min-height: 0; }
@media (max-width: 860px) { .feats { grid-template-columns: minmax(0, 1fr); } .feat.wide { grid-template-columns: minmax(0, 1fr); } .feat.wide .shot { aspect-ratio: 16 / 9; } }
@media (max-width: 520px) { .feat .body { padding: 16px 16px 18px; } .feat h4 { font-size: 19px; } .feat p { font-size: 15px; } .views { grid-template-columns: 1fr; } }

/* ——— the year ——— */
.year { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 36px); align-items: start; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  flex: 1 1 0; min-width: 70px; min-height: 46px; border-radius: 999px; cursor: pointer; font-family: var(--f-round); font-size: 17px;
  border: 1.5px solid var(--line-gold); background: var(--paper); color: var(--ink); box-shadow: 0 3px 10px var(--shadow);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.tab::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--season, var(--berry)); }
.tab[aria-selected="true"] { background: var(--season, var(--berry)); color: #fff; border-color: transparent; }
.tab[aria-selected="true"]::before { background: #fff; }
.tab[data-s="0"] { --season: #e886a6; } .tab[data-s="1"] { --season: #4fa7b8; } .tab[data-s="2"] { --season: #d0813c; } .tab[data-s="3"] { --season: #7c8fd4; }
.season-pics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.season-pics img { border-radius: 12px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; box-shadow: 0 0 0 1px var(--line-gold); }
.fests { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fests li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; background: var(--paper); border-radius: 16px; padding: 12px 16px; box-shadow: 0 0 0 1px var(--line), 0 4px 12px var(--shadow); }
.dayb { display: grid; place-items: center; width: 62px; min-height: 58px; border-radius: 14px; background: var(--season-c, var(--berry)); color: #fff; text-align: center; line-height: 1.2; padding: 6px 4px; font-family: var(--f-round); font-size: 13px; }
.dayb b { display: block; font-size: 22px; font-weight: 400; }
.fests h4 { margin: 0; font-family: var(--f-round); font-size: 18px; color: var(--berry); line-height: 1.35; }
.fests p { margin: 2px 0 0; font-size: 14.5px; line-height: 1.7; }
.year-side .frame { margin-bottom: 18px; }
.note-card { background: var(--paper); border-radius: var(--r-md); padding: 16px 20px; box-shadow: 0 0 0 1px var(--line-gold), 0 6px 18px var(--shadow); margin-bottom: 16px; }
.note-card h4 { margin: 0 0 4px; font-family: var(--f-round); font-size: 18px; color: var(--berry); }
.note-card p { margin: 0; font-size: 15px; line-height: 1.8; }
@media (max-width: 900px) { .year { grid-template-columns: minmax(0, 1fr); } }

/* ——— music ——— */
.music { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(22px, 3.5vw, 44px); align-items: center; }

/* the stage: the song's own paintings drift behind, the sung line glows in front, as in the game */
.stage {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; isolation: isolate; cursor: pointer;
  background: #2b2140;
  box-shadow: 0 0 0 1px var(--line-gold), 0 0 0 6px var(--paper), 0 0 0 7px var(--line-gold), 0 18px 44px var(--shadow-2);
}
.stage-pics img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.8s ease; transform: scale(1.05); }
.stage-pics img.on { opacity: 1; animation: drift 16s ease-in-out both; }
@keyframes drift { from { transform: scale(1.04) translate3d(0, 0, 0); } to { transform: scale(1.13) translate3d(-1.6%, -1.2%, 0); } }
.stage-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(34, 18, 46, 0) 30%, rgba(34, 18, 46, .5) 62%, rgba(30, 14, 40, .86) 100%); }
.stage-play {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: 78px; height: 78px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 35% 30%, #f7a8c4, #c24f7a 60%, #9e3863);
  box-shadow: 0 0 0 4px rgba(255, 246, 220, .85), 0 0 0 7px rgba(200, 151, 47, .55), 0 10px 30px rgba(60, 10, 40, .5);
  transition: opacity .3s, transform .3s;
}
.stage-play svg { width: 32px; height: 32px; margin-inline-start: 4px; }
.stage-play:hover { transform: translate(-50%, -50%) scale(1.06); }
.stage.playing .stage-play { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(.8); }
.karaoke { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 5% 4%; text-align: center; pointer-events: none; }
.karaoke { --k-font: var(--f-round); }
.karaoke:lang(zh) { --k-font: "Round ZH", "PingFang SC", "Microsoft YaHei", sans-serif; }
.karaoke:lang(zh-Hant) { --k-font: "PingFang TC", "Microsoft JhengHei", sans-serif; }
.karaoke:lang(ja) { --k-font: "Round JA", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif; }
.karaoke:lang(ko) { --k-font: "Round KO", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
.karaoke:lang(en), .karaoke:lang(es), .karaoke:lang(fr), .karaoke:lang(de), .karaoke:lang(it), .karaoke:lang(pt), .karaoke:lang(ru), .karaoke:lang(pl) { --k-font: "Round Latin", "Nunito", "Avenir Next Rounded", sans-serif; }
.karaoke:lang(ar) { --k-font: "Round AR", "Geeza Pro", sans-serif; }
.stage { container-type: inline-size; }
.k-line { margin: 0; min-height: 1.5em; font-family: var(--k-font); font-weight: 800; font-size: clamp(17px, 2.35vw, 31px); font-size: clamp(16px, 4.6cqw, 38px); line-height: 1.55; letter-spacing: .02em; }
.k-line .w { display: inline-block; white-space: nowrap; }
.k-line .c {
  display: inline-block; white-space: pre; color: var(--c); opacity: .9;
  text-shadow: 0 0 1px rgba(255, 255, 255, .9), 0 1.5px 0 rgba(70, 24, 66, .75), 0 0 8px rgba(40, 10, 40, .45);
  transition: transform .16s cubic-bezier(.3, 1.7, .5, 1), text-shadow .25s ease, opacity .25s ease;
}
.k-line .c.lit {
  opacity: 1;
  text-shadow: -1.5px -1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px 1.5px 0 #fff, 0 -1.5px 0 #fff, 0 1.5px 0 #fff, 0 0 14px var(--c), 0 0 4px var(--c);
}
.k-line .c.now { position: relative; z-index: 2; transform: translateY(-.3em) scale(1.62); }
.k-line .c.now::after { /* a little star on the letter being sung */
  content: ""; position: absolute; left: 50%; top: -.42em; width: .42em; height: .42em; margin-left: -.21em; background: #fff6c8;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle .9s ease-in-out infinite;
}
.k-next { margin: 4px 0 0; min-height: 1.4em; font-family: var(--k-font); font-size: clamp(12px, 1.35vw, 17px); font-size: clamp(12px, 2.4cqw, 20px); color: rgba(255, 250, 245, .78); text-shadow: 0 1px 3px rgba(40, 10, 40, .7); }
.k-sub { margin: 3px 0 0; min-height: 1.3em; font-size: clamp(11.5px, 1.2vw, 14px); font-size: clamp(11.5px, 2.1cqw, 16px); color: rgba(255, 244, 236, .92); text-shadow: 0 1px 3px rgba(40, 10, 40, .8); }
.k-sub:empty, .k-next:empty { visibility: hidden; }
.sparks { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.sparks i {
  position: absolute; width: 10px; height: 10px; background: var(--c, #fff6c8);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: spark .9s ease-out forwards;
}
@keyframes spark {
  0% { transform: translate(0, 0) scale(.4) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(160deg); opacity: 0; }
}
@media (max-width: 520px) { .stage-play { width: 62px; height: 62px; } .k-line { font-size: clamp(16px, 5.3cqw, 20px); } }
@media (prefers-reduced-motion: reduce) { .k-line .c.now { transform: scale(1.25); } .sparks { display: none; } }
.player { display: flex; flex-direction: column; gap: 14px; }
.player h3 { margin: 0; font-size: 30px; }
.player .song { font-family: var(--f-round); color: var(--berry); font-size: 22px; margin: 0; }
.play-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.play-btn { width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, #e98cab, #b44470); box-shadow: 0 0 0 3px var(--gold-soft), 0 8px 18px rgba(150, 50, 90, .35); flex: none; }
.play-btn svg { width: 26px; height: 26px; }
.play-btn .pause { display: none; } .play-btn[aria-pressed="true"] .pause { display: block; } .play-btn[aria-pressed="true"] .play { display: none; }
.track { flex: 1; min-width: 160px; }
.track .bar-line { height: 8px; border-radius: 99px; background: var(--lilac-soft); overflow: hidden; cursor: pointer; }
.track .bar-line i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--lilac), var(--berry)); border-radius: 99px; }
.track .time { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; font-variant-numeric: tabular-nums; direction: ltr; }
.versions { display: flex; flex-wrap: wrap; gap: 6px; }
.versions button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-gold); background: var(--paper); cursor: pointer; font-size: 13px; color: var(--ink); }
.versions button[aria-pressed="true"] { background: var(--plum); color: #fff; border-color: var(--plum); }
:root[data-theme="dark"] .versions button[aria-pressed="true"] { background: var(--berry); color: var(--berry-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .versions button[aria-pressed="true"] { background: var(--berry); color: var(--berry-ink); } }
.small { font-size: 13.5px; color: var(--ink-soft); margin: 0; }
@media (max-width: 860px) { .music { grid-template-columns: minmax(0, 1fr); } }

/* ——— the little game: 哈火火签收 (drawn by assets/game.js) ——— */
.mg {
  position: relative; max-width: 1000px; margin: 0 auto; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, #a9c3ee, #f3dcec 60%, #ffe6d2);
  box-shadow: 0 0 0 1px var(--line-gold), 0 0 0 6px var(--paper), 0 0 0 7px var(--line-gold), 0 18px 44px var(--shadow-2);
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.mg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: default; outline: none; }
.mg.playing canvas { cursor: pointer; }
.mg canvas:focus-visible { outline: 3px solid #e8578f; outline-offset: -3px; }
.mg-card { /* the cards are paper in the daylight scene, whatever the page's theme */
  --ink: #4a2f41; --ink-soft: #7c6070; --berry: #c24f7a; --paper: #fffdf9; --paper-2: #fff3f6; --line-gold: rgba(200, 151, 47, .45);
  position: absolute; z-index: 2; left: 3.5%; top: 50%; width: min(360px, 40%); max-height: calc(100% - 28px); overflow: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--ink);
  padding: 18px 20px 20px; border-radius: 24px; background: rgba(255, 252, 248, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px var(--line-gold), 0 0 0 5px rgba(255, 253, 249, .92), 0 0 0 6px var(--line-gold), 0 16px 36px rgba(110, 48, 82, .28);
  transform: translateY(-50%); animation: mg-in .5s cubic-bezier(.3, 1.4, .5, 1) both;
}
.mg-card[hidden] { display: none; }
@keyframes mg-in { from { opacity: 0; transform: translateY(-44%) scale(.94); } to { opacity: 1; transform: translateY(-50%) scale(1); } }
.mg .mg-card h3 { margin: 0; font-size: 25px; color: var(--berry); line-height: 1.3; }
.mg-card p { margin: 0; font-size: 14.5px; line-height: 1.7; }
.mg-card .btn { min-height: 48px; font-size: 17px; padding: 0 24px; flex: none; }
.mg-env { width: 54px; height: auto; flex: none; margin-bottom: -2px; filter: drop-shadow(0 3px 5px rgba(110, 48, 82, .2)); animation: mg-bob 2.4s ease-in-out infinite; }
@keyframes mg-bob { 50% { transform: translateY(-4px) rotate(-4deg); } }
.mg-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; }
.mg-legend span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px 4px 6px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px rgba(200, 151, 47, .3); }
.mg-legend .no { background: #fff4f6; box-shadow: inset 0 0 0 1.5px rgba(228, 91, 107, .28); }
.mg-legend svg { height: 18px; width: auto; flex: none; }
.mg-legend svg.mk { height: 16px; margin-inline-end: 2px; }
.mg-legend b { font-family: var(--f-round); font-weight: 400; font-size: 13.5px; margin-inline-start: 3px; white-space: nowrap; }
.mg-legend .ok b { color: #3f7f47; }
.mg-legend .no b { color: #c24f7a; }
.receipt { width: min(380px, 42%); gap: 8px; background: #fffaf2; }
.receipt::before { content: ""; position: absolute; inset: 7px; border: 1.5px dashed rgba(200, 151, 47, .45); border-radius: 18px; pointer-events: none; }
.receipt::after { /* his paw stamp */
  content: ""; position: absolute; top: 12px; inset-inline-end: 14px; width: 50px; height: 50px; opacity: .85; pointer-events: none; transform: rotate(-14deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23e8578f'%3E%3Cellipse cx='32' cy='39' rx='13' ry='10.5'/%3E%3Cellipse cx='17.5' cy='25' rx='5' ry='6.5'/%3E%3Cellipse cx='27' cy='17.5' rx='5' ry='6.5'/%3E%3Cellipse cx='37' cy='17.5' rx='5' ry='6.5'/%3E%3Cellipse cx='46.5' cy='25' rx='5' ry='6.5'/%3E%3C/g%3E%3Ccircle cx='32' cy='32' r='29' fill='none' stroke='%23e8578f' stroke-width='3' stroke-dasharray='5 4'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: mg-stamp .5s .3s cubic-bezier(.3, 1.6, .5, 1) both;
}
@keyframes mg-stamp { from { opacity: 0; transform: rotate(-14deg) scale(2.2); } to { opacity: .85; transform: rotate(-14deg) scale(1); } }
.receipt h3 { padding-inline: 46px; }
.mg-new { display: none; flex: none; padding: 3px 14px; border-radius: 999px; background: linear-gradient(180deg, #ffe58f, #f4b93f); color: #6e3a10; font-family: var(--f-round); font-size: 14px; box-shadow: 0 3px 8px rgba(150, 90, 20, .28); white-space: nowrap; transform: rotate(-3deg); }
.receipt.record .mg-new { display: inline-block; animation: mg-new .6s .55s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes mg-new { from { opacity: 0; transform: rotate(-3deg) scale(.4); } to { opacity: 1; transform: rotate(-3deg) scale(1); } }
.receipt .tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin: 0; }
.receipt .tiles div { display: flex; flex-direction: column-reverse; align-items: center; justify-content: flex-end; gap: 2px; padding: 8px 4px 7px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px rgba(200, 151, 47, .3); }
.receipt .tiles dd { margin: 0; font-family: var(--f-round); font-size: 25px; line-height: 1.15; color: var(--berry); font-variant-numeric: tabular-nums; }
.receipt .tiles dt { font-size: 12.5px; line-height: 1.3; color: var(--ink-soft); }
.receipt .odd { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 8px; font-size: 13.5px; color: var(--ink-soft); }
.receipt .odd b { font-weight: 400; font-family: var(--f-round); font-size: 14.5px; color: var(--ink); }
.receipt .total { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 24px; width: 100%; margin: 0; padding: 6px 0 8px; border-block: 1.5px dashed rgba(200, 151, 47, .4); }
.receipt .total div { display: flex; align-items: baseline; gap: 8px; }
.receipt .total dt { font-size: 14px; color: var(--ink-soft); }
.receipt .total dd { margin: 0; font-family: var(--f-round); font-size: 20px; color: var(--berry); font-variant-numeric: tabular-nums; }
.receipt .total .sum dt { font-family: var(--f-round); font-size: 16px; color: var(--ink); }
.receipt .total .sum dd { font-size: 36px; line-height: 1; }
.receipt .say { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; }
.receipt .face { width: 50px; height: 50px; flex: none; border-radius: 50%; background: #ffe9c9 url(img/c-kiki.webp) 49% 25% / 236% auto no-repeat; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(200, 151, 47, .55); }
.receipt .bubble { position: relative; flex: 1; padding: 8px 12px; border-radius: 14px; background: #fff; box-shadow: 0 2px 8px rgba(110, 48, 82, .12); font-family: var(--f-round); font-size: 15px; line-height: 1.5; }
.receipt .bubble::before { content: ""; position: absolute; inset-inline-start: -7px; top: 50%; margin-top: -7px; border: 7px solid transparent; border-inline-start-width: 0; border-inline-end-color: #fff; }
.mg-bar { max-width: 1000px; margin: 16px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 4px; }
.mg-best { display: inline-flex; align-items: baseline; gap: 8px; font-size: 14.5px; color: var(--ink-soft); }
.mg-best b { font-family: var(--f-round); font-size: 21px; font-weight: 400; color: var(--berry); font-variant-numeric: tabular-nums; }
.mg-sound .off { display: none; }
.mg-sound[aria-pressed="false"] .on { display: none; }
.mg-sound[aria-pressed="false"] .off { display: block; }
.mg-sound[aria-pressed="false"] { color: var(--ink-soft); border-style: dashed; }
@media (max-width: 900px) {
  .mg { aspect-ratio: 4 / 3; }
  .mg-card { width: min(400px, 54%); }
}
@media (max-width: 600px) {
  .mg { aspect-ratio: 3 / 4; }
  .mg-card { left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; max-height: calc(100% - 20px); padding: 16px 16px 18px; transform: none; animation-name: mg-up; }
  @keyframes mg-up { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
  .mg .mg-card h3 { font-size: 22px; }
  .mg-card p { font-size: 14px; line-height: 1.65; }
  .mg-env { display: none; }
  .receipt { gap: 7px; }
  .receipt .tiles dd { font-size: 22px; }
  .receipt .total .sum dd { font-size: 30px; }
}

@media (max-height: 520px) and (orientation: landscape) { /* a phone held sideways: the whole game fits on the screen */
  .mg { aspect-ratio: 16 / 9; max-width: min(1000px, calc((100svh - 96px) * 16 / 9)); }
  .mg-card { left: 2.5%; top: 50%; right: auto; bottom: auto; width: min(340px, 48%); max-height: calc(100% - 16px); padding: 12px 14px 14px; gap: 7px; transform: translateY(-50%); animation-name: mg-in; }
  .mg-card p { font-size: 13px; line-height: 1.55; }
  .mg .mg-card h3 { font-size: 19px; }
  .mg-env { display: none; }
  .mg-card .btn { min-height: 42px; font-size: 15.5px; }
  .mg-bar { max-width: min(1000px, calc((100svh - 96px) * 16 / 9)); margin-top: 10px; }
  .receipt { left: 50%; width: min(460px, 92%); gap: 5px; transform: translate(-50%, -50%); animation: none; }
  .receipt::after { width: 36px; height: 36px; top: 8px; }
  .receipt h3 { font-size: 18px; }
  .receipt .tiles div { padding: 4px 4px 3px; }
  .receipt .tiles dd { font-size: 19px; }
  .receipt .tiles dt { font-size: 11.5px; }
  .receipt .total { padding: 3px 0 4px; }
  .receipt .total .sum dd { font-size: 24px; }
  .receipt .face { width: 34px; height: 34px; }
  .receipt .bubble { font-size: 13px; padding: 5px 10px; }
  .receipt { flex-flow: row wrap; align-content: flex-start; justify-content: center; }
  .receipt > h3, .receipt > .tiles, .receipt > .odd, .receipt > .total { flex: 1 1 100%; }
  .receipt .mg-new { position: absolute; top: 10px; left: 14px; font-size: 12.5px; }
  .receipt .say { flex: 1 1 0; min-width: 0; }
  .receipt .btn { min-height: 38px; padding: 0 16px; font-size: 14.5px; }
}

/* ——— the game corner: four tabs over the one box ——— */
.mg-tabs { max-width: 1000px; margin: 0 auto 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.mg-tabs button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px 0 12px; border-radius: 999px; cursor: pointer;
  background: var(--paper); border: 1.5px solid var(--line-gold); box-shadow: 0 3px 10px var(--shadow); color: var(--ink); font-family: var(--f-round); font-size: 16px;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}
.mg-tabs button svg { width: 24px; height: 24px; flex: none; color: var(--berry); }
.mg-tabs button:hover { transform: translateY(-2px); border-color: var(--gold); }
.mg-tabs button[aria-selected="true"] { color: #fff; border-color: transparent; background: linear-gradient(180deg, #e98cab, #c24f7a 60%, #a83e68); box-shadow: 0 0 0 2px #f6dca0, 0 6px 16px rgba(150, 50, 90, .3); text-shadow: 0 1px 0 rgba(110, 30, 70, .4); }
.mg-tabs button[aria-selected="true"] svg { color: #fff; }
@media (max-width: 600px) {
  .mg-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mg-tabs button { min-height: 44px; padding: 0 10px; font-size: 15px; gap: 6px; }
  .mg-tabs button svg { width: 21px; height: 21px; }
}
.mg-toggles { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.mg-music .off { display: none; }
.mg-music[aria-pressed="false"] .on { display: none; }
.mg-music[aria-pressed="false"] .off { display: block; }
.mg-music[aria-pressed="false"] { color: var(--ink-soft); border-style: dashed; }
.mg[data-game="night"] canvas, .mg[data-game="night"].playing canvas { cursor: default; }
.mg-legend.pair .arrows { font-style: normal; color: #c24f7a; font-size: 15px; margin: 0 2px; }
.mg-legend img { height: 18px; width: auto; flex: none; }
/* the speakers on the receipts: Kiki (letters), Lili (kite), the kitten (the night), Uncle Du (fishing) */
.receipt .face.lili { background: #ffe9c9 url(img/lili-linen.webp) 49% 8.5% / 304% auto no-repeat; }
@media (min-width: 601px) and (min-height: 521px) { .mg[data-game="kite"] .mg-card { left: auto; right: 3.5%; } }   /* the kite flies on the left */
.receipt .face.cat { background: #f1eaff url(img/hahuohuo.webp) 108% 9% / 205% auto no-repeat; }
.receipt .face.du { background: #ffe9c9 url(img/t-du.webp) 50% 2% / 160% auto no-repeat; }

/* ——— 「天亮前送回去」: the cards on the night board ——— */
.mg-board { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 12px; }
.mg-board[hidden] { display: none; }
.nb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nb-left { padding: 4px 14px; border-radius: 999px; background: rgba(255, 253, 249, .92); color: #4a2f41; font-family: var(--f-round); font-size: 15px; box-shadow: 0 0 0 1.5px rgba(200, 151, 47, .5); white-space: nowrap; }
.nb-clock { flex: 1; max-width: 240px; height: 12px; border-radius: 6px; background: rgba(255, 253, 249, .85); overflow: hidden; box-shadow: 0 0 0 1.5px rgba(200, 151, 47, .4); }
.nb-clock i { display: block; height: 100%; width: 100%; border-radius: 6px; background: linear-gradient(90deg, #ffb48a, #a98bd6); }
.nb-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 10px; }
.nb-card { position: relative; min-height: 0; padding: 0; border: 0; background: none; cursor: pointer; perspective: 700px; container-type: size; -webkit-tap-highlight-color: transparent; }
.nb-card:focus-visible { outline: 3px solid #ffd36a; outline-offset: 3px; border-radius: 14px; }
.nb-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3, 1.3, .5, 1); }
.nb-card.up .nb-in { transform: rotateY(180deg); }
.nb-back, .nb-front { position: absolute; inset: 0; border-radius: 14px; -webkit-backface-visibility: hidden; backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.nb-back { /* a little door with a lit window */
  background: linear-gradient(180deg, #93603f, #6e4630);
  box-shadow: inset 0 0 0 3px #b98157, inset 0 0 0 5px #6e4630, 0 4px 12px rgba(20, 10, 40, .4);
}
.nb-back::before { content: ""; width: min(44cqw, 34cqh); aspect-ratio: 1; margin-bottom: 14cqh; border-radius: 50% 50% 8px 8px; background: radial-gradient(circle at 50% 62%, #fff0b8, #f4b54a 58%, #c27a2a); box-shadow: 0 0 18px rgba(255, 200, 100, .7); }
.nb-back .lamp { position: absolute; bottom: 10cqh; width: min(30cqw, 20cqh); aspect-ratio: 1; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23e8578f'%3E%3Cellipse cx='32' cy='39' rx='13' ry='10.5'/%3E%3Cellipse cx='17.5' cy='25' rx='5' ry='6.5'/%3E%3Cellipse cx='27' cy='17.5' rx='5' ry='6.5'/%3E%3Cellipse cx='37' cy='17.5' rx='5' ry='6.5'/%3E%3Cellipse cx='46.5' cy='25' rx='5' ry='6.5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; opacity: .55; filter: hue-rotate(-10deg) brightness(1.3); }
.nb-card:hover .nb-back { box-shadow: inset 0 0 0 3px #e3b07c, inset 0 0 0 5px #6e4630, 0 6px 16px rgba(20, 10, 40, .45); }
.nb-front { transform: rotateY(180deg); gap: 4cqh; padding: 6px; background: #fffaf2; box-shadow: inset 0 0 0 2px rgba(200, 151, 47, .55), 0 4px 12px rgba(20, 10, 40, .35); }
.nb-icon { width: min(70cqw, 52cqh); aspect-ratio: 1; display: grid; place-items: center; }
.nb-icon svg { width: 100%; height: 100%; }
.nb-face { width: min(74cqw, 52cqh); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #ffe9c9; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(200, 151, 47, .55); }
.nb-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 6%; }
.nb-face.tall img { object-position: 50% 0; transform: scale(2.1); transform-origin: 50% 56%; }
.nb-name { max-width: 100%; padding: 0 2px; font-family: var(--f-round); font-size: clamp(11px, 11cqw, 15px); line-height: 1.25; color: #4a2f41; text-align: center; overflow-wrap: anywhere; }
.nb-paw { position: absolute; top: 6px; inset-inline-end: 6px; width: min(26cqw, 24px); aspect-ratio: 1; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23e8578f'%3E%3Cellipse cx='32' cy='39' rx='13' ry='10.5'/%3E%3Cellipse cx='17.5' cy='25' rx='5' ry='6.5'/%3E%3Cellipse cx='27' cy='17.5' rx='5' ry='6.5'/%3E%3Cellipse cx='37' cy='17.5' rx='5' ry='6.5'/%3E%3Cellipse cx='46.5' cy='25' rx='5' ry='6.5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; opacity: 0; transform: rotate(-12deg) scale(2); transition: opacity .3s ease .25s, transform .35s cubic-bezier(.3, 1.6, .5, 1) .25s; }
.nb-card.done .nb-paw { opacity: .9; transform: rotate(-12deg) scale(1); }
.nb-card.done .nb-front { box-shadow: inset 0 0 0 2.5px #e8578f, 0 0 18px rgba(255, 210, 130, .85); }
.nb-card.done { cursor: default; }
.nb-cap { margin: 0; min-height: 2.9em; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; padding: 6px 14px; border-radius: 14px; background: rgba(255, 253, 249, .93); color: #4a2f41; font-family: var(--f-round); font-size: 15px; line-height: 1.45; text-align: center; box-shadow: 0 0 0 1.5px rgba(200, 151, 47, .45); }
.nb-cap:empty { visibility: hidden; }
.nb-cap b { font-weight: 400; color: #c24f7a; }
.nb-cap.show { animation: nb-cap .35s ease both; }
@keyframes nb-cap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.mg-board.dealt .nb-card { animation: nb-deal .5s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: var(--d); }
@keyframes nb-deal { from { opacity: 0; transform: translateY(-16px) scale(.9) rotate(-3deg); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .nb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; } }
@media (max-width: 600px) { .mg-board { padding: 10px; gap: 8px; } .nb-cap { font-size: 13.5px; padding: 5px 10px; } .nb-left { font-size: 13.5px; } }
@media (max-height: 520px) and (orientation: landscape) { .nb-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; } .nb-cap { min-height: 2.2em; font-size: 13px; } .mg-board { padding: 8px 10px; gap: 6px; } }

/* ——— languages ——— */
.langs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lang-card {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: start; padding: 14px 16px; min-height: 84px; cursor: pointer;
  border-radius: 16px; border: 1.5px solid var(--line-gold); background: var(--paper); color: var(--ink); box-shadow: 0 4px 12px var(--shadow);
}
.lang-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.lang-card[aria-pressed="true"] { border-color: var(--berry); box-shadow: 0 0 0 2px var(--berry), 0 6px 16px var(--shadow); }
.lang-card .ln { font-family: var(--f-round); font-size: 18px; color: var(--berry); }
.lang-card .gt { font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.lang-card[dir="rtl"] { text-align: right; align-items: flex-end; }
.lang-shots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.lang-shots img { border-radius: 12px; box-shadow: 0 0 0 1px var(--line-gold), 0 6px 14px var(--shadow); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
@media (max-width: 900px) { .langs { grid-template-columns: repeat(3, minmax(0, 1fr)); } .lang-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .langs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ——— wishlist ——— */
.wish { position: relative; max-width: 820px; margin: 0 auto; text-align: center; background: var(--paper); border-radius: 32px; padding: clamp(28px, 5vw, 48px) clamp(18px, 4vw, 44px); box-shadow: 0 0 0 1px var(--line-gold), 0 0 0 7px var(--paper), 0 0 0 8px var(--line-gold), 0 16px 40px var(--shadow); }
.wish .cat { width: 120px; margin: -96px auto 4px; filter: drop-shadow(0 6px 10px var(--shadow)); }
.wish p { margin: 10px auto 0; max-width: 36em; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.facts div { padding: 12px; border-radius: 14px; background: var(--paper-2); border: 1px dashed var(--line-gold); }
.facts dt { font-size: 13px; color: var(--ink-soft); }
.facts dd { margin: 2px 0 0; font-family: var(--f-round); color: var(--berry); font-size: 17px; }
@media (max-width: 560px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* ——— footer ——— */
footer { padding-block: 40px 56px; text-align: center; color: var(--ink-soft); font-size: 14px; }
footer .flinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 14px; }
footer .flinks a { color: var(--ink); text-decoration: none; font-family: var(--f-round); }
footer .flinks a:hover { color: var(--berry); }
footer p { margin: 4px 0; }

/* ——— dialogs ——— */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(40, 20, 45, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet {
  position: relative; width: min(760px, calc(100vw - 24px)); max-height: calc(100svh - 32px); overflow: auto;
  background: var(--paper); border-radius: 28px; padding: 26px clamp(18px, 4vw, 34px) 28px;
  box-shadow: 0 0 0 1px var(--line-gold), 0 0 0 6px var(--paper), 0 0 0 7px var(--line-gold), 0 24px 60px rgba(30, 10, 30, .4);
}
.sheet .x { position: absolute; top: 14px; inset-inline-end: 14px; }
.sheet h3 { margin: 0 0 4px; font-size: 26px; }
.sheet .hint { margin: 0 0 16px; color: var(--ink-soft); font-size: 14px; }
.lang-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lang-list button { min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line-gold); background: var(--paper); cursor: pointer; font-family: var(--f-round); font-size: 17px; color: var(--ink); }
.lang-list button[aria-pressed="true"] { background: var(--berry); color: var(--berry-ink); border-color: var(--berry); }
.variant { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.variant[hidden] { display: none; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--lilac-soft); gap: 4px; }
.seg button { min-height: 40px; min-width: 84px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer; background: transparent; font-family: var(--f-round); font-size: 16px; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--berry); box-shadow: 0 2px 8px var(--shadow); }
@media (max-width: 520px) { .lang-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.menu-sheet { width: min(420px, calc(100vw - 24px)); }
.menu-sheet nav { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.menu-sheet nav a { font-family: var(--f-round); font-size: 20px; text-decoration: none; color: var(--ink); padding: 12px 16px; border-radius: 14px; background: var(--paper-2); }
.menu-sheet nav a:hover { color: var(--berry); }

.person { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 20px; align-items: start; width: min(880px, calc(100vw - 24px)); }
.person .big { position: sticky; top: 0; display: flex; justify-content: center; background: radial-gradient(ellipse at 50% 85%, var(--lilac-soft), transparent 70%); border-radius: 20px; }
.person .big img { width: 100%; max-width: 300px; height: auto; }
.person h3 { font-size: 34px; color: var(--berry); }
.person .rl { margin: 0 0 12px; color: var(--ink-soft); }
.person blockquote { margin: 0 0 14px; padding: 12px 16px; border-radius: 14px; background: var(--paper-2); font-family: var(--f-elegant); font-size: 17px; line-height: 1.8; border-inline-start: 4px solid var(--berry-2); }
.person p.tx { margin: 0 0 14px; font-size: 16px; }
.person .outfits { display: flex; gap: 8px; flex-wrap: wrap; }
.person .outfits button { padding: 4px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper-2); cursor: pointer; }
.person .outfits button[aria-pressed="true"] { border-color: var(--berry); }
.person .outfits img { width: 54px; height: auto; }
.person .of-label { font-size: 13px; color: var(--ink-soft); margin: 0 0 6px; }
.person .stepper { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
@media (max-width: 640px) { .person { grid-template-columns: minmax(0, 1fr); } .person .big { position: relative; } .person .big img { max-width: 220px; } .person h3 { font-size: 28px; } }

.lightbox { width: min(1280px, calc(100vw - 20px)); }
.lightbox figure { margin: 0; background: var(--paper); border-radius: 18px; padding: 8px; box-shadow: 0 0 0 1px var(--line-gold), 0 24px 60px rgba(20, 5, 20, .5); }
.lightbox img { width: 100%; height: auto; max-height: calc(100svh - 120px); object-fit: contain; border-radius: 12px; }
.lightbox figcaption { padding: 10px 64px 4px; font-size: 14.5px; color: var(--ink); text-align: center; min-height: 1.5em; }
.lightbox .x { position: absolute; top: -6px; inset-inline-end: -6px; z-index: 2; }
.lb-stage { position: relative; touch-action: pan-y; }
.lb-nav { position: absolute; top: 50%; margin-top: -22px; z-index: 2; background: rgba(255, 253, 249, .92); color: #c24f7a; }
.lb-nav.prev { inset-inline-start: 10px; }
.lb-nav.next { inset-inline-end: 10px; }
.lb-nav[hidden], .lb-count[hidden] { display: none; }
.lb-count { position: absolute; top: calc(100% + 11px); inset-inline-end: 12px; font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; direction: ltr; pointer-events: none; }
#lbImg.in { animation: lb-in .35s ease both; }
@keyframes lb-in { from { opacity: .35; transform: scale(.985); } to { opacity: 1; transform: none; } }

.top-btn { position: fixed; z-index: 40; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); opacity: 0; pointer-events: none; transition: opacity .25s; }
.top-btn.on { opacity: 1; pointer-events: auto; }
:root[dir="rtl"] .top-btn { right: auto; left: calc(16px + env(safe-area-inset-left, 0px)); }

[data-loading="1"] main { opacity: .55; transition: opacity .2s; }

/* ——— account (sign in / sign up / reset): the screens are ready, the service is not yet connected ——— */
.acct-btn { padding: 0 14px 0 10px; }
@media (max-width: 600px) { .acct-btn { width: 40px; padding: 0; justify-content: center; } .acct-btn .txt { display: none; } }
.acct { width: min(520px, calc(100vw - 24px)); }
.acct-head { display: flex; align-items: center; gap: 12px; margin: -4px 0 10px; }
.acct-head img { width: 64px; height: auto; filter: drop-shadow(0 4px 8px var(--shadow)); }
.acct-head h3 { margin: 0; font-size: 26px; }
.notice {
  position: relative; margin: 0 0 16px; padding: 10px 14px; padding-inline-start: 40px; border-radius: 14px;
  font-size: 14px; line-height: 1.65; color: var(--ink); background: var(--paper-2); border: 1.5px dashed var(--line-gold);
}
.notice::before {
  content: ""; position: absolute; inset-inline-start: 13px; top: 13px; width: 16px; height: 16px; background: var(--gold);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
.acct-tabs { display: flex; width: 100%; margin-bottom: 16px; }
.acct-tabs button { flex: 1 1 auto; min-width: 0; padding: 0 12px; font-size: 15px; line-height: 1.25; }
@media (max-width: 420px) { .acct-tabs button { padding: 0 8px; font-size: 14px; } }
.acct-tabs button[aria-selected="true"] { background: var(--paper); color: var(--berry); box-shadow: 0 2px 8px var(--shadow); }
.acct-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-family: var(--f-round); font-size: 14.5px; color: var(--plum); }
:root[data-theme="dark"] .field > span { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field > span { color: var(--ink); } }
.field input {
  width: 100%; min-height: 46px; padding: 0 16px; border-radius: 14px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line-gold); outline: none;
}
.field input:focus-visible { border-color: var(--lilac); box-shadow: 0 0 0 3px var(--lilac-soft); }
.field input::placeholder { color: var(--ink-soft); opacity: .75; }
fieldset[disabled] .field input { background: var(--paper-2); border-style: dashed; cursor: not-allowed; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.55; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--berry); flex: none; }
fieldset[disabled] .check { cursor: not-allowed; opacity: .8; }
.btn.wide { width: 100%; margin-top: 4px; }
fieldset[disabled] .btn.primary { filter: saturate(.55) brightness(1.08); opacity: .9; cursor: not-allowed; }
fieldset[disabled] .btn.primary::after { animation: none; opacity: .6; }
.acct-form .hint { margin: 0 0 12px; font-size: 14px; color: var(--ink-soft); }
.switch { margin: 12px 0 0; text-align: center; font-size: 14.5px; color: var(--ink-soft); }
.switch + .switch { margin-top: 4px; }
.link {
  border: 0; background: none; padding: 4px 2px; cursor: pointer; color: var(--berry); font: inherit; font-family: var(--f-round);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line);
}
.link:hover { text-decoration-color: var(--berry); }
.perks { margin-top: 20px; padding-top: 16px; border-top: 1.5px dashed var(--line-gold); }
.perks h4 { margin: 0 0 10px; font-family: var(--f-round); font-size: 16px; color: var(--berry); }
.perks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.perks li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.perks b { display: block; font-family: var(--f-round); font-weight: 400; font-size: 15px; color: var(--plum); }
:root[data-theme="dark"] .perks b { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .perks b { color: var(--ink); } }
.perks li span:not(.pi) { font-size: 14px; line-height: 1.65; color: var(--ink-soft); }
.pi { width: 34px; height: 34px; border-radius: 50%; background: var(--lilac-soft) center / 18px no-repeat; box-shadow: 0 0 0 2px var(--gold-soft); }
.pi.bell { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c24f7a'%3E%3Cpath d='M12 3a5.5 5.5 0 0 0-5.5 5.5v3.3L5 15v1.2h14V15l-1.5-3.2V8.5A5.5 5.5 0 0 0 12 3zm-2.2 14.6a2.2 2.2 0 0 0 4.4 0z'/%3E%3C/svg%3E"); }
.pi.heart { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c24f7a'%3E%3Cpath d='M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z'/%3E%3C/svg%3E"); }
.pi.chat { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c24f7a'%3E%3Cpath d='M5 5h14a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-7l-4.5 3.5V17H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z'/%3E%3C/svg%3E"); }

/* ——— parts come in softly as they scroll into view (added by site.js, then taken off again) ——— */
.rv { opacity: 0; translate: 0 24px; transition: opacity .8s ease var(--rv-delay, 0ms), translate .8s cubic-bezier(.2, .8, .2, 1) var(--rv-delay, 0ms); }
.rv.shown { opacity: 1; translate: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .petals { display: none; }
}

/* the invited build's download card (11-18) */
.dl-buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }
.dl-buttons .btn { min-width: min(100%, 220px); justify-content: center; }
.wish .dl-note { font-size: .92rem; opacity: .82; margin-top: 16px; }
