/* =========================================================
   V1549 · PHASE 8 · J3/J4 FINAL POLISH
   Real click-through findings across phone / laptop / desktop.
   ========================================================= */

/* Passport close is a real action, not a tiny text link. */
.stamp-award .stamp-award-card > button{
  min-height:50px!important;
  padding:10px 18px!important;
  border-radius:999px!important;
  cursor:pointer!important;
}

/* J3: lived-scene microcopy remains readable on phone. */
@media (max-width:700px){
  html[data-dobox-layout^="phone"] .chapter-day3 .v129-social-whisper.compact,
  html[data-dobox-layout^="phone"] .chapter-day3 :is(.v129-human-reaction.order-reaction,.v123-cooking-observation p,.v127-meal-prompt p,.v127-bill-prompt p,.v129-human-reaction.farewell-reaction){
    font-size:14px!important;
    line-height:1.42!important;
  }
  html[data-dobox-layout^="phone"] .chapter-day3 .v104-phrase details>summary{
    min-height:50px!important;
    display:flex!important;
    align-items:center!important;
    padding:9px 10px!important;
  }
  html[data-dobox-layout^="phone"] .journey-menu.v38-menu :is(.j3-memory-total,.j3-memory-line){
    font-size:14px!important;
    line-height:1.42!important;
  }
}

/* J4: opening shoji instruction is a centered overlay, not a translated flow node. */
.chapter-day4 .d4-gesture-shoji{
  position:absolute!important;
  left:50%!important;
  right:auto!important;
  transform:translateX(-50%)!important;
  width:max-content!important;
  max-width:min(340px,calc(100vw - 24px))!important;
  box-sizing:border-box!important;
  padding:9px 12px!important;
  border-radius:999px!important;
  background:rgba(4,29,36,.78)!important;
  color:#fff!important;
  text-shadow:0 1px 8px rgba(0,0,0,.55)!important;
  backdrop-filter:blur(7px)!important;
}
@media (max-width:700px){
  html[data-dobox-layout^="phone"] .chapter-day4 .d4-gesture-shoji{
    bottom:35svh!important;
    justify-content:center!important;
    font-size:12px!important;
    line-height:1.25!important;
  }
}

/* Required controls may fade, but must never drift while being acquired. */
.chapter-day3 .v104-action,
.chapter-day4 :is(button,[role="button"],summary){
  animation-name:none;
}
@media (hover:hover) and (pointer:fine){
  .chapter-day3 :is(.v104-action,.v104-hotspot),
  .chapter-day4 :is(button,[role="button"]){
    transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease,background-color .16s ease;
  }
}
@media (prefers-reduced-motion:reduce){
  .chapter-day3 *, .chapter-day3 *::before, .chapter-day3 *::after,
  .chapter-day4 *, .chapter-day4 *::before, .chapter-day4 *::after{
    animation:none!important;
    transition-duration:.001ms!important;
  }
}

/* Phase 8 — yatai paper menu may appear softly, but its close control cannot move outside
   the viewport during a transform/scale animation on laptop/desktop. */
@keyframes v1549-yatai-menu-fade{from{opacity:0}to{opacity:1}}
.chapter-day3 .v104-menu-object{
  animation:v1549-yatai-menu-fade .18s ease both!important;
}
.chapter-day3 .v104-menu-close{
  width:50px!important;
  height:50px!important;
  min-width:50px!important;
  min-height:50px!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
}

/* Phase 8 — global journey menu on laptop/desktop.
   The menu owns the right-side foreground: underlying HUD controls must not compete with its close button. */
.experience:has(.journey-menu.v38-menu) :is(.sound,.journey-menu-trigger){
  visibility:hidden!important;
  pointer-events:none!important;
}
.journey-menu.v38-menu .journey-menu-close{
  width:50px!important;
  height:50px!important;
  min-width:50px!important;
  min-height:50px!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  border-radius:50%!important;
}
@media (min-width:761px){
  .journey-menu.v38-menu .route-day4-cta{
    position:fixed!important;
    z-index:235!important;
    right:24px!important;
    bottom:18px!important;
    width:min(562px,calc(100vw - 48px))!important;
    min-height:54px!important;
    margin:0!important;
    border:1px solid rgba(255,255,255,.24)!important;
    border-radius:999px!important;
    background:#173846!important;
    color:#fff!important;
    box-shadow:0 14px 34px rgba(4,25,33,.28)!important;
  }
  .journey-menu.v38-menu .object-ledger.route{
    padding-bottom:92px!important;
  }
}
@media (min-width:761px) and (max-height:850px){
  .journey-menu.v38-menu .route-photo-card{min-height:210px!important}
  .journey-menu.v38-menu .route-photo-grid{gap:10px!important}
}
.experience:has(.journey-menu.v38-menu) .interaction-layer{
  pointer-events:none!important;
}
.experience:has(.journey-menu.v38-menu) .journey-menu.v38-menu{
  pointer-events:auto!important;
}
