/* =======================================================================
   LORECRAFT · A QUESTION IN A WINDOW OF OUR OWN (shared/ask.js)
   The shade, the window framed in a gradient (the colors of a deck, when
   the question paints --seat-a and --seat-b, as the Starting Deck's choice
   does; else the accent) and the answers: yes in the green of Nature, no in
   the red of Fire. An answer that can't be undone (danger) is the red one,
   and no is then plain. With a picture (a card), the card big beside the
   words; on a phone, over them. Only children (>) of the window are styled
   here: nothing reaches inside the card (CLAUDE.md, a card is one component).
   ======================================================================= */
dialog.ask-window::backdrop, .ask-shade{background:rgb(6 5 9 / .72); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px)}
dialog.ask-window{position:fixed; z-index:41; inset:auto; left:50%; top:50%; translate:-50% -50%; margin:0; padding:0;
  width:min(480px, calc(100vw - 32px)); max-width:none; height:auto; max-height:calc(100dvh - 32px); overflow:auto;
  border:2px solid transparent; border-radius:18px; color:var(--fg);
  background:linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(150deg, var(--seat-a, var(--accent)), var(--seat-b, var(--line))) border-box;
  box-shadow:0 24px 60px rgb(0 0 0 / .55); animation:ask-in .28s cubic-bezier(.2, .9, .3, 1.15)}
dialog.ask-window.danger{--seat-a:var(--fire-hi)}
.ask-body{display:grid; gap:12px; padding:24px}
.ask-body > h2{margin:0; font:700 clamp(22px, 3vw, 28px)/1.15 var(--display)}
.ask-body > p{margin:0; line-height:1.45}
.ask-body > label{display:grid; gap:6px; font-weight:600}
.ask-body > label > textarea{font:inherit; min-height:84px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--fg); resize:vertical}
.ask-buttons{display:flex; flex-wrap:wrap; gap:10px; margin-top:8px}
.ask-buttons button{min-height:46px; padding:0 26px; border:0; border-radius:999px; color:#fff; font:700 16px/1 var(--sans); cursor:pointer;
  box-shadow:0 6px 16px rgb(0 0 0 / .3); transition:filter .15s, transform .15s}
.ask-buttons .yes{background:linear-gradient(180deg, color-mix(in srgb, var(--nature-fb) 78%, #fff), var(--nature-fb))}
.ask-buttons .no, .ask-buttons .danger{background:linear-gradient(180deg, color-mix(in srgb, var(--fire-hi) 80%, #fff), var(--fire-hi))}
.ask-buttons .plain{background:var(--chip); color:var(--fg); box-shadow:none; outline:1px solid var(--line); outline-offset:-1px}
.ask-buttons button:hover{filter:brightness(1.12); transform:translateY(-1px)}
.ask-buttons button:focus-visible{outline:3px solid var(--accent); outline-offset:3px}
/* the card beside the words (the Lorecraft of a Starting Deck), only as wide as its column: card.js draws it, this only sizes it */
dialog.ask-window.with-picture{width:min(700px, calc(100vw - 32px))}
.with-picture .ask-body{grid-template-columns:minmax(0, 260px) minmax(0, 1fr); column-gap:26px; row-gap:10px; align-content:center}
.with-picture .ask-body > *{grid-column:2}
.with-picture .ask-body > h2{font-size:clamp(24px, 3.4vw, 32px); line-height:1.1}
.with-picture .ask-body > .ask-picture{grid-column:1; grid-row:1 / span 8; align-self:center; width:100%}
@media (max-width:560px){
  .with-picture .ask-body{grid-template-columns:1fr; justify-items:center; text-align:center; padding:18px}
  .with-picture .ask-body > *{grid-column:1}
  .with-picture .ask-body > .ask-picture{grid-row:auto; width:min(230px, 68vw)}
  .with-picture .ask-buttons{justify-content:center}
}
/* the answers of a step (Lorecraft.choose): buttons, each with the cards it means (a card to Discard, the Summons to Consume) */
dialog.ask-window.with-options{width:min(900px, calc(100vw - 32px))}
.with-options.with-picture .ask-body{grid-template-columns:minmax(0, 220px) minmax(0, 1fr)}
.ask-body > .ask-options{display:flex; flex-wrap:wrap; gap:10px; max-height:52vh; overflow:auto; padding:4px}
.ask-option{display:grid; justify-items:center; align-content:start; gap:6px; padding:10px 14px; border:2px solid var(--line); border-radius:12px;
  background:var(--chip); color:var(--fg); font:600 15px/1.2 var(--sans); cursor:pointer; transition:border-color .15s, transform .15s}
.ask-option.with-cards{padding:6px}
.ask-option:hover, .ask-option:focus-visible{border-color:var(--accent); transform:translateY(-2px); outline:none}
.ask-cards{display:flex; gap:4px}
.ask-cards > .card-box{width:118px}
/* a resource: its token, big, with how many the player has, as the Stash shows it (12/11/2026) */
.ask-cards > .ask-token{position:relative; margin:4px}
.ask-token > .mini{width:56px; height:56px; margin:0}
.ask-token > .mini svg{width:34px; height:34px}
.ask-token > b{position:absolute; right:-8px; top:-8px; min-width:26px; padding:3px 7px; border-radius:999px; background:var(--fg); color:var(--bg);
  font:700 13px/1.2 var(--sans); text-align:center; font-variant-numeric:tabular-nums}
.ask-option-label{max-width:240px; text-align:center}
.ask-option.danger{border-color:color-mix(in srgb, var(--fire-hi) 55%, var(--line)); color:var(--fire-hi)}
.ask-option.danger:hover, .ask-option.danger:focus-visible{border-color:var(--fire-hi); background:color-mix(in srgb, var(--fire-hi) 14%, var(--chip))}
/* a menu (narrow): its answers one under the other, as wide as the window, and the way back under them */
dialog.ask-window.narrow{width:min(400px, calc(100vw - 32px))}
.narrow .ask-body > .ask-options{flex-direction:column; flex-wrap:nowrap; padding:4px 0}
.narrow .ask-option{width:100%; min-height:50px; place-content:center; font-size:17px}
.narrow .ask-buttons{margin-top:2px}
.narrow .ask-buttons > button{width:100%}
/* a small list under the words of an answer: each resource's token, how many and its name (what an Infuse of everything puts) */
.ask-option-list{display:flex; flex-wrap:wrap; justify-content:center; gap:6px; max-width:260px}
.ask-count{display:inline-flex; align-items:center; gap:5px; padding:3px 9px 3px 3px; border-radius:999px; background:var(--bg); color:var(--muted); font:600 12px/1 var(--sans)}
.ask-count > .mini{width:22px; height:22px; margin:0}
.ask-count > .mini svg{width:14px; height:14px}
.ask-count > b{color:var(--fg); font:700 13px/1 var(--sans); font-variant-numeric:tabular-nums}

/* ---------- a window a page keeps itself (open without showModal: the table's payment, the End's Discard, a choice, a pile) ----------
   The same window, under the page's menus and a card's preview (z-index 20 and over), with its shade (.ask-shade) right before it. fit:
   as wide as what it shows (12/11/2026: "no need to be wide when there are few options"); its words wrap at that width */
.ask-shade{position:fixed; inset:0; z-index:19}
dialog.ask-window:not(:modal){z-index:20}
dialog.ask-window.fit{width:fit-content; min-width:min(460px, calc(100vw - 32px)); max-width:min(1000px, calc(100vw - 32px))}
.fit .ask-body > :is(h2, p){width:0; min-width:100%}
.fit.with-picture .ask-body{grid-template-columns:190px auto}
.ask-body > h3{margin:6px 0 0; font:700 11px/1.2 var(--sans); letter-spacing:.12em; text-transform:uppercase; color:var(--muted)}
.ask-buttons button:disabled{filter:grayscale(.8); opacity:.5; cursor:default; transform:none}
@media (max-width:560px){ .fit.with-picture .ask-body{grid-template-columns:1fr} }
/* ---------- a window the page fills (Lorecraft.window): its title and close button stay on top while its inside scrolls; wide: as
   wide and as tall as the screen allows (the choice of a deck) ---------- */
.ask-head{position:sticky; top:0; z-index:3; display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:20px 24px 12px;
  background:var(--surface)}
.ask-head .eyebrow{margin:0 0 4px}
.ask-head h2{margin:0; font:700 clamp(22px, 3vw, 30px)/1.1 var(--display)}
.ask-head + .ask-body{padding-top:0}
.ask-close{flex:none; display:grid; place-items:center; width:40px; height:40px; padding:0; border:1px solid var(--line); border-radius:50%;
  background:var(--chip); color:var(--fg); font:400 26px/1 var(--sans); cursor:pointer; transition:background .15s, transform .15s}
.ask-close:hover{background:color-mix(in srgb, var(--fire-hi) 30%, var(--chip)); transform:rotate(90deg)}
.ask-close:focus-visible{outline:3px solid var(--accent); outline-offset:2px}
dialog.ask-window.wide{width:min(1180px, calc(100vw - 32px)); height:calc(100dvh - 48px); max-height:none}
@media (max-width:560px){ dialog.ask-window.wide{width:100vw; height:100dvh; border-radius:0} .ask-head{padding:14px 16px 10px} }
@keyframes ask-in{from{opacity:0; scale:.94}}
@media (prefers-reduced-motion:reduce){ dialog.ask-window{animation:none} .ask-buttons button, .ask-close{transition:none} .ask-close:hover{transform:none} }
