/* =====================================================================
   PREMIUM SCREENS: the world behind every screen between fights, scenes for
   the Rest Stop, encounters, loot, map terrain, fight foregrounds
   ===================================================================== */
/* 1. the hunt's region behind the map, encounters, rest stops and rewards */
.overlay.world { background: radial-gradient(ellipse at 50% 42%, rgba(13,20,48,.55), rgba(13,20,48,.92) 78%), var(--world) center / cover no-repeat fixed, var(--damask) 0 0 / 90px 90px, var(--royal-mid); backdrop-filter: none; }
.overlay.world > .ov-fx { position: fixed; inset: 0; z-index: 0; opacity: .85; }
.overlay.world > .modal { position: relative; z-index: 1; box-shadow: 0 0 0 1px var(--shade-60), 0 24px 60px rgba(0,0,0,.7); }

/* scene art shared by the screens between fights */
.sc-wrap { position: relative; margin: -6px -6px 12px; border-radius: 0; overflow: hidden; border: 2px solid var(--royal); box-shadow: inset 0 0 0 2px var(--gilt), 0 8px 18px rgba(5,9,24,.4); }
.sc-svg { display: block; width: 100%; height: auto; }
.sc-flicker { animation: scFlicker 2.4s ease-in-out infinite; }
@keyframes scFlicker { 0%,100% { opacity: 1; } 25% { opacity: .82; } 50% { opacity: .95; } 70% { opacity: .78; } }
.sc-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: scFlame .9s ease-in-out infinite alternate; }
.sc-flame.f2 { animation-duration: .7s; animation-delay: -.3s; } .sc-flame.f3 { animation-duration: .5s; }
@keyframes scFlame { 0% { transform: scale(1, 1) skewX(0deg); } 50% { transform: scale(.94, 1.08) skewX(-4deg); } 100% { transform: scale(1.04, .94) skewX(3deg); } }
.sc-ember { animation: scEmber 2.2s ease-out infinite; } .sc-ember.e1 { animation-delay: -.5s; } .sc-ember.e2 { animation-delay: -1s; } .sc-ember.e3 { animation-delay: -1.5s; } .sc-ember.e4 { animation-delay: -1.9s; }
@keyframes scEmber { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(8px, -90px); opacity: 0; } }
.sc-twinkle { animation: scFlicker 3.4s ease-in-out infinite; } @keyframes scSpin { to { transform: rotate(360deg); } } @keyframes scBell { 0%,80%,100% { transform: rotate(0); } 85% { transform: rotate(12deg); } 92% { transform: rotate(-10deg); } }
.sc-z { animation: scZ 2.4s ease-in-out infinite; } .sc-z.z2 { animation-delay: -1.2s; } @keyframes scZ { 0% { opacity: 0; transform: translateY(6px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
.sc-spark { animation: scSpark 1s ease-out infinite; } .sc-spark.s1 { animation-delay: -.33s; } .sc-spark.s2 { animation-delay: -.66s; } @keyframes scSpark { 0% { opacity: 1; transform: translate(0,0); } 100% { opacity: 0; transform: translate(10px,-10px); } }
.sc-glint { animation: scGlint 2.6s ease-in-out infinite; opacity: 0; } .sc-glint.g1 { animation-delay: -.6s; } .sc-glint.g2 { animation-delay: -1.3s; } .sc-glint.g3 { animation-delay: -1.9s; }
@keyframes scGlint { 0%,70%,100% { opacity: 0; } 80% { opacity: 1; } }
body.no-fx .sc-flicker, body.no-fx .sc-flame, body.no-fx .sc-ember, body.no-fx .sc-z, body.no-fx .sc-spark, body.no-fx .sc-glint, body.no-fx .sc-twinkle { animation: none; }

/* 2. the Rest Stop: the chapel scene with your hero by the fire, illustrated choices */
.modal.rest-modal { width: min(760px, 96vw); max-width: 760px; }
.rest-scene .sc-hero { position: absolute; left: 27%; bottom: 3%; width: 17%; height: 80%; background: none; border: 0; box-shadow: none; padding: 0; }
.rest-scene .sc-hero .sprite { position: absolute; inset: 0; }
.sc-title { margin-top: 2px; }
.sc-options .option-card { padding: 0 10px 12px; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.sc-options .option-card:hover:not(:disabled) { transform: translateY(-3px); }
.sc-opt { display: block; width: calc(100% + 20px); margin: 0 -10px 8px; height: 70px; background: var(--royal-mid); border-bottom: 2px solid var(--gilt); }

/* 3. encounters as a storybook page: a framed painting, a title plaque, parchment text, carved choices */
.event-modal .event-scene { box-shadow: inset 0 0 0 2px var(--royal), inset 0 0 0 5px var(--gilt), inset 0 0 0 6px var(--royal), inset 0 -60px 80px var(--shade-30); }
.event-modal .event-scene::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(ellipse at 50% 40%, transparent 55%, var(--shade-35)); pointer-events: none; }
.event-modal .event-scene h1 { z-index: 1; text-shadow: 0 2px 0 var(--ink), 0 0 18px rgba(0,0,0,.8); letter-spacing: .02em; }
.event-modal .event-scene h1::after { content: ""; display: block; width: 120px; height: 2px; margin: 6px auto 0; background: linear-gradient(90deg, transparent, var(--gilt), transparent); }
.modal.narrow .event-text { position: relative; padding: 14px 20px; border-radius: 0; color: var(--ink); font-family: var(--font-body); font-style: italic; font-size: 17px;
  background: var(--paper); border-left: 5px solid var(--claw); box-shadow: 0 3px 0 rgba(30,27,22,.15); }
.event-modal .event-text {
  max-width: 640px; position: relative; padding: 14px 20px; border-radius: 0; color: var(--ink); font-family: var(--font-body); font-style: italic;
  font-size: 17px; background: var(--paper); border-left: 5px solid var(--claw); box-shadow: 0 3px 0 rgba(30,27,22,.15);
}
.ev-story .event-text .ev-first { color: var(--claw); font-style: normal; font-weight: 800; letter-spacing: .02em; }
.choices .choice { transition: transform .15s, border-color .15s, box-shadow .15s; }
.event-modal .choice-pic { box-shadow: inset 0 0 0 2px var(--royal); }
/* rewards: a victory banner behind the title */
.reward-modal > h1 { position: relative; display: inline-block; padding: 8px 54px 10px; margin-top: 2px; color: var(--ivory) !important; text-shadow: 0 2px 0 var(--shade-30); font-family: var(--font-scrawl) !important;
  background: var(--claw); clip-path: polygon(0 6%, 8% 0, 26% 5%, 48% 0, 70% 6%, 90% 1%, 100% 5%, 97% 50%, 100% 95%, 80% 100%, 56% 94%, 32% 100%, 10% 95%, 0 100%, 3% 50%); }
.reward-modal.rw-boss > h1 { background: var(--claw-dark); }
.reward-modal .big-icon { filter: drop-shadow(0 0 14px rgba(201,161,59,.5)); }

/* 6. the map: terrain in the margins, a banner where you stand, the road you just took inks itself in */
.map .map-terrain { position: absolute; left: 0; top: 0; pointer-events: none; }
.map .road.traveled.fresh { stroke-dasharray: 400; stroke-dashoffset: 400; animation: mapInk 1.1s ease-out .2s forwards; }
@keyframes mapInk { to { stroke-dashoffset: 0; } }
.map-here { position: absolute; width: 0; height: 0; z-index: 6; pointer-events: none; }
.map-here i {
  position: absolute; left: 0; top: -58px; width: 3px; height: 34px; animation: mapBob 1.6s ease-in-out infinite; border-color: var(--claw) !important;
  background: rgba(163, 38, 31, .25) !important;
}
.map-here i::after { content: ""; position: absolute; left: 3px; top: 0; width: 22px; height: 15px; background: var(--claw); border: 1.5px solid var(--ink); clip-path: polygon(0 0, 100% 0, 78% 50%, 100% 100%, 0 100%); }
@keyframes mapBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
body.no-fx .map-here i, body.no-fx .map .road.traveled.fresh { animation: none; stroke-dashoffset: 0; }

/* 7. fights: the region's ground along the bottom of the stage, pieces at the edges in front, cleaner plates */
.stage-fg { position: absolute; left: 0; right: 0; bottom: 0; height: 13%; z-index: -1; pointer-events: none; display: none; }
.stage-fg svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 -2px 4px var(--shade-25)); }
.stage-edge { position: absolute; bottom: 0; width: 15%; max-width: 200px; z-index: 3; pointer-events: none; display: none; filter: drop-shadow(0 -2px 6px rgba(0,0,0,.4)); }
.stage-edge.l { left: 0; } .stage-edge.r { right: 0; } .stage-edge svg { width: 100%; height: auto; display: block; }
.stage.has-fg .stage-fg, .stage.has-fg .stage-edge { display: block; }
.fg-glow { animation: scFlicker 2s ease-in-out infinite; } body.no-fx .fg-glow { animation: none; }
@media (max-width: 680px) { .stage-edge { width: 18%; } }

/* 8. a shared finish: every screen between fights is a proclamation on the wall (paper, ink and a royal double rule: see 31-homesworn.css), a royal rule under its title */
.overlay:not(.title-mode) > .modal:not(.title-modal):not(.reward-modal) > h1::after, .overlay:not(.title-mode) > .modal:not(.title-modal) .sc-title::after, #popup > .modal > h1::after {
  content: ""; display: block; width: 160px; height: 2px; margin: 6px auto 0; background: linear-gradient(90deg, transparent, var(--royal), transparent); }
.overlay:not(.title-mode) .modal .sub { color: var(--ink-muted); }

/* developer one-shot mode: a corner tag so it is never left on by accident */
body.dev-oneshot::after { content: "DEV · ONE-SHOT"; position: fixed; right: 8px; bottom: 8px; z-index: 400; padding: 3px 8px; border-radius: 0; background: var(--claw); color: var(--ivory); font: 700 11px var(--font-body); letter-spacing: .1em; pointer-events: none; opacity: .85; }
