/* guildle's styles, part 4 of 10 (quests.css). Home tabs, quest notices and the quest view, and a hand of cards (hand.js).
   The parts load in order (index.html) and later rules build on earlier ones. */

/* ================================================================ tabs (the Heroes room's and the admin panel's), and the home screen's pages */
.home-tabs { display: flex; gap: 4px; }
.home-tab { position: relative; background: none; border: 0; padding: 6px 14px 10px; font: 400 1.7rem/1 var(--display); color: var(--text-dim); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.home-tab:hover { color: var(--text); }
.home-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--gold); }
.home-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 6px 6px 0 0; }
.tab-panel { display: grid; gap: 14px; animation: fadein .3s ease-out both; }
.tab-panel > .party-head { border-bottom: 0; padding-bottom: 0; }
.tab-panel .away { margin-top: 0; }
@media (max-width: 560px) {
  .home-tab { flex: 1; font-size: 1.5rem; }
  .home-tabs { width: 100%; }
}

/* ================================================================ notices: CR and scouting */
.n-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.n-badges { display: inline-flex; align-items: center; flex: none; }
.q-diff { font: 800 .66rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; border-radius: 5px; margin-right: 4px; white-space: nowrap; cursor: help; color: #1d1206; }
.q-diff.d-easy { background: #8fd4b4; } .q-diff.d-medium { background: #e2cd78; } .q-diff.d-hard { background: #eb9b5e; } .q-diff.d-deadly { background: #c9473f; color: #fff; }
.cr { font: 800 .7rem/1 var(--sans); letter-spacing: .06em; padding: 4px 7px; border-radius: 5px; background: #1b120a; color: var(--gold-hi); border: 1px solid #6b4f2a; white-space: nowrap; cursor: help; }
.n-scout { font: 800 .62rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; padding: 3px 6px; border-radius: 4px; }
.n-scout.ok { background: rgba(63, 143, 85, .18); color: #2f6d43; }
.n-scout.no { background: rgba(43, 33, 24, .1); color: var(--ink-soft); }


/* ================================================================ the quest view (a notice, grown to fill the screen) */
html.qv-open { overflow: hidden; background: var(--card-edge); } /* the scrollbar gutter matches the parchment */
.quest-view { --qv-bg: var(--felt-deep); position: fixed; inset: 0; z-index: 9; background: var(--qv-bg); background-image: radial-gradient(ellipse at top, rgba(240, 207, 142, .06), transparent 60%); color: var(--text); }
.qv-scroll { position: absolute; inset: 0 0 68px; overflow-y: auto; overscroll-behavior: contain; }
.qv-body { max-width: 860px; margin: 0 auto; padding: 26px 16px 40px; }
.qv-foot { position: absolute; left: 0; right: 0; bottom: 0; height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 max(16px, calc((100vw - 860px) / 2)); padding-bottom: env(safe-area-inset-bottom); background: rgba(var(--panel-rgb), .94); border-top: 1px solid var(--felt-line); }
.qv-foot .recruit { font-size: 1.15rem; }
.qv { display: grid; gap: 22px; }
.qv-head { display: grid; gap: 8px; border-top: 6px solid var(--tc); padding-top: 14px; }
.qv-head h2 { margin: 0; font: 400 2.4rem/1.05 var(--display); }
.qv-head .qs-blurb { margin: 0; max-width: 62ch; }
.qv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) { .qv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.qv-sec { display: grid; gap: 10px; }
.qv-sec h3:not(.c-name) { margin: 0; font: 700 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.qv-sec h3 small { letter-spacing: 0; font-weight: 500; margin-left: 4px; }
.qv-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qv-hint { margin: 0; font-size: .8rem; color: var(--text-dim); max-width: 70ch; }
.qv-orders { justify-self: start; }

/* stages */
.qv-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qv-stage { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: rgba(0, 0, 0, .22); border: 1px solid var(--felt-line); border-radius: 8px; padding: 9px 10px; min-height: 46px; }
.qv-stage.boss { border-color: var(--brass-dim); }
.qn { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font: 800 .8rem/1 var(--sans); background: rgba(255, 255, 255, .06); color: var(--text-dim); }
.qv-stage.unknown .qq { font: 800 1rem/1 var(--sans); letter-spacing: .35em; color: rgba(169, 184, 173, .45); }
.qv-stage .qs-text { display: grid; gap: 3px; min-width: 0; }
.qv-stage .qs-text small { font-size: .8rem; color: var(--text-dim); }
.qv-trait { color: var(--text); font-weight: 700; border-bottom: 1px dotted rgba(255, 255, 255, .35); --tc: var(--gold); }
.qv-trait.spec { color: #e2c9ff; border-bottom-color: rgba(183, 124, 255, .6); }
.qr { font: 800 .9rem/1 var(--sans); padding: 6px 8px; border-radius: 6px; min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.qr.good { background: rgba(63, 143, 85, .22); color: var(--good); }
.qr.mid { background: rgba(214, 150, 40, .2); color: #f3c76b; }
.qr.bad { background: rgba(176, 48, 42, .25); color: #ff9d90; }
.qr.rest, .qr.none { background: rgba(255, 255, 255, .06); color: var(--text-dim); font-size: .72rem; }
.qv-stages.reveal .qv-stage { animation: stagein .55s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 140ms); }
@keyframes stagein { from { opacity: 0; transform: rotateX(80deg) translateY(-6px); } to { opacity: 1; transform: none; } }

/* scouting */
.qv-scout { display: grid; gap: 10px; justify-items: start; }
.qv-scout-btn { font-size: .95rem; padding: 10px 16px; border-style: solid; border-color: var(--brass); color: var(--gold); }
.qv-scout-btn small { font-weight: 600; color: var(--text-dim); margin-left: 6px; }
.qv-scout-btn:hover:not(:disabled) { background: #1b120a; }
.qv-rolls { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; width: 100%; }
.qv-rolls:empty { display: none; }
.qv-roll { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, .25); border: 1px solid var(--felt-line); transition: border-color .2s, background .2s; }
.qv-die { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: #f4ecda; color: #2b2118; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), 0 3px 8px rgba(0, 0, 0, .4); }
.qv-die b { font: 800 1.2rem/1 var(--sans); font-variant-numeric: tabular-nums; }
.qv-roll.rolling .qv-die { animation: tumble .35s linear infinite; }
@keyframes tumble { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(.9); } 100% { transform: rotate(360deg) scale(1); } }
.qv-roll.landed .qv-die { animation: land .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes land { from { transform: scale(1.35); } to { transform: none; } }
.qv-who { display: grid; gap: 2px; min-width: 0; }
.qv-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qv-who small { font-size: .74rem; color: var(--text-dim); }
.qv-total { font: 800 1rem/1 var(--sans); font-variant-numeric: tabular-nums; }
.qv-roll.pass { border-color: rgba(63, 143, 85, .6); background: rgba(63, 143, 85, .12); }
.qv-roll.pass .qv-total { color: #9fe0b2; }
.qv-roll.fail { border-color: rgba(176, 48, 42, .5); background: rgba(176, 48, 42, .1); }
.qv-roll.fail .qv-total { color: #ff9d90; }
.qv-verdict { margin: 0; font-weight: 700; }
.qv-verdict.good { color: #9fe0b2; }
.qv-verdict.bad { color: #ff9d90; }
@media (prefers-reduced-motion: reduce) { .qv-roll.rolling .qv-die, .qv-roll.landed .qv-die, .qv-stages.reveal .qv-stage { animation: none; } }

/* ---------------------------------------------------------------- the quest view on parchment
   The notice's own paper grows to fill the screen, so everything inside is ink on parchment. */
.quest-view {
  --pv-line: rgba(43, 33, 24, .16); --pv-box: rgba(255, 255, 255, .38); --pv-dim: var(--ink-soft);
  background: linear-gradient(170deg, var(--card) 0%, var(--card-edge) 100%); background-attachment: fixed; color: var(--ink);
}
.quest-view .qv-head h2 { color: var(--ink); }
.quest-view .qs-blurb { color: var(--ink-soft); }
.quest-view .qv-sec h3:not(.c-name), .quest-view .qv-hint, .quest-view .qs-order-note, .quest-view .qs-xp-note { color: var(--pv-dim); }
.quest-view .qs-grid > div { background: var(--pv-box); border-color: var(--pv-line); }
.quest-view .qs-grid span, .quest-view .qs-grid small { color: var(--pv-dim); }
.quest-view .qs-grid b { color: var(--ink); }
.quest-view .qs-grid b.big { color: #8a6414; }
.quest-view .orders { background: rgba(43, 33, 24, .07); border-color: var(--pv-line); }
.quest-view .order { color: var(--ink-soft); }
.quest-view .order:hover { color: var(--ink); }
.quest-view .order[aria-checked="true"] { background: #1b120a; color: var(--gold-hi); }
.quest-view .qv-stage { background: var(--pv-box); border-color: var(--pv-line); }
.quest-view .qv-stage.boss { border-color: #b8913f; box-shadow: inset 0 0 0 1px rgba(184, 145, 63, .35); }
.quest-view .qn { background: rgba(43, 33, 24, .08); color: var(--ink-soft); }
.quest-view .qv-stage.unknown .qq { color: rgba(43, 33, 24, .32); }
.quest-view .qv-stage .qs-text small { color: var(--ink-soft); }
.quest-view .qv-trait { color: var(--ink); border-bottom-color: rgba(43, 33, 24, .4); }
.quest-view .qv-trait.spec { color: #5b2b85; border-bottom-color: rgba(138, 72, 194, .5); }
.quest-view .qr.good { background: rgba(63, 143, 85, .18); color: #2a6a3e; }
.quest-view .qr.mid { background: rgba(214, 150, 40, .22); color: #83530a; }
.quest-view .qr.bad { background: rgba(176, 48, 42, .15); color: #9e2a22; }
.quest-view .qr.rest, .quest-view .qr.none { background: rgba(43, 33, 24, .07); color: var(--ink-soft); }
.quest-view .n-scout.ok { background: rgba(63, 143, 85, .18); color: #2a6a3e; }
.quest-view .qv-scout-btn { background: #1b120a; }
.quest-view .qv-scout-btn small { color: #cbb892; }
.quest-view .qv-roll { background: var(--pv-box); border-color: var(--pv-line); }
.quest-view .qv-die { background: #1b120a; color: #f6ecd6; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .4), 0 3px 8px rgba(43, 33, 24, .35); }
.quest-view .qv-who small { color: var(--ink-soft); }
.quest-view .qv-roll.pass { border-color: rgba(63, 143, 85, .55); background: rgba(63, 143, 85, .12); }
.quest-view .qv-roll.pass .qv-total { color: #2a6a3e; }
.quest-view .qv-roll.fail { border-color: rgba(176, 48, 42, .45); background: rgba(176, 48, 42, .08); }
.quest-view .qv-roll.fail .qv-total { color: #9e2a22; }
.quest-view .qv-verdict.good { color: #2a6a3e; }
.quest-view .qv-verdict.bad { color: #9e2a22; }
.quest-view .qs-xp-total { color: var(--ink-soft); }
.quest-view .qs-xp-total b { color: #2a6a3e; }
.quest-view .qs-xp-total small { background: rgba(43, 33, 24, .08); color: var(--ink-soft); }
.quest-view .qs-xp li { background: var(--pv-box); border-color: var(--pv-line); color: var(--ink); }
.quest-view .qs-xp li small, .quest-view .qs-xp li b { color: var(--ink-soft); }
.quest-view .qs-xp li b.up { color: #2a6a3e; }
.quest-view .qv-foot { background: rgba(227, 214, 184, .95); border-top-color: rgba(43, 33, 24, .2); box-shadow: 0 -6px 16px rgba(43, 33, 24, .12); }
.quest-view .qv-foot .link { color: var(--ink-soft); }
.quest-view .qv-foot .recruit { background: #1b120a; }
.quest-view .qv-foot .recruit:disabled { opacity: .55; }

/* ---------------------------------------------------------------- quest view: the party, small */
.qv-mini { position: relative; display: block; aspect-ratio: 5 / 7; width: 100%; }
.qv-mini-in { position: absolute; top: 0; left: 0; width: var(--draw, 260px); transform: scale(var(--s, 1)); transform-origin: top left; }
.hand-card .pstate { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); z-index: 3; font-size: .6rem; padding: 3px 6px; white-space: nowrap; }
.quest-view .pslot.vacant { background: rgba(43, 33, 24, .05); border-color: rgba(143, 108, 52, .6); color: var(--ink-soft); font-size: .8rem; gap: 2px; }
.quest-view .pslot.vacant .plus { font-size: 1.8rem; color: #8f6c34; }
.quest-view .pslot.vacant:hover { border-color: #8f6c34; color: var(--ink); }

/* a scouting die over a hero's card */
.qv-over { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; display: grid; justify-items: center; gap: 4px; min-width: 76%; padding: 9px 8px 8px; border-radius: 10px; background: rgba(27, 18, 10, .9); color: #f6ecd6; border: 1px solid #6b4f2a; box-shadow: 0 8px 20px rgba(0, 0, 0, .45); pointer-events: none; animation: overin .25s ease-out both; }
@keyframes overin { from { opacity: 0; transform: translate(-50%, -40%) scale(.85); } to { opacity: 1; transform: translate(-50%, -50%); } }
.quest-view .qv-over .qv-die { width: 40px; height: 40px; background: #f4ecda; color: #2b2118; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), 0 3px 8px rgba(0, 0, 0, .4); }
.qv-over .qv-die b { font-size: 1.15rem; }
.qv-over .qv-sum { font: 700 .66rem/1.1 var(--sans); color: #cbb892; text-align: center; }
.qv-over .qv-total { font: 800 1rem/1 var(--sans); min-height: 1em; }
.qv-over.rolling .qv-die { animation: tumble .35s linear infinite; }
.qv-over.landed .qv-die { animation: land .35s cubic-bezier(.3,1.6,.5,1); }
.qv-over.pass { border-color: #4f9f65; box-shadow: 0 0 0 2px rgba(79, 159, 101, .35), 0 8px 20px rgba(0, 0, 0, .45); }
.qv-over.pass .qv-total { color: #9fe0b2; }
.qv-over.fail { border-color: #b0453c; box-shadow: 0 0 0 2px rgba(176, 69, 60, .3), 0 8px 20px rgba(0, 0, 0, .45); }
.qv-over.fail .qv-total { color: #ff9d90; }
@media (max-width: 560px) {
  .qv-over { min-width: 88%; padding: 6px 4px; gap: 3px; }
  .quest-view .qv-over .qv-die { width: 30px; height: 30px; }
  .qv-over .qv-die b { font-size: .9rem; }
  .qv-over .qv-sum { font-size: .6rem; }
  .qv-over .qv-total { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) { .qv-over, .qv-over.rolling .qv-die, .qv-over.landed .qv-die { animation: none; } }

/* ---------------------------------------------------------------- quest view: prepare for adventure */
.qv-prep { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; max-width: 660px; }
.qv-opt { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 10px; background: #1b120a; color: #f6ecd6; border: 1px solid #6b4f2a; box-shadow: 0 6px 14px rgba(43, 33, 24, .25); cursor: pointer; font: inherit; transition: transform .15s, border-color .15s, box-shadow .15s; }
.qv-opt:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 10px 20px rgba(43, 33, 24, .3); }
.qv-opt:disabled { cursor: default; }
.qv-opt-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(240, 207, 142, .12); color: var(--gold); }
.qv-opt-icon svg { width: 22px; height: 22px; }
.qv-opt-text { display: grid; gap: 3px; min-width: 0; }
.qv-opt-text b { font: 400 1.25rem/1.1 var(--display); color: var(--gold); }
.qv-opt-text small { font-size: .78rem; line-height: 1.35; color: #cbb892; }
.qv-opt-tag { font: 800 .7rem/1 var(--sans); letter-spacing: .06em; padding: 5px 8px; border-radius: 6px; border: 1px solid #6b4f2a; color: var(--gold); white-space: nowrap; }
.qv-opt.done { border-color: #4f9f65; }
.qv-opt.done .qv-opt-tag { color: #9fe0b2; border-color: #4f9f65; }
.qv-opt.failed { opacity: .85; }
.qv-opt.failed .qv-opt-tag { color: #ff9d90; border-color: #b0453c; }

/* quest view: close button and the reward in the bottom bar */
.qv-x { position: absolute; top: 12px; right: 14px; z-index: 2; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #1b120a; color: #f6ecd6; border: 1px solid #6b4f2a; font: 400 1.7rem/1 var(--sans); cursor: pointer; box-shadow: 0 4px 12px rgba(43, 33, 24, .3); }
.qv-x:hover { border-color: var(--gold); color: var(--gold); }
.qv-x:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.qv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .qv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .qv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .qv-grid > div:first-child { grid-column: 1 / -1; } }
.qv-reward { display: grid; gap: 3px; min-width: 0; }
.qv-reward > span { font: 700 .62rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.qv-reward b { font: 800 1rem/1.2 var(--sans); color: var(--ink); }
@media (max-width: 480px) { .qv-reward b { font-size: .86rem; } }
@media (max-width: 700px) { .qv-body { padding-top: 64px; } .qv-x { top: 12px; right: 12px; width: 40px; height: 40px; } }
.qv-foot .recruit { white-space: nowrap; }
@media (max-width: 480px) {
  .qv-foot { gap: 10px; }
  .qv-foot .recruit { font-size: 1rem; padding: 10px 14px 10px 12px; gap: 6px; }
  .qv-reward > span { font-size: .6rem; }
}
.qv-reward .gold { color: #a8750f; }
.qv-reward .xp { color: #2a6a3e; }

/* ---------------------------------------------------------------- a hand of cards (hand.js) */
.hand { position: relative; width: 100%; touch-action: pan-y; margin-top: 4px; -webkit-user-select: none; user-select: none; }
.hand-card {
  position: absolute; left: 50%; top: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer;
  transform-origin: 50% 85%; transition: transform .42s cubic-bezier(.3, 1.45, .55, 1), filter .2s; -webkit-tap-highlight-color: transparent;
}
.hand-card:focus-visible { outline: none; }
.hand-card:focus-visible .hand-tilt { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
.hand-sway { display: block; animation: sway 5s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes sway { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.hand-card.focus .hand-sway { animation-play-state: paused; }
.hand-tilt { position: relative; display: block; transition: transform .18s ease-out; }
/* 3D only while a card is being tilted: flat cards are drawn sharper */
.hand-tilt.tilting { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.hand-card .card { box-shadow: 0 6px 14px rgba(43, 33, 24, .35); transition: box-shadow .3s; }
.hand-card.focus .card { box-shadow: 0 22px 40px rgba(43, 33, 24, .45), 0 0 0 1px rgba(255, 255, 255, .2); }
.hand-glare { position: absolute; inset: 0; border-radius: 4%; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255, 255, 255, .35), transparent 55%); mix-blend-mode: soft-light; }
.hand-card.focus .hand-glare { opacity: 1; }
.hand-vacant { display: grid; place-content: center; justify-items: center; gap: 4px; aspect-ratio: 5 / 7; border-radius: 8px; border: 2px dashed rgba(143, 108, 52, .6); background: #efe4cc; color: var(--ink-soft); font: italic .9rem/1.2 var(--serif); text-align: center; padding: 8px; }
.hand-vacant .plus { font: 400 2rem/1 var(--display); color: #8f6c34; }
.hand-card.focus .hand-vacant { border-color: #8f6c34; color: var(--ink); background: #f5ecd8; }
@media (prefers-reduced-motion: reduce) {
  .hand-card { transition: transform .15s ease-out; }
  .hand-sway { animation: none; }
  .hand-tilt { transform: none; }
}
.hand-card:has(.pstate) .card { filter: saturate(.55) brightness(.9); }

/* the Party tab's hand, on the felt */
.party-row.hand { display: block; gap: 0; margin-top: 6px; }
.party-hand .card { box-shadow: 0 10px 22px rgba(0, 0, 0, .45); }
.party-hand .hand-card.focus .card { box-shadow: 0 26px 46px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .15); }
.party-hand .hand-vacant { border-color: var(--brass-dim); background: var(--felt-deep); color: var(--text-dim); box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }
.party-hand .hand-vacant .plus { color: var(--brass); }
.party-hand .hand-card.focus .hand-vacant { border-color: var(--brass); color: var(--text); background: var(--felt); }
.hand-vacant.locked { font-size: .82rem; line-height: 1.35; padding: 10% 12%; }
.hand-vacant.locked .plus { font-size: 1.4rem; }
.hand-card.locked { cursor: default; }
.hand-card .pstate { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); z-index: 3; white-space: nowrap; }
.party-hand .hand-card .pstate { font-size: .66rem; }
.hand-card:has(.pstate.away) .card { filter: saturate(.55) brightness(.85); }

/* A card looks the same wherever it's shown: page and sheet heading styles never reach its name. */
.card h3.c-name { font: 400 var(--name-size, 8cqw)/1.05 var(--display); letter-spacing: normal; text-transform: none; color: inherit; margin: 0; }

/* Nothing may scroll the page sideways (hands of cards reach close to the edges on phones). */
body { overflow-x: hidden; overflow-x: clip; }
.qv-scroll { overflow-x: hidden; }

/* quest view: danger, time and tags under the blurb; success chance beside Send */
.qv-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
.qv-facts .danger { margin: 0; cursor: help; }
.qv-time { display: inline-flex; align-items: center; gap: 5px; font: 700 .8rem/1 var(--sans); color: var(--ink); background: rgba(43, 33, 24, .07); border: 1px solid rgba(43, 33, 24, .14); padding: 5px 10px 5px 8px; border-radius: 5px; cursor: help; font-variant-numeric: tabular-nums; }
.qv-time svg { width: 14px; height: 14px; color: var(--ink-soft); }
.qv-facts .t-name:focus-visible, .qv-head .n-tests .t-name:focus-visible { outline: 2px solid #8f6c34; outline-offset: 2px; }
.qv-head .n-tests { margin-top: 2px; }
.qv-head .n-tests li { font-size: .74rem; padding: 5px 8px; }
.qv-head .n-tests .t-name { cursor: help; --tc: #8f6c34; }
.qv-go { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.qv-chance { display: grid; gap: 3px; justify-items: end; text-align: right; }
.qv-chance span { font: 700 .62rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.qv-chance b { font: 800 1.5rem/1 var(--sans); color: #8a6414; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) {
  .qv-go { gap: 10px; }
  .qv-chance span { font-size: .58rem; letter-spacing: .08em; }
  .qv-chance b { font-size: 1.2rem; }
  .qv-reward b { font-size: .78rem; }
}
/* small phones: reward on its own line above chance + Send */
@media (max-width: 420px) {
  .qv-scroll { bottom: 104px; }
  .qv-foot { height: 104px; flex-wrap: wrap; align-content: center; row-gap: 8px; }
  .qv-reward { flex: 1 1 100%; display: flex; align-items: baseline; gap: 8px; }
  .qv-reward > span { font-size: .6rem; }
  .qv-reward b { font-size: .86rem; }
  .qv-go { flex: 1 1 100%; justify-content: space-between; margin-left: 0; }
  .qv-chance { justify-items: start; text-align: left; }
  .qv-chance span { font-size: .6rem; }
  .qv-chance b { font-size: 1.3rem; }
}

/* taken notices: a stamp for how it went, and a button to watch it again */
.notice-wrap { position: relative; display: grid; gap: 8px; grid-template-rows: minmax(0, 1fr); } /* each notice fills its row, so a row's notices line up */
.notice-wrap:has(.n-view) { grid-template-rows: minmax(0, 1fr) auto; }
.notice-wrap > .notice { height: 100%; }
.notice-wrap .n-done { top: 42%; z-index: 2; pointer-events: none; background: rgba(244, 236, 218, .85); white-space: nowrap; font-size: .95rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.notice-wrap:has(.n-view) .n-done { top: calc(42% - 20px); }
.n-done.won { color: #2a7a45; border-color: #2a7a45; }
.n-done.lost { color: #9e2a22; border-color: #9e2a22; }
.n-done.away { color: #3f6f98; border-color: #3f6f98; }
.n-view { justify-self: stretch; text-align: center; border-style: solid; border-color: var(--brass); color: var(--gold); padding: 10px 12px; }
.n-view:hover { background: #1b120a; }

/* ================================================================ the board: three notices and the pile, cascading across */
/* Each notice is tucked a little under the one before it, a touch lower; the pile to search for more is
   last. Hovering a notice brings it to the top of the stack (quests.js rowHTML). */
.deck-board { --ovl: 34px; padding: 14px 0 18px; }
.qrow { display: flex; align-items: flex-start; }
.qslot { position: relative; z-index: calc(10 - var(--i)); flex: 0 0 calc((100% + 3 * var(--ovl)) / 4); min-width: 0; margin-top: calc(var(--i) * 12px); perspective: 1400px; }
.qslot + .qslot { margin-left: calc(var(--ovl) * -1); }
.qslot:not(.q-reroll):hover, .qslot:not(.q-reroll):focus-within, .qslot.front { z-index: 20; }
.qcard { position: relative; display: grid; }
.qcard .notice-wrap { height: auto; }
.qslot .notice { min-width: 0; transition: transform .18s ease-out, box-shadow .18s; }
.qslot .notice:hover:not([disabled]) { transform: perspective(900px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)) translateY(-4px); box-shadow: 0 18px 32px rgba(0, 0, 0, .5); }
.qslot .notice[disabled] { opacity: 1; filter: grayscale(.6) brightness(.82); }
.notice .n-top { flex-wrap: wrap; row-gap: 4px; }
.q-reroll { align-self: stretch; display: grid; padding: 6px 0 30px; }
.q-reroll .deck-back { transform: scale(.9); transform-origin: 30% 50%; min-height: 280px; }
.deck-back {
  position: relative; border: 1px solid rgba(0, 0, 0, .25); border-top: 6px solid #9a8a6c; border-radius: 6px 6px 10px 10px; cursor: pointer; padding: 0; font: inherit; color: inherit;
  background: linear-gradient(170deg, var(--card) 0%, var(--card-edge) 100%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .35); filter: brightness(.88) saturate(.85); transition: filter .15s, box-shadow .15s;
}
.deck-back::before { content: ""; position: absolute; top: -11px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e9c77a, #8f6c34 70%); box-shadow: 0 2px 3px rgba(0, 0, 0, .5); }
.deck-back:hover:not(.moving):not(:disabled), .deck-back:focus-visible { filter: brightness(1) saturate(1); box-shadow: 0 14px 28px rgba(0, 0, 0, .45); outline: none; }
.deck-back:focus-visible { box-shadow: 0 0 0 3px var(--gold), 0 14px 28px rgba(0, 0, 0, .45); }
.deck-back:disabled { cursor: default; filter: brightness(.7) saturate(.6); }
.dk-lbl { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  padding: 0 calc(var(--ovl) + 8px) 0 calc(var(--ovl) + 14px); text-align: center; font: italic 400 1.15rem/1.25 var(--serif); color: var(--ink-soft, #5a4a35); }
.dk-lbl svg { width: 26px; height: 26px; opacity: .75; }
/* The turn-over: while it turns, a notice has two faces, a blank back and the quest. */
.qcard.flipping { transform-style: preserve-3d; }
.qcard.flipping > .notice-wrap { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.qcard > .flip-face { position: absolute; inset: 0; transform-origin: 50% 50%; transform: rotateY(180deg) !important; backface-visibility: hidden; -webkit-backface-visibility: hidden; pointer-events: none; }
/* Narrower screens: the row scrolls sideways, one notice and a bit of the next in view. */
@media (max-width: 900px) {
  .deck-board { --ovl: 22px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 14px 16px 20px; scrollbar-width: none; }
  .deck-board::-webkit-scrollbar { display: none; }
  .qrow { width: max-content; }
  .qslot { flex: 0 0 min(300px, 74vw); scroll-snap-align: start; scroll-margin-left: 16px; }
  .q-reroll { flex-basis: min(220px, 50vw); padding-right: 16px; }
  .q-reroll .deck-back { min-height: 240px; }
  .dk-lbl { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .deck-back, .qslot .notice { transition: none; } }
.deck-board.qv-ghost-wrap { display: block; position: static; padding: 0; margin: 0; overflow: visible; }

/* The notice's spoils row: what its fights and chests leave behind, as small icons. */
.n-spoils { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 2px 0 8px; }
.n-spoils .sp-lbl { font: 800 .62rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-right: 2px; }
.n-spoils .sp-i { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 5px; background: rgba(43, 33, 24, .07); border: 1px solid rgba(107, 79, 42, .2); }
.n-spoils .sp-i .inv-ic, .rw-icons .rw-i .inv-ic { width: 30px; height: 30px; }
.n-spoils .sp-i.sp-gear { --rc: #8b8f86; border: 2px solid var(--rc); background: color-mix(in srgb, var(--rc) 14%, transparent); }
.n-spoils .sp-i.r-uncommon { --rc: #3f8f55; } .n-spoils .sp-i.r-rare { --rc: #3b6fbf; } .n-spoils .sp-i.r-epic { --rc: #8a48c2; } .n-spoils .sp-i.r-legendary { --rc: #d29a12; }
@media (max-width: 560px) {
  .n-spoils .sp-lbl { display: none; }
  .n-spoils .sp-i { width: 33px; height: 33px; }
  .n-spoils .sp-i .inv-ic { width: 27px; height: 27px; }
  .notice .q-diff { font-size: .6rem; padding: 2px 4px; }
}

/* The quest view: subtitles in small capitals, Possible Rewards as icons (tap or hover for a line about each). */
.qh-sub { margin: 16px 0 8px; font: 700 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.qv-head .qv-risk { margin-top: 18px; padding: 0; border: 0; }
.qv-head .qv-risk .qh-sub { margin-top: 0; }
.rw-icons { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 6px; padding: 0; list-style: none; }
.rw-icons .rw-i { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 5px; cursor: pointer;
  background: rgba(43, 33, 24, .07); border: 1px solid rgba(107, 79, 42, .2); }
.rw-icons .rw-i:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.rw-icons .rw-i.r-uncommon { border: 2px solid #3f8f55; background: rgba(63, 143, 85, .12); }
.rw-icons .rw-i.r-rare { border: 2px solid #3b6fbf; background: rgba(59, 111, 191, .12); }
.rw-icons .rw-i.r-epic { border: 2px solid #8a48c2; background: rgba(138, 72, 194, .12); }
.rw-icons .rw-i.r-legendary { border: 2px solid #d29a12; background: rgba(210, 154, 18, .14); }
.tip .tip-nm { display: block; margin-bottom: 3px; font: 400 1.02rem/1.15 var(--serif); }
@media (max-width: 640px) { .rw-icons .rw-i { width: 33px; height: 33px; } .rw-icons .rw-i .inv-ic { width: 27px; height: 27px; } }

