:root {
  color-scheme: dark;
  --ink: #fff;
  --gold: #ffdfb4;
  --muted: #c6bbab;
  --line: #514537;
  --bg: #13110f;
  --red: #ff5353;
  --unit: min(13.333333vw, 95px);
  --nav-height: calc(.8 * var(--unit));
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; background: #000; }
body { color: var(--ink); font: 15px/1.5 "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
h1, h2, p, figure { margin: 0; }
button { padding: 0; border: 0; font: inherit; color: inherit; background: none; cursor: pointer; }
button:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid white; outline-offset: 3px; }
button:disabled { opacity: .72; cursor: progress; }
[hidden], .icon-library { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.cover { position: relative; height: 100vh; height: 100dvh; width: 100%; overflow: hidden; isolation: isolate; background: #000; }
.poster { position: absolute; z-index: -1; inset: 0; display: block; }
.poster img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: left center; }
.fixed-links { position: absolute; top: max(3.7vh, env(safe-area-inset-top)); right: max(3.7vh, env(safe-area-inset-right)); display: flex; gap: 1vh; align-items: start; }
.fixed-links button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: clamp(32px, 4.5vh, 58px); padding: .3em .9em;
  border: 1px solid #c4a36f; border-radius: 100px; background: linear-gradient(110deg, #654021, #a7804d 55%, #dec699);
  font-size: clamp(12px, 1.62vh, 20px); font-weight: 550; white-space: nowrap; color: #fff; text-shadow: 0 1px 2px #503828;
}
.fixed-links button:hover .nav-icon { color: #fff4d9; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; font-size: 1.15em; }
.fixed-footer { position: absolute; bottom: max(1.5vh, env(safe-area-inset-bottom)); right: max(2.77vh, env(safe-area-inset-right)); width: 27vh; text-align: center; }
.qr-wrap { margin: 0 auto 1vh; text-align: center; }
#qr { width: 14vh; aspect-ratio: 1; margin: 0 auto; background: #fff; }
#qr svg, #qr canvas, #qr img { display: block; width: 100%; height: 100%; }
.qr-wrap figcaption { margin-top: 1.1vh; font-size: clamp(12px, 1.65vh, 18px); color: #fff; text-shadow: 0 1px 3px #000; }
.download-box { display: flex; justify-content: center; align-items: center; }
.download-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; color: var(--gold); background: var(--red); border-radius: 100px; font-size: clamp(14px, 1.85vh, 22px); padding-inline: 1.25em; min-height: 38px; white-space: nowrap; }
.download-btn:hover { background: #f54646; }
.download-btn .icon { color: #fff; }
.ios-help, .safari-note, .help-link { display: none; }
.age-note { position: absolute; left: 3.7vh; bottom: 2.2vh; color: #d6cbb7; font-size: 11px; letter-spacing: .06em; }
.age-note span { margin-left: 4px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; gap: 9px; border-radius: 6px; font-weight: 600; }
@media (max-width: 960px) {
  .poster { top: calc(env(safe-area-inset-top) + var(--nav-height)); }
  .poster img { object-position: center top; }
  .fixed-links { top: calc(env(safe-area-inset-top) + .19 * var(--unit)); left: 50%; right: auto; transform: translateX(-50%); gap: calc(.44 * var(--unit)); }
  .fixed-links button { display: flex; flex-direction: column; gap: calc(.08 * var(--unit)); width: calc(.8 * var(--unit)); min-height: 44px; padding: 0; background: none; border: 0; border-radius: 5px; font-size: clamp(10px, calc(.18 * var(--unit)), 16px); line-height: 1; font-weight: 450; text-shadow: 0 1px 3px black; }
  .nav-icon { width: calc(.8 * var(--unit)); aspect-ratio: 1; border: 1px solid #d6b47f; border-radius: 50%; background: linear-gradient(105deg, #654021, #a7804d 55%, #dec699); font-size: calc(.42 * var(--unit)); }
  .fixed-footer { top: calc(82% - .39 * var(--unit)); bottom: auto; left: 0; right: 0; width: 100%; }
  .qr-wrap { display: none; }
  .download-box { gap: calc(.24 * var(--unit)); }
  .download-btn { height: calc(.7 * var(--unit)); min-height: 0; width: calc(3 * var(--unit)); padding-inline: 4px; font-size: calc(.28 * var(--unit)); line-height: 1; }
  .download-btn::before { content: ""; position: absolute; inset: -4px 0; }
  .download-btn { position: relative; }
  :root[data-ios] .download-btn { width: calc(2.8 * var(--unit)); }
  :root[data-ios] .ios-help { display: inline-flex; }
  .help-link, .safari-note { color: var(--red); font-size: calc(.28 * var(--unit)); line-height: 1.5; margin: calc(.2 * var(--unit)) auto 0; }
  .help-link { display: inline-block; }
  :root[data-ios] .help-link { display: none; }
  :root[data-ios] .safari-note { display: block; }
  .age-note { left: 0; right: 0; text-align: center; bottom: max(1rem, env(safe-area-inset-bottom)); }
}
@media (max-width: 960px) and (max-height: 800px), (max-width: 960px) and (min-aspect-ratio: 1/2) {
  .fixed-footer { top: auto; bottom: calc(.66 * var(--unit) + env(safe-area-inset-bottom)); }
  .age-note { bottom: max(5px, env(safe-area-inset-bottom)); }
}
@media (max-width: 960px) and (orientation: landscape) {
  :root { --unit: clamp(35px, 8.8vh, 49px); --nav-height: 0px; }
  .fixed-links { top: max(5px, env(safe-area-inset-top)); }
  .poster img { object-position: center 30%; }
  .fixed-footer { bottom: max(26px, env(safe-area-inset-bottom)); }
}
.modal { width: min(430px, calc(100% - 32px)); max-height: calc(100vh - 34px); max-height: calc(100dvh - 34px); padding: 0; overflow: auto; border: 1px solid #574c3b; border-radius: 12px; background: #171514; color: var(--ink); }
.modal::backdrop { background: #070605c7; }
.modal-inner { position: relative; padding: 32px 26px 25px; }
.modal-close { position: absolute; inset: 6px 6px auto auto; display: grid; place-items: center; width: 44px; height: 44px; color: var(--muted); }
.modal .section-kicker { color: var(--gold); font-size: 12px; margin-bottom: 10px; }
.modal h2 { font-size: 28px; }
.modal-description, .help-list p { color: #d0c4b5; font-size: 14px; line-height: 1.8; }
.modal-description { margin-top: 15px; }
.guide-steps { margin: 20px 0 12px; display: flex; align-items: center; gap: 12px; color: var(--gold); font-size: 13px; }
.url-box { overflow-wrap: anywhere; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); user-select: all; font-size: 13px; }
.dialog-confirm, .copy-button { width: 100%; margin-top: 20px; background: var(--gold); color: #211910; }
.modal-secondary { display: block; margin: 4px auto 0; min-height: 44px; color: var(--muted); font-size: 13px; }
.help-list { margin: 18px 0 0; padding-left: 20px; }
.help-list li + li { margin-top: 14px; }
.toast, .noscript-note { position: fixed; z-index: 4; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); border: 1px solid #665743; padding: 12px 16px; border-radius: 8px; background: #28231e; font-size: 13px; }
.toast { visibility: hidden; pointer-events: none; }
.toast.show { visibility: visible; }

.modal .icon { width: 19px; height: 19px; }
.modal-description, .help-list p { margin-top: 8px; }
.modal .modal-inner > h2 { padding-right: 20px; }
