/* Quick roll popover, animated dice and result toast. Transforms and opacity only; flat on phones (mobile-lite rules still apply). */
.qr-pop{position:fixed;z-index:1200;width:min(320px,calc(100vw - 16px));max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);overflow:auto;box-sizing:border-box;padding:14px;color:#292116;background:#f1e7d1;border:2px solid #aa8650;border-radius:8px;box-shadow:0 6px 24px #0006;font:16px/1.35 Georgia,'Times New Roman',serif}
.qr-pop *{box-sizing:border-box}
.qr-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.qr-title{font-size:19px;line-height:1.2}
.qr-x{border:0;background:none;font-size:26px;line-height:1;min-width:44px;min-height:44px;margin:-8px -8px -8px 0;color:#6a604e;cursor:pointer}
.qr-chips{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 10px}
.qr-chip{font-size:14px;padding:2px 9px;border-radius:999px;background:#e3d5b4;border:1px solid #bba681}
.qr-chip.qr-mod{font-weight:bold;background:#fbf6e8}
.qr-chip.qr-advantage{background:#dbe8cd;border-color:#8da673;color:#243a1b}
.qr-chip.qr-disadvantage,.qr-chip.qr-fail{background:#f0d5cf;border-color:#b8776c;color:#6d1421}
.qr-chip.qr-crit{background:#f4dfa5;border-color:#aa8650;color:#5c3d08;font-weight:bold}
.qr-actions{display:flex;gap:8px}
.qr-action{flex:1 1 0;min-height:48px;padding:10px 12px;font:bold 17px Georgia,serif;color:#292116;border:1px solid #ad9976;border-radius:6px;background:linear-gradient(#fcf6e7,#e0d4bc);cursor:pointer}
.qr-action.qr-first{color:#fff6e3;background:linear-gradient(#8a2037,#5c1023);border-color:#c19465}
.qr-action:disabled{opacity:.55;cursor:default}
.qr-action:focus-visible,.qr-more:focus-visible,.qr-input:focus-visible,.qr-select:focus-visible{outline:3px solid #9e6930;outline-offset:2px}
.qr-enter{margin-top:10px}
.qr-dice{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}
.qr-input,.qr-select{font:18px Georgia,serif;color:#292116;background:#fbf6e8;border:1px solid #ac9b7d;border-radius:5px;padding:8px;min-height:44px;width:100%}
.qr-die{width:64px;text-align:center;font-size:22px}.qr-die.qr-list{width:100%;text-align:left;font-size:18px}
.qr-submit{width:100%;margin-top:6px}
.qr-more,.qr-link,.qr-done{margin-top:8px;border:0;background:none;color:#72152b;text-decoration:underline;font:15px Georgia,serif;min-height:44px;padding:0 4px;cursor:pointer}
.qr-done{display:block}
.qr-more-body{border-top:1px solid #bba681;margin-top:2px;padding-top:8px}
.qr-label{display:block;font-size:15px;font-weight:bold;margin:0 0 10px}.qr-label>span{display:block;margin-bottom:3px}
.qr-label.qr-check{display:flex;align-items:center;gap:10px;min-height:44px}.qr-label.qr-check>span{margin:0;order:2;font-weight:normal}
.qr-label.qr-check input{width:22px;height:22px;margin:0;accent-color:#72152b}
.qr-hint{font-size:14px;color:#6a604e;margin:2px 0 8px}
.qr-error{margin:8px 0 0;padding:8px 10px;color:#771a27;background:#ffdfd1;border:1px solid #ab7f6c;border-radius:5px;font-size:15px}
.qr-center{left:50%!important;top:50%!important;transform:translate(-50%,-50%)}
.qr-scrim{position:fixed;inset:0;z-index:1190;background:#140d0855}
.qr-pop.qr-sheet{left:0!important;right:0;top:auto!important;bottom:0;width:100%;max-height:85vh;max-height:85dvh;border-radius:16px 16px 0 0;border-width:2px 0 0;padding:16px 16px calc(16px + env(safe-area-inset-bottom));box-shadow:none;animation:qr-up .18s ease-out}
.qr-sheet .qr-action{min-height:56px;font-size:18px}
.qr-sheet .qr-actions{margin-top:4px}
@keyframes qr-up{from{transform:translateY(100%)}to{transform:none}}
.qr-pop.qr-kid{font-family:var(--kid-font,inherit);font-size:19px;background:#fff;border:2px solid #cbd9ed;border-radius:18px;color:#050c25}
.qr-kid .qr-action{min-height:60px;font-size:21px;border-radius:14px;font-family:inherit}
.qr-kid .qr-action.qr-first{background:#0872d8;border-color:#0868c0;color:#fff}
.qr-kid .qr-title{font-size:24px}

/* Dice stage: overlays the page, never shifts layout, never takes clicks. */
.sd-stage{position:fixed;inset:0;z-index:1150;pointer-events:none;overflow:hidden;perspective:700px;transition:opacity .35s}
.sd-stage.sd-leaving{opacity:0}
.sd-stage3d{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;z-index:1150;pointer-events:none;overflow:visible;perspective:none;transition:opacity .35s}
.sd-more3d{position:fixed;z-index:1151;top:14px;left:50%;transform:translateX(-50%);pointer-events:none;padding:2px 10px;border-radius:999px;background:#2a1a10cc}
.sd-row{position:absolute;left:0;right:0;top:34%;display:flex;flex-wrap:wrap;justify-content:center;gap:14px 12px;padding:0 24px}
.sd-die{position:relative;width:68px;height:68px;transform-style:preserve-3d;will-change:transform,opacity}
.sd-die svg{width:100%;height:100%;display:block;overflow:visible}
.sd-body{fill:url(#sd-brass);stroke:#6e4f24;stroke-width:2.4;stroke-linejoin:round}
.sd-edge{fill:none;stroke:#8a6a3a;stroke-width:1.2;opacity:.65}
.sd-face{position:absolute;inset:0;display:grid;place-content:center;font:bold 24px Georgia,serif;color:#4e0d1b;text-shadow:0 1px 0 #fff8;transform:translateZ(1px)}
.sd-d4 .sd-face{padding-top:14px}.sd-d12 .sd-face,.sd-d20 .sd-face{font-size:22px}
.sd-tag{position:absolute;left:0;right:0;bottom:-15px;text-align:center;font:11px Georgia,serif;color:#4e0d1b;text-shadow:0 0 3px #fff,0 0 3px #fff}
.sd-dropped{opacity:.55}.sd-bonus .sd-body{fill:#cfe0c3}
.sd-landed .sd-body{stroke:#4e0d1b}
.sd-more{align-self:center;color:#fff6e3;font:bold 18px Georgia,serif;text-shadow:0 1px 3px #000}

.sd-toast{position:fixed;z-index:1160;left:50%;bottom:24px;transform:translateX(-50%);width:min(380px,calc(100vw - 24px));box-sizing:border-box;padding:12px 16px 12px;color:#292116;background:#f1e7d1;border:2px solid #aa8650;border-radius:8px;box-shadow:0 6px 24px #0006;font:16px/1.35 Georgia,serif;animation:sd-rise .22s ease-out}
@keyframes sd-rise{from{opacity:0;transform:translate(-50%,16px)}to{opacity:1;transform:translateX(-50%)}}
/* A result toast never covers an open menu or popover (Rest, hit points, the more menu, quick roll, creator popovers): it waits out of sight and is back when they close, if its time is not up. */
body:has(.player-header details[open],.qr-pop,.cpop-layer) .sd-toast{visibility:hidden;pointer-events:none}
.sd-toast-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.sd-toast-close{border:0;background:none;font-size:26px;line-height:1;min-width:44px;min-height:44px;margin:-10px -10px -10px 0;color:#6a604e;cursor:pointer}
.sd-total{font:bold 44px/1.05 Georgia,serif;color:#72152b}
.sd-working{font-size:17px;color:#4a3f2b;margin-bottom:2px;overflow-wrap:anywhere}
.sd-flag{font-size:15px;font-weight:bold;color:#5c3d08}.sd-flag.sd-type{font-weight:normal;color:#4a3f2b}
.sd-foot{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;margin-top:6px}
.sd-source{font-size:13px;color:#6a604e}
.sd-actions{display:flex;gap:8px;margin-left:auto}
.sd-next,.sd-options{min-height:44px;padding:8px 14px;font:16px Georgia,serif;border:1px solid #ad9976;border-radius:6px;background:linear-gradient(#fcf6e7,#e0d4bc);color:#292116;cursor:pointer}
.sd-next{background:linear-gradient(#8a2037,#5c1023);color:#fff6e3;border-color:#c19465;font-weight:bold}
.sd-riders{display:flex;flex-direction:column;gap:6px;margin-top:8px}
.sd-rider{min-height:44px;padding:8px 12px;text-align:left;font:15px/1.25 Georgia,serif;border:1px solid #8a6a2c;border-radius:6px;background:linear-gradient(#fff3c8,#ead59a);color:#292116;cursor:pointer;overflow-wrap:anywhere}
.sd-rider[disabled]{cursor:default;opacity:.85}.sd-rider-done{background:#dfe9d4;border-color:#6b8a4a}
.sd-rider[data-error]{background:#f4d9d4;border-color:#8a2037}
body.kid-friendly-mode .sd-rider{font-family:var(--kid-font,inherit);font-size:18px;border-radius:12px}
.sd-options{border:0;background:none;text-decoration:underline;color:#72152b;padding:8px 4px}
.sd-nat20{border-color:#c79a2c;background:#fff3c8}.sd-nat20 .sd-total{color:#8a5b00}
.sd-nat20 .sd-flag{color:#8a5b00;font-size:18px}
.sd-nat1{border-color:#8a2037;background:#f4d9d4}.sd-nat1 .sd-flag{color:#8a1b2d;font-size:18px}
.sd-crit{border-color:#c79a2c}
body.kid-friendly-mode .sd-toast{font-family:var(--kid-font,inherit);font-size:19px;background:#fff;border:2px solid #cbd9ed;border-radius:18px;color:#050c25}
body.kid-friendly-mode .sd-total{font:900 56px/1.05 var(--kid-font,Georgia,serif);color:#0872d8}
body.kid-friendly-mode .sd-die{width:88px;height:88px}body.kid-friendly-mode .sd-face{font-size:30px}
body.kid-friendly-mode .sd-next{background:#0872d8;border-color:#0868c0;border-radius:12px}
@media(max-width:640px){
 .sd-die{width:52px;height:52px}.sd-face{font-size:19px}.sd-d12 .sd-face,.sd-d20 .sd-face{font-size:17px}
 .sd-row{top:26%;gap:12px 8px}
 .sd-toast{bottom:calc(12px + env(safe-area-inset-bottom));box-shadow:none}
 body.kid-friendly-mode .sd-die{width:64px;height:64px}
}
@media(prefers-reduced-motion:reduce){.qr-pop.qr-sheet,.sd-toast{animation:none}.sd-stage{display:none}}

/* Feat riders (docs/NATIVE2024-FEAT-RIDERS.md): the Lucky / Savage Attacker toggles on the popover's first screen, the Actions-tab prompts. 44px targets. */
.qr-toggles{display:flex;flex-direction:column;gap:6px;margin:4px 0}
.qr-toggle{display:flex;align-items:center;gap:10px;min-height:44px;padding:4px 10px;border:1px solid #ad9976;border-radius:6px;background:#fbf6e8;font-size:15px;cursor:pointer;overflow-wrap:anywhere}
.qr-toggle input{width:24px;height:24px;flex:none;margin:0}
.qr-toggle.qr-off{opacity:.6;cursor:not-allowed}
.feat-controls button{min-height:44px}
.feat-prompts{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0;padding:8px 10px;border:1px solid #c79a2c;border-radius:6px;background:#fff3c8}
.feat-prompts button{min-height:44px}
.feat-notes{margin:10px 0}.feat-notes summary{min-height:44px;display:flex;align-items:center;cursor:pointer}
body.kid-friendly-mode .qr-toggle{font-size:18px;border-radius:12px;background:#fff}
.sd-reroll{border:1px solid #ad9976;background:linear-gradient(#fcf6e7,#e0d4bc);text-decoration:none;padding:8px 14px}

/* Sneak Attack offer (sheet-class-features-a-v1.js): on the attack's result toast and in the Sneak Attack row's window. The dice count is the largest thing. */
.cfa-sneak{display:flex;flex-direction:column;gap:6px;margin-top:10px;padding-top:10px;border-top:1px solid #bba681}
.cfa-sneak-roll,.cfa-sneak-row{display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:8px 14px;text-align:left;font:bold 17px Georgia,serif;color:#fff6e3;background:linear-gradient(#8a2037,#5c1023);border:1px solid #c19465;border-radius:6px;cursor:pointer}
.cfa-sneak-dice{font:bold 32px/1 Georgia,serif;letter-spacing:.5px;flex:none}
.cfa-sneak-what{flex:1 1 auto;overflow-wrap:anywhere}
.cfa-sneak-saved{background:linear-gradient(#fcf6e7,#e0d4bc);color:#292116;border-color:#ad9976}
.cfa-sneak-used .cfa-sneak-roll{min-height:48px;background:linear-gradient(#fcf6e7,#e0d4bc);color:#292116;border-color:#ad9976;font-weight:normal}
.cfa-sneak-used .cfa-sneak-roll .cfa-sneak-dice{font-size:22px}
.cfa-sneak-roll:disabled,.cfa-sneak-row:disabled{opacity:.6;cursor:default}
.cfa-sneak-roll:focus-visible,.cfa-sneak-row:focus-visible,.cfa-sneak-small:focus-visible,.cfa-sneak-chip:focus-visible{outline:3px solid #9e6930;outline-offset:2px}
.cfa-sneak-why{font-size:14px;color:#4a3f2b}
.cfa-sneak-extras{display:flex;flex-wrap:wrap;gap:4px 12px}
.cfa-sneak-small{min-height:44px;padding:0 4px;border:0;background:none;color:#72152b;text-decoration:underline;font:15px Georgia,serif;cursor:pointer}
.cfa-sneak-strikes{display:flex;flex-wrap:wrap;gap:6px}
.cfa-sneak-chip{min-height:44px;padding:6px 12px;font:15px Georgia,serif;color:#292116;background:#fbf6e8;border:1px solid #ad9976;border-radius:999px;cursor:pointer}
.cfa-sneak-chip[aria-pressed=true]{background:#f4dfa5;border-color:#aa8650;font-weight:bold}
.cfa-sneak-chip:disabled{opacity:.5;cursor:default}
.cfa-sneak-enter{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.cfa-sneak-enter .qr-input{flex:1 1 140px;width:auto}
.cfa-sneak-error{margin:0;padding:6px 10px;color:#771a27;background:#ffdfd1;border:1px solid #ab7f6c;border-radius:5px;font-size:15px}
.sd-toast.sd-has-offer{max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);overflow:auto}
.cfa-sneak-row{width:auto;flex:1 1 220px}
/* Combat mode: one three-way choice (Character options and Roll options). Each option is a 44px+ row with a one-line description. */
.qr-combat{border:1px solid #bba681;border-radius:6px;margin:6px 0 10px;padding:4px 10px 6px;min-width:0}
.qr-combat legend{font-weight:bold;font-size:15px;padding:0 4px}
.qr-combat-option{display:flex;align-items:flex-start;gap:10px;min-height:44px;padding:6px 0;cursor:pointer;font-size:15px;line-height:1.3}
.qr-combat-option input{flex:none;width:22px;height:22px;margin:1px 0 0;accent-color:#72152b}
.qr-combat-option span{display:block;min-width:0}.qr-combat-option strong{display:block}
.qr-combat-option small{display:block;font-size:13px;color:#6a604e;font-weight:normal}
body.kid-friendly-mode .cfa-sneak-roll,body.kid-friendly-mode .cfa-sneak-row{background:#0872d8;border-color:#0868c0;border-radius:12px;font-family:var(--kid-font,inherit)}
.cfa-sneak[hidden],.cfa-sneak [hidden]{display:none!important}
.cfa-sneak-crit{display:flex;align-items:center;gap:10px;min-height:44px}.cfa-sneak-crit input{width:24px;height:24px;margin:0}
/* Combat-mode intro (once on sheet open, or "What are these?"): the quick-roll popover's own card. Bottom sheet on phones, centred card on desktop. */
.qr-pop.qr-intro{width:min(440px,calc(100vw - 16px))}
.qr-pop.qr-intro.qr-sheet{width:100%}
.qr-intro-title{margin:0;font:bold 21px/1.2 Georgia,serif;color:#72152b}
.qr-intro-lead{margin:6px 0 4px;font-size:15px;color:#4a3f2b}
.qr-intro .qr-combat{background:#fbf6e8}
.qr-intro-where{margin:4px 0 10px}
.qr-intro-actions .qr-action{min-height:48px}
.qr-combat-what{margin:2px 0 0;padding:0 4px}
/* Quick cast (combat modes without targets): the cast's note on the result card, and one tap for the next beam or ray. */
.cast-note{margin-top:8px;padding-top:6px;border-top:1px solid #bba681}.cast-note p{margin:2px 0;font-size:15px;color:#4a3f2b}
.cast-next{display:block;width:100%;min-height:48px;margin-top:6px;padding:8px 12px;font:bold 16px Georgia,serif;color:#fff6e3;background:linear-gradient(#8a2037,#5c1023);border:1px solid #c19465;border-radius:6px;cursor:pointer}
.cast-options{min-height:44px}
.cast-options-list{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.cast-option{min-height:48px;text-align:left}
