:root {
  color-scheme: dark;
  --ink: #f7f1e6;
  --muted: rgba(247, 241, 230, .66);
  --wine: #8d1d2c;
  --navy: #0b2747;
  --gold: #d9aa55;
  --parallax-x: 0;
  --parallax-y: 0;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #071323; }
body { font-family: "Hiragino Sans", "Yu Gothic", YuGothic, system-ui, sans-serif; color: var(--ink); }
button { font: inherit; }

.app { position: relative; width: 100%; height: 100%; height: 100dvh; overflow: hidden; isolation: isolate; background: radial-gradient(circle at 70% 20%, #17395b, #071323 58%, #03080f); }
.camera { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s ease; transform: scaleX(-1); }
.app[data-camera="environment"] .camera { transform: none; }
.app[data-state="scanning"] .camera, .app[data-state="active"] .camera { opacity: 1; }
.camera-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2,7,14,.55), transparent 28%, transparent 66%, rgba(2,7,14,.72)); pointer-events: none; }
.app[data-state="welcome"] .camera-shade { background: radial-gradient(circle at 74% 22%, rgba(30,69,105,.9), #071323 65%, #03080f); }

.topbar { position: absolute; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: max(18px, env(safe-area-inset-top)) 18px 12px; }
.brand-lockup { display: flex; gap: 9px; align-items: center; }
.brand-mark { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 27px; letter-spacing: -.08em; font-weight: 700; }
.brand-copy { font-family: Arial, sans-serif; font-size: 7px; line-height: 1.25; letter-spacing: .17em; color: var(--muted); }
.tracking-status { display: flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.13); background: rgba(4,10,18,.35); backdrop-filter: blur(12px); border-radius: 99px; padding: 8px 11px; font: 600 9px/1 Arial, sans-serif; letter-spacing: .14em; }
.tracking-dot { width: 6px; height: 6px; border-radius: 50%; background: #8391a0; box-shadow: 0 0 0 4px rgba(131,145,160,.1); }
.app[data-state="scanning"] .tracking-dot { background: #e8bd63; animation: pulse 1s infinite; }
.app[data-state="active"] .tracking-dot { background: #6ee7a0; box-shadow: 0 0 10px #6ee7a0; }

.panel { position: absolute; z-index: 10; }
.welcome { inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 96px 24px max(65px, calc(env(safe-area-inset-bottom) + 42px)); background: linear-gradient(115deg, rgba(5,12,23,.98) 0%, rgba(7,19,35,.86) 52%, rgba(7,19,35,.22) 100%); transition: opacity .5s, visibility .5s; }
.welcome::before { content: "遊"; position: absolute; z-index: -1; right: -8vw; top: 6vh; font: 700 min(54vw, 380px)/1 "Yu Mincho", serif; color: transparent; -webkit-text-stroke: 1px rgba(213,173,96,.14); transform: rotate(-5deg); }
.eyebrow { margin: 0 0 18px; color: var(--gold); font: 700 10px/1 Arial, sans-serif; letter-spacing: .22em; }
.welcome h1 { margin: 0; max-width: 680px; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(38px, 10.5vw, 76px); line-height: 1.18; font-weight: 500; letter-spacing: .02em; text-shadow: 0 14px 44px rgba(0,0,0,.4); }
.welcome h1 span { font-size: .58em; letter-spacing: .06em; }
.lead { max-width: 520px; margin: 22px 0 28px; font-size: 13px; line-height: 1.9; color: var(--muted); }
.welcome-actions { display: grid; gap: 10px; max-width: 390px; }
.button { border: 0; border-radius: 14px; min-height: 54px; padding: 0 20px; cursor: pointer; touch-action: manipulation; font-weight: 700; letter-spacing: .03em; }
.button-primary { color: #111827; background: linear-gradient(135deg, #f3d492, #d9aa55); box-shadow: 0 12px 30px rgba(184,128,41,.28); }
.button-secondary { color: var(--ink); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); }
.button-icon { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-right: 8px; border-radius: 50%; background: rgba(7,19,35,.13); }
.marker-link { justify-self: center; padding: 4px; color: rgba(255,255,255,.58); font-size: 9px; letter-spacing: .04em; text-underline-offset: 3px; }
.trust-row { display: flex; align-items: center; gap: 11px; margin-top: 18px; color: rgba(255,255,255,.44); font-size: 9px; letter-spacing: .05em; }
.trust-row i { width: 2px; height: 2px; border-radius: 50%; background: rgba(255,255,255,.4); }

.scanner { position: absolute; z-index: 8; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; }
.scan-frame { position: relative; width: min(82vw, 470px); aspect-ratio: 1.414 / 1; display: grid; place-items: center; background: rgba(255,255,255,.04); backdrop-filter: blur(2px); overflow: hidden; }
.marker-ghost { width: 100%; height: 100%; object-fit: cover; opacity: .1; filter: grayscale(1); }
.corner { position: absolute; z-index: 2; width: 38px; height: 38px; border-color: #f1cd83; border-style: solid; filter: drop-shadow(0 0 8px rgba(241,205,131,.45)); }
.c1 { top: 0; left: 0; border-width: 2px 0 0 2px; }.c2 { top: 0; right: 0; border-width: 2px 2px 0 0; }.c3 { bottom: 0; right: 0; border-width: 0 2px 2px 0; }.c4 { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.scan-line { position: absolute; z-index: 2; left: 5%; right: 5%; top: 4%; height: 1px; background: linear-gradient(90deg, transparent, #eec873, transparent); box-shadow: 0 0 14px #eec873; animation: scan 2.4s ease-in-out infinite; }
.scan-title { margin: 22px 0 6px; font-family: "Yu Mincho", serif; font-size: 16px; letter-spacing: .06em; }
.scan-hint { margin: 0; width: 80%; text-align: center; font-size: 10px; color: rgba(255,255,255,.65); line-height: 1.7; }
.text-button { margin-top: 25px; padding: 10px; color: rgba(255,255,255,.72); background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.25); font-size: 10px; cursor: pointer; }

.world { position: absolute; z-index: 5; inset: 0; opacity: 0; visibility: hidden; perspective: 900px; transition: opacity 1s ease .15s, visibility 1s; }
.portal { position: absolute; left: 50%; top: 45%; width: min(88vw, 660px); aspect-ratio: 1.45; transform-style: preserve-3d; transform: translate(-50%, -50%) rotateX(calc(var(--parallax-y) * 2deg)) rotateY(calc(var(--parallax-x) * -2.5deg)); transition: transform .15s ease-out; }
.depth-stage { position: absolute; inset: 7% 2% 10%; transform-style: preserve-3d; border-radius: 50% 50% 44% 44% / 58% 58% 34% 34%; overflow: hidden; background: linear-gradient(#ffd89b, #ee976f 45%, #233c56 46%, #09111c 80%); box-shadow: inset 0 -30px 55px rgba(1,6,13,.7), 0 35px 70px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.1); animation: portalOpen 1.3s cubic-bezier(.2,.8,.2,1) both; }
.aura { position: absolute; inset: 7% 2% 10%; border-radius: 50%; border: 1px solid rgba(238,194,109,.34); animation: aura 3.5s ease-in-out infinite; }
.aura-two { inset: 1% -4% 4%; animation-delay: -1.6s; opacity: .35; }
.depth { position: absolute; transition: transform .15s ease-out, opacity .45s; }
.depth-5 { transform: translate(calc(var(--parallax-x) * -3px), calc(var(--parallax-y) * -2px)); }
.depth-4 { transform: translate(calc(var(--parallax-x) * -7px), calc(var(--parallax-y) * -4px)) translateZ(12px); }
.depth-3 { transform: translate(calc(var(--parallax-x) * -13px), calc(var(--parallax-y) * -6px)) translateZ(25px); }
.depth-2 { transform: translate(calc(var(--parallax-x) * -21px), calc(var(--parallax-y) * -8px)) translateZ(45px); }
.depth-1 { transform: translate(calc(var(--parallax-x) * -30px), calc(var(--parallax-y) * -10px)) translateZ(75px); }
.sky-glow { inset: -30%; background: radial-gradient(circle at 55% 34%, rgba(255,246,203,.8), transparent 23%); }
.sun { width: 13%; aspect-ratio: 1; left: 60%; top: 17%; border-radius: 50%; background: #fff0b8; box-shadow: 0 0 32px #ffd786; }
.mountains { left: -5%; right: -5%; height: 52%; bottom: 22%; }
.mountains i { position: absolute; bottom: 0; width: 58%; height: 82%; background: linear-gradient(145deg, #375670, #15293d); clip-path: polygon(0 100%, 48% 8%, 63% 38%, 76% 18%, 100% 100%); }
.mountains i:nth-child(2) { left: 30%; height: 100%; opacity: .9; }.mountains i:nth-child(3) { right: -10%; height: 70%; opacity: .75; }
.mountains-front { bottom: 6%; filter: brightness(.58) saturate(1.3); }
.mountains-front i { background: linear-gradient(145deg, #8e3430, #361e27); }
.torii { left: 20%; bottom: 18%; width: 18%; height: 34%; border-left: 8px solid #8e2d29; border-right: 8px solid #8e2d29; filter: drop-shadow(0 8px 7px rgba(0,0,0,.3)); }
.torii::before, .torii::after { content: ""; position: absolute; left: -30%; right: -30%; height: 8px; background: #a73b2d; border-radius: 3px; }
.torii::before { top: 0; }.torii::after { top: 18%; left: -15%; right: -15%; height: 5px; }
.road { left: 43%; bottom: -10%; width: 42%; height: 62%; background: linear-gradient(95deg, transparent 6%, rgba(243,216,169,.78) 10% 86%, transparent 91%); clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%); opacity: .8; }
.road i { position: absolute; left: 50%; top: 18%; bottom: 0; border-left: 2px dashed rgba(255,255,255,.55); transform: translateX(-50%); }
.bus { right: 15%; bottom: 20%; width: 26%; height: 19%; border-radius: 9px 9px 5px 5px; background: linear-gradient(180deg, #f8f0de 0 58%, #812230 59%); box-shadow: -9px 11px 18px rgba(0,0,0,.35); }
.bus::before { content: "YUSAN"; position: absolute; right: 8%; top: 62%; font: 700 6px Arial; letter-spacing: .12em; color: #f4d38e; }
.bus-window { position: absolute; top: 14%; height: 34%; width: 21%; border-radius: 2px; background: linear-gradient(140deg, #172b3c, #6890a1); }.w1 { left: 8%; }.w2 { left: 34%; }.w3 { left: 60%; }
.bus-wheel { position: absolute; bottom: -9%; width: 13%; aspect-ratio: 1; border-radius: 50%; background: #10151a; border: 2px solid #77808a; }.bw1 { left: 17%; }.bw2 { right: 14%; }
.stage-rim { position: absolute; left: 4%; right: 4%; bottom: -3%; height: 22%; border-radius: 50%; border: 1px solid rgba(241,209,150,.36); background: radial-gradient(ellipse, rgba(20,35,48,.5), rgba(3,8,14,.9)); transform: rotateX(58deg); }

.particles { inset: 0; overflow: hidden; pointer-events: none; }
.particle { position: absolute; top: -10%; width: 10px; height: 7px; border-radius: 90% 15% 90% 15%; background: var(--particle, #b6402e); opacity: .8; animation: drift var(--duration, 6s) linear infinite; animation-delay: var(--delay, 0s); left: var(--x, 50%); }
.destination-card { left: 9%; bottom: 5%; padding: 10px 13px; min-width: 178px; border-left: 2px solid var(--gold); background: linear-gradient(90deg, rgba(3,9,16,.8), rgba(3,9,16,.16)); backdrop-filter: blur(8px); }
.destination-card span, .destination-card small { display: block; font: 600 7px/1.2 Arial, sans-serif; letter-spacing: .15em; color: #e4bd6d; }
.destination-card strong { display: block; margin: 5px 0; font: 500 17px/1.2 "Yu Mincho", serif; letter-spacing: .08em; }.destination-card small { color: rgba(255,255,255,.55); font-size: 6px; }

.concierge { position: absolute; z-index: 3; right: -2%; bottom: 11%; width: min(42vw, 280px); height: 54%; transform: translateX(110%) translateZ(100px); transition: transform 1s cubic-bezier(.18,.8,.24,1) .7s; pointer-events: none; }
.concierge img { position: absolute; z-index: 2; right: -8%; bottom: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom right; filter: drop-shadow(-12px 18px 18px rgba(0,0,0,.4)); }
.concierge-halo { position: absolute; z-index: 1; width: 75%; aspect-ratio: 1; right: 0; top: 12%; border-radius: 50%; background: radial-gradient(circle, rgba(245,204,126,.35), transparent 68%); }
.speech-card { position: absolute; z-index: 4; right: 62%; bottom: 7%; width: min(66vw, 330px); padding: 15px 16px; border: 1px solid rgba(255,255,255,.18); border-radius: 13px 13px 3px 13px; background: linear-gradient(135deg, rgba(5,16,29,.92), rgba(15,40,64,.8)); box-shadow: 0 15px 36px rgba(0,0,0,.35); backdrop-filter: blur(14px); pointer-events: auto; opacity: 0; transform: translateY(12px); transition: opacity .7s 1.4s, transform .7s 1.4s; }
.speech-label { color: var(--gold); font: 700 7px/1 Arial, sans-serif; letter-spacing: .18em; }
.speech-card p { margin: 8px 0 10px; font-size: 11px; line-height: 1.7; color: rgba(255,255,255,.88); }
.voice-button { display: flex; align-items: center; gap: 7px; padding: 6px 10px; color: #f0cd85; border: 1px solid rgba(235,193,111,.25); border-radius: 99px; background: rgba(217,170,85,.08); font-size: 8px; cursor: pointer; }
.sound-bars { display: flex; align-items: center; gap: 2px; height: 9px; }.sound-bars i { display: block; width: 2px; height: 4px; background: #e8bd63; }.sound-bars i:nth-child(2) { height: 8px; }.sound-bars i:nth-child(3) { height: 6px; }
.voice-button.is-speaking .sound-bars i { animation: bars .55s ease-in-out infinite alternate; }.voice-button.is-speaking .sound-bars i:nth-child(2) { animation-delay: -.2s; }.voice-button.is-speaking .sound-bars i:nth-child(3) { animation-delay: -.35s; }
.depth-instruction { position: absolute; left: 15px; bottom: calc(104px + env(safe-area-inset-bottom)); color: rgba(255,255,255,.6); font-size: 8px; line-height: 1.5; letter-spacing: .04em; }.depth-instruction span { display: inline-block; margin-right: 5px; color: #edc976; font-size: 15px; }

.theme-nav { position: absolute; z-index: 15; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 7px; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; background: rgba(4,12,22,.72); backdrop-filter: blur(16px); opacity: 0; visibility: hidden; transform: translate(-50%, 150%); transition: opacity .4s ease 1s, visibility .4s ease 1s, transform .7s cubic-bezier(.2,.8,.2,1) 1.1s; }
.theme-button { display: grid; grid-template-columns: 31px auto; align-items: center; gap: 6px; min-width: 65px; padding: 5px 9px 5px 5px; border: 0; border-radius: 12px; color: rgba(255,255,255,.55); background: transparent; cursor: pointer; }.theme-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; background: rgba(255,255,255,.06); font-family: "Yu Mincho", serif; }.theme-button small { font-size: 9px; }.theme-button.is-active { color: #fff; background: rgba(222,178,93,.12); }.theme-button.is-active .theme-icon { color: #25150c; background: linear-gradient(145deg, #f0d28e, #be7f35); }

.food-scene, .onsen-scene { opacity: 0; pointer-events: none; }
.food-scene { right: 15%; bottom: 13%; width: 32%; height: 29%; }.plate { position: absolute; left: 8%; right: 8%; bottom: 0; height: 38%; border-radius: 50%; background: radial-gradient(ellipse, #f7f0de 0 50%, #b5c7cd 53% 58%, #263542 61%); transform: rotateX(58deg); box-shadow: 0 9px 14px rgba(0,0,0,.35); }.dish { position: absolute; z-index: 2; bottom: 18%; border-radius: 55% 45% 55% 45%; background: #cc6b38; }.d1 { left: 26%; width: 28%; height: 25%; }.d2 { right: 19%; width: 30%; height: 21%; background: #6e8d43; }
.steam { position: absolute; width: 12px; height: 50%; border-left: 2px solid rgba(255,255,255,.55); border-radius: 50%; animation: steam 2.3s ease-in-out infinite; }.food-scene .s1 { left: 39%; top: 0; }.food-scene .s2 { left: 60%; top: 5%; animation-delay: -.9s; }
.onsen-scene { left: 14%; bottom: 13%; width: 55%; height: 28%; }.water { position: absolute; inset: 36% 0 0; border-radius: 50%; background: radial-gradient(ellipse, #b6e2dc, #568b93 65%, #253a43 69%); transform: rotateX(53deg); box-shadow: 0 8px 20px rgba(0,0,0,.3); }.stone { position: absolute; z-index: 2; bottom: 7%; width: 25%; height: 26%; border-radius: 50%; background: linear-gradient(140deg, #76776f, #303835); }.st1 { left: 2%; }.st2 { right: 1%; width: 31%; }.onsen-scene .s1 { left: 30%; top: 0; }.onsen-scene .s2 { left: 50%; top: -7%; animation-delay: -.7s; }.onsen-scene .s3 { left: 70%; top: 3%; animation-delay: -1.3s; }

.app[data-theme="gourmet"] .depth-stage { background: linear-gradient(#3a1720, #8b3929 48%, #20171b 49%, #070a0e 85%); }.app[data-theme="gourmet"] .bus, .app[data-theme="gourmet"] .torii, .app[data-theme="gourmet"] .road { opacity: .1; }.app[data-theme="gourmet"] .food-scene { opacity: 1; }
.app[data-theme="onsen"] .depth-stage { background: linear-gradient(#d8e6df, #8fb1ac 48%, #29464a 49%, #071116 85%); }.app[data-theme="onsen"] .bus, .app[data-theme="onsen"] .torii, .app[data-theme="onsen"] .road { opacity: .08; }.app[data-theme="onsen"] .onsen-scene { opacity: 1; }

.error-panel { position: absolute; z-index: 40; left: 20px; right: 20px; top: 50%; max-width: 420px; margin: auto; padding: 24px; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; background: rgba(6,16,29,.96); text-align: center; transform: translateY(-50%); display: none; box-shadow: 0 30px 90px #000; }.error-panel strong { font-family: "Yu Mincho", serif; }.error-panel p { color: var(--muted); font-size: 12px; line-height: 1.7; }.error-panel .button { width: 100%; margin-top: 8px; }
.credit { position: absolute; z-index: 20; left: 0; right: 0; bottom: max(12px, env(safe-area-inset-bottom)); text-align: center; font: 500 6px/1 Arial; letter-spacing: .16em; color: rgba(255,255,255,.25); pointer-events: none; }.credit strong { color: rgba(255,255,255,.48); }

.app[data-state="scanning"] .welcome { opacity: 0; visibility: hidden; }.app[data-state="scanning"] .scanner { opacity: 1; visibility: visible; }
.app[data-state="active"] .welcome, .app[data-state="active"] .scanner { opacity: 0; visibility: hidden; }.app[data-state="active"] .world { opacity: 1; visibility: visible; }.app[data-state="active"] .concierge { transform: translateX(0) translateZ(100px); }.app[data-state="active"] .speech-card { opacity: 1; transform: translateY(0); }.app[data-state="active"] .theme-nav { opacity: 1; visibility: visible; transform: translate(-50%, 0); }.app[data-state="active"] .credit { display: none; }

@keyframes pulse { 50% { opacity: .35; box-shadow: 0 0 0 8px rgba(232,189,99,0); } }
@keyframes scan { 0%,100% { top: 5%; opacity: .3; } 50% { top: 94%; opacity: 1; } }
@keyframes portalOpen { from { clip-path: circle(0 at 50% 52%); transform: scale(.65) rotateX(18deg); filter: brightness(2); } to { clip-path: circle(78% at 50% 52%); transform: scale(1); filter: brightness(1); } }
@keyframes aura { 50% { transform: scale(1.04); opacity: .25; } }
@keyframes drift { to { top: 110%; transform: translateX(70px) rotate(420deg); } }
@keyframes bars { to { height: 9px; } }
@keyframes steam { 0% { opacity: 0; transform: translateY(18px) scaleX(.7); } 40% { opacity: .7; } 100% { opacity: 0; transform: translate(7px,-18px) scaleX(1.25); } }

@media (min-width: 760px) {
  .welcome { padding-left: max(8vw, 70px); padding-bottom: 8vh; }
  .portal { top: 48%; left: 61%; width: min(58vw, 760px); }
  .concierge { right: 3%; height: 67%; width: min(29vw, 320px); }
  .speech-card { right: 72%; bottom: 11%; }
  .depth-instruction { left: 30px; bottom: 35px; }
}

@media (max-height: 650px) {
  .welcome { padding-bottom: 32px; }.lead { margin: 13px 0 18px; }.welcome h1 { font-size: 34px; }.trust-row, .marker-link { display: none; }
  .concierge { height: 50%; }.speech-card { bottom: 4%; }.speech-card p { font-size: 9px; }.depth-instruction { display: none; }
}

@media (max-width: 430px) {
  .depth-instruction { display: none; }
}

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