@font-face {
  font-family: Caveat;
  src: url('./assets/fonts/Caveat-VF.ttf') format('truetype');
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('./assets/fonts/EBGaramond-LatinExt.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('./assets/fonts/EBGaramond-Latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #101b20;
  --panel: #17272c;
  --panel-deep: #122126;
  --ink: #f3ecdc;
  --muted: #a9b4af;
  --line: #385053;
  --gold: #d6ac66;
  --gold-light: #f2d397;
  --danger: #e6a198;
  --display: Georgia, "Times New Roman", serif;
  --title: 'EB Garamond', Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 50% -10%, #254046 0, var(--bg) 54%); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; }
p { line-height: 1.65; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { max-width: 700px; min-height: 100dvh; margin: auto; display: grid; grid-template-rows: auto 1fr auto; border-left: 1px solid #ffffff10; border-right: 1px solid #ffffff10; }
.topbar { position: relative; min-height: 90px; padding: max(20px, env(safe-area-inset-top)) 26px 18px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); background: #101b20e8; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--gold-light); font-family: var(--display); font-weight: 700; font-size: 18px; line-height: .82; letter-spacing: .12em; }
.brand-copy { display: grid; gap: 5px; }
.brand-copy strong { font-size: 21px; line-height: 1; }
.brand-copy small { color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 9px; font-weight: 600; line-height: 1; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; font-family: Georgia, serif; font-size: 23px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.connection { max-width: 115px; color: var(--muted); font-size: 10px; line-height: 1.3; text-align: right; }
.icon-button { width: 40px; height: 40px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--gold-light); font-size: 24px; line-height: 1; }
.icon-button:hover { border-color: var(--gold); background: #d6ac6615; }
.app-shell.has-timer .scene, .app-shell.has-timer .loading { padding-top: calc(clamp(36px, 7vw, 72px) + 54px); }

main { display: block; width: 100%; }
.scene, .loading { padding: clamp(36px, 7vw, 72px) clamp(24px, 6vw, 58px) 90px; animation: appear .35s ease both; }
.scene-top { display: flex; align-items: center; gap: 14px; }
.scene-rule { height: 1px; flex: 1; background: linear-gradient(90deg, var(--gold), transparent); opacity: .55; }
.eyebrow, .small-label { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
h1, h2 { font-family: var(--title); font-weight: 600; line-height: 1.02; }
h1 { margin: 20px 0 28px; font-size: clamp(36px, 9vw, 54px); line-height: 1.04; letter-spacing: -.02em; }
h2 { margin: 8px 0 0; font-size: 36px; }
.scene > p { max-width: 57ch; color: var(--muted); font-size: 16px; }
.scene > p strong { color: var(--ink); }
.mission-stamp { margin: 38px 0 42px; width: fit-content; padding: 8px 16px; border: 1px solid var(--line); color: var(--gold); font-family: Caveat, var(--display); font-size: 31px; font-weight: 600; line-height: 1.05; transform: rotate(-2deg); }
.start-scene .mission-stamp { margin: 32px 0 12px; }
.start-scene h1 { margin-top: 24px; font-size: clamp(29px, 9vw, 56px); font-weight: 500; }
.start-scene .button { margin-top: 44px; }
.confirmation-mark { margin: 28px auto 24px; text-align: center; }
.seal-medallion { width: 128px; height: 128px; margin: 0 auto 14px; display: grid; place-items: center; border: 1px solid #bba16f; border-radius: 50%; background: radial-gradient(circle at 38% 30%, #ebdbb8, #d5bd91); box-shadow: 0 0 0 5px #d6ac661a, inset 0 0 0 5px #ead8b2; }
.seal-medallion img { width: 96px; height: 96px; object-fit: contain; }
.confirmation-mark p { margin: 0; }
.confirmation-mark span { display: block; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.confirmation-mark strong { display: block; margin-top: 3px; color: var(--ink); font-family: var(--title); font-size: 31px; font-weight: 600; line-height: 1; }
.start-ready-scene h1 { margin: 9px 0 20px; text-align: center; }
.start-ready-scene > p { margin: 0 auto; text-align: center; }
.start-ready-scene > .button { width: min(100%, 420px); margin-right: auto; margin-left: auto; }
.key-accepted-scene { text-align: center; }
.key-accepted-scene h1 { margin-top: 16px; }
.key-accepted-scene > p { margin: 0 auto 30px; }
.key-accepted-scene > .button { width: min(100%, 420px); margin-right: auto; margin-left: auto; }
.mission-clock { margin: 27px 0 23px; padding: 20px 0 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.mission-clock .small-label { display: block; margin-bottom: 8px; }
.mission-clock strong { display: block; color: var(--gold-light); font-family: var(--title); font-size: clamp(53px, 15vw, 78px); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .035em; line-height: 1; }
.mission-clock strong.expired { color: var(--danger); }
.route-map-card { margin: 30px 0; overflow: hidden; border: 1px solid #a89775; background: #d8c8a5; color: #2c3431; box-shadow: 4px 5px 0 #0002; }
.route-map-art { height: 88px; overflow: hidden; border-bottom: 1px solid #ad9b79; background: #c9bb9a; }
.route-map-art svg { display: block; width: 100%; height: 100%; }
.map-streets { fill: none; stroke: #766e5b; stroke-width: 2; opacity: .5; }
.map-route { fill: none; stroke: #4f4f3f; stroke-width: 3; stroke-dasharray: 4 8; stroke-linecap: round; }
.map-origin { fill: #d8c8a5; stroke: #5b5a48; stroke-width: 3; }
.map-destination { fill: #755a3e; stroke: #d8c8a5; stroke-width: 3; }
.map-compass circle:first-child { fill: #d8c8a5; stroke: #755f43; stroke-width: 2; }
.map-compass path { fill: #755f43; stroke: #755f43; stroke-width: 1; }
.map-compass circle:last-child { fill: #d8c8a5; }
.route-map-copy { padding: 17px 21px 22px; }
.route-map-copy .small-label { color: #715b3d; }
.route-map-copy p { margin: 7px 0 0; font-family: var(--title); font-size: clamp(22px, 5.5vw, 27px); font-weight: 600; line-height: 1.2; }
.safety-note { margin: 30px 0; font-size: 13px !important; color: #91a29d !important; }
.answer-form { margin: 30px 0 20px; }
.start-question-scene .answer-form { margin-top: 32px; }
.question-card { position: relative; margin: 0 3px 22px 0; padding: 22px 23px 28px; background: #e0cfaa; clip-path: polygon(0 0, calc(100% - 19px) 0, 100% 19px, 100% 100%, 0 100%); box-shadow: inset 0 0 0 1px #b6a17b; }
.question-card::after { content: ''; position: absolute; top: 0; right: 0; width: 19px; height: 19px; background: #907a5b; clip-path: polygon(0 0, 0 100%, 100% 100%); }
.question-card .small-label { display: block; margin-bottom: 8px; color: #765737; font-family: Caveat, var(--display); font-size: 26px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.answer-form label { display: block; color: #23302e; font-family: var(--display); font-size: clamp(24px, 5vw, 30px); font-weight: 600; line-height: 1.23; }
.question-note { margin: 18px 0 0; padding-top: 13px; border-top: 1px solid #9e8c6d; color: #5c574a; font-size: 14px; line-height: 1.45; }
.answer-form input { width: 100%; height: 62px; padding: 0 18px; border: 1px solid #64807b; border-radius: 3px; background: #0d181c; color: var(--ink); font-size: 23px; letter-spacing: .08em; }
.answer-form input::placeholder { color: #89958f; font-size: 16px; letter-spacing: 0; }
.answer-form input[aria-invalid="true"] { border-color: var(--danger); }
.answer-error { margin: 9px 0 2px; color: var(--danger); font-size: 13px; font-weight: 600; line-height: 1.45; }
.button { width: 100%; min-height: 58px; margin-top: 14px; padding: 15px 19px; display: flex; justify-content: space-between; align-items: center; gap: 15px; border: 1px solid var(--gold); border-radius: 3px; background: var(--gold); color: #111b1e; font-size: 15px; font-weight: 700; text-align: left; }
.button:hover { background: var(--gold-light); border-color: var(--gold-light); }
.button span { font-size: 22px; font-weight: 400; }
.button-secondary { border-color: var(--line); background: transparent; color: var(--ink); }
.button-secondary:hover { border-color: var(--gold); background: #d6ac6610; }
.quiet-button { margin-top: 5px; padding: 10px 0; border: 0; background: transparent; color: var(--gold-light); font-size: 15px; font-weight: 700; text-align: left; text-decoration: underline; text-underline-offset: 5px; }
.quiet-button:hover { color: var(--ink); }
.hints { margin: 26px 0 36px; }
.answer-form .hints { margin: 0 0 24px; }
.hint-button { position: relative; min-height: 48px; max-width: 100%; padding: 11px 29px 11px 15px; border: 0; background: linear-gradient(225deg, transparent 0 13px, #d8c79e 13px); color: #28332f; text-align: left; font-family: var(--title); font-size: 20px; font-weight: 600; line-height: 1.15; }
.hint-button::after { content: ''; position: absolute; top: 0; right: 0; width: 13px; height: 13px; background: #978361; clip-path: polygon(0 0, 0 100%, 100% 100%); }
.hint-button:hover { background: linear-gradient(225deg, transparent 0 13px, #ead7af 13px); }
.hint-record { margin: 0; }
#hint-dialog .hint-record:focus { outline: none; }
.audit-hints ol { margin: 0 0 8px; padding: 0 0 0 25px; color: var(--muted); }
.audit-hints li { margin-bottom: 13px; padding-left: 7px; line-height: 1.6; }
.audit-hints li::marker { color: var(--gold); }
.artifact-quote { margin: 0 0 18px; color: var(--gold-light); font-family: Caveat, var(--display); font-size: 28px; font-style: italic; font-weight: 600; line-height: 1.12; }
.hint-artifact { margin: 8px 0 22px; }
.hint-artifact img { display: block; width: 100%; height: auto; border: 1px solid var(--gold); background: #dfcca6; }
.hint-artifact figcaption { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.record-note { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.notice { margin: 14px 0 !important; color: var(--danger) !important; font-size: 13px !important; font-weight: 600; }
.time-warning { margin: -20px 0 32px; padding: 14px 16px; border: 1px solid var(--gold); background: #d6ac6615; color: var(--gold-light); font-size: 13px; line-height: 1.5; }

.reward-scene { text-align: center; }
.reward-scene h1 { margin: 6px 0 24px; color: var(--ink); font-size: clamp(32px, 8vw, 42px); letter-spacing: 0; overflow-wrap: anywhere; }
.reward-scene > p { margin: 0 auto 34px; }
.role-shift { margin: 35px 0; padding: 25px 10px; display: flex; justify-content: center; gap: 18px; border-block: 1px solid var(--line); color: var(--muted); font-size: 14px; letter-spacing: .12em; }
.role-shift strong { color: var(--gold-light); }
.fragment-list { margin: 30px 0; display: grid; gap: 8px; }
.fragment-item, .fragment-option { min-height: 64px; padding: 13px 16px; display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); background: var(--panel-deep); }
.fragment-item .roman { width: 25px; color: var(--gold); font-family: var(--display); font-size: 20px; }
.fragment-item strong, .fragment-option strong { color: var(--ink); font-family: var(--display); font-size: 25px; font-weight: 600; letter-spacing: .03em; }
.fragment-item > span:last-child { margin-left: auto; color: var(--muted); font-size: 11px; text-align: right; }
.fragment-option { width: 100%; color: var(--ink); text-align: left; cursor: pointer; }
.fragment-choices { min-width: 0; }
.fragment-option:hover:not(:disabled) { border-color: var(--gold); }
.fragment-option:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; }
.fragment-option:disabled { opacity: .38; cursor: not-allowed; }
.fragment-option.selected { border-color: var(--gold); background: #d6ac6618; }
.fragment-option.selected strong { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--danger); }
.fragment-option > span:first-child { display: grid; gap: 2px; }
.fragment-option small { color: var(--muted); font-size: 11px; }
.fragment-option .fragment-cross { width: 31px; height: 31px; margin-left: auto; flex: none; fill: none; stroke: var(--gold-light); stroke-width: 2.4; stroke-linecap: round; opacity: .45; transform: rotate(-8deg); }
.fragment-option.selected .fragment-cross { color: var(--danger); opacity: 1; }
.fragment-option.selected .fragment-cross { stroke: var(--danger); }
.sort-list { margin: 28px 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.sort-item { min-height: 72px; padding: 10px 11px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); background: var(--panel-deep); }
.sort-position { min-width: 22px; color: var(--gold); font-family: var(--title); font-size: 24px; }
.sort-record { min-width: 0; flex: 1; display: grid; gap: 3px; }
.sort-record strong { overflow-wrap: anywhere; font-family: var(--title); font-size: 19px; line-height: 1.1; font-weight: 600; }
.sort-record small { color: var(--muted); font-size: 11px; letter-spacing: .05em; }
.sort-controls { display: flex; gap: 5px; }
.sort-controls button { width: 37px; height: 42px; border: 1px solid var(--line); border-radius: 2px; background: var(--panel); color: var(--gold-light); font-size: 22px; line-height: 1; }
.sort-controls button:hover:not(:disabled) { border-color: var(--gold); }
.sort-controls button:disabled { opacity: .3; cursor: default; }
.handoff-scene { background: radial-gradient(circle at 50% 35%, #34444655, transparent 58%); text-align: center; }
.handoff-scene h1 { margin-bottom: 18px; }
.handoff-scene > p { margin-right: auto; margin-left: auto; }
.handoff-path { position: relative; width: min(100%, 460px); height: 48px; margin: 29px auto 20px; display: grid; place-items: center; }
.handoff-path::before, .handoff-path::after { content: ''; position: absolute; top: 50%; width: calc(50% - 30px); border-top: 2px solid var(--gold); }
.handoff-path::before { left: 0; border-top-style: dashed; opacity: .45; }
.handoff-path::after { right: 0; }
.handoff-path-seal { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; background: #dfcba4; color: #5c4732; font-family: var(--display); font-size: 27px; line-height: 1; box-shadow: 0 0 0 5px #d6ac661a; }
.handoff-ticket { width: min(100%, 460px); margin: 0 auto 28px; padding: 24px 26px 28px; border: 1px solid #8c754f; border-left: 5px solid var(--gold); background: linear-gradient(135deg, #1d2c2f, #172427); text-align: left; box-shadow: 5px 6px 0 #0003; }
.handoff-ticket p { margin: 13px 0 0; color: var(--ink); font-family: var(--title); font-size: clamp(24px, 5.7vw, 29px); font-weight: 600; line-height: 1.2; }
.handoff-scene > .button { width: min(100%, 460px); margin-right: auto; margin-left: auto; }
.app-shell.is-intrusion { background: #0a1115; }
.app-shell.is-intrusion .topbar { display: none; }
.intrusion-scene { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; background: radial-gradient(circle at 50% 43%, #472c3150, transparent 58%); }
.intrusion-status { width: fit-content; padding: 0 0 12px; border-bottom: 1px solid #ae736e; color: var(--danger); font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.intrusion-scene h1 { max-width: 13ch; margin: 30px 0 54px; color: var(--danger); font-size: clamp(38px, 9vw, 58px); line-height: 1.07; }
.intrusion-action { align-self: flex-start; min-height: 48px; padding: 9px 0; display: inline-flex; align-items: center; gap: 14px; border: 0; border-bottom: 1px solid #ac7770; background: transparent; color: var(--ink); font-size: 16px; font-weight: 700; }
.intrusion-action:hover { color: var(--danger); border-color: var(--danger); }
.intrusion-action span { color: var(--danger); font-size: 25px; font-weight: 400; line-height: 1; }
.audit-hints { margin: 28px 0; padding: 20px; border: 1px solid var(--line); background: var(--panel); }
.audit-hints ol { margin-top: 16px; }
.code-panel { margin: 34px 0; padding: 24px 22px; border: 1px solid var(--gold); background: radial-gradient(circle at 50% 0, #38514c, var(--panel-deep)); text-align: center; }
.code-digits { margin: 20px 0 4px; display: flex; justify-content: center; gap: 7px; }
.code-digits span { width: clamp(44px, 13vw, 70px); height: clamp(66px, 18vw, 82px); display: grid; place-items: center; border: 1px solid #c59e62; background: #0c171a; color: var(--gold-light); font-family: var(--display); font-size: clamp(43px, 12vw, 64px); line-height: 1; }
.app-shell.is-attack { background: #0b1216; }
.app-shell.is-attack .topbar { display: none; }
.attack-scene { min-height: 100dvh; background: radial-gradient(circle at 50% 28%, #613a3b42, transparent 62%); }
.attack-signal { max-width: 560px; margin: 0 auto 26px; color: var(--danger); font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.attack-document { position: relative; max-width: 560px; margin: 0 auto; padding: 30px clamp(23px, 6vw, 42px) 34px; overflow: hidden; border: 1px solid #9a7466; background: radial-gradient(circle at 8% 9%, #8d534223, transparent 32%), radial-gradient(circle at 91% 82%, #5b342524, transparent 30%), #dcc7a7; box-shadow: 8px 9px 0 #8d5c5740, 15px 17px 0 #0007; color: #392c29; clip-path: polygon(0 0, 22% 0, 23% 5px, 60% 1px, 61% 5px, 100% 0, 100% 83%, calc(100% - 7px) 85%, 100% 88%, 100% 100%, 66% calc(100% - 4px), 34% 100%, 0 calc(100% - 2px), 0 19%, 6px 17%, 0 14%); transform: rotate(-.65deg); }
.attack-document::after { content: ''; position: absolute; top: 0; right: 17%; width: 1px; height: 100%; background: #5e403020; transform: rotate(2deg); pointer-events: none; }
.attack-crest { width: 110px; height: 110px; margin: -5px auto 7px; display: block; object-fit: contain; filter: saturate(.74) brightness(.88); }
.attack-document-label { display: block; color: #67483c; font-size: 10px; font-weight: 800; letter-spacing: .25em; text-align: center; text-transform: uppercase; }
.attack-document h1 { margin: 9px 0 18px; color: #3a2926; font-size: clamp(33px, 8vw, 51px); line-height: .98; text-align: center; overflow-wrap: anywhere; }
.attack-motto { margin: 0; color: #5e3931; font-family: var(--title); font-size: clamp(24px, 5.6vw, 30px); font-style: italic; font-weight: 600; line-height: 1.1; text-align: center; }
.attack-translation { margin: 8px 0 23px; color: #65574c; font-size: 12px; line-height: 1.4; text-align: center; }
.attack-message { padding-top: 21px; border-top: 1px solid #8b7162; }
.attack-message p { margin: 0 0 17px; color: #352d29; font-size: 16px; font-weight: 600; line-height: 1.45; }
.attack-message p:last-child { margin-bottom: 0; }
.attack-recover { width: min(100%, 560px); min-height: 58px; margin: 32px auto 0; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #ae736e; background: #1b2023; color: var(--ink); font-size: 16px; font-weight: 700; text-align: left; }
.attack-recover:hover { border-color: var(--danger); background: #2b2022; }
.attack-recover span { color: var(--danger); font-size: 24px; font-weight: 400; }
.latin { color: var(--gold-light) !important; font-family: var(--display); font-size: 27px !important; font-style: italic; }
.translation { margin-top: -16px; font-size: 12px !important; }
.letter { margin: 30px 0; padding: 28px 25px; border: 1px solid #dcc69e; background: #e4d4af; box-shadow: 6px 8px 0 #0004; color: #273333; transform: rotate(-1deg); }
.letter .small-label { color: #765b37; }
.letter p { font-family: var(--display); font-size: 25px; line-height: 1.25; }
.letter p:last-child { text-align: right; }
.complete-scene .ending-lead { margin-top: 36px; }
.ending { margin: 30px 0 35px; color: var(--ink) !important; font-family: var(--title); font-size: clamp(29px, 6.6vw, 37px) !important; font-weight: 600; line-height: 1.16 !important; }
.complete-scene > .button { width: min(100%, 420px); margin-top: 46px; }
.app-shell.is-prize { background: #0c171a; }
.app-shell.is-prize .topbar { display: none; }
.prize-scene { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; background: radial-gradient(circle at 50% 43%, #4f48384a, transparent 65%); }
.ending-envelope { position: relative; max-width: 520px; margin: 54px 0 0; padding: 100px 27px 34px; overflow: hidden; border: 1px solid #b39667; background: #e6d3af; box-shadow: 6px 8px 0 #0004; color: #2d3430; }
.prize-scene .ending-envelope { width: min(100%, 520px); margin: 0 auto; padding-top: 108px; padding-bottom: 42px; transform: rotate(-.5deg); }
.envelope-flap { position: absolute; inset: 0 0 auto; height: 72px; background: #cdb58b; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.envelope-seal { position: absolute; z-index: 1; top: 35px; left: calc(50% - 29px); width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid #9e7450; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e8d7b4, #c9ae7d); box-shadow: 0 3px 7px #715a3d55; }
.envelope-seal img { width: 40px; height: 40px; object-fit: contain; }
.ending-envelope .envelope-message { margin: 0; color: #273331; font-family: var(--title); font-size: clamp(29px, 7.8vw, 40px); font-weight: 600; line-height: 1.12; }
.ending-envelope .envelope-message + .envelope-message { margin-top: 26px; }
.final-motto { margin-top: 45px; }

.hanging-timer { position: absolute; z-index: 2; top: calc(100% - 1px); left: 50%; display: flex; flex-direction: column; align-items: center; pointer-events: none; transform: translateX(-50%); }
.hanging-timer[hidden] { display: none; }
.hanging-timer::before { content: ''; width: 1px; height: 12px; background: var(--gold); box-shadow: 2px 0 0 #554934; }
#timer { display: block; padding: 7px 13px 5px; border: 1px solid #a78550; border-radius: 3px; background: #0d171b; box-shadow: 0 6px 16px #0007; color: var(--gold-light); font-family: var(--title); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .025em; line-height: 1; white-space: nowrap; }
#timer.expired { color: var(--danger); }

dialog { width: min(100% - 24px, 600px); max-height: min(90dvh, 800px); padding: 0; border: 1px solid var(--gold); background: var(--bg); color: var(--ink); box-shadow: 0 25px 80px #000b; }
dialog::backdrop { background: #050b0de8; }
#hint-dialog { width: min(100% - 16px, 640px); max-height: calc(100dvh - 16px); margin: auto; overflow-y: auto; overscroll-behavior: contain; }
.hint-dialog-head { position: sticky; z-index: 1; top: 0; padding: max(6px, env(safe-area-inset-top)) 16px 6px; display: flex; justify-content: flex-end; border-bottom: 1px solid var(--line); background: var(--bg); }
#hint-close { min-height: 44px; padding: 7px 4px 7px 12px; display: flex; align-items: center; gap: 14px; border: 0; background: transparent; color: var(--gold-light); font-size: 14px; font-weight: 700; }
#hint-close span { font-size: 28px; font-weight: 400; line-height: 1; }
#hint-content { padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); }
#hint-dialog .artifact-quote { margin-bottom: 12px; }
#hint-dialog .hint-artifact { margin: 6px 0 12px; }
#hint-dialog .hint-artifact img { width: auto; max-width: 100%; max-height: 56dvh; margin: 0 auto; object-fit: contain; }
.dialog-head { padding: 25px 24px 20px; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 32px; }
#archive-content { padding: 0 24px; }
.dialog-description { color: var(--muted); font-size: 13px; }
.dialog-foot { padding: 15px 24px 26px; border-top: 1px solid var(--line); }
.text-button { padding: 8px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--ink); }

@keyframes appear { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; } }
@media (max-width: 420px) {
  .topbar { padding-left: 18px; padding-right: 18px; }
  .scene, .loading { padding-left: 22px; padding-right: 22px; }
  .connection { max-width: 92px; font-size: 9px; }
  .fragment-item > span:last-child { max-width: 90px; }
}
@media (max-width: 350px) {
  .hint-button { padding-right: 22px; font-size: 17px; }
  .brand { gap: 8px; }
  .brand-mark { width: 32px; height: 32px; font-size: 19px; }
  .brand-copy strong { font-size: 18px; }
  .brand-copy small { font-size: 8px; }
  .topbar-right { gap: 6px; }
  .connection { max-width: 60px; font-size: 8px; }
  .icon-button { width: 36px; height: 36px; }
}
