/* Phase 10B: optional scene display. Fail-open if metadata or artwork is absent. */
.scene-visual{
  position:relative;
  margin:18px 0 22px;
  border:1px solid rgba(157,216,224,.23);
  border-radius:19px;
  overflow:hidden;
  background:#152b3b;
  height:clamp(184px,28vw,300px);
  isolation:isolate
}

.scene-visual-placeholder{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:24px 28px;
  gap:18px;
  background:radial-gradient(circle at 78% 25%,rgba(238,198,128,.34),transparent 45%),linear-gradient(128deg,#14384b,#285a62 59%,#12283e)
}

.scene-visual--airport .scene-visual-placeholder{
  background:radial-gradient(circle at 80% 14%,rgba(164,211,229,.34),transparent 48%),linear-gradient(135deg,#203d58,#3b5c72 58%,#182f47)
}

.scene-visual--hotel .scene-visual-placeholder{
  background:radial-gradient(circle at 78% 22%,rgba(252,190,92,.42),transparent 48%),linear-gradient(128deg,#453747,#756452 60%,#243a48)
}

.scene-visual--market .scene-visual-placeholder{
  background:radial-gradient(circle at 76% 20%,rgba(236,153,90,.4),transparent 48%),linear-gradient(128deg,#2c484c,#637253 65%,#24404b)
}

.scene-visual--observatory .scene-visual-placeholder{
  background:radial-gradient(circle at 82% 26%,rgba(129,152,225,.32),transparent 44%),linear-gradient(130deg,#182941,#3e486c 64%,#151b36)
}

.scene-visual--museum .scene-visual-placeholder{
  background:radial-gradient(circle at 78% 18%,rgba(223,205,169,.4),transparent 48%),linear-gradient(135deg,#465462,#a2967a 62%,#4f6069)
}

.scene-visual--garden .scene-visual-placeholder{
  background:radial-gradient(circle at 78% 18%,rgba(221,206,137,.38),transparent 48%),linear-gradient(135deg,#31524f,#6a8460 62%,#24484a)
}

.scene-visual--coast .scene-visual-placeholder{
  background:radial-gradient(circle at 80% 20%,rgba(251,189,129,.48),transparent 48%),linear-gradient(135deg,#1d5873,#4e8b97 55%,#5b6a7e)
}

.scene-visual-ornament{
  font-size:clamp(65px,11vw,146px);
  color:rgba(255,255,255,.17);
  line-height:1;
  user-select:none;
  transform:rotate(-13deg)
}

.scene-visual-content{
  position:relative;
  z-index:1;
  display:flex;
  flex-direction:column;
  gap:5px;
  text-align:left;
  max-width:65%;
  text-shadow:0 2px 12px rgba(2,13,25,.4)
}

.scene-visual-eyebrow{
  font-size:10px;
  color:#edf4f1;
  letter-spacing:.22em;
  font-weight:750
}

.scene-visual-content strong{
  font-size:clamp(16px,2.5vw,24px);
  line-height:1.3;
  color:#fff
}

.scene-visual-status{
  font-size:12px;
  color:#e4e8e8
}

.scene-visual-image{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
}

.scene-visual-caption{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  padding:16px 18px 12px;
  color:white;
  font-size:12px;
  font-weight:650;
  background:linear-gradient(transparent,rgba(4,19,28,.72));
  pointer-events:none
}

@media(max-width:600px){
  .scene-visual{
    height:clamp(164px,45vw,216px);
    margin:14px 0 18px;
    border-radius:14px
  }
  .scene-visual-placeholder{
    padding:16px
  }
  .scene-visual-ornament{
    font-size:68px
  }
  .scene-visual-content{
    max-width:74%
  }
  .scene-visual-status{
    font-size:11px
  }
}

@media(prefers-reduced-motion:reduce){
  .scene-visual{
    transition:none
  }
}


/* Reviewer P2-03: fast, accessible path to the question; story remains intact. */
.skip-scene-link{
  display:inline-flex;
  margin:10px 0 0;
  align-items:center;
  color:#c2e4ed;
  text-decoration:underline;
  text-underline-offset:4px;
  font-size:13px;
  min-height:36px
}

.skip-scene-link:focus-visible{
  outline:2px solid #f0d48c;
  outline-offset:4px;
  border-radius:3px
}

#current-question{
  scroll-margin-top:72px
}

@media(max-width:600px){
  .scene-visual:not(:has(.scene-visual-image)){
    height:clamp(140px,39vw,184px);
    margin:8px 0 14px
  }
  .skip-scene-link{
    font-size:12px
  }
}

/* Route Pause & Resume M3: shared scene/story UX for every city and route. */
.revisit-banner{
  display:flex;
  flex-direction:column;
  gap:5px;
  padding:14px 17px;
  margin:14px 0;
  border:1px solid rgba(244,202,126,.45);
  border-radius:14px;
  background:rgba(244,202,126,.1);
  color:#f5e4bb;
}
.revisit-banner strong{font-size:15px}
.revisit-banner span{font-size:13px;line-height:1.6}
.revisit-actions{margin:16px 0}
.story-pause-actions{margin:10px 0 19px}
.story-pause-actions button{min-height:44px}
.route-progress,.route-frontier{font-size:13px;line-height:1.6}
.route-frontier{color:var(--gold)!important;overflow-wrap:anywhere}
.checkpoint-picker{margin-top:18px}
.checkpoint-picker[hidden]{display:none!important}
.checkpoint-picker h3{margin:0 0 8px}
.checkpoint-list{display:grid;gap:10px;max-height:45dvh;overflow-y:auto;overscroll-behavior:contain}
.checkpoint-row{
  display:grid;
  grid-template-columns:64px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(170,214,234,.06);
}
.checkpoint-thumb,.checkpoint-placeholder{width:64px;height:58px;border-radius:9px;object-fit:cover}
.checkpoint-placeholder{display:grid;place-items:center;background:#23475b;font-size:25px}
.checkpoint-detail{min-width:0;overflow-wrap:anywhere}
.checkpoint-detail strong{display:block;font-size:13px}
.checkpoint-row button{min-height:44px;padding:9px 11px}
@media(max-width:600px){
  .checkpoint-row{grid-template-columns:52px minmax(0,1fr);gap:8px}
  .checkpoint-thumb,.checkpoint-placeholder{width:52px;height:52px}
  .checkpoint-row button{grid-column:1/-1;width:100%}
  .revisit-actions button{width:100%}
  .checkpoint-list{max-height:45dvh}
}

/* Wrong-choice tactile feedback: in-place shake + zero-CLS tried state for mobile & desktop. */
.option{
  position:relative;
  padding-right:38px;
  transition:transform .12s ease,filter .12s ease,border-color .22s ease,background-color .22s ease,opacity .22s ease;
}
.option:active:not(:disabled){
  transform:scale(.99);
}
@media(hover:none){
  .option:hover:not(:disabled){
    border-color:rgba(171,213,234,.22);
    background:rgba(170,214,234,.07);
    filter:none;
    transform:none;
  }
}
@keyframes option-wrong-shake{
  0%,100%{transform:translateX(0)}
  20%{transform:translateX(-5px)}
  45%{transform:translateX(5px)}
  70%{transform:translateX(-3px)}
  88%{transform:translateX(2px)}
}
@keyframes answer-hint-pulse{
  0%{border-color:var(--red);background:rgba(246,162,162,.18)}
  100%{border-color:rgba(246,162,162,.28);background:rgba(246,162,162,.08)}
}
.option.option--wrong,
.option.option--wrong:hover:not(:disabled){
  border-color:rgba(246,162,162,.52);
  background:rgba(246,162,162,.09);
  opacity:.68;
  filter:none;
  transform:none;
}
.option.option--wrong .key{
  color:var(--red);
}
.option.option--shake,
.option.option--shake:hover:not(:disabled){
  opacity:1;
  border-color:var(--red);
  background:rgba(246,162,162,.16);
  animation:option-wrong-shake .32s cubic-bezier(.36,.07,.19,.97);
}
.option-wrong-mark{
  position:absolute;
  top:10px;
  right:10px;
  width:20px;
  height:20px;
  border-radius:999px;
  display:grid;
  place-items:center;
  font-size:11px;
  font-weight:800;
  line-height:1;
  color:var(--red);
  background:rgba(246,162,162,.16);
  border:1px solid rgba(246,162,162,.42);
  pointer-events:none;
}
.answer-hint.error.answer-hint--pulse{
  animation:answer-hint-pulse .42s ease-out;
}
@media(max-width:600px){
  .option{padding-right:36px}
  .option-wrong-mark{top:9px;right:9px}
}
@media(prefers-reduced-motion:reduce){
  .option{transition:none}
  .option:active:not(:disabled){transform:none}
  .option.option--shake,
  .option.option--shake:hover:not(:disabled){
    animation:none;
    opacity:.68;
    border-color:rgba(246,162,162,.52);
    background:rgba(246,162,162,.09);
  }
  .answer-hint.error.answer-hint--pulse{animation:none}
}

/* Upgraded Well Done travel-journal feedback modal (mobile-first, zero sticky jitter). */
.overlay.overlay--story-feedback{
  padding:18px 16px;
}
.dialog.dialog--story-feedback{
  max-width:580px;
  width:100%;
  padding:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  max-height:min(90dvh,840px);
  border-radius:22px;
  border:1px solid rgba(151,222,219,.34);
  background:linear-gradient(180deg,#132d42 0%,#0f2436 100%);
  box-shadow:0 30px 90px rgba(0,0,0,.62);
}
.dialog.dialog--story-feedback:focus:not(:focus-visible){
  outline:none;
}
.dialog.dialog--story-feedback:focus-visible{
  outline:2px solid rgba(244,202,126,.7);
  outline-offset:2px;
}
.story-feedback{
  --sf-glow:rgba(118,225,209,.17);
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  position:relative;
}
.story-feedback--airport{--sf-glow:rgba(164,211,229,.19)}
.story-feedback--hotel{--sf-glow:rgba(252,190,92,.2)}
.story-feedback--market{--sf-glow:rgba(236,153,90,.2)}
.story-feedback--observatory{--sf-glow:rgba(139,162,235,.2)}
.story-feedback--museum{--sf-glow:rgba(223,205,169,.19)}
.story-feedback--garden{--sf-glow:rgba(146,216,174,.19)}
.story-feedback--coast{--sf-glow:rgba(251,189,129,.21)}
.sf-body{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  padding:22px 24px 18px;
  position:relative;
  background:radial-gradient(circle at 92% -6%,var(--sf-glow),transparent 52%);
}
.sf-header{
  position:relative;
  z-index:1;
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:14px;
  overflow:hidden;
}
.sf-stamp{
  position:absolute;
  top:2px;
  right:4px;
  color:var(--gold);
  opacity:.15;
  pointer-events:none;
  user-select:none;
  transform:rotate(-8deg);
  transform-origin:center;
  animation:sf-stamp-land .25s cubic-bezier(.2,.8,.2,1) both;
}
.sf-stamp-svg{
  display:block;
  width:78px;
  height:78px;
}
.sf-header-top{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  padding-right:44px;
}
.sf-check-badge{
  width:38px;
  height:38px;
  flex-shrink:0;
  border-radius:12px;
  display:grid;
  place-items:center;
  color:var(--teal);
  background:rgba(118,225,209,.13);
  border:1px solid rgba(118,225,209,.36);
  box-shadow:0 0 18px rgba(118,225,209,.14);
}
.sf-check-svg{
  display:block;
}
.sf-check-mark{
  stroke-dasharray:22;
  stroke-dashoffset:0;
  animation:sf-check-draw .24s ease-out .03s both;
}
.sf-heading-group{
  min-width:0;
  flex:1 1 auto;
}
.sf-eyebrow{
  margin:0 0 2px;
  font-size:11px;
  letter-spacing:.11em;
  color:var(--teal);
  font-weight:700;
  overflow-wrap:anywhere;
}
.dialog.dialog--story-feedback .sf-title{
  margin:0;
  font-size:clamp(20px,3.6vw,24px);
  line-height:1.2;
  color:#f4fbff;
}
.sf-trail-row{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  color:var(--muted);
}
.sf-trail-track{
  flex:0 1 260px;
  min-width:0;
  display:block;
}
.sf-trail-svg{
  display:block;
  width:100%;
  height:18px;
}
.sf-trail-count{
  flex-shrink:0;
  font-size:11px;
  font-weight:750;
  letter-spacing:.08em;
  color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.sf-reward-bar{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px 9px;
  padding:8px 12px;
  border-radius:12px;
  border:1px solid rgba(244,202,126,.3);
  background:linear-gradient(90deg,rgba(244,202,126,.13),rgba(244,202,126,.04));
  min-width:0;
}
.sf-reward-bar.is-claimed{
  border-color:rgba(188,228,247,.18);
  background:rgba(188,228,247,.06);
}
.sf-coin-icon{
  color:var(--gold);
  display:inline-flex;
  flex-shrink:0;
}
.sf-reward-bar.is-claimed .sf-coin-icon{
  color:var(--muted);
}
.sf-coin-svg{
  display:block;
}
.sf-reward-text{
  font-size:14px;
  line-height:1.45;
  overflow-wrap:anywhere;
  min-width:0;
}
.sf-reward-bar.is-claimed .sf-reward-text{
  color:var(--muted);
  font-weight:650;
}
.sf-first-try-pill{
  margin-left:auto;
  font-size:11px;
  font-weight:750;
  letter-spacing:.04em;
  color:#0c2233;
  background:var(--gold);
  padding:2px 9px;
  border-radius:999px;
  white-space:nowrap;
}
.sf-answer-echo{
  position:relative;
  z-index:1;
  display:flex;
  align-items:flex-start;
  gap:8px;
  padding:8px 12px;
  margin:0 0 13px;
  border-radius:11px;
  background:rgba(118,225,209,.07);
  border:1px solid rgba(118,225,209,.22);
  border-left:3px solid var(--teal);
  min-width:0;
}
.sf-echo-icon{
  color:var(--teal);
  display:inline-flex;
  flex-shrink:0;
  margin-top:3px;
}
.sf-echo-svg{
  display:block;
}
.sf-echo-body{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
  flex:1 1 auto;
}
.sf-echo-label{
  font-size:10px;
  letter-spacing:.11em;
  font-weight:750;
  color:var(--teal);
}
.sf-echo-text{
  font-size:13.5px;
  line-height:1.45;
  color:#e4faf6;
  overflow-wrap:anywhere;
}
.sf-section-label{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  font-weight:750;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.sf-section-icon{
  display:inline-flex;
  flex-shrink:0;
}
.sf-section-svg{
  display:block;
}
.sf-note-card{
  position:relative;
  z-index:1;
  padding:14px 16px;
  margin:0 0 14px;
  border-radius:15px;
  border:1px solid rgba(244,202,126,.28);
  border-left:3.5px solid var(--gold);
  background:linear-gradient(135deg,rgba(244,202,126,.1),rgba(16,38,56,.62) 62%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
  min-width:0;
}
.sf-note-card .sf-section-label{
  color:var(--gold);
}
.sf-note-card .sf-explanation{
  margin:8px 0 0;
}
.sf-note-card .sf-explanation .english{
  font-size:15px;
  line-height:1.65;
  color:#f4f9fd;
  overflow-wrap:anywhere;
}
.sf-note-card .sf-explanation .chinese{
  margin-top:6px;
  font-size:14px;
  line-height:1.72;
  color:#d6e6f2;
  overflow-wrap:anywhere;
}
.sf-story-card{
  position:relative;
  z-index:1;
  padding:12px 14px 4px;
  border-radius:14px;
  border:1px solid rgba(157,216,224,.18);
  background:rgba(9,24,38,.42);
  min-width:0;
}
.sf-story-card .sf-section-label{
  color:var(--teal);
}
.dialog.dialog--story-feedback .sf-quote{
  margin:10px 0;
  padding:10px 13px;
  background:rgba(18,52,71,.78);
  overflow-wrap:anywhere;
}
.sf-quote .dual{
  margin:4px 0 0;
}
.sf-transition{
  margin:10px 0 8px;
  padding-top:10px;
  border-top:1px dashed rgba(188,228,247,.16);
}
.sf-story-card .sf-section-label+.sf-transition{
  margin-top:8px;
  padding-top:0;
  border-top:0;
}
.sf-transition-text{
  margin:0;
}
.sf-transition-text .english{
  font-size:14.5px;
  line-height:1.62;
  color:#e2eff8;
  overflow-wrap:anywhere;
}
.sf-transition-text .chinese{
  margin-top:4px;
  font-size:13.5px;
  line-height:1.68;
  color:var(--muted);
  overflow-wrap:anywhere;
}
.sf-footer{
  flex-shrink:0;
  padding:12px 24px 16px;
  border-top:1px solid rgba(188,228,247,.14);
  background:linear-gradient(180deg,rgba(13,32,48,.95),rgba(10,25,38,.99));
}
.sf-footer .button-row{
  margin:0;
  justify-content:flex-end;
}
.sf-continue-btn{
  min-height:46px;
  padding:11px 22px;
  font-weight:750;
  letter-spacing:.02em;
}
@keyframes sf-stamp-land{
  0%{opacity:0;transform:scale(1.12) rotate(-13deg)}
  100%{opacity:.15;transform:scale(1) rotate(-8deg)}
}
@keyframes sf-check-draw{
  0%{stroke-dashoffset:22}
  100%{stroke-dashoffset:0}
}
@media(max-width:600px){
  .overlay.overlay--story-feedback{
    padding:12px 10px;
  }
  .dialog.dialog--story-feedback{
    max-height:min(92dvh,840px);
    border-radius:18px;
  }
  .sf-body{
    padding:16px 15px 14px;
  }
  .sf-stamp{
    top:0;
    right:2px;
  }
  .sf-stamp-svg{
    width:66px;
    height:66px;
  }
  .sf-note-card{
    padding:12px 13px;
  }
  .sf-story-card{
    padding:11px 12px 4px;
  }
  .sf-footer{
    padding:10px 15px calc(12px + env(safe-area-inset-bottom,0px));
  }
  .sf-footer .button-row{
    width:100%;
  }
  .sf-continue-btn{
    width:100%;
  }
}
@media(max-width:360px){
  .sf-body{
    padding:14px 12px 12px;
  }
  .sf-header-top{
    gap:9px;
    padding-right:30px;
  }
  .sf-check-badge{
    width:34px;
    height:34px;
  }
  .dialog.dialog--story-feedback .sf-title{
    font-size:19px;
  }
  .sf-reward-bar{
    padding:7px 10px;
  }
  .sf-first-try-pill{
    margin-left:0;
  }
  .sf-note-card{
    padding:11px;
  }
  .sf-story-card{
    padding:10px 11px 4px;
  }
  .sf-footer{
    padding:9px 12px calc(11px + env(safe-area-inset-bottom,0px));
  }
}
@media(max-height:520px){
  .overlay.overlay--story-feedback{
    padding:8px 10px;
  }
  .dialog.dialog--story-feedback{
    max-height:95dvh;
  }
  .sf-body{
    padding:12px 14px 10px;
  }
  .sf-footer{
    padding:8px 14px;
  }
}
@media(prefers-reduced-motion:reduce){
  .sf-stamp,
  .sf-check-mark{
    animation:none;
  }
}
