/* Mansions of Madness Casebook. House rule: no yellow, amber or gold anywhere in the UI (see CLAUDE.md).
   Colours: cool slate greys, a deep teal accent, green for passes, oxblood red for failures. */
:root{
  --bg:#eceef0; --surface:#fafbfb; --surface2:#e1e5e8; --ink:#1a1f26; --muted:#555d68; --line:#bcc3ca;
  --accent:#1d5c63; --accent-ink:#ffffff; --accent-soft:#d5e7e8;
  --ok:#2c6a46; --ok-soft:#d7ebde; --bad:#a3322a; --bad-soft:#f4dcd8; --slate:#5b6472; --slate-soft:#e3e6ea; --focus:#2d5bd1;
  --chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' fill='none' stroke='%23555d68' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); --mag:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.5' fill='none' stroke='%23555d68' stroke-width='1.6'/%3E%3Cpath d='m9.5 9.5 3.2 3.2' stroke='%23555d68' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  --display:'IM Fell English',Georgia,'Times New Roman',serif; --body:'Source Sans 3','Segoe UI',Helvetica,Arial,sans-serif; --mono:'IBM Plex Mono',ui-monospace,Menlo,monospace;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  color-scheme:dark; --bg:#0f1317; --surface:#171c22; --surface2:#222932; --ink:#e4e7ea; --muted:#a3aab3; --line:#354049;
  --accent:#6fb3bb; --accent-ink:#0b1114; --accent-soft:#1c3337; --ok:#6cc08a; --ok-soft:#1d3527; --bad:#ef7c70; --bad-soft:#41211e; --slate:#9aa3ae; --slate-soft:#262d35; --focus:#8fb0ff; --chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' fill='none' stroke='%23a3aab3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); --mag:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.5' fill='none' stroke='%23a3aab3' stroke-width='1.6'/%3E%3Cpath d='m9.5 9.5 3.2 3.2' stroke='%23a3aab3' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");}}
:root[data-theme="dark"]{
  color-scheme:dark; --bg:#0f1317; --surface:#171c22; --surface2:#222932; --ink:#e4e7ea; --muted:#a3aab3; --line:#354049;
  --accent:#6fb3bb; --accent-ink:#0b1114; --accent-soft:#1c3337; --ok:#6cc08a; --ok-soft:#1d3527; --bad:#ef7c70; --bad-soft:#41211e; --slate:#9aa3ae; --slate-soft:#262d35; --focus:#8fb0ff; --chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' fill='none' stroke='%23a3aab3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); --mag:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.5' fill='none' stroke='%23a3aab3' stroke-width='1.6'/%3E%3Cpath d='m9.5 9.5 3.2 3.2' stroke='%23a3aab3' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--body);font-size:16px;line-height:1.45;min-height:100vh;display:flex;flex-direction:column;
  padding-bottom:env(safe-area-inset-bottom,0px)}
a{color:var(--ink);text-decoration-color:var(--muted);text-underline-offset:2px}
a:hover{text-decoration-color:var(--ink)}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
/* every box (text, dropdown, pick-or-type, date, notes) looks the same when it's in use: the accent border and glow */
.f:focus,.f:focus-visible,.f.dd-open,.langpick select.dd-open{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 22%,transparent)}
.num{font-family:var(--mono);font-variant-numeric:tabular-nums;font-size:.92em}
.note{color:var(--muted);font-size:14px;margin:0}
.pad{padding:24px 0}
.err{color:var(--bad);font-weight:600;margin:0}
h2,h3{font-family:var(--display);font-weight:400;margin:0;text-wrap:balance}
h2{font-size:24px}

/* header */
/* a solid header: a frosted-glass (backdrop blur) one made Chromium browsers such as Brave flash while scrolling */
.top{position:sticky;top:0;z-index:5;background:var(--bg);
  border-bottom:1px solid var(--line);padding-top:env(safe-area-inset-top,0px)}
.top-in{max-width:980px;margin:0 auto;padding:12px 16px 10px;display:flex;align-items:center;gap:12px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;margin-right:auto;min-width:0}
.brand img{border-radius:8px;flex:none}
.brand span{font-family:var(--display);font-size:21px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.brand b{font-weight:400}
/* the Beta pill after the name, as on the Arkham Horror RPG Ledger (the admin page shows its Admin tag there instead) */
.brand .beta{display:inline-block;vertical-align:4px;margin-left:4px;font-style:normal;font-family:var(--body);font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:1px 7px;line-height:1.5}
/* phones (up to the widest iPhones): the name on two lines so it isn't cut off */
@media (max-width:480px){.brand span{font-size:18px}.brand b{display:block;font-size:15px;line-height:1.1}.brand .beta{font-size:9px;padding:0 6px;vertical-align:3px}}

main{flex:1;width:100%;max-width:980px;margin:0 auto;padding:16px 16px 56px;display:flex;flex-direction:column;gap:16px}
.foot{max-width:980px;width:100%;margin:0 auto;padding:16px 16px 24px;border-top:1px solid var(--line);display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px 0;font-size:13px;color:var(--muted)}
/* a dot between the footer's items, as on the Arkham site */
.foot>*+*::before{content:'\00b7';margin:0 10px;opacity:.7;display:inline-block;text-decoration:none}
.foot a{color:var(--muted);text-decoration:none}.foot a:hover{color:var(--ink);text-decoration:underline}
/* phones: the disclaimer gets its own line, the site's name (already at the top) is left out */
@media (max-width:600px){.foot>:first-child{display:none}.foot>:nth-child(2){flex-basis:100%;text-align:center}.foot>:nth-child(2)::before,.foot>:nth-child(3)::before{content:none}}
/* the footer's language picker: quiet, like the rest of the footer */
.langpick select{font:inherit;font-size:13px;color:var(--muted);background:transparent;border:1px solid var(--line);border-radius:6px;padding:2px 6px;cursor:pointer}
.langpick select:hover{color:var(--ink)}

/* building blocks */
.sec{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:16px;display:flex;flex-direction:column;gap:12px}
.sec-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px;flex-wrap:wrap}
.sec.danger{border-color:color-mix(in srgb,var(--bad) 40%,var(--line))}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.row.tight{gap:6px}
.row.end{justify-content:flex-end}
.row.bottom{align-items:flex-end}
.stack{display:flex;flex-direction:column;gap:14px}
.grow{flex:1;min-width:0}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media (max-width:520px){.grid2:not(.keep){grid-template-columns:1fr}}
/* where a pair belongs together (date and time; where and how long) it stays a pair on phones */
.grid2.plan-where{grid-template-columns:minmax(0,3fr) minmax(0,2fr)}
.lbl{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:700}
.field{display:flex;flex-direction:column;gap:4px;min-width:0;margin:0;border:0;padding:0}
.field legend{padding:0;margin-bottom:6px}
.f{width:100%;min-height:42px;padding:8px 12px;border:1px solid var(--line);border-radius:6px;background-color:var(--surface);color:var(--ink);line-height:1.3}
input.f,select.f{height:42px;margin:0}
/* iPhone gives date and time boxes a width of their own and centres the text; make them fit like the other boxes */
input.f[type="date"],input.f[type="time"]{-webkit-appearance:none;appearance:none;min-width:0;max-width:100%;display:block;text-align:left}
input.f[type="date"]::-webkit-date-and-time-value,input.f[type="time"]::-webkit-date-and-time-value{text-align:left;margin:0}
input.f[type="search"]{-webkit-appearance:none;appearance:none}
textarea.f{resize:vertical;min-height:90px;height:auto}
/* our own chevron (a small drawn SVG, per theme in --chev) with room for it on the right */
select.f{-webkit-appearance:none;appearance:none;padding-right:38px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;cursor:pointer;
  background-image:var(--chev);background-repeat:no-repeat;background-position:right 14px center;background-size:12px 8px}
select.f:hover{border-color:var(--muted)}
/* nothing chosen yet ("Choose a scenario…", "Investigator…"): shown like a placeholder, not a value */
select.f:has(option:checked[value=""]){color:var(--muted)}
select.f option{color:var(--ink)}
.f::placeholder{color:var(--muted);opacity:.8}
/* pick-or-type boxes (players when logging a play): the same chevron as a dropdown, and the same menu */
input.f.combo{padding-right:38px;background-image:var(--chev);background-repeat:no-repeat;background-position:right 14px center;background-size:12px 8px}
input.f.combo::-webkit-calendar-picker-indicator{display:none!important;opacity:0}
.dd-new .dd-txt{font-style:italic}
.pp-wrap{position:relative;display:block;min-width:0}
.pp-pick{display:none}
/* phones and tablets: the device's own picker, invisible over the box (js/shared.js); "Someone new…" uncovers the box for typing, leaving the arrow to open the picker again */
@media (pointer:coarse){.pp-pick{display:block;position:absolute;inset:0;width:100%;height:100%;opacity:0;font-size:16px;-webkit-appearance:none;appearance:none;cursor:pointer}
  .pp-wrap.typing .pp-pick{left:auto;width:48px}}
select.f::-ms-expand{display:none}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:42px;padding:8px 14px;border:1px solid var(--line);border-radius:6px;
  background:var(--surface);color:var(--ink);font-weight:600;font-size:15px;cursor:pointer;text-decoration:none;white-space:nowrap}
.btn:hover{background:var(--surface2)}
.btn:disabled{opacity:.55;cursor:default}
.btn.pri{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.pri:hover{background:color-mix(in srgb,var(--accent) 86%,var(--ink))}
.btn.dng{background:var(--bad);border-color:var(--bad);color:#fff}
.btn.dng.ghost,.btn.ghost{background:transparent}
.btn.dng.ghost{color:var(--bad);border-color:transparent}
.btn.sm{min-height:34px;padding:4px 10px;font-size:14px}
.btn.file{cursor:pointer}
.x{border:0;background:none;font-size:24px;line-height:1;width:40px;height:40px;border-radius:6px;cursor:pointer;color:var(--muted);flex:none}
.x:hover{background:var(--surface2);color:var(--ink)}
.chip{display:inline-flex;align-items:center;padding:1px 8px;border-radius:999px;font-size:12.5px;font-weight:700;letter-spacing:.02em;white-space:nowrap}
.chip.ok{background:var(--ok-soft);color:var(--ok)}
.chip.bad{background:var(--bad-soft);color:var(--bad)}
.chip.muted{background:var(--slate-soft);color:var(--slate)}
.chip.tag{background:var(--accent-soft);color:var(--accent)}

/* tabs and the bar under the header */
.bar{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.tabs{display:flex;gap:2px;overflow-x:auto;scrollbar-width:none;max-width:100%}
.tab{border:0;background:none;padding:10px 12px;border-bottom:3px solid transparent;cursor:pointer;white-space:nowrap;color:var(--muted);font-weight:700;font-size:15px}
.tab[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--accent)}
/* the tabs are spread evenly across the bar, each underline only as wide as its word (left of Log a play on a computer, the full width on a phone) */
.bar .tabs{flex:1;min-width:0;justify-content:space-around}
.bar .tab{flex:none}
/* longer words (other languages): see fitTabs in js/app.js */
.bar .tabs.snug .tab{padding-left:5px;padding-right:5px}
.bar .tabs.snugger .tab{padding-left:3px;padding-right:3px;font-size:13px;letter-spacing:-.01em}
.tab:hover{color:var(--ink)}
.bar .btn{margin-bottom:8px}
@media (max-width:560px){.bar .tab{padding:10px 6px;font-size:14.5px}.bar>.btn.pri{position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:6;min-height:52px;padding:10px 18px;border-radius:26px;box-shadow:0 6px 18px rgba(0,0,0,.28);margin:0}}

/* segmented choices */
.seg{display:inline-flex;border:1px solid var(--line);border-radius:6px;overflow:hidden;background:var(--surface);flex-wrap:wrap}
.seg label{position:relative;cursor:pointer}
.seg input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.seg span{display:block;padding:8px 12px;font-weight:600;font-size:14px;border-right:1px solid var(--line)}
.seg label:last-child span{border-right:0}
.seg input:checked+span{background:var(--accent);color:var(--accent-ink)}
.seg input:focus-visible+span{outline:2px solid var(--focus);outline-offset:-3px}
.seg.big{display:flex}
.seg.big label{flex:1;text-align:center}
.seg.big span{padding:11px 8px;font-size:15px}
.seg.big .pass input:checked+span{background:var(--ok);color:var(--surface)}
.seg.big .fail input:checked+span{background:var(--bad);color:var(--surface)}
.seg.big .abandoned input:checked+span{background:var(--slate);color:var(--surface)}
/* Send feedback, laid out like the Arkham Horror RPG Ledger's: a sliding three-way choice, a roomy box with a count */
.fbform{gap:14px}
.fbhead{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.fbhead h2{margin:0 0 4px}
.fbhead .note{margin:0}
.fbhead .x{margin-top:-6px}
.fbkinds{display:flex;gap:6px;padding:4px;background:var(--surface2);border:1px solid var(--line);border-radius:10px}
.fbkind{flex:1 1 0;min-width:0;display:block;position:relative;cursor:pointer}
.fbkind input{position:absolute;opacity:0;pointer-events:none}
.fbkind span{display:block;text-align:center;white-space:nowrap;padding:8px 6px;border-radius:7px;font-size:14px;font-weight:600;color:var(--muted);transition:background .15s,color .15s}
.fbkind:hover span{color:var(--ink)}
.fbkind input:checked+span{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.25),0 0 0 1px var(--line)}
.fbkind input:focus-visible+span{outline:2px solid var(--focus);outline-offset:1px}
.fbbox{position:relative}
.fbbox textarea{display:block;width:100%;box-sizing:border-box;min-height:140px;resize:vertical;padding:12px 12px 26px;border:1px solid var(--line);border-radius:10px;background:var(--surface2);color:var(--ink);font:inherit;font-size:16px;line-height:1.5}
.fbbox textarea:focus{outline:none;border-color:var(--focus)}
.fbbox textarea::placeholder{color:var(--muted)}
.fbcount{position:absolute;right:12px;bottom:8px;font-size:11px;color:var(--muted);pointer-events:none}
.fbfoot{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px}
.fbfoot .note{margin:0;flex:1 1 200px}
.fbfoot .row{margin-left:auto}
/* Admin: tabs, then search and Refresh; on a phone the tabs get their own row (scrolling sideways if need be) and
   search and Refresh share the next, as on the Arkham Horror RPG Ledger */
.admbar{border-bottom:0;row-gap:10px}
.admbar .tabs{justify-content:flex-start;border-bottom:1px solid var(--line)}
.admbar .admq{min-width:200px;margin-bottom:8px}
.admbar .btn{min-height:42px}
.tabn{display:inline-block;min-width:18px;margin-left:5px;padding:0 5px;border-radius:9px;background:var(--accent-soft);color:var(--ink);font-size:11.5px;line-height:18px;text-align:center;vertical-align:1px}
@media (max-width:700px){
  .admbar{align-items:flex-end}
  .admbar .tabs{flex:1 1 100%}
  .admbar .tab{flex:1 0 auto;padding:10px 6px}
  .admbar .admq{flex:1;min-width:0;margin-bottom:0}
  .admbar .btn{margin-bottom:0}
}

/* filters */
.filters{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end}
.filters .field{min-width:150px}
.filters .field.grow{min-width:220px}
.count{margin-top:-6px}

/* the play list */
.plays{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.play{display:flex;flex-direction:column;gap:4px;width:100%;text-align:left;background:var(--surface);border:1px solid var(--line);border-left:4px solid var(--line);
  border-radius:8px;padding:12px 14px;cursor:pointer}
.play:hover{background:color-mix(in srgb,var(--surface) 70%,var(--surface2))}
li:has(.chip.ok)>.play{border-left-color:var(--ok)}
li:has(.chip.bad)>.play{border-left-color:var(--bad)}
.pl-top{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.pl-date{color:var(--muted);margin-right:2px}
.pl-name{font-family:var(--display);font-size:21px;line-height:1.2}
.pl-party{font-size:15px}
.pl-party .as{color:var(--muted);font-size:13px}
.pl-party.none{color:var(--muted);font-style:italic;font-size:14px}
.pl-rules{font-size:13px;color:var(--accent);font-weight:600}
.pl-notes{font-size:14px;color:var(--muted);white-space:pre-line;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}

/* scenarios */
.scs,.adm{list-style:none;margin:0;padding:0}
.scs li,.adm li{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:10px 0;border-top:1px solid var(--line)}
.scs li:first-child,.adm li:first-child{border-top:0}
.scs .grow,.adm .grow{display:flex;flex-direction:column;gap:2px}
.adm li.done{opacity:.6}
.admsort{gap:8px;align-items:center;margin-bottom:4px}.admsort select.f{width:auto}
.adm .msg{white-space:pre-wrap}
.adm pre{white-space:pre-wrap;font-size:12px;max-height:200px;overflow:auto;background:var(--surface2);padding:8px;border-radius:6px}
.mono{font-family:var(--mono);font-weight:500;font-size:13px;word-break:break-word}

/* stats */
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
@media (max-width:620px){.stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
.stat{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.stat b{font-size:28px;font-weight:500}
.stat small{color:var(--muted)}
.tbl{width:100%;border-collapse:collapse;font-size:15px}
.tbl th{text-align:left;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);padding:6px 8px 6px 0;border-bottom:1px solid var(--line)}
.tbl td{padding:8px 8px 8px 0;border-bottom:1px solid color-mix(in srgb,var(--line) 50%,transparent);vertical-align:middle}
.tbl .r{text-align:right}
.tbl .w{width:38%}
.barwrap{display:flex;align-items:center;gap:8px}
.track{flex:1;min-width:0;display:block}
.meter{height:10px;background:color-mix(in srgb,var(--bad) 28%,var(--surface2));border-radius:5px;overflow:hidden;display:block;max-width:100%}
.meterin{display:block;height:100%;background:var(--ok)}
.barwrap .num{width:3.2em;text-align:right;color:var(--muted)}
@media (max-width:520px){.tbl .w{width:30%}.tbl{font-size:14px}}

/* settings */
.checks{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:6px 14px}
.check{display:flex;gap:8px;align-items:center;min-height:36px;cursor:pointer}
.check input{width:18px;height:18px;accent-color:var(--accent)}
.preview{border:1px dashed var(--line);border-radius:8px;padding:12px;display:flex;flex-direction:column;gap:8px}
.preview p{margin:0}
.mini{margin:0;padding-left:0;list-style:none;display:flex;flex-direction:column;gap:4px;font-size:14px;max-height:320px;overflow:auto}

/* sign-in */
.auth{max-width:440px}
.btn.google{width:100%}
.btn.google .g{font-family:Arial,sans-serif;font-weight:700;color:var(--accent)}
.or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:13px}
.or::before,.or::after{content:"";flex:1;border-top:1px solid var(--line)}
.auth .stack .btn.pri{width:100%}
.authlinks{justify-content:space-between}
.auth .fine{font-size:12px;text-align:center}

/* signed out: the intro beside the sign-in card, then the sample casebook (laid out like the Arkham Horror RPG Ledger's) */
.welcome{display:grid;grid-template-columns:minmax(0,1fr) 400px;grid-template-areas:"intro auth" "demo demo";gap:32px;align-items:start;margin-top:8px}
#introbox{grid-area:intro;min-width:0}#authbox{grid-area:auth;min-width:0}.welcome .demo{grid-area:demo;min-width:0}
.welcome .auth{margin:0;max-width:none}
.intro{display:flex;flex-direction:column;gap:14px;padding-top:8px}
.intro h2{font-size:clamp(28px,4.4vw,38px);line-height:1.12}
.intro p{margin:0;line-height:1.6}
.intro .note{line-height:1.5}
.cta{gap:10px}.narrow-only{display:none}
.demo{display:flex;flex-direction:column;gap:10px}
.demohead{display:flex;flex-direction:column;gap:2px}
.demohead h2{font-size:24px}
#demoframe{display:block;width:100%;height:min(780px,82vh);border:1px solid var(--line);border-radius:8px;background:var(--bg);box-shadow:0 10px 30px rgba(0,0,0,.12)}
@media (max-width:780px){.welcome{grid-template-columns:1fr;grid-template-areas:"intro" "demo" "auth";gap:24px;margin-top:0}.narrow-only{display:inline-flex}#demoframe{height:78vh}}
.savewrap{max-width:440px;width:100%;margin:8px auto 0;display:flex;flex-direction:column;gap:12px;align-items:flex-start}.savewrap .auth{width:100%;max-width:none}
.savenote{margin:0;padding:10px 12px;background:var(--surface2);border-radius:6px;line-height:1.5}
/* a casebook kept in this browser, and the sample */
.localban{flex-direction:row;align-items:center;gap:12px;flex-wrap:wrap;border-style:dashed}
.localban .grow{display:flex;flex-direction:column;gap:2px;min-width:220px}
.demoban{margin:0;padding:10px 14px;font-size:14px;color:var(--muted)}
/* the sample inside its frame on the welcome page: no header or footer */
html.embed .top,html.embed .foot{display:none}
html.embed main{padding-top:4px}
.empty{align-items:flex-start}

/* account menu */
/* avatars: picture, Google photo or initial in a circle */
.avatar{flex:none;width:34px;height:34px;border-radius:50%;overflow:hidden;display:inline-grid;place-items:center;background:var(--accent-soft);color:var(--accent);font-weight:700;font-size:15px;border:1px solid var(--line)}
.avatar img{width:100%;height:100%;object-fit:cover;display:block}
.avatar.lg{width:44px;height:44px;font-size:18px}
.swatches{display:flex;flex-wrap:wrap;gap:8px}
.swatch{width:34px;height:34px;border-radius:50%;border:2px solid transparent;cursor:pointer;padding:0;box-shadow:0 0 0 1px var(--line)}
.swatch.on{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--ink)}
.avatar.xl{width:84px;height:84px;font-size:34px;font-family:var(--display);font-weight:400}
.picrow{gap:16px;align-items:center}
.stack.tight{gap:6px}
.crop{display:grid;place-items:center;padding:4px 0}
.crop canvas{border-radius:50%;cursor:grab;touch-action:none;box-shadow:0 0 0 1px var(--line),0 0 0 6px var(--surface2)}
.crop canvas:active{cursor:grabbing}
.zoom{width:100%;accent-color:var(--accent)}

/* dialogs */
.dlg-bg{position:fixed;inset:0;z-index:20;background:rgba(6,9,12,.55);display:flex;align-items:flex-start;justify-content:center;overflow-y:auto;padding:max(24px,env(safe-area-inset-top)) 12px 24px}
.dlg{background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:10px;width:100%;max-width:560px;padding:16px;box-shadow:0 20px 50px rgba(0,0,0,.35)}
.dlg>*+*{margin-top:12px}
/* "Discard your changes?" sits above the dialog it's about, in the middle of the screen */
.dlg-ask{z-index:45;align-items:center}
.dlg-ask .dlg{max-width:380px}
.dlg-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.dlg .steps{padding-left:20px;display:flex;flex-direction:column;gap:6px}
.seats{display:flex;flex-direction:column;gap:8px}
.seat{display:grid;grid-template-columns:1fr 1fr 40px;gap:8px;align-items:center}
/* phones: player and investigator stay side by side, a little tighter */
@media (max-width:420px){.seat{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 30px;gap:6px}.seat .f{padding-left:10px;padding-right:26px;background-position:right 9px center}.seat .x{width:30px}}
.newsc{border-left:3px solid var(--accent);padding-left:12px}

.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(24px + env(safe-area-inset-bottom,0px));background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:8px;z-index:30;font-weight:600;max-width:calc(100% - 32px)}
.prose{max-width:720px}
.prose h3{font-size:20px;margin-top:6px}
.prose p,.prose ul{margin:0}
code{font-family:var(--mono);font-size:.88em;background:var(--surface2);padding:1px 4px;border-radius:4px}
@media (max-width:560px){.toast{bottom:calc(84px + env(safe-area-inset-bottom,0px))}main{padding-bottom:96px}}

/* players and groups */
.scs li>.avatar{align-self:flex-start;margin-top:2px}
.chips{margin-top:4px}
.pnote{font-style:italic}
select.grp{margin-bottom:8px}
@media (max-width:440px){.tab{padding:10px 8px;font-size:14px}}

/* investigator clean-up */
.sec.notice{flex-direction:row;align-items:center;flex-wrap:wrap;gap:12px;border-color:var(--accent);background:var(--accent-soft)}
.sec.notice .grow{display:flex;flex-direction:column;gap:2px;min-width:220px}
.fixes{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.fixes li{display:flex;flex-direction:column;gap:6px}
.seat select.f{min-width:0}

/* scenario list: ratings and reviews */
.community b{color:var(--ink)}
.pl-loc{color:var(--muted);font-size:14px}

.rating{font-weight:700;color:var(--accent)}
.reviews,.desc{margin-top:4px;font-size:14px}
.reviews summary,.desc summary{cursor:pointer;color:var(--accent);font-weight:600;width:max-content}
.reviews p{margin:6px 0 0;padding-left:10px;border-left:2px solid var(--line)}
.filters .field{min-width:130px;flex:1 1 130px}
.filters .field.grow{flex:3 1 260px}
.filters .lbl{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* collapsible Official / Valkyrie / Your own boxes */
details.box{padding:0;gap:0}
details.box>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:10px;padding:14px 16px}
/* a long summary (other languages, phones) wraps inside itself, so the arrow stays on the heading's line */
details.box>summary .note{flex:0 1 auto;min-width:0;text-align:right}
details.box>summary .chev{flex:none}
details.box>summary::-webkit-details-marker{display:none}
details.box>summary h2{margin-right:auto;flex:none}
details.box>summary .chev{width:10px;height:10px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(45deg);align-self:center;transition:transform .15s}
details.box:not([open])>summary .chev{transform:rotate(-45deg)}
details.box[open]>summary{border-bottom:1px solid var(--line)}
details.box>summary:hover h2{color:var(--accent)}
details.box>ul,details.box>.subhead{margin-left:16px;margin-right:16px}
details.box>ul:last-child{margin-bottom:6px}
.subhead{font-size:19px;margin-top:14px;margin-bottom:2px}

/* Play again: stands out from Log a play so played scenarios are obvious */
.btn.again{border-color:var(--accent);color:var(--accent)}
.btn.again:hover{background:var(--accent-soft)}

/* inline icons inside buttons: sized to the text, coloured like it */
.btn .ico{flex:none;width:1.2em;height:1.2em;margin-left:-3px}

/* plays inside collapsible boxes */
details.pbox>.plays{margin:12px 16px 16px}

/* import: names that need a scenario chosen */
.unmatched{display:flex;flex-direction:column;gap:10px;border-top:1px solid var(--line);padding-top:10px}
.unmatched p{margin:0}

.desc p{margin:6px 0 0;padding-left:10px;border-left:2px solid var(--line);max-width:70ch}
.desc p.note{border-left:0;padding-left:10px}
.credit{margin-top:4px}

/* stars (accent colour, never yellow) and plans */
.star{border:0;background:none;color:var(--muted);width:36px;height:36px;border-radius:50%;display:inline-grid;place-items:center;cursor:pointer;padding:0}
.star:hover{background:var(--accent-soft);color:var(--accent)}
.star.on{color:var(--accent)}
.star .ico{width:20px;height:20px;margin:0}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.plan{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:600;color:var(--accent);margin-top:4px}
.plan .ico{width:15px;height:15px}
.placewrap{position:relative;display:inline-flex}
.calmenu{position:absolute;right:0;top:calc(100% + 4px);z-index:8;min-width:230px;background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 30px rgba(0,0,0,.2);display:flex;flex-direction:column;padding:6px}
.calmenu a,.calmenu button{border:0;background:none;text-align:left;padding:9px 10px;border-radius:6px;font-weight:600;font-size:14px;text-decoration:none;cursor:pointer;color:var(--ink)}
.calmenu a:hover,.calmenu button:hover{background:var(--surface2)}
details[data-box=starred]>summary h2::before{content:"\2605  ";color:var(--accent)}

/* keep scenario names readable: the buttons wrap below the text before squeezing it */
.scs li>.grow{min-width:min(100%,280px)}
.scs li>.acts{margin-left:auto}

/* star sits at the start of each scenario row, so names and buttons line up */
.scs li.sc{flex-wrap:nowrap;align-items:flex-start}
.scs li.sc>.star{flex:none;width:32px;height:32px;margin:-4px -2px 0 -6px}
.scs li.sc>.grow{flex:1}
@media (max-width:560px){.scs li.sc{flex-wrap:wrap}.scs li.sc>.grow{flex:1 1 calc(100% - 40px)}.scs li.sc>.acts{margin-left:34px}}

/* Account button and menu: copied from the Arkham Horror RPG Ledger (css/app.css there) so both sites match exactly. */
.acctwrap{position:relative;display:inline-flex}
.acctbtn{display:inline-flex;align-items:center;gap:7px;background:none;border:1px solid transparent;border-radius:999px;padding:3px 8px 3px 3px;font:inherit;color:var(--ink);cursor:pointer}
/* On the Arkham pages the button sits in a <span class="nav"> (13px) inside a muted <small>, in the Libre Franklin
   typeface; the same here so the corner matches exactly */
.acctwrap{font-size:13px;color:var(--muted);font-family:'Libre Franklin','Helvetica Neue',Arial,sans-serif}
.acctbtn:hover,.acctbtn[aria-expanded="true"]{background:var(--surface2);border-color:var(--line)}
.av{object-fit:cover;width:22px;height:22px;border-radius:50%;background:#56606f;color:#fff;display:inline-grid;place-items:center;font-size:12px;font-weight:700;line-height:1}
.acctbtn .av{width:28px;height:28px;font-size:13px}
.acctbtn b{font-weight:600;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acctbtn .caret{font-size:10px;color:var(--muted)}
.acctmenu{position:absolute;right:0;top:calc(100% + 6px);z-index:40;min-width:230px;background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.25);padding:6px;display:flex;flex-direction:column;font-size:14px}
.acctmenu[hidden]{display:none}
.acctmenu-head{display:flex;gap:10px;align-items:center;padding:8px 10px 10px;border-bottom:1px solid var(--line);margin-bottom:4px}
.acctmenu-head .av{width:34px;height:34px;font-size:15px;flex:none}
.acctmenu-head>span:not(.av){display:flex;flex-direction:column;min-width:0}
.acctmenu-head .note{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acctmenu a,.acctmenu button{display:block;text-align:left;padding:8px 10px;border-radius:6px;color:var(--ink);text-decoration:none;background:none;border:0;font:inherit;cursor:pointer}
.acctmenu a:hover,.acctmenu button:hover,.acctmenu a:focus-visible,.acctmenu button:focus-visible{background:var(--surface2)}
@media (max-width:600px){.acctbtn .acctname,.acctbtn .caret{display:none}.acctbtn{padding:2px}}
.acctver{display:block;padding:8px 10px 4px;margin-top:4px;border-top:1px solid var(--line);font-size:11px;color:var(--muted)}

/* play cards: details on the left, the result on the right, vertically centred */
.play{flex-direction:row;align-items:center;gap:16px}
.pl-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.pl-res{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:4px;text-align:right}
.pl-res .chip{font-size:13.5px;padding:3px 10px}
.pl-tries{font-size:12.5px;color:var(--muted);font-weight:600;white-space:nowrap}
@media (max-width:420px){.play{gap:10px;padding:12px}.pl-res .chip{font-size:12.5px;padding:2px 8px}}

/* play card date and place: one line, body font, muted */
.pl-meta{font-size:14px;color:var(--muted);line-height:1.3}

/* dropdown menus (js/shared.js opens these in place of the browser's own list) */
.dd-wrap{position:fixed;inset:0;z-index:40;pointer-events:none}
.dd{position:fixed;pointer-events:auto;display:flex;flex-direction:column;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:10px;
  box-shadow:0 12px 32px rgba(0,0,0,.22),0 2px 6px rgba(0,0,0,.12);overflow:hidden;font-size:15px;
  animation:dd-in .14s cubic-bezier(.2,.8,.3,1);transform-origin:top center}
.dd.up{transform-origin:bottom center}
@keyframes dd-in{from{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:none}}
.dd-out .dd{opacity:0;transition:opacity .12s}
.dd-search{padding:8px;border-bottom:1px solid var(--line);flex:none}
.dd-search input{width:100%;height:36px;padding:6px 10px 6px 32px;border:1px solid var(--line);border-radius:6px;background-color:var(--bg);color:var(--ink);font-size:15px;
  background-image:var(--mag);background-repeat:no-repeat;background-position:10px center;background-size:14px 14px}
.dd-search input:focus{outline:none;border-color:var(--accent)}
.dd-list{overflow-y:auto;overscroll-behavior:contain;padding:4px;flex:1;min-height:0;outline:none}
.dd-grp{padding:10px 10px 4px;font-size:11.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.dd-grp:first-child{padding-top:6px}
.dd-sep{height:1px;background:var(--line);margin:4px 6px}
.dd-opt{display:flex;align-items:center;gap:8px;min-height:36px;padding:7px 10px 7px 8px;border-radius:6px;cursor:pointer;line-height:1.3}
.dd-opt.on{background:var(--surface2)}
.dd-opt.sel{font-weight:600;color:var(--accent)}
.dd-opt.dis{color:var(--muted);cursor:default}
.dd-tick{flex:none;width:16px;height:16px;position:relative}
.dd-opt.sel .dd-tick::after{content:"";position:absolute;left:5px;top:1px;width:5px;height:10px;border:solid var(--accent);border-width:0 2px 2px 0;transform:rotate(45deg)}
.dd-txt{min-width:0;overflow-wrap:anywhere;flex:1}
.dd-tag{flex:none;font-size:11.5px;font-weight:700;letter-spacing:.04em;padding:1px 7px;border-radius:999px;background:var(--accent-soft);color:var(--accent)}
.dd-empty{margin:0;padding:14px 16px;color:var(--muted);font-size:14px}
@media (prefers-reduced-motion:reduce){.dd{animation:none}.dd-out .dd{transition:none}}

/* packing lists (Valkyrie scenarios) */
.needs .missing,.missing{color:var(--bad)}
.pk-bar{justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px}
.pk-order{display:flex;align-items:center;gap:6px;margin-left:auto}
.pk-order select.f{width:auto}
.pk-bar .btn{min-height:42px}
.pk-tiles>*+*{margin-top:12px}
.pk-h{font-size:19px;margin-top:4px}
.pk-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.pk-list li+li{border-top:1px solid var(--line)}
.pk{display:flex;align-items:center;gap:12px;padding:9px 12px;cursor:pointer;background:var(--surface)}
.pk:hover{background:var(--surface2)}
.pk input{width:20px;height:20px;flex:none;accent-color:var(--accent);margin:0}
.pk-idx{flex:none;min-width:56px;text-align:center;padding:2px 6px;border-radius:6px;background:var(--slate-soft);color:var(--ink);font-size:13px}
.pk-pic{flex:none;width:48px;height:48px;border-radius:50%;object-fit:cover}
.pk-zoom{flex:none;position:relative;padding:0;margin:0;border:0;background:none;border-radius:50%;line-height:0;cursor:zoom-in}
.pk-zoom.pk-tile{border-radius:4px}
.pk-picbox{flex:none;width:96px;display:flex;justify-content:center}
.pk-zoom:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
/* a small magnifier on each picture: it opens large, the rest of the row ticks */
.pk-zoom::after{content:"";position:absolute;right:-3px;bottom:-3px;width:18px;height:18px;border-radius:50%;background:var(--surface) center/12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E");box-shadow:0 0 0 1px var(--line)}
.pk-zoom:hover .pk-pic{filter:brightness(1.12)}
.lb{position:fixed;inset:0;z-index:40;background:rgba(6,9,12,.92);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:max(56px,env(safe-area-inset-top)) 12px max(16px,env(safe-area-inset-bottom));touch-action:pan-y}
.lb-img{max-width:min(100%,1000px);max-height:calc(100vh - 140px);max-height:calc(100dvh - 140px);object-fit:contain;border-radius:6px}
.lb-cap{margin:12px 0 0;color:#e8eaee;font-size:16px;text-align:center}
.lb-cap span{color:#a9adb6;margin-left:6px;font-size:14px}
.lb-x,.lb-nav{position:absolute;border:0;border-radius:50%;background:rgba(255,255,255,.14);color:#fff;width:44px;height:44px;font-size:28px;line-height:1;cursor:pointer}
.lb-x:hover,.lb-nav:hover{background:rgba(255,255,255,.26)}
.lb-x{top:max(10px,env(safe-area-inset-top));right:10px}
.lb-nav{top:50%;transform:translateY(-50%)}
.lb-prev{left:10px}.lb-next{right:10px}
/* an investigator's card on the Players tab, and full size with its back (cardView) */
.inv-face{flex:none;align-self:flex-start;width:60px;height:60px;padding:0;border:2px solid var(--accent);border-radius:50%;overflow:hidden;background:var(--surface2);line-height:0;cursor:zoom-in;box-shadow:0 0 0 3px var(--accent-soft),0 2px 6px rgba(0,0,0,.25);transition:transform .15s}
.inv-face img{width:100%;height:100%;object-fit:cover;display:block}
.inv-face:hover{transform:scale(1.06)}
.inv-face:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
.scs li.person{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;column-gap:14px}
.scs li.person>.grow{min-width:0}
.scs li.person>.pacts{margin-top:2px}

.played-as{margin-top:10px;display:flex;flex-direction:column;gap:6px}
.played-as~.chips{margin-top:8px}
.ipills{display:grid;grid-template-columns:repeat(auto-fill,minmax(176px,1fr));gap:6px;max-width:760px}
.ipill{display:flex;align-items:center;gap:8px;min-width:0;padding:4px 10px 4px 4px;border:1px solid transparent;border-radius:8px;background:var(--surface2);color:var(--ink);font:inherit;font-size:14px;line-height:1.2;text-align:left}
button.ipill{cursor:zoom-in}
button.ipill:hover{border-color:var(--accent)}
button.ipill:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.ipill img,.ipill i{flex:none;width:28px;height:28px;border-radius:50%;object-fit:cover;display:grid;place-items:center;background:var(--slate-soft);color:var(--muted);font-style:normal;font-weight:700}
.ipill span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ipill b{flex:none;color:var(--muted);font-weight:600;font-size:13px;font-variant-numeric:tabular-nums}
.ipill b::before{content:'\00d7';margin-right:1px;opacity:.7}
@media (max-width:560px){.scs li.person>.pacts{grid-column:2;justify-self:start;margin-top:8px}.ipills{grid-template-columns:minmax(0,1fr);gap:4px}.ipill{gap:8px;padding:2px 10px 2px 2px;font-size:14px}.ipill img,.ipill i{width:24px;height:24px}.ipill b{font-size:12px}}
.avatar.pl{width:60px;height:60px;font-size:26px;font-family:var(--display);font-weight:400}
.inv-line{display:block;font-size:14px;margin:1px 0 2px}
.inv-line a{font-weight:600}
.card3d{padding:0;border:0;background:none;cursor:pointer;perspective:1600px;width:min(100%,900px,calc((100dvh - 170px)*600/351));aspect-ratio:600/351}
.card3d-in{position:relative;display:block;width:100%;height:100%;transition:transform .6s cubic-bezier(.3,.7,.3,1);transform-style:preserve-3d}
.card3d.flipped .card3d-in{transform:rotateY(180deg)}
.card3d img{position:absolute;inset:0;width:100%;height:100%;border-radius:10px;backface-visibility:hidden;-webkit-backface-visibility:hidden;box-shadow:0 12px 40px rgba(0,0,0,.5)}
.card3d-b{transform:rotateY(180deg)}
.lb-cap .lb-flip{margin-left:10px;vertical-align:middle}
.lb-note{margin:6px 0 0;color:#a9adb6;font-size:12px}
@media (prefers-reduced-motion:reduce){.card3d-in{transition:none}}
.lb-side{text-align:center}
/* a phone turned sideways: the card as tall as the screen, its name and Flip beside it */
@media (orientation:landscape) and (max-height:540px){
  .lb-card{flex-direction:row;gap:16px;padding:8px max(60px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left))}
  .lb-card .card3d{flex:none;width:min(calc(100vw - 230px),calc((100dvh - 16px)*600/351))}
  .lb-card .lb-side{flex:0 1 150px;text-align:left}
  .lb-card .lb-cap{margin:0;text-align:left}
  .lb-card .lb-cap .lb-flip{display:block;margin:10px 0 0}
  .lb-card .lb-note{margin-top:10px}
}
@media (max-width:480px){.inv-face,.avatar.pl{width:48px;height:48px}.avatar.pl{font-size:21px}}
.pk.on .pk-pic{opacity:.55}
.pk-pic.pk-tile{width:auto;height:48px;max-width:96px;border-radius:4px;display:block}
.pk-txt{display:flex;flex-direction:column;min-width:0}
.pk-txt b{font-weight:600}
.pk.on .pk-txt b{text-decoration:line-through;color:var(--muted)}
.pk.on .pk-idx{opacity:.55}
.btn .ic{flex:none}
/* set tags in packing lists: which symbol is printed on the tile or figure (colours avoid yellow, see CLAUDE.md) */
.set{display:inline-block;min-width:34px;padding:0 6px;border-radius:5px;font-size:11.5px;font-weight:700;letter-spacing:.02em;text-align:center;color:#fff;vertical-align:1px;line-height:17px}
.set.s-2e{background:#4b5563}.set.s-1e{background:#6b4fa0}.set.s-cotw{background:#2f7a4a}.set.s-fa{background:#1f6f78}
.set.s-btt{background:#2f5fb3}.set.s-soa{background:#9b2c2c}.set.s-sot{background:#9a3a7a}.set.s-hj{background:#2b3f74}
.set.s-pots{background:#7a4a2a}.set.s-fan{background:transparent;color:var(--muted);border:1px solid var(--line)}
/* the real set symbols (img/sets/, transparent shapes) drawn in the text colour, so they suit both themes */
.set.sym{min-width:0;width:19px;height:19px;padding:0;border-radius:0;background:var(--ink);vertical-align:-4px;-webkit-mask:var(--sym) center/contain no-repeat;mask:var(--sym) center/contain no-repeat}
.set.sym.s-2e{--sym:url(../img/sets/2e.png)}.set.sym.s-btt{--sym:url(../img/sets/btt.png)}.set.sym.s-soa{--sym:url(../img/sets/soa.png)}.set.sym.s-sot{--sym:url(../img/sets/sot.png)}
.set.sym.s-hj{--sym:url(../img/sets/hj.png)}.set.sym.s-pots{--sym:url(../img/sets/pots.png)}.set.sym.s-fa{--sym:url(../img/sets/fa.png)}
/* an official scenario's English name under its translated one (Scenarios tab) */
.scs .orig{font-size:12.5px;font-style:italic;margin-top:-2px}
/* cross table (Stats tab): scrolls inside its box; the row names and column heads stay put while it does */
.xt-pick{align-items:flex-end}
.xt-pick .xt-swap{min-height:42px;font-size:18px;padding:4px 12px}
.xt-wrap{overflow:auto;max-height:70vh;border:1px solid var(--line);border-radius:8px;background:var(--surface);overscroll-behavior:contain}
.xt{border-collapse:separate;border-spacing:0;font-size:14px;min-width:100%}
.xt th,.xt td{padding:6px 8px;border-bottom:1px solid color-mix(in srgb,var(--line) 60%,transparent);border-right:1px solid color-mix(in srgb,var(--line) 40%,transparent);white-space:nowrap}
.xt thead th{position:sticky;top:0;z-index:2;background:var(--surface2);font-size:12px;font-weight:700;color:var(--muted);text-align:center;vertical-align:bottom}
.xt tbody th,.xt tfoot th{position:sticky;left:0;z-index:1;background:var(--surface);text-align:left;font-weight:600;max-width:42vw;overflow:hidden;text-overflow:ellipsis}
.xt thead th.xt-corner{left:0;z-index:3;text-align:left;font-weight:600;white-space:normal;min-width:120px}
.xt td{text-align:center;min-width:34px}
.xt .xt-none{color:var(--muted);opacity:.5}
.xt .xt-tot{font-weight:700;background:var(--surface2)}
.xt tfoot th,.xt tfoot td{border-bottom:0}
/* many columns: their names run upwards so the table stays narrow */
.xt.xt-v thead th:not(.xt-corner) span{writing-mode:vertical-rl;transform:rotate(180deg);display:inline-block;max-height:170px;overflow:hidden;text-overflow:ellipsis;text-align:left}
@media (max-width:520px){.xt{font-size:13px}.xt th,.xt td{padding:5px 6px}}
/* packing-list pictures on a phone: smaller, so the names keep their room */
@media (max-width:480px){.pk{gap:9px}.pk-picbox{width:64px}.pk-pic.pk-tile{height:36px;max-width:64px}.pk-zoom:not(.pk-tile) .pk-pic{width:40px;height:40px}.pk-zoom::after{width:16px;height:16px;background-size:10px}}
/* game-night cheat sheet (cheatSheet() in app.js): one card per seat, on screen and on paper */
.dlg-bg.wide .dlg{max-width:880px}
.ch-head{margin:4px 0 12px}
.ch-head h2{margin:2px 0}
.ch-head .note{margin:0}
.ch-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(330px,1fr));gap:12px}
.ch-card{display:flex;gap:12px;align-items:flex-start;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);break-inside:avoid;page-break-inside:avoid}
.ch-face{flex:none;width:64px;height:64px;border-radius:50%;object-fit:cover;border:2px solid var(--accent)}
.ch-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.ch-who{font-size:20px;font-weight:700;line-height:1.15}
.ch-inv{font-size:14px}
.ch-inv span{color:var(--muted);font-style:italic}
.ch-ab{margin:4px 0 2px;padding:6px 0 6px 10px;border-left:3px solid var(--accent);font-size:15px;line-height:1.35}
.ch-ab .die{display:inline-block;width:1.05em;height:1.05em;vertical-align:-.15em;color:var(--accent)}
.ch-ab .die svg{width:100%;height:100%;display:block}
.dlg .ch-head .lbl{display:none}
.ch-foot{margin:12px 0 0;font-size:12px;color:var(--muted)}
#printarea{display:none}
@media (max-width:420px){.ch-grid{grid-template-columns:1fr}.ch-face{width:48px;height:48px}}
@media print{
  @page{margin:12mm}
  body.printing>*:not(#printarea){display:none!important}
  body.printing{background:#fff!important}
  /* paper is always light: the light theme's tokens, whatever the screen uses */
  body.printing #printarea{display:block;font-size:12pt;--surface:#fff;--surface2:#e1e5e8;--ink:#1a1f26;--muted:#555d68;--line:#bcc3ca;--accent:#1d5c63;--bad:#a3322a;color:var(--ink)}
  /* one wide card per seat: big enough to read across the table, up to eight on a page */
  #printarea .ch-grid{grid-template-columns:1fr;gap:8px}
  #printarea .ch-card{padding:8px 12px;gap:14px;align-items:center}
  #printarea .ch-face{width:58px;height:58px}
  #printarea .ch-ab{font-size:13pt;margin:2px 0 0}
  #printarea *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
/* the next game on the Plays tab, laid out like the Arkham Horror RPG Ledger's next session: countdown, when and where,
   calendar and Change at the top; then the scenario, who's playing, and what to do about it */
.sec.nextup{gap:12px}
.nu-top{display:flex;flex-wrap:wrap;align-items:flex-start;gap:10px}
.nu-top .grow{display:flex;flex-direction:column;gap:3px;flex:1;min-width:200px}
.nu-top .lbl [data-pcd]{color:var(--accent)}
.nu-when{font-size:18px;font-weight:700;line-height:1.25}
.nu-where{color:var(--muted);font-size:15px}
.nu-game{display:flex;flex-direction:column;gap:6px;padding-top:12px;border-top:1px solid var(--line)}
.nu-game h3{margin:0;font-family:var(--display);font-weight:400;font-size:24px;line-height:1.15}
.nu-game .note{margin:0}
.nu-cast{list-style:none;margin:4px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.nu-cast li{display:flex;align-items:center;gap:8px;padding:4px 12px 4px 4px;border-radius:999px;background:var(--surface2)}
.nu-cast img,.nu-cast .avatar{width:34px;height:34px;border-radius:50%;object-fit:cover;flex:none}
.nu-cast span{display:flex;flex-direction:column;line-height:1.15}
.nu-cast b{font-size:14px}
.nu-cast small{font-size:12px;color:var(--muted)}
.nu-acts .btn.pri{margin-left:auto}
.placecaret{margin-left:4px;font-size:.8em}
.placelink{border:0;background:none;padding:0;font:inherit;color:inherit;text-decoration:underline;text-decoration-color:var(--line);text-underline-offset:3px;cursor:pointer}
.calmenu.left{right:auto;left:0}
.calmenu[hidden]{display:none}
@media (max-width:520px){.nu-acts .btn.pri{margin-left:0;flex:1 1 100%}.nu-top>.row{width:100%}}
/* a play's scenario title: a link to the scenario on the Scenarios tab (the rest of the card opens the play) */
.pl-sc{cursor:pointer;text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--accent) 45%,transparent);text-decoration-thickness:1.5px;text-underline-offset:4px}
.pl-sc:hover{color:var(--accent);text-decoration-color:var(--accent)}
.nu-game h3 .pl-sc{color:inherit}
/* arriving at a scenario from a play: a brief highlight */
.scs li.sc.hl{animation:schl 2.2s ease-out}
@keyframes schl{0%,35%{background:var(--accent-soft);box-shadow:0 0 0 6px var(--accent-soft)}100%{background:transparent;box-shadow:0 0 0 6px transparent}}
@media (prefers-reduced-motion:reduce){.scs li.sc.hl{animation:none;outline:2px solid var(--accent)}}
/* Back to your plays, after following a link from a play to its scenario: floats at the bottom left, clear of the
   phone's + Log a play at the bottom right */
.btn.backfloat{position:fixed;left:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:6;min-height:48px;padding:10px 18px;border-radius:999px;background:var(--surface);box-shadow:0 6px 20px rgba(0,0,0,.3);font-size:15px}
/* packing list: a monster to bring every figure of; a tile that comes up more than once */
.pk-warn{display:block;margin-top:2px;color:var(--bad);font-weight:600}
.pk-again{display:block;margin-top:2px;color:var(--accent);font-weight:600}
/* a scenario's difficulty, beside its name, as Valkyrie shows it: five elder signs (img/elder-sign.svg, the glyph from
   the Mansions of Madness symbol font Valkyrie uses), filled to the nearest half in the text colour */
.diffm{display:inline-flex;align-items:center;gap:1px;vertical-align:middle}
.diffm i{position:relative;display:block;width:19px;height:19px;background:color-mix(in srgb,var(--muted) 35%,transparent);overflow:hidden;-webkit-mask:url(../img/elder-sign.svg) center/contain no-repeat;mask:url(../img/elder-sign.svg) center/contain no-repeat}
.diffm i u{position:absolute;left:0;top:0;bottom:0;background:var(--ink)}
