/* =========================================================
   V154.6 · GATE C · DAY 2 ONLY
   Strict FR/EN, responsive HUD, konbini layering and shrine
   gestures. Scoped to .chapter-day2 so J0/J1 locks stay frozen.
   ========================================================= */
.chapter-day2 :is(button,input,textarea,summary,[role="slider"]){box-sizing:border-box}
.chapter-day2 :is(.d2-story-panel,.d2-aoi-panel,.d2-ritual-panel,.d2-prayer-panel,.v73-basket-drawer,.v73-receipt-paper,.v86-shrine-discovery,.v79-tanaka-dialogue,.v79-question-panel,.v79-answer-panel,.v79-farewell-panel,.v78-return-panel){overflow-wrap:anywhere}
.chapter-day2 button:disabled{cursor:default}

/* Foreground sheets own the interaction while they are open. */
.chapter-day2.d2-konbini .v73-konbini:has(.v73-basket-drawer) :is(.v75-world-prompt,.v73-store-zones,.v73-zone-focus,.v73-product-rail,.v73-basket-chip){pointer-events:none!important;filter:saturate(.72) brightness(.82)}
.chapter-day2.d2-konbini .v73-konbini .v73-basket-drawer{pointer-events:auto!important;z-index:70!important}
.chapter-day2.d2-shrineApproach .d2-shrine-approach-scene:has(.v97-context-fold[open]) :is(.v97-world-whisper,.v129-shrine-cross,.d2-shrine-entry-gesture,.v97-shrine-water-hotspot,.d2-carry-moment){pointer-events:none!important;filter:saturate(.72) brightness(.82)}
.chapter-day2.d2-shrineApproach .v97-context-fold[open]{pointer-events:auto!important}
.chapter-day2.d2-prayer .d2-prayer-panel:has(.d2-five-yen-note[open]) > :not(.d2-five-yen-note):not(.eyebrow){pointer-events:none!important;opacity:.32}
.chapter-day2.d2-prayer .d2-five-yen-note[open]{pointer-events:auto!important;opacity:1!important}

/* Physical gesture language shared by torii, chōzuya and prayer. */
.chapter-day2 .d2-shrine-entry-gesture{position:absolute;z-index:34;left:clamp(28px,4vw,72px);bottom:clamp(30px,5vh,64px);width:min(500px,38vw)}
.chapter-day2 .d2-gesture-track{display:grid;gap:10px;width:100%;padding:14px 16px;border:1px solid rgba(247,240,223,.22);border-radius:20px;background:rgba(4,24,33,.88);color:#fff;box-shadow:0 18px 50px rgba(0,0,0,.22);backdrop-filter:blur(10px)}
.chapter-day2 .d2-gesture-copy{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;align-items:end}
.chapter-day2 .d2-gesture-copy b{font:600 clamp(17px,1.45vw,21px)/1.2 var(--font-display),Georgia,serif}
.chapter-day2 .d2-gesture-copy small{grid-column:1/-1;font-size:12px;line-height:1.38;color:rgba(255,255,255,.78)}
.chapter-day2 .d2-gesture-copy span{grid-column:2;grid-row:1;font:700 10px/1 system-ui,sans-serif;letter-spacing:.08em;color:#efb596}
.chapter-day2 .d2-gesture-surface{position:relative;height:72px;min-height:72px;border-radius:16px;border:1px solid rgba(247,240,223,.2);background:linear-gradient(90deg,rgba(247,240,223,.08),rgba(247,240,223,.16));overflow:hidden;touch-action:none!important;user-select:none;cursor:grab;outline:none}
.chapter-day2 .d2-gesture-surface:active{cursor:grabbing}
.chapter-day2 .d2-gesture-surface:focus-visible{outline:3px solid rgba(247,240,223,.9);outline-offset:3px}
.chapter-day2 .d2-gesture-path{position:absolute;left:14px;right:14px;top:50%;height:3px;transform:translateY(-50%);background:linear-gradient(90deg,rgba(239,181,150,.18),rgba(239,181,150,.72));border-radius:99px}
.chapter-day2 .d2-gesture-path::after{content:"";display:block;width:var(--d2-gesture-progress);height:100%;background:#efb596;box-shadow:0 0 16px rgba(239,181,150,.42)}
.chapter-day2 .d2-gesture-handle{position:absolute;z-index:3;left:clamp(18px,var(--d2-gesture-progress),calc(100% - 18px));top:50%;width:42px;height:42px;display:grid;place-items:center;transform:translate(-50%,-50%);border-radius:50%;background:#f7f0df;color:#7e4f45;box-shadow:0 7px 18px rgba(0,0,0,.24);font-style:normal}
.chapter-day2 .d2-gesture-surface em{position:absolute;left:14px;bottom:7px;font:600 9px/1 system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase;color:rgba(255,255,255,.58)}
.chapter-day2 .d2-gesture-track.dir-left .d2-gesture-path{background:linear-gradient(270deg,rgba(239,181,150,.18),rgba(239,181,150,.72))}
.chapter-day2 .d2-gesture-track.dir-up .d2-gesture-surface,.chapter-day2 .d2-gesture-track.dir-down .d2-gesture-surface{height:96px}
.chapter-day2 .d2-gesture-track:is(.dir-up,.dir-down) .d2-gesture-path{left:50%;right:auto;top:12px;bottom:12px;width:3px;height:auto;transform:translateX(-50%);background:linear-gradient(180deg,rgba(239,181,150,.18),rgba(239,181,150,.72))}
.chapter-day2 .d2-gesture-track:is(.dir-up,.dir-down) .d2-gesture-path::after{width:100%;height:var(--d2-gesture-progress)}
.chapter-day2 .d2-gesture-track:is(.dir-up,.dir-down) .d2-gesture-handle{left:50%;top:clamp(18px,var(--d2-gesture-progress),calc(100% - 18px))}
.chapter-day2 .d2-gesture-track.dir-inward .d2-gesture-handle{display:none}
.chapter-day2 .d2-gesture-hand{position:absolute;z-index:3;top:50%;width:46px;height:46px;display:grid;place-items:center;transform:translateY(-50%);border-radius:50%;background:#f7f0df;color:#7e4f45;font-size:24px;font-style:normal;box-shadow:0 7px 18px rgba(0,0,0,.24)}
.chapter-day2 .d2-gesture-hand.left{left:12%}
.chapter-day2 .d2-gesture-hand.right{right:12%}
.chapter-day2 .d2-quiet-hold{position:relative;width:100%;min-height:76px;padding:13px 16px;border:1px solid rgba(247,240,223,.24);border-radius:18px;background:rgba(247,240,223,.95);color:#17313a;text-align:left;overflow:hidden;touch-action:none!important}
.chapter-day2 .d2-quiet-hold b,.chapter-day2 .d2-quiet-hold small{position:relative;z-index:2;display:block}
.chapter-day2 .d2-quiet-hold b{font:600 17px/1.2 var(--font-display),Georgia,serif}
.chapter-day2 .d2-quiet-hold small{margin-top:5px;font-size:12px;line-height:1.35;opacity:.72}
.chapter-day2 .d2-quiet-hold i{position:absolute;z-index:1;inset:auto 0 0;height:5px;width:var(--d2-hold-progress);background:#c36c5d;transition:width .08s linear}

/* ---------- Laptop / desktop ---------- */
@media (min-width:761px){
  .chapter-day2 .hud-layer .sound,.chapter-day2 > .sound{top:var(--dobox-safe-top,20px)!important;right:clamp(24px,3vw,48px)!important;width:58px!important;height:58px!important;min-width:58px!important;min-height:58px!important}
  .chapter-day2 .hud-layer .journey-menu-trigger,.chapter-day2 > .journey-menu-trigger{top:var(--dobox-safe-top,20px)!important;right:calc(clamp(24px,3vw,48px) + 68px)!important;width:58px!important;height:58px!important;min-width:58px!important;min-height:58px!important}
  .chapter-day2 .hud-layer .scene-meta{max-width:min(42vw,560px)!important}
  .chapter-day2 :is(.d2-story-panel,.d2-aoi-panel,.d2-ritual-panel,.d2-prayer-panel,.v79-tanaka-dialogue,.v79-question-panel,.v79-answer-panel,.v79-farewell-panel,.v78-return-panel){width:min(520px,39vw)!important;max-width:min(520px,39vw)!important}
  .chapter-day2 :is(.d2-story-panel,.d2-aoi-panel,.d2-ritual-panel,.d2-prayer-panel) h2{font-size:clamp(28px,2.55vw,42px)!important;line-height:1.05!important}
  .chapter-day2 :is(.d2-primary,.d2-narrative-next,.v73-zone,.v73-basket-chip,.v73-checkout-go,.v73-response-pills button,.v73-pay-methods button,.v73-pay-action,.v73-receipt-store,.v129-human-choice button,.d2-human-response,.v97-street-path,.v97-shrine-water-hotspot,.v86-shrine-hotspot,.v86-shrine-exit,.v79-soft-next,.v79-question-next,.v79-close-focus,.v73-street-continue){min-height:50px!important}
  .chapter-day2.d2-purification .d2-ritual-panel,.chapter-day2.d2-prayer .d2-prayer-panel{overflow:auto!important}
}
@media (min-width:761px) and (max-height:820px){
  .chapter-day2 :is(.d2-story-panel,.d2-aoi-panel,.d2-ritual-panel,.d2-prayer-panel,.v79-tanaka-dialogue,.v79-question-panel,.v79-answer-panel,.v79-farewell-panel,.v78-return-panel){max-height:54vh!important;overflow:auto!important}
  .chapter-day2 .d2-gesture-track{padding:11px 13px;gap:7px}
  .chapter-day2 .d2-gesture-surface{height:62px;min-height:62px}
  .chapter-day2 .d2-gesture-track:is(.dir-up,.dir-down) .d2-gesture-surface{height:76px}
}
@media (hover:hover) and (pointer:fine){
  .chapter-day2 :is(button,summary,[role="slider"]):focus-visible{outline:3px solid rgba(247,240,223,.92)!important;outline-offset:3px!important}
  .chapter-day2 :is(.v73-zone,.v73-product-choice,.v73-pay-methods button,.v129-human-choice button,.v86-shrine-hotspot,.v79-soft-next){transition:transform .18s ease,box-shadow .18s ease}
  .chapter-day2 :is(.v73-zone,.v73-product-choice,.v73-pay-methods button,.v129-human-choice button,.v86-shrine-hotspot,.v79-soft-next):hover{transform:translateY(-2px)}
}

/* ---------- Phone: touch-first ---------- */
@media (max-width:760px){
  html[data-dobox-layout^="phone"] .chapter-day2 .brand,
  html[data-dobox-layout^="phone"] .chapter-day2 .brand.brand-home{top:max(8px,env(safe-area-inset-top))!important;left:8px!important;max-width:calc(100vw - 76px)!important;padding:4px 8px 4px 4px!important;gap:7px!important;height:50px!important;min-height:50px!important;max-height:none!important;box-sizing:border-box!important;transform:none!important;transform-origin:top left!important}
  html[data-dobox-layout^="phone"] .chapter-day2 .brand img{width:36px!important;height:36px!important;flex:0 0 36px!important}
  html[data-dobox-layout^="phone"] .chapter-day2 .sound{top:max(8px,env(safe-area-inset-top))!important;right:8px!important;width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important}
  html[data-dobox-layout^="phone"] .chapter-day2 .journey-menu-trigger{top:max(66px,calc(env(safe-area-inset-top) + 58px))!important;right:8px!important;width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important}
  html[data-dobox-layout^="phone"] .chapter-day2 .scene-meta{top:max(66px,calc(env(safe-area-inset-top) + 58px))!important;left:10px!important;right:70px!important;width:auto!important;max-width:none!important;transform:none!important;text-align:left!important;overflow:hidden!important;padding:4px 8px!important}
  html[data-dobox-layout^="phone"] .chapter-day2 .scene-meta time{font-size:15px!important}
  html[data-dobox-layout^="phone"] .chapter-day2 .scene-meta span{font-size:10px!important;line-height:1.2!important;letter-spacing:.06em!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}

  html[data-dobox-layout^="phone"] .chapter-day2 :is(.d2-story-panel,.d2-aoi-panel,.d2-ritual-panel,.d2-prayer-panel,.v79-tanaka-dialogue,.v79-question-panel,.v79-answer-panel,.v79-farewell-panel,.v78-return-panel,.v73-basket-drawer,.v86-shrine-discovery){left:10px!important;right:10px!important;width:auto!important;max-width:none!important;max-height:43svh!important;overflow:auto!important}
  html[data-dobox-layout^="phone"] .chapter-day2 :is(.d2-story-panel,.d2-aoi-panel,.d2-ritual-panel,.d2-prayer-panel) h2{font-size:clamp(24px,7.2vw,31px)!important;line-height:1.05!important}
  html[data-dobox-layout^="phone"] .chapter-day2 :is(.d2-story-panel,.d2-aoi-panel,.d2-ritual-panel,.d2-prayer-panel) p{font-size:13px!important;line-height:1.44!important}

  html[data-dobox-layout^="phone"] .chapter-day2 :is(.d2-primary,.d2-narrative-next,.v73-zone,.v73-basket-chip,.v73-zone-back,.v73-product-choice,.v73-checkout-go,.v73-basket-drawer header button,.v73-basket-list button,.v73-response-pills button,.v73-pay-methods button,.v73-pay-action,.v73-receipt-store,.v129-human-choice button,.d2-human-response,.v97-street-path,.v97-shrine-water-hotspot,.v86-shrine-hotspot,.v86-shrine-exit,.v86-discovery-close,.d2-focus-close,.v79-soft-next,.v79-question-next,.v79-close-focus,.v73-street-continue,.d2-carry-moment button,.d2-origin button){min-width:50px!important;min-height:50px!important}
  html[data-dobox-layout^="phone"] .chapter-day2 .d2-focus-close{width:50px!important;height:50px!important}

  html[data-dobox-layout^="phone"] .chapter-day2 .d2-shrine-entry-gesture{left:10px!important;right:10px!important;bottom:max(12px,env(safe-area-inset-bottom))!important;width:auto!important}
  html[data-dobox-layout^="phone"] .chapter-day2 .d2-gesture-track{padding:11px 12px;gap:8px;border-radius:17px}
  html[data-dobox-layout^="phone"] .chapter-day2 .d2-gesture-copy{grid-template-columns:minmax(0,1fr) auto}
  html[data-dobox-layout^="phone"] .chapter-day2 .d2-gesture-copy b{font-size:17px}
  html[data-dobox-layout^="phone"] .chapter-day2 .d2-gesture-copy small{font-size:11.5px}
  html[data-dobox-layout^="phone"] .chapter-day2 .d2-gesture-surface{height:68px;min-height:68px}
  html[data-dobox-layout^="phone"] .chapter-day2 .d2-gesture-track:is(.dir-up,.dir-down) .d2-gesture-surface{height:82px}
  html[data-dobox-layout^="phone"] .chapter-day2 .d2-gesture-handle{width:50px;height:50px}
  html[data-dobox-layout^="phone"] .chapter-day2 .d2-gesture-hand{width:50px;height:50px}
  html[data-dobox-layout^="phone"] .chapter-day2 .d2-quiet-hold{min-height:68px}

  /* Konbini: one task at a time; horizontal rail stays touch-scrollable. */
  html[data-dobox-layout^="phone"] .chapter-day2.d2-konbini .v73-product-scroll{scroll-snap-type:x proximity;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  html[data-dobox-layout^="phone"] .chapter-day2.d2-konbini .v73-product-choice{scroll-snap-align:start}
  html[data-dobox-layout^="phone"] .chapter-day2.d2-konbini .v73-basket-drawer{bottom:max(10px,env(safe-area-inset-bottom))!important;max-height:55svh!important;z-index:74!important}
  html[data-dobox-layout^="phone"] .chapter-day2.d2-checkout :is(.v73-cashier-dialogue,.v73-payment-dock,.v73-receipt-object){max-width:calc(100vw - 20px)!important}
  html[data-dobox-layout^="phone"] .chapter-day2.d2-checkout .v73-response-pills{grid-template-columns:1fr!important}
  html[data-dobox-layout^="phone"] .chapter-day2.d2-checkout .v73-pay-methods{grid-template-columns:1fr 1fr!important;gap:8px!important}

}

@media (max-width:760px) and (hover:none), (max-width:760px) and (pointer:coarse){
  html[data-dobox-layout^="phone"] .chapter-day2 :is(.v73-zone,.v73-product-choice,.v73-pay-methods button,.v129-human-choice button,.v86-shrine-hotspot,.v79-soft-next):hover{transform:none!important}
  html[data-dobox-layout^="phone"] .chapter-day2 :is(.v73-zone,.v73-product-choice,.v73-pay-methods button,.v129-human-choice button,.v86-shrine-hotspot,.v79-soft-next):active{transform:scale(.985)}
}

@media (max-width:400px){
  html[data-dobox-layout^="phone"] .chapter-day2 .d2-gesture-copy span{display:none}
  html[data-dobox-layout^="phone"] .chapter-day2.d2-konbini .v73-store-zones{gap:7px!important}
  html[data-dobox-layout^="phone"] .chapter-day2.d2-checkout .v73-pay-methods{grid-template-columns:1fr!important}
}

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

/* Gate C visual ownership: an open shrine information sheet must not compete
   with the physical task underneath it. */
.chapter-day2.d2-shrineApproach .d2-shrine-approach-scene:has(.v97-context-fold[open]) :is(.d2-shrine-entry-gesture,.v97-shrine-water-hotspot,.d2-carry-moment){
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
