/* guildle's styles, part 5 of 10 (adventure.css). The adventure as it plays (adventure.js).
   The parts load in order (index.html) and later rules build on earlier ones. */

/* ================================================================ the adventure (adventure.js) */
.adventure { z-index: 11; }
.adv .qv-head { gap: 6px; }
.adv-hand-wrap { position: sticky; top: 0; z-index: 3; margin: 0 -16px; padding: 0 16px 4px;
  background: linear-gradient(to bottom, #f1e8d3 88%, rgba(241, 232, 211, 0)); }
.adv-hand { pointer-events: none; }                   /* look, don't touch */
.adv-hand .hand-sway { animation: none; }
.adv-hand .hand-card { transition: transform .5s cubic-bezier(.3, 1.3, .55, 1), filter .4s; }
.adv-hand .hand-card .pstate.adv-st { top: -9px; background: #1b120a; color: var(--gold-hi); border: 1px solid #6b4f2a; font-size: .62rem; }
.adv-st[data-s="combat"], .adv-st[data-s="in-combat"] { background: #7a2019 !important; color: #ffe1d8 !important; border-color: #b0453c !important; }
.adv-st[data-s="unconscious"] { background: #3a3a3a !important; color: #ddd !important; border-color: #666 !important; }
.adv-st[data-s="fallen"] { background: #000 !important; color: #ff8a7a !important; border-color: #5a2020 !important; }
.adv-st[data-s="resting"], .adv-st[data-s="home"] { background: #1f4a31 !important; color: #c9f0d4 !important; border-color: #3f8f55 !important; }
.adv-hp { position: absolute; left: 8%; right: 8%; bottom: -12px; z-index: 3; height: 14px; border-radius: 99px; background: #1b120a; border: 1px solid #6b4f2a; overflow: hidden; display: grid; place-items: center; }
.adv-hp i { position: absolute; inset: 0; width: var(--p); background: linear-gradient(90deg, #3f8f55, #66b87a); transition: width .5s ease; }
.adv-hp.low i { background: linear-gradient(90deg, #9e2a22, #d0503f); }
/* Wild Shape: the beast's own hit points, a bar of their own just under the hero's */
.adv-hp.beast-hp { border-color: #7a5a2a; }
.adv-hp.beast-hp i { background: linear-gradient(90deg, #8a5a22, #c99a4a); }
.adv-hp.beast-hp.low i { background: linear-gradient(90deg, #7a3a12, #b8662e); }
.adv-hp b { position: relative; font: 800 .6rem/1 var(--sans); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); font-variant-numeric: tabular-nums; }
.adv-hand .hand-card.down .card { filter: grayscale(.8) brightness(.7); }
.adv-hand .hand-card.dead .card { filter: grayscale(1) brightness(.4); }
.adv-hand .hand-card.dead .hand-tilt { transform: rotate(-4deg) translateY(10px); transition: transform .6s; }
.adv-hand .hand-card.flash-hurt .card { animation: flash-hurt .6s ease-out; }
.adv-hand .hand-card.flash-heal .card { animation: flash-heal 1.6s ease-out; }
.adv-hand .hand-card.flash-buff .card { animation: flash-buff .9s ease-out; }
@keyframes flash-hurt { 0% { box-shadow: 0 0 0 2px rgba(208, 60, 45, .55), 0 0 16px rgba(208, 60, 45, .45); } 100% { box-shadow: 0 6px 14px rgba(43, 33, 24, .35); } }
@keyframes flash-heal { 0% { box-shadow: 0 0 0 2px rgba(90, 190, 120, .55), 0 0 18px rgba(90, 190, 120, .45); } 100% { box-shadow: 0 6px 14px rgba(43, 33, 24, .35); } }
@keyframes flash-buff { 0% { box-shadow: 0 0 0 4px rgba(240, 207, 142, .9), 0 0 34px rgba(240, 207, 142, .8); } 100% { box-shadow: 0 6px 14px rgba(43, 33, 24, .35); } }

/* a die over a hero's card, like the recruitment dice */
.adv-roll { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 5; display: grid; justify-items: center; gap: 5px;
  padding: 10px 12px 9px; min-width: 78%; border-radius: 10px; background: rgba(27, 18, 10, .9); border: 1px solid #6b4f2a; box-shadow: 0 10px 24px rgba(0, 0, 0, .45); --glow: var(--gold); }
.adv-roll .adv-die { position: static; margin: 0; width: 44px; height: 44px; font-size: 1.3rem; border-radius: 10px; }
.adv-lab { font: 700 .66rem/1.2 var(--sans); letter-spacing: .06em; color: #cbb892; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adv-res { font: 800 1rem/1 var(--sans); color: #f6ecd6; min-height: 1em; font-variant-numeric: tabular-nums; }
.adv-roll.pass { border-color: #4f9f65; box-shadow: 0 0 0 2px rgba(79, 159, 101, .4), 0 10px 24px rgba(0, 0, 0, .45); --glow: #7fdc9a; }
.adv-roll.pass .adv-res { color: #9fe0b2; }
.adv-roll.fail { border-color: #b0453c; box-shadow: 0 0 0 2px rgba(176, 69, 60, .35), 0 10px 24px rgba(0, 0, 0, .45); --glow: #ff8a7a; }
.adv-roll.fail .adv-res { color: #ff9d90; }
.adv-roll.nat20 .adv-die { background: linear-gradient(145deg, #fff6c9, #f0cf8e); box-shadow: 0 0 18px #f0cf8e; }
.adv-roll.nat1 .adv-die { background: linear-gradient(145deg, #e9c7c2, #b77a72); }
.adv-roll.landed .adv-die { animation: land .35s cubic-bezier(.3,1.6,.5,1); }
@media (max-width: 560px) {
  .adv-roll { padding: 6px 5px; min-width: 92%; gap: 3px; }
  .adv-roll .adv-die { width: 32px; height: 32px; font-size: 1rem; }
  .adv-lab { font-size: .58rem; }
  .adv-res { font-size: .8rem; }
}
.adv-float { position: absolute; left: 50%; top: 22%; z-index: 6; pointer-events: none; white-space: nowrap; font: 800 1.35rem/1 var(--sans); text-shadow: 0 2px 6px rgba(0, 0, 0, .55), 0 0 2px rgba(0, 0, 0, .8); }
.adv-float.hurt, .adv-float.crit-hurt { color: #ff6a57; }
.adv-float.crit-hurt { font-size: 1.7rem; }
.adv-float.heal { color: #8ff0a8; }
.adv-float.dealt { color: #fff3c4; }
.adv-float.crit { color: #ffd76a; font-size: 1.6rem; }
.adv-float.miss { color: #e9e0cc; font-size: 1.05rem; }

/* the stage feed: newest on top, each new one rising in from below */
.adv-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.adv-stage { background: rgba(255, 255, 255, .38); border: 1px solid rgba(43, 33, 24, .16); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column-reverse; gap: 8px; }
.adv-stage.boss { border-color: #b8913f; box-shadow: inset 0 0 0 1px rgba(184, 145, 63, .35); }
.adv-stage.enter { animation: adv-rise .6s cubic-bezier(.2,.9,.3,1.05) both; }
@keyframes adv-rise { from { opacity: 0; transform: translateY(40px) scale(.97); } to { opacity: 1; transform: none; } }
.adv-sh { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: center; }
.adv-sh b { font: 400 1.3rem/1.1 var(--display); color: var(--ink); }
.adv-sh small { display: block; font: 700 .64rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.adv-mark { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font: 800 .9rem/1 var(--sans); background: rgba(43, 33, 24, .08); color: var(--ink-soft); }
.adv-stage.pass .adv-mark { background: rgba(63, 143, 85, .2); color: #2a6a3e; }
.adv-stage.fail .adv-mark { background: rgba(176, 48, 42, .16); color: #9e2a22; }
.adv-stage.cost .adv-mark { background: rgba(214, 150, 40, .22); color: #83530a; }
.adv-stage.end .adv-mark { background: #1a1a1a; color: #ddd; }
.adv-scene { margin: 0; font: italic 1rem/1.4 var(--serif); color: var(--ink-soft); }
.adv-need { margin: 0; font-size: .86rem; color: var(--ink-soft); }
.adv-need b { color: var(--ink); }
.adv-lines { margin: 0; border-left-color: rgba(43, 33, 24, .2); color: var(--ink-soft); font-size: .84rem; }
.adv-lines p.in { animation: fadein .35s ease-out both; }
.adventure .rp-lines .log-bad { color: #a8291f; }
.adventure .rp-lines .log-dead { color: #8e140c; }
.adventure .rp-lines .log-good { color: #2a6a3e; }
.adventure .rp-lines .log-loot { color: #8a6414; }
.adventure .rp-lines .log-crit { color: #8a6414; }
.adventure .rp-lines .log-round { color: var(--ink); opacity: 1; }
.adv-rounds { display: grid; gap: 6px; }
.adv-round { background: rgba(43, 33, 24, .04); border-radius: 6px; padding: 6px 8px; border-left: 2px solid #b8913f; }
.adv-round.enter { animation: adv-rise .45s ease-out both; }
.adv-sum { display: grid; gap: 6px; border-bottom: 1px dashed rgba(43, 33, 24, .2); padding-bottom: 8px; }
.adv-sum p { margin: 0; font-weight: 600; color: var(--ink); }
.adventure .rp-chips .chip.hurt { color: #9e2a22; background: rgba(176, 48, 42, .1); }
.adventure .rp-chips .chip.hurt.dead { color: #fff; }
.adventure .rp-chips .chip.loot { color: #8a6414; }
.adventure .rp-chips .chip.xp { color: #2a6a3e; }
.adv-end:empty { display: none; }
.adv-end { display: grid; gap: 10px; }
.adventure .rp-outcome span { color: var(--ink-soft); }
.adventure .rp-outcome.good b { color: #2a6a3e; }
.adventure .rp-outcome.bad b { color: #9e2a22; }
.adventure .rp-outcome.o-triumph b { color: #8a6414; }
.adventure .rp-gold { color: #8a6414; }
.adventure .rp-heroes li { background: rgba(255, 255, 255, .38); border-color: rgba(43, 33, 24, .16); color: var(--ink); }
.adventure .rp-heroes li > span { color: var(--ink-soft); }
.adventure .rp-heroes li.dead { background: rgba(40, 8, 8, .1); border-color: #b06a60; }
.adventure .rp-level { color: #2a6a3e !important; }
.adventure .rp-dead, .adventure .rp-rest { color: #9e2a22 !important; }
.adventure .rp-down { color: #83530a !important; }
.adventure .rp-mvp { color: #8a6414 !important; }
.adv-skip { border-style: solid; }
/* Log entries written as a few short lines: who acts, the roll, the result, what it did. */
.rp-lines p.log-multi { display: grid; gap: 1px; margin: 3px 0; padding: 1px 0; color: var(--text-dim); font-weight: 400; }
.rp-lines p.log-multi + p.log-multi { border-top: 1px dashed rgba(127, 110, 80, .18); padding-top: 4px; }
.rp-lines .log-multi span { display: block; }
.rp-lines .log-multi span[hidden] { display: none; }
.rp-lines .log-multi span.in { animation: fadein .3s ease-out both; }
.rp-lines .log-multi .l-head { color: var(--text); font-weight: 600; }
.rp-lines .log-multi .l-res { font-weight: 800; }
.rp-lines .log-multi .l-res.ok { color: #8fdca6; }
.rp-lines .log-multi.log-bad .l-res, .rp-lines .log-multi.log-bad .l-after, .rp-lines .log-multi.log-dead .l-after { color: var(--bad); }
.rp-lines .log-multi.log-crit .l-res { color: #ffe08a; }
.adventure .rp-lines p.log-multi { color: var(--ink-soft); }
.adventure .rp-lines .log-multi .l-head { color: var(--ink); }
.adventure .rp-lines .log-multi .l-res.ok, .adventure .rp-lines .log-multi.log-good .l-res { color: #2a6a3e; }
.adventure .rp-lines .log-multi.log-bad .l-res, .adventure .rp-lines .log-multi.log-bad .l-after, .adventure .rp-lines .log-multi.log-dead .l-after { color: #a8291f; }
.adventure .rp-lines .log-multi.log-crit .l-res { color: #8a6414; }
.adv-need small { display: block; margin-top: 2px; font-size: .78rem; opacity: .8; }
@media (prefers-reduced-motion: reduce) { .adv-stage.enter, .adv-round.enter, .adv-lines p.in { animation: none; } }
.adv-hand-wrap { background: linear-gradient(170deg, var(--card) 0%, var(--card-edge) 100%); background-attachment: fixed; box-shadow: 0 10px 12px -12px rgba(43, 33, 24, .35); }
@media (max-width: 560px) {
  .adv-hand .hand-card .pstate.adv-st { font-size: .46rem; padding: 2px 5px; top: -7px; letter-spacing: .06em; }
  .adv-hp { height: 11px; bottom: -9px; }
  .adv-hp b { font-size: .5rem; }
  .adv-float { font-size: 1.05rem; }
  .adv-float.crit, .adv-float.crit-hurt { font-size: 1.25rem; }
}
@media (max-width: 420px) {
  .adventure .qv-scroll { bottom: 68px; }
  .adventure .qv-foot { height: 68px; flex-wrap: nowrap; }
  .adventure .qv-go { flex: 0 0 auto; margin-left: auto; }
}
/* the adventure's status badges don't dim the cards (only being down or fallen does) */
.adv-hand .hand-card:not(.down):not(.dead) .card { filter: none; }

/* Adventure dice: plain shapes by their sides (d4 triangle … d20 hexagon), no outline, a little
   see-through. A d20 with a verdict tints all over, green (success) or red (failure); a natural 20
   tints gold and sparkles. Damage dice never tint. */
.adv-layer { z-index: 6; }
.adv-die { width: 38px; height: 38px; margin: -19px 0 0 -19px; background: none; border: 0; box-shadow: none; border-radius: 0; }
.adv-die svg { width: 100%; height: 100%; overflow: visible; opacity: .9; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.adv-die svg .body path, .adv-die svg .body rect { fill: url(#adv-die-fill); stroke: none; }
.adv-die svg .tint path, .adv-die svg .tint rect { fill: var(--tint, transparent); stroke: none; opacity: 0; transition: opacity .4s ease, fill .4s ease; }
.adv-die svg text { font: 800 13px/1 var(--sans); fill: rgba(43, 29, 14, .92); text-anchor: middle; dominant-baseline: central; transition: fill .4s; }
.adv-die.big svg text { font-size: 15px; }
.adv-die.d4 svg text { font-size: 12px; }
.adv-die i { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 2px); font: 800 8px/1 var(--sans); font-style: normal; letter-spacing: .06em; color: #fff3c4; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
.adv-die.settled svg { animation: die-land .3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes die-land { from { transform: scale(1.25); } to { transform: none; } }
.adv-die.enemy svg .body path, .adv-die.enemy svg .body rect { fill: url(#adv-die-foe); }
.adv-die.enemy svg text { fill: rgba(255, 228, 220, .95); }
.adv-die.ok svg .tint path { --tint: #4fae6c; opacity: .72; }
.adv-die.no svg .tint path { --tint: #c2463a; opacity: .72; }
.adv-die.ok svg text, .adv-die.no svg text { fill: #fff; }
.adv-die.nat20 svg .tint path { --tint: #f2c14e; opacity: .85; }
.adv-die.nat20 svg text { fill: #4a3000; }
.adv-die.nat20 svg { filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3)); animation: gold-pulse 1.6s ease-in-out infinite; }
@keyframes gold-pulse { 50% { filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3)) drop-shadow(0 0 10px rgba(255, 215, 110, .75)); } }
.adv-spark { position: absolute; left: 0; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; pointer-events: none; z-index: 2;
  background: radial-gradient(circle, #fff 0 18%, rgba(255, 226, 140, .9) 30%, transparent 66%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
@media (max-width: 560px) {
  .adv-die i { font-size: 7px; }
  .adv-spark { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; }
}

/* Notes: like damage numbers in a game. No box; bold, outlined, slightly see-through and rubbed. */
.adv-note { position: absolute; left: 0; top: 0; z-index: 7; pointer-events: none; width: max-content; text-align: center; line-height: 1.05;
  font: 900 1.05rem/1.05 var(--sans); letter-spacing: .01em; text-transform: none; color: #fff3d6;
  -webkit-text-stroke: 1px rgba(30, 18, 8, .75); paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(30, 18, 8, .55), 0 3px 8px rgba(0, 0, 0, .45); filter: url(#adv-worn-text); }
.adv-note.good, .adv-note.heal { color: #9ff0b6; }
.adv-note.bad, .adv-note.hurt { color: #ff8f7e; }
.adv-note.hurt { font-size: 1.25rem; }
.adv-note.dealt { color: #ffe39a; font-size: 1.2rem; }
.adv-note.crit { color: #ffd45a; font-size: 1.45rem; }
.adv-note.miss { color: #d6e6ff; font-size: 1.2rem; -webkit-text-stroke: 1.2px rgba(20, 24, 40, .9); }
.adv-note.ability { color: #dcc6ff; font-style: italic; }
.adv-note.rage { color: #ff7a62; font-size: 1.35rem; }
@media (max-width: 560px) {
  .adv-note { font-size: .7rem; -webkit-text-stroke-width: .7px; }
  .adv-note.hurt, .adv-note.dealt, .adv-note.rage, .adv-note.miss { font-size: .82rem; }
  .adv-note.crit { font-size: .95rem; }
}

/* Abilities. A soft glow of the ability's colour (--fx) that pulses slowly and fades, plus a move
   (adventure.js FX/MOVES). */
.adv-hand .hand-tilt::before, .adv-hand .hand-tilt::after { content: ""; position: absolute; inset: 0; border-radius: 7%; pointer-events: none; opacity: 0; z-index: -1; }
.adv-hand .hand-card.adv-fx .hand-tilt::after { animation: fx-glow 2.5s ease-in-out both;
  box-shadow: 0 0 0 1px rgba(var(--fx), .45), 0 0 16px 4px rgba(var(--fx), .4); }
@keyframes fx-glow { 0% { opacity: 0; } 25% { opacity: 1; } 50% { opacity: .55; } 72% { opacity: .9; } 100% { opacity: 0; } }
/* Bless: a soft golden glow for the rest of the stage, pulsing slowly. */
.adv-hand .hand-card.aura-bless .hand-tilt::before { opacity: 1; animation: aura-pulse 3.6s ease-in-out infinite;
  box-shadow: 0 0 0 1px rgba(255, 214, 120, .5), 0 0 14px 3px rgba(255, 205, 100, .35); }
/* Rage: the card grows a little and is tinted red for the rest of the fight. */
.adv-hand .hand-sway { transition: transform .5s cubic-bezier(.3, 1.3, .5, 1); }
.adv-hand .hand-card.aura-rage .hand-sway { transform: scale(1.05); }
.adv-hand .hand-card.aura-rage .card { box-shadow: inset 0 0 0 999px rgba(190, 35, 20, .1), 0 0 0 1px rgba(210, 70, 50, .5); }
.adv-hand .hand-card.aura-rage .hand-tilt::before { opacity: 1; animation: aura-pulse 2.8s ease-in-out infinite; box-shadow: 0 0 16px 4px rgba(220, 60, 35, .35); }
@keyframes aura-pulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
/* Fireball: the whole party lit orange for a moment. */
.adv-hand.blaze::after { content: ""; position: absolute; inset: -10% -4%; pointer-events: none; z-index: 60; border-radius: 30px;
  background: radial-gradient(ellipse at 50% 55%, rgba(255, 180, 60, .3), rgba(255, 90, 20, .12) 45%, transparent 72%); animation: blaze 1.6s ease-in-out both; }
@keyframes blaze { 0% { opacity: 0; transform: scale(.85); } 30% { opacity: 1; } 55% { opacity: .6; } 75% { opacity: .85; } 100% { opacity: 0; transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .adv-hand .hand-card.aura-bless .hand-tilt::before, .adv-hand .hand-card.aura-rage .hand-tilt::before { animation: none; } .adv-hand .hand-card.adv-fx .hand-tilt::after { animation-duration: .01s; } }

/* The quest's name always shows at the top of the adventure. */
#adventure .adv-title { display: block; margin: 0; font: 400 2.4rem/1.05 var(--display); color: var(--ink); visibility: visible; opacity: 1; }
@media (max-width: 560px) { #adventure .adv-title { font-size: 1.6rem; } }

/* Labels and tags are small squared-off boxes (5px corners, a thin border), like the quest trait
   tags. No rounded pills anywhere. */
