:root {
  color-scheme: dark;
  --navy: #0a101d;
  --panel: #111a2b;
  --line: #3a4154;
  --cream: #f8eacb;
  --muted: #b4bcce;
  --gold: #e8bc83;
  --rose: #e4a998;
  --serif: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; min-height: 100vh; color: var(--cream); background: radial-gradient(ellipse at 42% -10%,#263652 0%,#10182a 44%,#0a101d 85%) }
button, input, a { font: inherit }
button { cursor: pointer; color: inherit }
a { color: inherit }
button:disabled { opacity: .52; cursor: default }
:focus-visible { outline: 2px solid #ffdca6; outline-offset: 4px }
.nav { max-width: 1248px; margin: auto; padding: 0 24px; height: 66px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #d6b8a22b }
.brand { letter-spacing: .19em; font-size: 11px; text-decoration: none; white-space: nowrap }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 750 }
.brand-icon { display: grid; place-items: center; color: var(--gold); height: 29px; width: 29px; border: 1px solid #e8bc834d; border-radius: 50%; font-size: 18px; letter-spacing: 0 }
main { max-width: 1248px; margin: auto; padding: 0 24px; position: relative }
.page-snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .66 }
.intro { text-align: center; padding: 34px 0 29px }
.intro h1 { font-family: var(--serif); font-size: clamp(50px,7.6vw,90px); line-height: 1.03; letter-spacing: .2em; margin: 10px -.2em 10px 0; color: #f8eace; font-weight: 700; text-shadow: 0 3px 32px #eebf9550 }
.intro p:last-child { font-size: 16px; letter-spacing: .13em; margin: 15px 0 0; color: #ddd1c3; line-height: 1.6 }
.kicker { font: 700 11px/1.2 Georgia,serif; letter-spacing: .23em; color: var(--gold); display: flex; justify-content: center; align-items: center; gap: 13px; margin: 0 }
.kicker i { width: 22px; height: 1px; background: #e8bc8370 }
.stage { display: grid; grid-template-columns: 1.85fr 1fr; gap: 16px; align-items: stretch }
.scene, .booth { border: 1px solid #ceaf8b50; border-radius: 17px; overflow: hidden; box-shadow: 0 14px 50px #05071184 }
.scene { position: relative; min-height: 415px; aspect-ratio: 1.5; background: #091020 }
.scene img, #scene { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover }
#scene { pointer-events: none }
.scene-top, .scene-bottom { position: absolute; left: 0; right: 0; display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 13px 16px }
.scene-top { top: 0 }
.scene-bottom { bottom: 0; min-height: 62px; padding-top: 24px; background: linear-gradient(transparent,#070e1bcc 70%); align-items: end }
.scene-label, .quiet { border-radius: 30px; padding: 7px 11px; border: 1px solid #ead0af60; background: #0a1222c4; color: #f7e6c8; font-size: 13px }
.scene-label { display: flex; gap: 8px; align-items: center }
.scene-label i { width: 6px; height: 6px; border-radius: 50%; background: #f4c789; box-shadow: 0 0 12px #f4c789 }
.quiet:hover { background: #32415b }
#scene-story { font-family: var(--serif); font-size: 21px; font-weight: bold; text-shadow: 0 2px 4px #000c }
#scene-count { color: #f5e0c0; font-size: 13px; white-space: nowrap }
.booth { padding: 18px; background: linear-gradient(145deg,#20283a,#12192a 57%) }
.booth-head { display: flex; align-items: center; justify-content: space-between; gap: 12px }
h2 { margin: 0; font-family: var(--serif); font-size: 23px; letter-spacing: .06em }
.booth-head p { margin: 5px 0 0; color: var(--muted); font-size: 14px }
.mode { display: flex; gap: 4px; margin: 13px 0 10px; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: #0e1626 }
.mode button { flex: 1; background: transparent; border: 0; border-radius: 6px; color: var(--muted); font-size: 14px; padding: 7px 2px }
.mode button[aria-pressed=true] { color: #ffebcc; background: #383143 }
.view { overflow: hidden; border: 1px solid #d7bc8a49; border-radius: 11px; min-height: 146px; aspect-ratio: 1.72; max-height: 240px; isolation: isolate; position: relative; background: radial-gradient(ellipse at 50% 42%,#2e303d,#151d32 70%) }
.view::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle,#cfd0dd50 .7px,transparent 1.1px); background-size: 13px 13px; opacity: .45 }
.view video, .view img, #hand { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }

#hand { object-fit: fill; pointer-events: none }
.view-corners { position: absolute; inset: 12px; border: 1px solid #e6cda380; border-radius: 7px; mask-image: conic-gradient(at 50% 50%,transparent 35deg,#000 40deg 51deg,transparent 57deg 123deg,#000 129deg 140deg,transparent 145deg 215deg,#000 220deg 231deg,transparent 237deg 303deg,#000 309deg 320deg,transparent 326deg); pointer-events: none }
.empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: #e6d8c6; font-size: 14px; text-align: center; padding: 10px }
.lens { position: relative; height: 31px; width: 44px; border: 1px solid var(--gold); border-radius: 7px; display: grid; place-items: center }
.lens::before { content: ""; position: absolute; left: 7px; top: -5px; width: 12px; height: 4px; border: 1px solid var(--gold); border-radius: 2px 2px 0 0 }
.lens::after { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--gold) }
.gesture-state, .recording, .close-camera { position: absolute; background: #0c1221e6; padding: 5px 8px; border: 1px solid #e8bc8362; border-radius: 20px; font-size: 12px }
.gesture-state { left: 10px; top: 10px }
.gesture-state[data-active=true] { color: #f8d397 }
.recording { right: 10px; top: 10px; color: #ffd9cb }
.recording::before { content: "●"; color: #ef7f77; margin-right: 5px }
.close-camera { right: 10px; bottom: 10px }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; color: #ffebc9; background: #090d1860; font: bold 64px Georgia,serif; pointer-events: none }
.actions { display: flex; gap: 8px }
.actions>* { flex: 1 }
.primary, .secondary { padding: 9px 8px; min-height: 42px; border-radius: 8px; text-decoration: none; text-align: center; display: grid; place-items: center; font-size: 15px; font-weight: 700 }
.primary { color: #312219; background: #f1cea0; border: 1px solid #f1cea0 }
.primary:hover { background: #ffe1b7 }
.secondary { background: #1e283c; color: var(--cream); border: 1px solid #606476 }
.secondary:hover { background: #2e3850 }
.booth-foot { display: flex; justify-content: space-between; align-items: start; gap: 5px; min-height: 28px; margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 1.55 }
.text-button { background: none; border: 0; color: #f2cb96; padding: 0; white-space: nowrap; font-size: 13px; text-decoration: underline; text-underline-offset: 3px }
.gestures { margin-top: 19px }
.gestures-head { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; margin-bottom: 10px }
.gestures-head h2 { font-size: 21px }
.gestures-head p { color: var(--muted); font-size: 14px; margin: 0 }
.gesture-list { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px }
.gesture-list button { display: flex; align-items: center; gap: 9px; padding: 9px 10px; text-align: left; min-height: 62px; background: #151d30e8; border: 1px solid #78697a75; border-radius: 10px }
.gesture-list button:hover, .gesture-list button[aria-pressed=true] { border-color: var(--gold); background: #372b39 }
.gesture-icon { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 7px; background: #e8bc831a; color: var(--gold); font-size: 20px }
.gesture-list strong { display: block; font-size: 14px }
.gesture-list small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px }
footer { position: relative; text-align: center; font-size: 11px; color: #b3b5c4; letter-spacing: .12em; padding: 21px 15px 24px }
footer span { color: var(--gold); margin-inline: 7px }
dialog { border: 1px solid #d0a77b80; border-radius: 14px; background: #151e30; color: var(--cream); padding: 15px; width: min(420px,calc(100% - 20px)); max-height: calc(100dvh - 20px); box-shadow: 0 12px 40px #0009 }
dialog::backdrop { background: #06070ed7; backdrop-filter: blur(5px) }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px }
.result-head button { min-width: 34px; min-height: 34px; border-radius: 50%; font-size: 22px; background: #222b40; border: 1px solid var(--line) }
dialog img, dialog video { display: block; width: auto; max-width: 100%; max-height: min(64dvh,540px); margin: 0 auto 10px; border-radius: 3px; background: #0a101d }
dialog p { text-align: center; margin: 9px 0 2px; color: var(--muted); font-size: 13px }
@media(max-width: 900px) { .stage{grid-template-columns:1.37fr 1fr} .gesture-list{grid-template-columns:repeat(3,minmax(0,1fr))} }
@media(max-width: 675px) {
  .nav { height: 55px; padding-inline: 13px }
  .brand { font-size: 9px; letter-spacing: .1em }
  main { padding-inline: 12px }
  .intro { padding: 23px 0 18px }
  .intro p:last-child { font-size: 14px; letter-spacing: .04em; margin-top: 9px }
  .stage { grid-template-columns: 1fr; gap: 10px }
  .scene { min-height: 0 }
  .booth { padding: 13px }
  .view { min-height: 125px }
  .gestures { margin-top: 14px }
  .gesture-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px }
  .gesture-list button { min-height: 55px }
  .gesture-list small { font-size: 12px }
  .camera-live .intro { padding: 10px 0 }
  .camera-live .intro h1 { font-size: 33px; margin: 0 }
  .camera-live .intro p { display: none }
}

/* The stage uses the same centered crop as the card renderer. */
.stage { grid-template-columns: minmax(0,1.55fr) minmax(320px,1fr) }
.scene { min-height: 0; aspect-ratio: 840 / 650; align-self: start; touch-action: none }
.scene img { object-position: right center }
.scene-bottom small { display: block; color: #f3ddc2; margin-top: 3px; font-size: 12px }
.gesture-list button[data-collected=true] .gesture-icon { background: #e8bc8340 }
.gesture-list button[aria-pressed=true] { box-shadow: inset 0 0 0 1px #e8bc8344 }
.view video { transform: scaleX(-1) }
@media(max-width: 675px) { .stage { grid-template-columns: 1fr } }


.booth > .actions { margin-top: 12px }

.nav-controls { display: flex; gap: 8px; align-items: center }
.nav-button { color: var(--cream); display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #e8bc835c; background: #131b2b; border-radius: 7px; min-height: 34px; padding: 4px 10px; white-space: nowrap; font-size: 13px; font-weight: 650 }
.nav-button:hover, .nav-button[aria-pressed=true] { background: #352a36; border-color: var(--gold) }
.nav-button span[aria-hidden=true] { color: var(--gold); font-size: 15px }
#language-switch { min-width: 42px }
footer span[data-i18n] { color: inherit; margin: 0 }
:lang(en) .intro h1 { letter-spacing: .045em; font-size: clamp(39px,7vw,86px) }
:lang(en) #play-hint { font-size: 12px }
@media(max-width: 380px) {
  .nav-controls { gap: 5px }
  .nav-button { padding-inline: 7px; font-size: 12px }
}

.aurora-hint { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: #c2d8da; font-size: 12px; line-height: 1.5 }
.aurora-hint > span:first-child { color: #a9d8c6; font-size: 16px }

.lens-fog { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; touch-action: none; cursor: grab; opacity: 1; transition: opacity .46s ease-out }
.lens-fog canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none }
.lens-fog:focus-visible { outline-offset: -3px }
.lens-fog.fog-clearing { opacity: 0 }
.fog-prompt { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; margin: 10px; padding: 9px 16px; border-radius: 10px; color: #172e41; background: #eef6f1ac; opacity: var(--fog-hint-opacity,1); user-select: none; pointer-events: none }
.fog-prompt strong { font-size: 18px }
.fog-prompt span { font-size: 13px; font-weight: 650 }
.fog-prompt small { font-size: 11px }
.view .close-camera, .view .gesture-state { z-index: 2 }
.view:has(.lens-fog:not([hidden])) .gesture-state { opacity: 0; pointer-events: none }

.footer-links { display: flex; justify-content: center; align-items: center; gap: 13px; margin-top: 7px }
.footer-links span { margin: 0 }
.footer-links b { color: var(--cream); letter-spacing: .04em }
