:root {
  color-scheme: dark;
  --bg: #130e1d;
  --surface: #1e1629;
  --line: #3b2d4b;
  --ink: #fff4e7;
  --muted: #cfc0d6;
  --gold: #ffdc88;
  --coral: #f0a6a2;
  --body: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --display: "Instrument Serif", "Georgia", serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.55 var(--body); }
a { color: var(--gold); text-underline-offset: .22em; }
a:hover { color: #fff0be; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
[hidden] { display: none !important; }
.shell { width: min(100% - 3rem, 1120px); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.header-inner { min-height: 4.5rem; }
.header-inner nav, .footer-inner nav { display: flex; align-items: center; gap: clamp(.85rem, 3vw, 2rem); }
.header-inner nav a, .footer-inner nav a { display: flex; align-items: center; gap: .35rem; min-height: 44px; color: var(--muted); font-size: .9rem; font-weight: 640; text-decoration: none; }
.header-inner nav a:hover, .footer-inner nav a:hover { color: var(--gold); }
.wordmark { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 780; font-size: 1.36rem; letter-spacing: -.05em; }
.mark { display: grid; place-items: center; width: 32px; height: 32px; margin-right: .6rem; border-radius: 50%; background: var(--gold); color: #29192c; font-size: 1.18rem; line-height: 1; }
.wordmark-period { color: var(--coral); }
.main-shell { padding-block: 2.4rem 4rem; }
.game-section, .guide-section { scroll-margin-top: 1.3rem; }
.masthead { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; }
h1, h2, .cover-title { font-family: var(--display); font-weight: 500; letter-spacing: -.044em; }
h1 { margin: 0; font-size: clamp(2.55rem, 5.7vw, 4.8rem); line-height: .99; }
.title-tail { color: #e6c9ed; }
.byline { flex: none; margin: 0; color: var(--muted); font-size: .94rem; }
.byline a { color: var(--ink); }
.player { border: 1px solid #584363; border-radius: 1.35rem; overflow: hidden; background: #20162a; box-shadow: 0 25px 66px #0a071175; }
.player-top { min-height: 2.72rem; padding: .35rem 1.05rem; display: flex; align-items: center; justify-content: space-between; gap: .65rem; color: var(--muted); font-size: .76rem; letter-spacing: .025em; border-bottom: 1px solid var(--line); }
.player-label { display: flex; align-items: center; gap: .53rem; color: var(--ink); font-weight: 700; }
.player-label i { display: block; width: .46rem; height: .46rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 .72rem #ffd77c8c; }
.stage { position: relative; aspect-ratio: 1200 / 540; isolation: isolate; background: #160f24; }
.stage:focus-visible { outline-offset: -3px; }
.stage:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; }
.stage:fullscreen > :is(.cover, .loading, iframe) {
  height: calc(100% - 48px - env(safe-area-inset-bottom, 0px));
}
.fullscreen-tools { display: none; }
.stage:fullscreen .fullscreen-tools {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: calc(48px + env(safe-area-inset-bottom, 0px));
  padding: 0 1rem env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--line);
  background: #20162a;
}
.cover, .loading, .stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage iframe { display: block; border: 0; }
.cover { overflow: hidden; background: radial-gradient(ellipse at 70% 43%, #523044, #21142e 62%, #160f24); }
.cover-art, .cover-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover-art { object-fit: cover; object-position: 67% center; }
.cover-shade { background: linear-gradient(90deg, #150d22ed, #150d22c2 27%, #150d224b 48%, transparent 70%); }
.cover-copy { position: relative; height: 100%; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; width: min(43%, 28rem); margin-left: 6%; }
.cover-title { margin: 0; color: #ffedcb; font-size: clamp(2rem, 5.25vw, 4.9rem); line-height: .98; text-wrap: balance; }
.cover-description { margin: .95rem 0 1.25rem; max-width: 17.5rem; color: #f6e7ef; }
.play-button { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-height: 50px; padding: .65rem 1.15rem; border: 1px solid #ffeab0; border-radius: .6rem; color: #22142a; background: var(--gold); box-shadow: 0 4px 0 #b87945; cursor: pointer; font-weight: 800; text-align: center; }
.play-button:hover { background: #fff0b8; }
.play-button:active { box-shadow: 0 1px 0 #b87945; translate: 0 2px; }
.play-icon { font-size: .75rem; }
.cover-next { margin: .75rem 0 0; color: #f6e7ef; font-size: .82rem; }
.cover-next strong, .play-next strong { color: var(--gold); }
.art-credit { position: absolute; right: .7rem; bottom: .6rem; color: #f0dfe9; background: #160f24dd; border-radius: .3rem; padding: .15rem .48rem; font-size: .68rem; }
.loading { display: none; place-content: center; justify-items: center; gap: 1rem; background: radial-gradient(ellipse at center, #392344, #160f24 72%); color: var(--gold); text-align: center; font-weight: 650; padding: 1rem; }
.stage[data-gf-state="loading"] .loading { display: grid; z-index: 2; }
.stage[data-preview-wait-expired] .loading { display: none !important; }
.stage[data-gf-state="loading"] .cover, .stage[data-gf-state="playing"] .cover { display: none; }
.loading-lights { display: flex; gap: .65rem; }
.loading-lights i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 1.05rem #ffdc88; animation: glow 1.3s ease-in-out infinite alternate; }
.loading-lights i:nth-child(2) { animation-delay: .18s; }
.loading-lights i:nth-child(3) { animation-delay: .36s; }
@keyframes glow { from { opacity: .35; transform: translateY(2px); } to { opacity: 1; transform: translateY(-2px); } }
.player-tools { display: flex; align-items: center; justify-content: space-between; gap: .25rem 1rem; padding: .34rem .8rem; border-top: 1px solid var(--line); }
.tool-group { display: flex; flex-wrap: wrap; gap: .15rem .3rem; align-items: center; }
.tool-button, .original-link { display: inline-flex; align-items: center; gap: .36rem; min-height: 44px; padding: .2rem .62rem; border: 1px solid transparent; border-radius: .4rem; color: var(--ink); background: none; cursor: pointer; font-size: .84rem; font-weight: 650; white-space: nowrap; text-decoration: none; }
.tool-button:hover, .original-link:hover { border-color: #6d537a; color: var(--gold); background: #2b1e38; }
.tool-button[aria-pressed="true"] { color: var(--coral); }
.tool-button[aria-pressed="true"] .like-icon { color: var(--coral); }
.tool-symbol { font-size: 1.1rem; line-height: 1; }
.original-link { color: var(--gold); }
.fullscreen-status { margin: 0; color: var(--gold); font-size: .9rem; }
.fullscreen-status:not(:empty) { padding: .35rem 1rem .75rem; }
.player-help { margin-top: .75rem; }
.player-help p { margin: .35rem 0 0; color: var(--muted); font-size: .9rem; }
.player-help .play-next, .player-help .player-controls { color: var(--ink); }
.player-help .player-status { color: var(--gold); }
.player-status:empty { margin: 0; }
.guide-section, .faq-section { margin-top: clamp(2.7rem, 6vw, 4.75rem); }
.section-head { margin-bottom: 1.25rem; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 1rem; align-items: end; }
.section-head h2, .legal h2 { margin: 0; font-size: clamp(2rem, 4.4vw, 3.45rem); line-height: 1.08; }
.section-head p { max-width: 44rem; margin: 0; color: var(--muted); }
.control-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 0; padding: 0; list-style: none; }
.control-card { padding: clamp(1rem, 2.6vw, 1.6rem); border: 1px solid var(--line); border-top: 2px solid #95647a; border-radius: .85rem; background: var(--surface); }
.control-card:nth-child(2) { border-top-color: #8e7dba; }
.control-card:nth-child(3) { border-top-color: #c7a162; }
.card-icon { display: grid; place-items: center; width: 2.45rem; height: 2.45rem; border-radius: 50%; background: #35243e; color: var(--gold); font-size: 1.22rem; }
.control-card h3 { margin: .95rem 0 .25rem; font-size: 1.06rem; }
.control-card p { margin: 0; color: var(--muted); }
.guide-detail { max-width: 46rem; margin-top: 1.5rem; }
.guide-detail h3 { margin: 0; font-size: 1.1rem; }
.guide-detail p { margin: .45rem 0 0; color: var(--muted); }
.faq-list { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.2rem; padding-block: .7rem; cursor: pointer; list-style: none; font-weight: 700; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--gold); font-size: 1.35rem; font-weight: 500; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { margin: .05rem 2rem 1.15rem 0; max-width: 43rem; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); background: #100c18; }
.footer-inner { padding-block: 1.35rem; }
.footer-inner p { margin: .2rem 0 0; color: var(--muted); font-size: .88rem; }
.legal-shell { padding-block: 2.3rem 4rem; }
.legal { width: min(100%, 47rem); margin-inline: auto; }
.legal-back { margin: 0 0 1.45rem; }
.legal h1 { margin-bottom: 1.2rem; }
.legal h2 { margin-top: 1.8rem; font-size: 1.75rem; }
.legal p { color: var(--muted); }
.skip { position: fixed; left: 1rem; top: .6rem; z-index: 10; padding: .55rem 1rem; background: #241731; translate: 0 -180%; }
.skip:focus { translate: 0; }
.share-status { color: var(--gold); font-size: .76rem; }
.share-status:empty { display: none; }
@media (max-width: 700px) {
  .shell { width: calc(100% - 1.5rem); }
  .header-inner { min-height: 3.7rem; }
  .header-inner nav { gap: .8rem; }
  .header-inner nav a { font-size: .82rem; }
  .header-inner nav .head-original { display: none; }
  .main-shell { padding-top: 1.35rem; }
  .masthead { align-items: flex-start; flex-direction: column; gap: .45rem; margin-bottom: .85rem; }
  h1 { font-size: clamp(1.98rem, 7.5vw, 3.05rem); }
  .byline { font-size: .85rem; }
  .player { border-radius: .95rem; }
  .player-top { padding-inline: .65rem; font-size: .72rem; }
  .stage { aspect-ratio: 4 / 4.3; }
  .cover-art { height: 88%; object-position: right top; }
  .cover-shade {
    background: linear-gradient(to top, #150d22, #150d22f5 17%, #150d22cf 28%, #150d2252 39%, #150d2214 49%, transparent 57%);
  }
  .cover-copy { justify-content: flex-end; width: calc(100% - 1.65rem); margin-left: .82rem; padding-bottom: 1.9rem; }
  .cover-title, .cover-description { text-shadow: 0 2px 8px #100c1b, 0 0 18px #100c1b; }
  .cover-title { font-size: clamp(1.85rem, 6.2vw, 2.9rem); text-wrap: initial; }
  .cover-description { margin: .43rem 0 .75rem; font-size: .88rem; max-width: 17rem; }
  .play-button { min-height: 46px; padding-inline: .74rem; font-size: .87rem; }
  .cover-next { margin-top: .6rem; font-size: .77rem; }
  .art-credit { bottom: .35rem; }
  .player-tools { flex-wrap: wrap; padding-inline: .4rem; }
  .tool-button, .original-link { padding-inline: .36rem; font-size: .78rem; }
  .section-head, .control-grid { grid-template-columns: 1fr; }
  .section-head { gap: .65rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: .45rem; }
}
@media (min-width: 520px) and (max-width: 700px) {
  .stage { aspect-ratio: 4 / 3; }
}
@media (min-width: 701px) and (max-height: 680px) {
  .header-inner { min-height: 3.5rem; }
  .main-shell { padding-top: 1.2rem; }
  .masthead { margin-bottom: .8rem; }
  .masthead h1 { font-size: clamp(2.5rem, 5.2vw, 4rem); }
  .player-top { min-height: 2.25rem; }
  .stage:not(:fullscreen) { max-height: clamp(245px, 61vh, 390px); }
  .cover-title { font-size: clamp(2rem, 4.8vw, 3.8rem); }
  .cover-description { margin-block: .7rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.analytics-settings { border: 0; background: none; color: var(--muted); font: inherit; font-size: .9rem; font-weight: 640; min-height: 44px; cursor: pointer; }
.analytics-settings:hover { color: var(--gold); }
.analytics-banner { position: fixed; z-index: 100; inset: auto 1rem 1rem; max-width: 36rem; margin-inline: auto; padding: 1rem 1.2rem; border: 1px solid #74597f; border-radius: .8rem; background: #211629; color: var(--ink); box-shadow: 0 12px 40px #000a; }
.analytics-banner p { margin: .3rem 0 .8rem; font-size: .9rem; }
.analytics-banner strong { font-size: 1rem; }
.analytics-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.analytics-actions button { min-height: 44px; padding: .5rem .9rem; border: 1px solid var(--gold); border-radius: .45rem; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.analytics-actions [data-analytics-accept] { background: var(--gold); color: #22142a; font-weight: 700; }

/* Portrait game needs vertical room for its in-game controls. */
@media (max-width: 700px) and (orientation: portrait) {
  .stage:not(:fullscreen) {
    aspect-ratio: auto;
    height: calc(100vw - 1.5rem - 2px + 260px);
  }
  .cover-copy {
    justify-content: flex-start;
    padding-top: clamp(8rem, 40vw, 12rem);
    padding-bottom: 0;
  }
  .cover-next { text-shadow: 0 2px 8px #100c1b, 0 0 18px #100c1b; }
}

/* Fullscreen layout for browsers using the WebKit-prefixed API. */
.stage:-webkit-full-screen { width: 100%; height: 100%; aspect-ratio: auto; }
.stage:-webkit-full-screen > :is(.cover, .loading, iframe) {
  height: calc(100% - 48px - env(safe-area-inset-bottom, 0px));
}
.stage:-webkit-full-screen .fullscreen-tools {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: calc(48px + env(safe-area-inset-bottom, 0px));
  padding: 0 1rem env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--line);
  background: #20162a;
}
