/* UNNULLTOR v4. Theme for the official site shell; /unnulltor/ has its own build. */
.night-site {
  --ivory: #060d18;
  --surface: #111c31;
  --raised: #17243d;
  --text: #eaf0ff;
  --muted: #becbe1;
  --forest: #dbe5ff;
  --action: #a8c0f2;
  --action-hover: #c3d4fa;
  --gold: #c2aa78;
  --border: #526482;
  --ink: #30291f;
  --v4-paper: #f1d6a1;
  --focus: #b6ccff;
  background: var(--ivory);
  overflow-wrap: anywhere;
}

.night-site :focus-visible { outline-color: var(--focus); }
.night-site .skip { z-index: 10; }
.night-site .button, .night-site button {
  background: var(--action);
  color: var(--ivory);
  border: 1px solid transparent;
}
.night-site :is(.button, button):hover { background: var(--action-hover); }
.night-site button:disabled {
  background: #28364f;
  color: #b8c6dd;
  cursor: not-allowed;
}
.night-site .outline {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
}
.night-site .outline:hover { background: var(--raised); }
.night-site h1, .night-site h2, .night-site h3 {
  font-family: "Noto Serif TC", "PMingLiU", Georgia, serif;
}
.night-site .wrap { width: min(1280px, calc(100% - 48px)); }
.night-site .site-header {
  background: #0a1222;
  border-color: #394861;
}
.night-site .site-header .bar { min-height: 76px; }
.night-site .brand {
  font-size: clamp(1.05rem, 1.7vw, 1.45rem);
  font-family: Georgia, "Noto Serif TC", serif;
  gap: .75rem;
  letter-spacing: .13em;
}
.night-site .brand img { display: block; width: auto; height: 44px; object-fit: contain; }
.night-site .site-header :is(button[aria-controls], #header-sign-in, [data-sign-out]) {
  background: transparent;
  color: var(--text);
}
.night-site .site-header :is(#nav a, #header-sign-in, .disclosure-panel a, button):is(:hover,:focus-visible,[aria-current],.header-current),
.night-site .site-header .disclosure:has(a[aria-current="page"]) > button { background: var(--raised); }
.night-site .site-header .disclosure-panel { box-shadow: 0 .5rem 1.5rem #03070db3; }
.night-site .site-header :is(#header-sign-in, #menu, #header-account) { flex-shrink: 0; }
.night-site .header-status { color: #efcc8b; }
.night-site footer {
  background: var(--ivory) url("/theme-v4/backgrounds/footer-horizon.webp") center 70% / cover no-repeat;
  border-color: #394861;
}
.night-site footer .wrap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 1rem 2rem;
  padding-block: 2rem;
}
.night-site footer .brand { width: fit-content; white-space: nowrap; }
.night-site footer .brand img { height: 36px; }
.night-site footer nav { display: grid; gap: .4rem; }
.night-site footer nav a { min-height: 0; padding-block: .3rem; width: fit-content; }
.night-site footer small { grid-column: 1 / -1; }
@media (width < 760px) {
  .night-site .wrap { width: calc(100% - 32px); }
  .night-site footer .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .night-site footer .brand { grid-column: 1 / -1; }
}

.theme-home .hero {
  display: grid;
  align-items: center;
  min-height: clamp(440px, 58svh, 560px);
  background: var(--ivory);
  border: 0;
  overflow: clip;
}
.hero-night-art { position: absolute; inset: 0; pointer-events: none; }
.hero-night-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 70% 100%; }
.theme-home .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--ivory), transparent 64px),
    linear-gradient(90deg, #060d18c9, #060d1859 45%, transparent 67%);
  pointer-events: none;
}
.theme-home .hero .wrap { position: relative; z-index: 1; display: block; min-height: 0; }
.theme-home .hero-copy { width: min(100%, 620px); padding-block: 2.5rem; }
.theme-home .hero-copy h1, .theme-home .hero-copy > p, .theme-home .cover-link {
  text-shadow: 0 2px 6px #020610, 0 0 16px #020610;
}
.theme-home .hero h1 { font-size: clamp(3.5rem, 5vw, 4.5rem); line-height: 1.18; }
.theme-home:lang(en) .hero h1 { font-size: clamp(3rem, 4vw, 3.5rem); letter-spacing: .015em; }
.theme-home .hero h1::after { content: none; }
.theme-home .hero-copy > p { font-size: clamp(1.04rem, 1.7vw, 1.5rem); color: #c9d7e5; }
.theme-home .hero-copy .cover-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .8rem;
  margin-block-end: 1.4rem;
  color: #f4eee4;
  font: 600 clamp(.78rem, 1.3vw, 1.17rem)/1.4 Georgia, serif;
  letter-spacing: .23em;
}
.cover-kicker::after { content: ""; inline-size: 5rem; border-block-start: 1px solid var(--gold); }
.theme-home .hero .actions { margin-block-start: clamp(1.2rem, 2.5vw, 2.25rem); gap: .8rem 2.4rem; }
.theme-home .cover-action {
  padding-inline: clamp(1.1rem, 3vw, 2.7rem);
  justify-content: center;
  min-height: 52px;
  border: 1px solid #c8aa6c;
  border-radius: .55rem;
  background: linear-gradient(#6b5632, #392c18);
  color: #fff6e6;
  box-shadow: inset 0 0 0 1px #f2ddaa33;
  font-family: "Noto Serif TC", "PMingLiU", Georgia, serif;
}
.theme-home .cover-action:hover { background: #6c572e; }
.cover-link { gap: .6em; text-decoration: none; }
.cover-link:hover { color: #fff0cc; }
.home-games { border-block-start: 1px solid var(--border); }
.home-games > :first-of-type { margin-block-end: 1.5rem; }
.home-games > p { color: #bac4cc; }
.theme-home .home-stories { margin-block-start: 1.5rem; }
.home-showcase { padding-block: 4rem; }
.home-showcase-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; }
.home-showcase-heading h2 { margin: 0; }
.home-showcase-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-block: 1rem 0; padding: 0; list-style: none; }
.home-showcase-list li { display: flex; }
.home-project {
  display: flex;
  align-items: center;
  flex: 1;
  gap: .85rem;
  min-height: 112px;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
  background: var(--surface);
  text-decoration: none;
}
.home-project img { width: min(36%, 120px); height: auto; aspect-ratio: 2 / 1; border-radius: .35rem; }
.home-project > span { display: grid; gap: .25rem; }
.home-project .action-link { color: var(--muted); min-height: 0; font-size: .875rem; }
@media (760px <= width < 1000px) { .home-showcase-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (width < 760px) {
  .home-showcase { padding-block: 2.5rem; }
  .home-showcase-list { grid-template-columns: minmax(0, 1fr); }
}
.home-news { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 1rem; padding-block: .75rem; border-block-start: 1px solid var(--border); }
.home-news :is(h2, p) { margin: 0; }
.home-news h2 { font-size: 1.2rem; }
.home-about { padding-block: 1.75rem; }
.home-about > p { max-width: 65ch; line-height: 1.7; }
.theme-world main {
  background: var(--ivory) url("/theme-v4/backgrounds/hero-night-desktop.webp") center top / 100% auto no-repeat;
}
.theme-world main > .inner { overflow-wrap: anywhere; }

.night-site .parchment {
  --forest: #3a2a19;
  --surface: #fff4dc;
  --raised: #f8e5bd;
  --border: #80603b;
  --paper-rule: #80603b;
  --focus: #493116;
  color: var(--ink);
  background: var(--v4-paper);
  background-clip: padding-box;
  border: solid transparent;
  border-width: 74px 92px 106px;
  border-image: url("/theme-v4/parchment/story-scroll-desktop.webp") 184 230 266 230 fill stretch;
  border-radius: 0;
  padding: .3rem .6rem 1rem;
}
.night-site .parchment::before, .night-site .parchment::after { content: none; }
.night-site .parchment .meta { color: #5b432a; }
.night-site .parchment .button {
  background: #513b24;
  color: #fff6e7;
}
.night-site .parchment .button:hover { background: #674a2b; }
.night-site .parchment .route-node button {
  background: #f8e5bd;
  color: var(--forest);
  border-color: #927047;
}
.night-site .parchment .route-node button[aria-expanded="true"] { background: #513b24; color: #fff6e7; }
.night-site .route-medallion:has(.chapter-icon) { padding: 0; border: 0; background: transparent; }
.chapter-icon { display: block; width: 100%; height: auto; object-fit: contain; pointer-events: none; }
.home-stories {
  margin-block: -.9rem 1.5rem;
  scroll-margin-top: 1rem;
}
.home-stories > h2 { text-align: center; margin: 0; font-size: clamp(1.75rem, 4.1vw, 3.25rem); }
.home-stories-summary { text-align: center; margin-block: .35rem; }
.paper-band {
  position: relative;
  height: clamp(18px, 5vw, 46px);
  overflow: hidden;
  pointer-events: none;
}
.paper-band img {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
}
.home-stories > .paper-band { width: min(50%, 27rem); margin: .15rem auto .65rem; }
.route-track { display: flow-root; }
.theme-home .home-stories .lore-route, .theme-world .parchment-compact .lore-route { --medallion: 64px; }
@media (width < 760px) {
  .theme-home .home-stories .lore-route, .theme-world .parchment-compact .lore-route { --medallion: 56px; }
}
.night-site .lore-route { position: relative; z-index: 1; }
.night-site .route-track .route-medallion {
  padding: 3px;
  border: 2px solid #80603c;
  background: #f2e2c5;
}
.route-track .route-medallion .chapter-icon { filter: contrast(1.3) brightness(.72); }
@media (min-width: 768px) {
  .night-site .route-track .route-medallion { margin-block-end: 30px; }
  .night-site .lore-route.connected > li::before { inset-block-start: 64px; height: 28px; }
  .night-site .lore-route.connected > li::after {
    inset-block-start: 64px;
    inset-inline-start: calc(50% - 1px);
    width: 2px;
    height: 15px;
    border: 0;
    border-radius: 0;
  }
}
.night-site .dossier .dossier-route-line { border-color: #80603b; }
.night-site .lore-route > li .route-summary { min-width: 0; }
.night-site .reader-paper {
  --forest: #3a2a19;
  --focus: #493116;
  background: #f4e0b9 url("/theme-v4/parchment/reading-paper-grain.webp") center / cover no-repeat;
  color: var(--ink);
  border: 0;
  border-radius: .3rem;
}
.night-site .world-intro { max-width: 960px; margin-inline: auto; }
.night-site .reader-figure figcaption { color: var(--muted); }
.paper-brand { display: block; width: auto; height: 36px; margin: 1.6rem auto 0; }
.night-site .character-card, .night-site .story-index li { background: var(--surface); border-color: var(--border); }
.night-site .character-card .lore-meta { color: #e2c998; }
.featured-games { display: grid; gap: 24px; }
.home-games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (width >= 1100px) {
  .home-games-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .home-games-grid .game-feature { gap: 16px; border-radius: 20px; }
  .home-games-grid .featured-game-copy { padding: 0 4px 4px; gap: .55rem; }
  .home-games-grid .featured-game-copy h3 { font-size: 1.5rem; }
  .home-games-grid .actions { gap: 8px; }
  .home-games-grid .game-primary, .home-games-grid .action-control { padding-inline: 12px; font-size: .875rem; }
  .home-games-grid .game-closure-note { flex-basis: 100%; order: -1; }
}
.game-feature {
  --game-surface: #111b26;
  --game-accent: #aac8d6;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px;
  min-width: 0;
  background: var(--game-surface);
  color: #edf1f4;
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px #bac4cc25;
}
.game-feature--travelhome { --game-accent: #d4b27a; }
.game-feature-art {
  position: relative;
  align-self: start;
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: 16px;
}
.game-feature-art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.featured-game-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: .65rem;
  padding: 0 8px 8px;
}
.featured-game-copy :is(h2, h3, p) { margin: 0; }
.featured-game-copy :is(h2, h3) { color: inherit; font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.25; }
.game-genre { color: var(--game-accent); font-weight: 700; }
.game-description { color: #bac4cc; line-height: 1.7; }
.featured-game-copy .actions { gap: 12px; margin-block-start: auto; padding-block-start: .5rem; }
.game-primary {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--game-accent);
  color: var(--game-surface);
  font-weight: 700;
  text-decoration: none;
  justify-content: center;
}
.game-primary:hover { background: #edf1f4; }
.game-primary:disabled { background: #243145; color: #bac4cc; cursor: default; }
.featured-game-copy .action-control { background: transparent; border-color: #61758b; color: #edf1f4; }
.featured-game-copy .action-control:hover { background: var(--raised); }
.featured-game-copy a:focus-visible { outline: 2px solid #edf1f4; outline-offset: 3px; }
.games-sign-in-note { margin-block: .8rem 0; color: #bac4cc; }
#home-games, #home-stories, #travelhome { scroll-margin-top: 92px; }
.games-sign-in-note + .parchment { margin-block-start: 2rem; }
@media (width >= 900px) {
  .game-feature--wide { display: grid; grid-template-columns: minmax(0, 52fr) minmax(0, 48fr); gap: 24px; align-items: center; }
  .game-feature--wide .featured-game-copy { padding: 16px 16px 16px 8px; }
}
@media (width < 760px) {
  .featured-games { gap: 20px; }
  .home-games-grid { grid-template-columns: minmax(0, 1fr); }
  .game-feature { gap: 16px; padding: 12px; border-radius: 18px; }
  .game-feature-art { border-radius: 12px; }
}
.theme-utility main {
  min-height: 65vh;
  background: var(--ivory) url("/theme-v4/backgrounds/utility-night-desktop.webp") center top / 100% auto no-repeat;
}
.theme-utility :is(.account-login, .traveler-paper, .wallet-paper, .contact-layout, .overview-grid > section) {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .65rem;
}
.theme-utility :is(.traveler-paper, .wallet-paper)::before,
.theme-utility :is(.traveler-paper, .wallet-paper)::after { content: none; }
.theme-utility .account-side { border-color: var(--border); }
.theme-utility .account-side a[aria-current],
.theme-utility .account-side a:hover,
.theme-utility .account-side .account-logout:hover { background: var(--raised); color: var(--text); }
.theme-utility .account-side .account-logout { background: transparent; color: var(--text); }
.theme-utility .account-login input {
  background: #0b1528;
  border-color: #8a9dbf;
}
.theme-utility .overview-grid { gap: .85rem; }
.theme-utility .overview-grid > section { padding: clamp(.8rem, 2vw, 1.35rem); }
.theme-utility :is(.wallet-balances, .wallet-notice, .wallet-exchange-path span, .wallet-exchange-path span:nth-child(2)) {
  background: var(--raised);
  color: var(--text);
}
.theme-utility :is(.wallet-sections, .wallet-section, .wallet-preview, .wallet-preview dl div) { border-color: var(--border); }
.theme-utility .wallet-notice { border-inline-start-color: var(--gold); }
.theme-utility .package-card {
  background: #0e182c;
  color: var(--text);
  border-color: var(--border);
}
.theme-utility .wallet-packages input:checked + .package-card {
  background: var(--raised);
  border-color: var(--action);
}
.theme-utility .wallet-packages input:focus-visible + .package-card { outline-color: var(--focus); }
.theme-utility .package-current { color: var(--text); }
.theme-utility #exchange-orders { padding-inline-start: 1.25em; }
.theme-utility #exchange-orders button { text-align: start; max-width: 100%; }
.theme-utility .contact-layout { padding: clamp(1rem, 3vw, 2rem); }
.theme-utility .contact-tips { border-color: var(--border); }

/* Muted status panels elsewhere on the official site share the same palette. */
.night-site .planning, .night-site .playlist [aria-current="true"] { background: var(--raised); }
.night-site .roles span { color: var(--gold); }

@media (max-width: 74.99em) {
  .night-site .site-header .bar { min-height: 64px; }
  .night-site .site-header .brand img { height: 38px; }
}
@media (max-width: 767px) {
  .night-site .site-header .brand { letter-spacing: .07em; gap: .55rem; }
  .night-site .site-header .brand img { height: 34px; }
  .theme-home .hero { min-height: 0; }
  .theme-home .hero-copy { padding-block: 3.25rem 2.5rem; }
  .theme-home .hero h1, .theme-home:lang(en) .hero h1 { font-size: clamp(2.25rem, 9vw, 2.75rem); }
  .theme-home .hero .actions .button { width: auto; }
  .theme-world main {
    background-image: url("/theme-v4/backgrounds/hero-night-mobile.webp");
    background-position: center 10rem;
  }
  .theme-utility main { background-image: url("/theme-v4/backgrounds/utility-night-mobile.webp"); }
  .night-site .parchment {
    border-width: clamp(64px, 21vw, 94px) clamp(27px, 9vw, 41px) clamp(67px, 22vw, 99px);
    border-image: url("/theme-v4/parchment/story-scroll-mobile.webp") 292 123 307 123 fill stretch;
    padding: .25rem 0 .5rem;
  }
  .night-site .world-intro { border-inline-width: clamp(18px, 6vw, 24px); }
  .night-site .home-stories { margin-block-start: .2rem; }
  .night-site .lore-route.connected > li::before { content: none; }
  .night-site .lore-route.connected > li:not(:last-child)::before {
    content: "";
    inset: 36px auto -36px 23px;
    width: 2px;
    height: auto;
    background: #80603c;
  }
  .night-site .route-track .route-medallion { position: relative; }
  .night-site .lore-route > li .route-summary { margin-inline-start: 36px; }
  .night-site .dossier-route { grid-template-columns: auto minmax(0, 1fr) auto; }
  .night-site .dossier-route > .lore-avatar { --medallion: 3.25rem; }
  .night-site .dossier-route .route-medallion { --medallion: 2.75rem; }
}
@media (max-width: 359px) {
  .night-site .site-header .brand img { height: 32px; }
}

@media (orientation: landscape) and (max-width: 900px) {
  .theme-home .hero-copy { width: min(66%, 42rem); padding-block: clamp(1.3rem, 5vw, 3.2rem) 1rem; }
  .theme-home .hero { min-height: 0; }
  .theme-home .hero-copy .cover-kicker { margin-block-end: .65rem; }
  .theme-home .hero h1, .theme-home:lang(en) .hero h1 { font-size: clamp(1.8rem, 5.3vw, 3rem); }
  .theme-home .hero .actions { margin-block-start: .9rem; gap: .4rem 1.4rem; }
}

.game-closure-note { color: #bac4cc; font-size: .9375rem; }
.featured-games + .parchment { margin-block-start: 2rem; }

.game-feature--ember { --game-accent: #d4b27a; }
.game-feature--ember .game-feature-art { background: #1c1b15; }
.game-feature--ember .game-feature-art img { padding: 0; box-sizing: border-box; }
