:root {
  color-scheme: dark light;
  --bg: #0c0e0d;
  --panel: #151816;
  --panel-2: #1e221f;
  --text: #f2f3ed;
  --muted: #9ca29b;
  --line: rgba(242, 243, 237, 0.14);
  --accent: #a8d542;
  --ink: #10120f;
  --radius: 18px;
  --pad: clamp(20px, 6vw, 34px);
  font-family: "Arial Narrow", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { width: 100%; margin: 0; background: var(--bg); color: var(--text); overflow-x: hidden; }
button, a { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.boot {
  position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; gap: 18px;
  background: var(--bg); color: var(--muted); letter-spacing: .12em; font-size: 12px;
  transition: opacity .45s ease, visibility .45s ease;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot-line { width: 150px; height: 2px; overflow: hidden; background: var(--line); }
.boot-line i { display: block; width: 45%; height: 100%; background: var(--accent); animation: loading 1s ease-in-out infinite; }
@keyframes loading { 0% { transform: translateX(-110%); } 100% { transform: translateX(330%); } }

.app { width: 100%; max-width: 720px; min-width: 0; margin: 0 auto; background: var(--bg); overflow: hidden; }
.hero { min-width: 0; min-height: 100svh; position: relative; display: grid; grid-template-rows: auto auto 1fr auto; overflow: hidden; padding: max(18px, env(safe-area-inset-top)) var(--pad) max(22px, env(safe-area-inset-bottom)); background: #0c0e0d; color: #f2f3ed; }
.topbar { position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between; }
.wordmark { color: #f2f3ed; text-decoration: none; font-family: Impact, "Arial Black", sans-serif; font-size: 17px; letter-spacing: .08em; }
.edition { color: #9ca29b; font-size: 11px; letter-spacing: .08em; }
.hero-copy { min-width: 0; position: relative; z-index: 4; padding-top: clamp(36px, 7svh, 68px); pointer-events: none; }
.unlock { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--accent); font-size: 12px; letter-spacing: .08em; }
.unlock span { width: 24px; height: 1px; background: var(--accent); }
h1, h2, p { margin-top: 0; }
.hero h1 { max-width: 100%; margin-bottom: 14px; font-family: Impact, "Arial Black", "Microsoft YaHei UI", sans-serif; font-size: clamp(43px, 11.7vw, 72px); font-weight: 900; line-height: .98; letter-spacing: -.055em; white-space: nowrap; }
.hero h1 em { color: var(--accent); font-style: normal; }
.lead { max-width: 280px; color: #c4c8c1; font-size: 14px; line-height: 1.65; }
.character-stage { position: absolute; z-index: 1; inset: 0; margin: 0; pointer-events: none; }
.character-stage::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(12,14,13,.16) 0%, rgba(12,14,13,0) 42%, #0c0e0d 91%); }
.character-stage img { width: 100%; height: 100%; object-fit: cover; object-position: 62% center; filter: saturate(.92) contrast(1.04); animation: arrive 1.1s cubic-bezier(.2,.75,.2,1) both; }
@keyframes arrive { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: scale(1); } }
.halo { position: absolute; z-index: 1; width: 44vw; height: 44vw; max-width: 300px; max-height: 300px; right: 0; top: 34%; border: 1px solid rgba(168,213,66,.38); border-radius: 50%; box-shadow: 0 0 70px rgba(168,213,66,.09); animation: pulse 4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); opacity: .55; } }
.character-stage figcaption { position: absolute; z-index: 3; right: var(--pad); bottom: 150px; display: grid; justify-items: end; gap: 4px; font-size: 9px; letter-spacing: .15em; color: var(--muted); }
.character-stage figcaption span:first-child { color: var(--text); font-size: 11px; }
.hero-actions { position: relative; z-index: 5; display: grid; grid-template-columns: 1.18fr .82fr; gap: 10px; align-self: end; }
.primary, .secondary { min-width: 0; min-height: 52px; border-radius: 999px; padding: 0 10px; border: 1px solid transparent; cursor: pointer; font-size: 13px; white-space: nowrap; transition: transform .2s ease, background .2s ease, color .2s ease; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--accent); color: var(--ink); font-weight: 800; }
.primary:active, .secondary:active { transform: scale(.97); }
.secondary { background: rgba(12,14,13,.62); border-color: var(--line); backdrop-filter: blur(10px); }
.play-mark { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid currentColor; }
.primary.playing .play-mark { width: 8px; height: 10px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }

.identity, .sound-card, .system-story, .collector { margin: 12px; padding: clamp(24px, 7vw, 44px); border-radius: var(--radius); }
.identity { position: relative; display: grid; gap: 36px; min-height: 610px; background: #e8e9e2; color: #151714; overflow: hidden; }
.section-index { position: absolute; right: 16px; top: 6px; color: rgba(21,23,20,.09); font: 900 112px/1 Impact, sans-serif; }
.kicker { margin-bottom: 12px; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.identity .kicker { color: #62685f; }
.identity h2, .system-story h2, .collector h2 { position: relative; font-size: clamp(31px, 9vw, 54px); line-height: 1.08; letter-spacing: -.045em; }
.identity-copy > p:last-child, .story-copy > p:last-child, .collector > div p:last-child { max-width: 360px; color: #62685f; font-size: 14px; line-height: 1.75; }
.trait-board { align-self: end; display: grid; grid-template-columns: 1.3fr .7fr; gap: 8px; }
.trait-board > div { border-radius: 14px; padding: 18px; }
.trait-main { grid-row: span 2; min-height: 176px; display: flex; flex-direction: column; justify-content: space-between; background: var(--accent); }
.trait-main i { width: 48px; height: 48px; border-radius: 50%; background: #161915; box-shadow: 24px 0 0 rgba(22,25,21,.18); }
.trait-board span { color: #545a51; font-size: 10px; letter-spacing: .12em; }
.trait-board strong { display: block; font-size: 20px; }
.trait-small { min-height: 84px; background: #d3d5cd; }
.trait-small.outline { background: transparent; border: 1px solid rgba(21,23,20,.18); }

.sound-card { background: var(--panel); border: 1px solid var(--line); }
.sound-head { display: flex; align-items: end; justify-content: space-between; }
.sound-head h2 { margin: 0; font: 900 clamp(30px, 10vw, 58px)/.95 Impact, "Arial Black", sans-serif; letter-spacing: .02em; }
#timecode { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 12px; }
.waveform { width: 100%; height: 120px; margin: 24px 0 18px; padding: 0; display: flex; align-items: center; justify-content: space-between; gap: 5px; background: transparent; border: 0; cursor: pointer; }
.waveform span { flex: 1; height: var(--h); min-width: 3px; max-width: 8px; background: #555c56; border-radius: 8px; transform-origin: center; transition: background .25s ease; }
.waveform.playing span { background: var(--accent); animation: wave .72s ease-in-out infinite alternate; animation-delay: calc(var(--h) * -8ms); }
@keyframes wave { to { transform: scaleY(.35); } }
.sound-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }

.system-story { padding-bottom: 28px; background: var(--panel-2); }
.story-copy > p:last-child { color: var(--muted); }
.parts { margin-top: 42px; display: grid; justify-items: center; }
.part { width: 100%; min-height: 90px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center; padding: 18px; background: #262b27; border: 1px solid var(--line); border-radius: 15px; }
.part span { grid-row: span 2; color: var(--accent); font: 30px/1 Impact, sans-serif; }
.part b { align-self: end; }
.part small { align-self: start; color: var(--muted); }
.part.head { width: 74%; transform: rotate(-2deg); }
.part.core { min-height: 126px; background: var(--accent); color: var(--ink); transform: rotate(1deg); }
.part.core span { color: var(--ink); }
.part.core small { color: rgba(16,18,15,.62); }
.part.legs { width: 82%; transform: rotate(-1deg); }
.connector { height: 34px; display: flex; gap: 12px; align-items: center; }
.connector i { display: block; width: 5px; height: 18px; border-radius: 3px; background: #737a73; }

.collector { min-height: 560px; display: flex; flex-direction: column; justify-content: space-between; background: #d9dbd4; color: #131512; overflow: hidden; }
.serial { margin: -12px 0 38px; color: var(--accent); text-shadow: 1px 1px 0 #111, -1px -1px 0 #111, 1px -1px 0 #111, -1px 1px 0 #111; font: 900 clamp(72px, 24vw, 138px)/.78 Impact, sans-serif; letter-spacing: -.04em; transform: translateX(-5px); }
.collector .kicker { color: #62685f; }
.collector h2 { max-width: 450px; }
.collector .full { width: 100%; margin-top: 28px; }
footer { display: flex; justify-content: space-between; padding: 32px var(--pad) calc(32px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 9px; letter-spacing: .12em; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100vw - 40px); padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 12px; opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: .3s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.error-view { min-height: 100svh; padding: 12vh var(--pad); background: var(--bg); }
.error-view > span { color: var(--accent); font-size: 12px; letter-spacing: .12em; }
.error-view h1 { max-width: 520px; margin: 30px 0 20px; font-size: clamp(44px, 13vw, 76px); line-height: .98; }
.error-view p { color: var(--muted); line-height: 1.7; }
.error-view a { display: inline-block; margin-top: 24px; color: var(--ink); background: var(--accent); padding: 15px 22px; border-radius: 999px; text-decoration: none; font-weight: 800; }
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.75,.2,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (min-width: 721px) {
  body { padding: 30px 0; background: #050605; }
  .app { border: 1px solid #242824; box-shadow: 0 40px 90px rgba(0,0,0,.55); }
  .hero { min-height: 860px; }
}

@media (prefers-color-scheme: light) {
  :root { --bg: #eef0ea; --panel: #e1e4dd; --panel-2: #d4d8d0; --text: #111410; --muted: #62685f; --line: rgba(17,20,16,.16); --ink: #10120f; }
  .character-stage img { filter: saturate(.86) contrast(1.01); }
  .hero .secondary { color: #f2f3ed; background: rgba(12,14,13,.62); }
  .hero .lead { color: #c4c8c1; }
  .waveform span { background: #9ca29b; }
  .part { background: #c7cbc3; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
