/* Phase 3: a quiet, first-person window into Sylva. */
.fr-exploring .fr-hero { padding:24px 5.5% 35px; gap:40px; min-height:0; }
.fr-exploring .fr-hero__content,.fr-exploring .fr-relic,.fr-exploring .fr-coordinate,.fr-exploring .fr-scroll { display:none; }
.fr-exploring .fr-companion,.fr-exploring .fr-environment { visibility:hidden; }
.fr-exploring .fr-worlds { align-self:center; }
.fr-explore { position:relative; height:clamp(560px,78svh,840px); width:100%; isolation:isolate; overflow:hidden; background:#203c2d; color:#e1ead8; border:1px solid #a8c49a38; scroll-margin-top:12px; outline-offset:3px; }
.fr-explore__scenes,.fr-forest-scene,.fr-forest-scene__photo,.fr-forest-scene__light,.fr-forest-scene__fog,.fr-explore__shade,.fr-explore__targets { position:absolute; inset:0; }
.fr-explore__scenes { overflow:hidden; pointer-events:none; }
.fr-forest-scene { overflow:hidden; transform-origin:52% 52%; }
.fr-forest-scene__photo { inset:-3%; background:url('./assets/forest.webp') var(--pan) center / cover no-repeat; }
.fr-forest-scene__light { background:radial-gradient(ellipse at var(--pan) 22%,#e4efaa30,transparent 60%),linear-gradient(90deg,#0a272a28,transparent); }
.fr-forest-scene[data-kind=mist] .fr-forest-scene__photo { filter:saturate(.58) brightness(.78); }
.fr-forest-scene[data-kind=spring] .fr-forest-scene__photo,.fr-forest-scene[data-kind=water] .fr-forest-scene__photo { filter:saturate(.65) hue-rotate(18deg) brightness(.83); }
.fr-forest-scene[data-kind=bridge] .fr-forest-scene__photo,.fr-forest-scene[data-kind=tablet] .fr-forest-scene__photo { filter:saturate(.62) brightness(.82); }
.fr-forest-scene[data-kind=gate] .fr-forest-scene__photo { filter:saturate(.6) brightness(.7); }
.fr-forest-scene__land,.fr-forest-scene__near { position:absolute; width:100%; height:100%; inset:0; }
.fr-forest-scene[data-kind=roots] .fr-forest-scene__land { opacity:.45; mix-blend-mode:multiply; }
.fr-forest-scene[data-kind=spring] .fr-forest-scene__land,.fr-forest-scene[data-kind=water] .fr-forest-scene__land { transform:translateY(-12%); }
.fr-forest-scene__fog { inset:-6%; background:url('./assets/fog.svg') center / cover no-repeat; opacity:var(--fog); mix-blend-mode:screen; }
.fr-explore__shade { pointer-events:none; background:linear-gradient(180deg,#09221bd1,transparent 32%,transparent 59%,#071b17e8),linear-gradient(90deg,#09221b44,transparent 35%); }
.fr-explore__heading { position:absolute; top:30px; left:32px; right:94px; pointer-events:none; text-shadow:0 2px 20px #092018; }
.fr-explore__heading>p:first-child { font:9px/1.5 var(--serif); letter-spacing:.24em; color:#c0ceb0; }
.fr-explore__heading h2 { font:400 clamp(21px,3vw,32px)/1.7 var(--serif); letter-spacing:.17em; margin:9px 0; }
.fr-explore__heading>p:last-child { font:12px/1.9 var(--serif); max-width:440px; color:#cfdbc5; }
.fr-explore__bottom { position:absolute; bottom:max(14px,env(safe-area-inset-bottom)); left:20px; right:20px; text-align:center; }
.fr-explore #forest-message { min-height:2.8em; max-width:580px; margin:0 auto 12px; font:13px/1.8 var(--serif); letter-spacing:.05em; text-shadow:0 2px 12px #00170e; }
.fr-explore__controls { display:flex; justify-content:center; align-items:flex-end; gap:40px; }
.fr-explore__controls>button { font:11px/1.5 var(--serif); min-height:48px; min-width:88px; padding:10px 8px; border-bottom:1px solid #bbd5a844; background:transparent; }
.fr-dpad { display:grid; grid-template-columns:repeat(3,52px); grid-template-rows:repeat(2,48px); gap:5px; }
.fr-dpad button { background:#102f25a6; border:1px solid #c2d2aa60; border-radius:50%; font:24px/1 var(--serif); touch-action:manipulation; user-select:none; }
.fr-dpad [data-move=up] { grid-column:2; }
.fr-dpad [data-move=left] { grid-column:1; grid-row:2; }
.fr-dpad [data-move=down] { grid-column:2; grid-row:2; }
.fr-dpad [data-move=right] { grid-column:3; grid-row:2; }
.fr-dpad button[aria-disabled=true] { color:#c4d1bb55; border-color:#a8c5981a; background:#10251e70; }
.fr-dpad button:active { background:#91b78438; }
.fr-explore__help { font-size:9px; letter-spacing:.08em; opacity:.65; margin-top:10px!important; }
.fr-explore__targets { pointer-events:none; }
.fr .fr-forest-target { position:absolute; width:72px; height:72px; transform:translate(-50%,-50%); background:radial-gradient(ellipse,#d3ecc322,transparent 70%); padding:8px; pointer-events:auto; border-radius:50%; touch-action:manipulation; }
.fr-forest-target img { width:100%; height:100%; object-fit:contain; filter:drop-shadow(0 0 12px #d9f4b580); }
.fr-target--spirit { left:72%; top:58%; }
.fr-target--faerie { left:68%; top:40%; }
.fr-target--key { left:36%; top:62%; }
.fr-target--dew { left:63%; top:60%; }
.fr-target--tablet { left:49%; top:57%; }
.fr-target--gate { left:48%; top:49%; }
.fr-target-caption { position:absolute; width:max-content; max-width:180px; top:100%; left:50%; transform:translateX(-50%); font:11px/1.5 var(--serif); text-shadow:0 1px 5px #001c11,0 1px 12px #001c11; opacity:0; pointer-events:none; }
.fr-forest-target:hover .fr-target-caption,.fr-forest-target:focus-visible .fr-target-caption { opacity:1; }
.fr-target-glint { display:block; width:7px; height:7px; background:#e9f5c5; margin:auto; border-radius:50%; box-shadow:0 0 12px 4px #cfefad88,0 0 28px 10px #b7e6c133; }
.fr-target--faerie .fr-target-glint { width:12px; height:12px; box-shadow:-10px -3px 8px 1px #d2f1cb66,12px -5px 8px 1px #d2f1cb66,0 0 28px 8px #c8ffb977; }
.fr-inventory { position:fixed; right:max(14px,env(safe-area-inset-right)); top:max(126px,env(safe-area-inset-top)); z-index:20; display:flex; flex-direction:column; gap:5px; }
.fr-inventory button { width:48px; height:48px; display:grid; place-items:center; background:rgba(var(--veil),.82); border:1px solid var(--line); border-radius:50%; box-shadow:0 2px 12px #0002; touch-action:manipulation; }
.fr-inventory img { width:32px; height:32px; object-fit:contain; }
.fr-has-items .fr-coordinate { right:85px; }
.fr-intro-open .fr-inventory { visibility:hidden; }
.fr-item-detail { padding:30px; width:min(370px,calc(100% - 32px)); border:1px solid #a9bf9260; color:#e0e8d8; background:radial-gradient(ellipse at 50% 35%,#294737,#10251d 70%); text-align:center; box-shadow:0 30px 120px #0009; max-height:calc(100svh - 32px); overflow:auto; }
.fr-item-detail::backdrop { background:#07130ed9; }
.fr-item-detail form { text-align:right; }
.fr-item-detail button { background:transparent; min-height:44px; padding:10px; color:#d5dfca; font-size:11px; }
.fr-item-detail>p:first-of-type { font:9px var(--serif); letter-spacing:.16em; color:#b7c5a6; margin:18px 0; }
.fr-item-detail>img { display:block; margin:12px auto; max-width:100%; }
.fr-item-detail h2 { font:400 23px/1.7 var(--serif); letter-spacing:.15em; margin:20px 0 12px; }
.fr-item-detail>p:last-child { font:13px/2 var(--serif); color:#c2cfb8; }
.fr-trail-map { position:absolute; z-index:4; left:20px; bottom:190px; width:250px; max-width:calc(100% - 40px); padding:18px; background:#10281ff2; border:1px solid #b8cbab55; box-shadow:0 10px 50px #00140d66; }
.fr-trail-map svg { display:block; width:100%; max-height:220px; }
.fr-trail-map p { font:11px/1.8 var(--serif); }
.fr-trail-map button { background:none; border-bottom:1px solid #b4cba144; min-height:44px; font-size:11px; width:100%; }
.fr-explore.is-found:after,.fr-explore.is-spirit:after,.fr-explore.is-runes:after { content:''; position:absolute; inset:15% 0; pointer-events:none; background:radial-gradient(ellipse at 50% 55%,#d5efae55,transparent 45%); animation:fr-forest-glow 1.8s ease-out both; }
.fr-explore.is-spirit:after { background:radial-gradient(circle at 68% 40%,#d5ffd48c,transparent 20%); }
.fr-explore.is-runes .fr-forest-scene__land { filter:drop-shadow(0 0 8px #d7f0b044); }
.fr-gate-leaf { transition:transform 3.2s .7s ease-in-out; }
.fr-gate-seal { transition:opacity 1.2s,filter 1.2s; }
.is-open .fr-gate-leaf--left { transform:translateX(-130px); }
.is-open .fr-gate-leaf--right { transform:translateX(130px); }
.is-open .fr-gate-seal { opacity:0; }
.is-unsealing .fr-gate-seal { filter:drop-shadow(0 0 12px #f6ffe0); }
.fr-exploring:has(.is-unsealing) .fr-inventory img { animation:fr-item-answer 2.8s ease-in-out; }
.fr-forest-stag { position:absolute; width:160px; height:80px; left:24%; top:38%; fill:#183a32; color:#183a32; opacity:0; animation:fr-forest-visitor 5s ease-in-out both; }
@keyframes fr-forest-glow { 0%,100% { opacity:0; } 28% { opacity:1; } }
@keyframes fr-item-answer { 35% { filter:drop-shadow(0 0 10px #f0ffce); } }
@keyframes fr-forest-visitor { 0%,100% { opacity:0; transform:translateX(-6px); } 30%,65% { opacity:.55; } 100% { transform:translateX(10px); } }
.fr-motion-paused .fr-explore *,.fr-page-hidden .fr-explore * { animation:none!important; transition:none!important; }
.fr-motion-paused .fr-inventory img { animation:none!important; }
@media(max-width:700px) {
  .fr-exploring .fr-hero { padding:12px 0 30px; gap:36px; }
  .fr-exploring .fr-worlds { width:calc(100% - 40px); }
  .fr-explore { height:max(650px,85svh); border-left:0; border-right:0; }
  .fr-explore__heading { top:23px; left:22px; right:76px; }
  .fr-explore__heading h2 { font-size:23px; }
  .fr-explore__heading>p:last-child { font-size:11px; }
  .fr-explore__bottom { left:12px; right:12px; }
  .fr-explore__controls { gap:10px; justify-content:space-between; }
  .fr-explore__controls>button { min-width:62px; max-width:70px; font-size:10px; padding:7px 0; }
  .fr-dpad { grid-template-columns:repeat(3,48px); grid-template-rows:repeat(2,48px); gap:4px; }
  .fr-explore #forest-message { font-size:11px; min-height:3.6em; margin-bottom:10px; }
  .fr-inventory { top:100px; right:max(10px,env(safe-area-inset-right)); }
  .fr-has-items .fr-hero__content { padding-right:32px; }
  .fr-trail-map { left:12px; bottom:200px; }
  .fr-target--key { left:28%; }
  .fr-target--dew { left:64%; top:60%; }
  .fr-target--key { top:55%; }
  .fr-target--spirit { left:72%; top:54%; }
  .fr-target--faerie { left:72%; top:42%; }
}
@media(prefers-reduced-motion:reduce) {
  .fr-explore *,.fr-inventory img { animation:none!important; transition:none!important; }
}

/* The chest lives at the foot of the gate; its bell remains a separate discovery. */
.fr-forest-scene[data-kind=gate] .fr-forest-scene__land { transform:translateY(-6%) scale(.88); transform-origin:50% 38%; }
.fr .fr-target--chest { left:30%; top:57%; width:112px; height:96px; padding:0; background:none; }
.fr-target--chest .fr-target-caption { top:auto; bottom:100%; }
.fr-target--chest img { filter:drop-shadow(0 5px 8px #00150db3); }
.fr-target--chest .fr-chest-before { position:absolute; inset:0; }
.is-chest-opening .fr-chest-before { animation:fr-chest-lid 850ms ease-out both; }
.is-chest-still .fr-chest-before { display:none; }
.fr .fr-target--bell { left:30%; top:46%; width:60px; height:60px; }
.fr-explore.is-chest-opening:after,.fr-explore.is-chest-still:after { content:''; position:absolute; inset:28% 48% 24% 8%; background:radial-gradient(ellipse,#efd49b52,transparent 65%); pointer-events:none; }
.fr-explore.is-chest-opening:after { animation:fr-chest-light 1.5s ease-out both; }
.fr-explore.is-chest-still:after { opacity:.4; }
@keyframes fr-chest-lid { to { opacity:0; transform:translateY(-10px); } }
@keyframes fr-chest-light { 0%,100% { opacity:0; } 35% { opacity:.75; } }
.fr-item-detail #ring-bell { margin-top:20px; padding:12px 22px; border:1px solid #c6b67966; border-radius:2px; color:#e9dcae; min-height:48px; }
.fr-item-detail #ring-bell:disabled { opacity:.4; cursor:default; }
.fr-item-detail #forest-item-description,.fr-item-detail #bell-detail-message { font:13px/2 var(--serif); color:#c2cfb8; }
.fr-item-detail #bell-detail-message:empty { display:none; }
.fr-item-detail #bell-detail-message { margin-top:16px; font-size:12px; }
.fr-bell-notice { position:fixed; z-index:22; left:50%; bottom:max(215px,29svh); transform:translateX(-50%); width:min(360px,calc(100% - 32px)); display:flex; align-items:center; padding:6px 8px 6px 16px; gap:10px; color:var(--ink); background:rgba(var(--veil),.94); border:1px solid var(--line); box-shadow:0 8px 40px #0002; }
.fr-bell-notice p { font:12px/1.9 var(--serif); flex:1; }
.fr-bell-notice button { background:none; width:44px; min-height:44px; }
.fr-intro-open .fr-bell-notice { visibility:hidden; }
.fr-bell-light { position:fixed; inset:0; overflow:hidden; z-index:21; pointer-events:none; }
.fr[data-world=sky] .fr-relic.is-evolution-ready .fr-relic__art { filter:drop-shadow(0 0 7px #e5cb8f99); animation:fr-evolution-ready 4.8s ease-in-out infinite; }
@keyframes fr-evolution-ready { 0%,100% { opacity:.72; filter:drop-shadow(0 0 4px #e5cb8f66); } 50% { opacity:1; filter:drop-shadow(0 0 11px #e5cb8f99); } }
.fr-evolution h2 { font-size:clamp(18px,4.5vw,23px); line-height:1.9; }
.fr-evolution__items { display:flex; justify-content:center; gap:20px; margin:20px 0; }
.fr .fr-evolution__items img { width:56px; height:56px; margin:0; }
.fr .fr-evolution__actions { display:flex; justify-content:center; gap:12px; margin-top:24px; }
.fr .fr-evolution__actions button { position:static; min-width:96px; min-height:48px; padding:10px 16px; border:1px solid var(--line); background:transparent; }
.fr .fr-evolution__actions button[value=evolve] { background:rgba(var(--aether),.18); }
.fr-motion-paused .fr-relic.is-evolution-ready .fr-relic__art { animation:none!important; }
@media(prefers-reduced-motion:reduce) { .fr[data-world=sky] .fr-relic.is-evolution-ready .fr-relic__art { animation:none; } }
.fr-bell-light span { position:absolute; left:0; top:0; width:7px; height:7px; border-radius:50%; background:#efedc4; box-shadow:0 0 13px 5px #e9eab155; animation:fr-bell-gather 1.6s .45s ease-in-out both; }
.fr-bell-light span:nth-child(2) { background:#d9edf2; animation-delay:.6s; }
.fr-bell-ringing .fr-inventory [data-item=bell] img { animation:fr-bell-ring .8s ease-in-out; }
.fr-bell-ringing .fr-inventory [data-item=spirit] img,.fr-bell-ringing .fr-inventory [data-item=dew] img { animation:fr-bell-item 2.1s .2s ease-out both; }
.fr-companion.is-transforming:after { content:''; position:absolute; inset:8% -5% 2%; border-radius:50%; pointer-events:none; background:radial-gradient(ellipse,#f2efca77, #e9edc126 40%,transparent 68%); }
.fr-bell-ringing .fr-companion.is-transforming:after { animation:fr-powari-light 3.4s ease-in-out both; }
.fr-bell-ringing .fr-companion.is-transforming .fr-companion__arrival { animation:fr-powari-listen 1.2s ease-in-out both; }
.fr-bell-still .fr-companion.is-transforming:after { opacity:.3; }
@keyframes fr-bell-ring { 20% { transform:rotate(-9deg); } 45% { transform:rotate(7deg); } 70% { transform:rotate(-3deg); } }
@keyframes fr-bell-item { 45% { filter:drop-shadow(0 0 8px #e9f5bf); } }
@keyframes fr-bell-gather { 0% { opacity:0; transform:translate(var(--from-x),var(--from-y)); } 20% { opacity:.8; } 90% { opacity:.6; } 100% { opacity:0; transform:translate(var(--to-x),var(--to-y)); } }
@keyframes fr-powari-light { 0%,100% { opacity:0; transform:scale(.8); } 58%,70% { opacity:.9; transform:scale(1.1); } }
@keyframes fr-powari-listen { 40% { transform:translateY(-5px); } }
@media(max-width:700px) {
  .fr .fr-target--chest { left:20%; top:56%; width:102px; height:88px; }
  .fr .fr-target--bell { left:20%; top:46%; }
  .fr-explore.is-chest-opening:after,.fr-explore.is-chest-still:after { left:0; right:55%; }
}
@media(prefers-reduced-motion:reduce) {
  .fr-bell-light span { display:none; }
  .fr-bell-ringing .fr-companion *,.fr-companion.is-transforming:after { animation:none!important; }
  .fr-companion.is-transforming:after { opacity:.3; }
}
