:root {
  color-scheme: dark;
  --night: #171713;
  --ivory: #f5efe2;
  --paper: #f1ebdf;
  --ink: #252720;
  --mute: #595b51;
  --edge: clamp(28px, 4.6vw, 84px);
  --ease: cubic-bezier(.2, 0, 0, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--night);
  color: var(--ivory);
}
* { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: wait; opacity: .62; }
button:focus-visible, input:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
button svg { fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }

.hero {
  --word-size: clamp(74px, min(9.4vw, 20svh), 170px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(30px, env(safe-area-inset-top)) max(var(--edge), env(safe-area-inset-right)) max(34px, env(safe-area-inset-bottom)) max(var(--edge), env(safe-area-inset-left));
  background: var(--night);
}
.hero > .wrap { position: relative; z-index: 1; min-width: 0; display: grid; grid-template-rows: auto 1fr auto; }
.scenery, .scene-frame, .scenery::after { position: absolute; inset: 0; pointer-events: none; }
.scenery { z-index: 0; overflow: hidden; }
.scene-frame { opacity: 0; }
body[data-scene="0"] [data-scene-art="0"],
body[data-scene="1"] [data-scene-art="1"],
body[data-scene="2"] [data-scene-art="2"],
body[data-scene="3"] [data-scene-art="3"] { opacity: 1; }
.scene-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.scene-square {
  left: auto;
  width: min(83%, max(61%, 101svh));
  mask-image: linear-gradient(to right, transparent, #000 23%, #000);
}
[data-scene-art="0"] img { object-position: 50% 65%; }
[data-scene-art="1"] img { object-position: 57% 53%; }
[data-scene-art="2"] { --scene-glow: #4b3927; }
[data-scene-art="2"] img { object-position: 42% 66%; }
[data-scene-art="3"] { --scene-glow: #233731; }
[data-scene-art="3"] img { object-position: 68% 58%; }
.scenery::after {
  content: '';
  background: linear-gradient(to top, rgb(15 17 13 / 84%), transparent 28%),
              linear-gradient(to right, rgb(16 17 14 / 72%) 0%, rgb(16 17 14 / 34%) 34%, transparent 61%),
              radial-gradient(ellipse 38% 24% at 100% 0%, rgb(18 17 12 / 65%), transparent),
              linear-gradient(to bottom, rgb(18 17 12 / 32%), transparent 20%);
}
.masthead, .hero-foot, .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.signature { display: flex; align-items: center; gap: clamp(10px, 1vw, 17px); }
.symbol { height: clamp(36px, 3.4vw, 56px); width: auto; }
.chinese-name { width: clamp(120px, 9.8vw, 164px); height: auto; }
.release { display: inline-flex; align-items: center; gap: 10px; font-size: .77rem; font-weight: 500; letter-spacing: .1em; white-space: nowrap; }
.release::before { content: ''; width: 22px; height: 1px; background: currentColor; opacity: .7; }
.hero-content { align-self: end; margin: 15vh 0 clamp(30px, 5.4vh, 62px); }
.genre { margin-bottom: clamp(13px, 1.45vw, 23px); font-size: clamp(.84rem, 1vw, 1rem); font-weight: 450; line-height: 1.5; letter-spacing: .1em; }
.game-title { width: max-content; max-width: 100%; }
.name-cut { display: block; height: calc(var(--word-size) * .88); overflow: hidden; }
.name-cut img { display: block; width: auto; height: var(--word-size); transform: translateY(-6%); }
.name-first { width: calc(var(--word-size) * 3.3); }
.name-last { width: calc(var(--word-size) * 3.98); }
.hero-foot { min-width: 0; padding-top: clamp(15px, 2.1vh, 25px); border-top: 1px solid #f5efe253; }
.enter-button { display: inline-flex; align-items: center; justify-content: space-between; gap: clamp(27px, 3.5vw, 62px); min-height: 56px; padding: 0 23px; border: 0; border-radius: 100px; color: #262920; background: var(--ivory); font-size: 1.02rem; font-weight: 600; letter-spacing: .035em; }
.enter-button:focus-visible { outline-color: var(--ivory); }
.scene-switch { display: flex; align-items: stretch; gap: clamp(14px, 2.3vw, 42px); }
.scene-switch button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px;
  border: 0; background: transparent; color: #e0d9cb; font-size: .84rem; letter-spacing: .04em;
}
.scene-index { font: 500 .67rem/1.4 'SFMono-Regular', Consolas, monospace; letter-spacing: .04em; opacity: .85; }
.scene-switch button::before { content: ''; width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; }
.scene-switch [aria-pressed="true"] { color: var(--ivory); }
.scene-switch [aria-pressed="true"]::before { background: currentColor; }
.scene-switch [aria-pressed="true"] > :last-child { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .4em; }

#admission-dialog {
  --dialog-shift: translateX(32px);
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(100%, 470px); max-width: 100%; height: 100%; height: 100dvh; max-height: 100%;
  padding: max(21px, env(safe-area-inset-top)) max(36px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) 36px;
  border: 0; color-scheme: light; color: var(--ink); background: var(--paper);
  overflow-y: auto; overscroll-behavior: contain;
}
#admission-dialog[open] { display: flex; flex-direction: column; }
#admission-dialog::backdrop { background: rgb(14 16 12 / 52%); }
.sheet-head { flex: none; padding-bottom: 17px; border-bottom: 1px solid #c9c2b4; }
.sheet-wordmark { width: 151px; height: auto; filter: brightness(0) saturate(100%); opacity: .83; }
.close-button { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 1px solid #a6a497; border-radius: 50%; background: transparent; color: var(--ink); }
.entry { width: 100%; margin-block: auto; padding-block: clamp(30px, 6.4vh, 78px); }
.step-title { margin-bottom: 30px; }
.step-title h2 { font-size: clamp(2rem, 2.8vw, 2.75rem); font-weight: 520; line-height: 1.23; letter-spacing: -.045em; }
.step-title p, .alternative p { font-size: .9rem; line-height: 1.65; color: var(--mute); }
.step-title p { margin-top: 12px; }
.field { margin-bottom: 21px; }
label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin-bottom: 6px; font-size: .88rem; font-weight: 600; line-height: 1.45; }
label span { color: var(--mute); font-size: .76rem; font-weight: 400; }
input { display: block; width: 100%; min-width: 0; min-height: 48px; padding: 7px 0; border: 0; border-bottom: 1px solid #77796a; border-radius: 0; background: transparent; color: var(--ink); font-size: 1rem; line-height: 1.6; }
input::placeholder { color: #68695e; opacity: 1; }
input:focus { border-bottom-color: var(--ink); }
#verification-code { letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.flow button:not(.quiet) { width: 100%; min-height: 51px; padding: 10px 20px; border: 0; border-radius: 3px; background: #303a2e; color: #faf5e8; font-size: 1rem; font-weight: 600; }
.flow .quiet { display: inline-flex; align-items: center; min-height: 44px; padding: 5px 0; border: 0; background: transparent; color: var(--ink); font-size: .88rem; text-decoration: underline; text-decoration-color: #8e8f82; text-underline-offset: .3em; }
.alternative { margin-top: 13px; }
.alternative p { font-size: .8rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; margin-top: 8px; }
#notice { overflow-wrap: anywhere; font-size: .9rem; line-height: 1.55; }
#notice:not(:empty) { margin-top: 15px; border-inline-start: 2px solid #8d6e3e; padding: 8px 12px; background: #e6e0d2; }
#sign-out { margin-top: 4px; }

@media (hover: hover) {
  .enter-button:hover { background: white; }
  .enter-button:hover svg { transform: translateX(3px); }
  .scene-switch button:hover > :last-child, .flow .quiet:hover { text-decoration: underline; text-underline-offset: .4em; }
  .close-button:hover { background: #e3ddcf; }
  .flow button:not(.quiet):hover { background: #222a20; }
}
@media (prefers-reduced-motion: no-preference) {
  .m-enter .genre, .m-enter .hero-foot { animation: settle .55s var(--ease) backwards; }
  .m-enter .name-cut img { animation: reveal-word .7s cubic-bezier(.16,.83,.23,1) backwards; }
  .m-enter .name-last img { animation-delay: .09s; }
  .m-enter .hero-foot { animation-delay: .1s; }
  .m-enter .scenery { animation: aperture .95s cubic-bezier(.18,.65,.25,1) both; }
  .scene-frame { transition: opacity .45s var(--ease); }
  .enter-button svg, button { transition: transform .15s var(--ease), background-color .15s ease-out; }
  button:not(:disabled):active { transform: scale(.96); }
  @keyframes reveal-word { from { translate: 0 78%; opacity: .25; } }
  @keyframes settle { from { opacity: 0; transform: translateY(12px); } }
  @keyframes aperture { from { opacity: .72; transform: scale(1.025); } }
}
@media (prefers-reduced-motion: reduce) {
  .scene-frame { transition: opacity .12s linear; }
  .enter-button:hover svg { transform: none; }
}
@supports (transition-behavior: allow-discrete) {
  #admission-dialog { opacity: 0; transition: opacity .15s ease-out, display .15s allow-discrete, overlay .15s allow-discrete; }
  #admission-dialog[open] { opacity: 1; transition-duration: .32s; }
  #admission-dialog::backdrop { opacity: 0; transition: opacity .15s ease-out, display .15s allow-discrete, overlay .15s allow-discrete; }
  #admission-dialog[open]::backdrop { opacity: 1; transition-duration: .32s; }
  @starting-style { #admission-dialog[open], #admission-dialog[open]::backdrop { opacity: 0; } }
  @media (prefers-reduced-motion: no-preference) {
    #admission-dialog { transform: var(--dialog-shift); transition: opacity .15s ease-out, transform .15s var(--ease), display .15s allow-discrete, overlay .15s allow-discrete; }
    #admission-dialog[open] { transform: none; transition-duration: .38s; }
    @starting-style { #admission-dialog[open] { transform: var(--dialog-shift); } }
  }
}
@media (max-aspect-ratio: 9/10) {
  .scene-square {
    inset: 0;
    width: 100%;
    mask-image: none;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: radial-gradient(ellipse at 66% 15%, var(--scene-glow, #463427) 0%, var(--night) 77%);
  }
  .scene-square img {
    position: absolute; top: clamp(-90px, calc(62svh - 110vw), 16svh);
    width: 105%; max-width: none; height: auto; flex: none;
    mask-image: linear-gradient(to bottom, transparent, #000 13%, #000 84%, transparent);
  }
  [data-scene-art="1"] img { object-position: 58% 50%; }
  .scenery::after { background: linear-gradient(to top, rgb(13 16 12 / 92%), rgb(13 16 12 / 24%) 31%, transparent 54%), radial-gradient(ellipse 58% 20% at 100% 0%, rgb(15 16 13 / 84%), transparent), linear-gradient(to bottom, rgb(18 17 12 / 54%), transparent 17%); }
}
@media (max-width: 700px) {
  :root { --edge: clamp(20px, 5.1vw, 33px); }
  .hero {
    --word-size: clamp(64px, min(20.4vw, 12svh), 116px);
    padding-block: max(23px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-bottom));
  }
  .signature { gap: 10px; }
  .symbol { height: 35px; }
  .chinese-name { width: 120px; }
  .release { gap: 6px; font-size: .72rem; }
  .release::before { width: 15px; }
  .hero-content { margin-block: 17vh clamp(23px, 4.2vh, 36px); }
  .genre { margin-bottom: 11px; font-size: .79rem; }
  .hero-foot { gap: 12px; }
  .enter-button { min-height: 48px; padding: 0 16px; gap: 16px; font-size: .95rem; }
  .enter-button svg { width: 19px; }
  .scene-switch { display: grid; grid-template-columns: repeat(2, max-content); gap: 0 clamp(10px, 3vw, 20px); }
  .scene-switch button { gap: 5px; padding: 0 1px; font-size: .75rem; white-space: nowrap; }
  .scene-switch button::before { display: none; }
  .scene-index { font-size: .62rem; }
  #admission-dialog {
    --dialog-shift: translateY(28px);
    inset: auto 0 0; width: 100%; height: auto; max-height: 93vh; max-height: 93dvh;
    padding: 14px max(23px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(23px, env(safe-area-inset-left));
    border-radius: 15px 15px 0 0;
  }
  .sheet-head { padding-bottom: 11px; }
  .entry { margin: 0; padding-block: 24px 6px; }
  .step-title { margin-bottom: 22px; }
  .field { margin-bottom: 16px; }
}
@media (max-height: 560px) and (min-aspect-ratio: 1/1) {
  .hero { --word-size: min(12vw, 17svh); padding-block: max(15px, env(safe-area-inset-top)) max(15px, env(safe-area-inset-bottom)); }
  .hero-content { margin-block: 12px 15px; }
  .genre { margin-bottom: 7px; }
  .hero-foot { padding-top: 9px; }
  .enter-button { min-height: 44px; }
  .entry { margin: 0; padding-block: 24px 6px; }
}
