/* Murder Mystery: a playable case table, not a page inside the website. */
.mm-page {
  --mm-gold:var(--mm-amber); --mm-table:#bec8ba; --mm-stage:#e9dfc7;
  --mm-stage-raised:#f5eedc; --mm-ink:#263b3c; --mm-quiet:#576b67;
  --mm-edge:#9aa48d; --mm-case-accent:#83592d; --mm-shadow:#253b3b25;
}
html[data-theme=dark] .mm-page {
  --mm-table:#09171d; --mm-stage:#11252d; --mm-stage-raised:#1a333a;
  --mm-ink:#f0ead8; --mm-quiet:#adbfba; --mm-edge:#3d5758;
  --mm-case-accent:#e4bb7e; --mm-shadow:#020b1155;
}
body.mm-page [hidden] { display:none!important; }
.mm-page .mm-main { overflow:clip; }
.mm-page.mm-in-room { background:var(--mm-table); }
.mm-in-room .mm-workspace,.mm-room-dialog {
  --surface:var(--mm-stage); --surface-raised:var(--mm-stage-raised);
  --text:var(--mm-ink); --muted:var(--mm-quiet); --line:var(--mm-edge);
  --accent-text:var(--mm-case-accent); color:var(--text);
}
.mm-in-room .mm-workspace {
  width:min(1440px,100%); padding:30px clamp(16px,3vw,40px) 50px;
  min-height:80svh; position:relative; isolation:isolate;
}
.mm-in-room .mm-workspace::before {
  content:''; position:fixed; z-index:-1; inset:0; pointer-events:none;
  background:radial-gradient(ellipse at 80% 10%,#dfa96b19,transparent 60%),
    repeating-linear-gradient(125deg,transparent 0 140px,#50736c12 141px 142px);
}
.mm-in-room .mm-room { margin-top:0; }
.mm-in-room .mm-section-head { align-items:center; margin-bottom:22px; }
.mm-in-room .mm-section-head h2 { font:400 clamp(27px,4vw,40px)/1.15 Georgia,serif; }
.mm-in-room .mm-room-heading {
  padding:25px; border:1px solid var(--line); border-top:3px solid var(--mm-gold);
  background:var(--surface); margin-bottom:20px;
}
.mm-in-room .mm-room-heading h2 { font:400 clamp(28px,4vw,44px)/1.1 Georgia,serif; margin:5px 0 0; }
.mm-in-room .mm-room-grid { margin-top:0; }
.mm-in-room #mm-notice[data-tone=success] { display:none; }
.mm-page.mm-in-case { padding-top:0!important; }
.mm-in-case .mm-main { padding-top:0; margin:0; }
.mm-in-case .mm-workspace {
  width:min(1540px,100%); min-height:100svh; padding:0 max(16px,env(safe-area-inset-right)) max(30px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
}
.mm-in-case #mm-notice { margin:8px 0; }
.mm-case-play { position:relative; margin:0; padding:0; isolation:isolate; scroll-margin-top:0; }
.mm-game-hud {
  display:flex; align-items:center; gap:20px; padding:16px 0;
  border-bottom:1px solid var(--line); min-height:86px;
}
.mm-game-brand { display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--text); min-width:0; flex:1; }
.mm-game-brand>span {
  display:grid; place-items:center; flex-shrink:0; width:45px; height:49px;
  background:var(--mm-gold); color:#302a20; border:2px solid #f7d9a1;
  font:700 18px/1 Georgia,serif; clip-path:polygon(0 0,100% 0,100% 76%,50% 100%,0 76%);
}
.mm-game-brand strong { font:400 21px/1.15 Georgia,serif; }
.mm-game-brand small { display:block; margin-top:6px; color:var(--muted); font:500 10px/1.4 var(--body-font); letter-spacing:.03em; }
.mm-hud-actions { display:flex; gap:8px; }
.mm-hud-actions .mm-copy { min-height:42px; padding:9px 13px; background:var(--surface); }
.mm-hud-connection { color:var(--muted); font:600 10px/1.5 var(--body-font); display:flex; align-items:center; gap:7px; }
.mm-hud-connection::before { content:''; width:6px; height:6px; flex-shrink:0; background:#a9844d; border-radius:50%; }
.mm-hud-connection[data-status=connected]::before { background:#62ba99; }
.mm-hud-connection[data-status=disconnected]::before { background:#d57668; }
.mm-phase-rail { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); list-style:none; padding:0; margin:20px 0 0; gap:10px; }
.mm-phase-rail li { display:flex; align-items:center; gap:9px; padding:9px 0; border-bottom:2px solid var(--line); color:var(--muted); min-width:0; }
.mm-phase-rail li>span { font:500 10px/1.3 ui-monospace,monospace; opacity:.7; }
.mm-phase-rail strong { font:600 10px/1.4 var(--body-font); text-transform:uppercase; letter-spacing:.06em; }
.mm-phase-rail [data-state=current] { border-color:var(--mm-gold); color:var(--text); }
.mm-phase-rail [data-state=current]>span { color:var(--accent-text); opacity:1; }
.mm-phase-rail [data-state=complete] { border-color:#638f7b; }
.mm-ballot-notice { display:inline-block; margin:12px 0 0; padding:8px 12px; border-left:3px solid var(--line); background:var(--surface); color:var(--muted); font:600 10px/1.6 var(--body-font); }
.mm-ballot-notice[data-visibility=public] { border-color:var(--mm-gold); color:var(--text); }
.mm-voting-settings { margin-top:22px; border-left:3px solid var(--mm-gold); }
.mm-voting-settings h3 { font:400 29px/1.2 Georgia,serif; margin:8px 0 18px; }
.mm-voting-settings select { max-width:520px; }
.mm-voting-settings .mm-caption { max-width:90ch; color:var(--muted); line-height:1.8; margin:15px 0 20px; }
.mm-live-votes,.mm-vote-reveal { padding-top:22px; margin-top:24px; border-top:1px solid var(--line); }
.mm-live-votes>h3 { font:400 28px/1.2 Georgia,serif; margin:8px 0 15px; }
.mm-ballot-list { display:grid; gap:0; padding:0; margin:12px 0; list-style:none; }
.mm-ballot-list>li,.mm-history .mm-ballot-list>li { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; padding:10px 0; border:0; border-bottom:1px solid var(--line); font:400 12px/1.7 var(--body-font); overflow-wrap:anywhere; }
.mm-ballot-list>li>span { text-align:right; color:var(--muted); }
.mm-history details>summary { padding:9px 0; cursor:pointer; color:var(--accent-text); font-size:11px; }
.mm-case-header { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:20px; width:100%; max-width:100%; padding:27px 0 25px; position:sticky; top:0; z-index:4; background:var(--mm-table); border-bottom:1px solid var(--line); margin-bottom:20px; }
.mm-case-header>div:first-child { min-width:0; flex:1; }
.mm-case-header .mm-kicker { margin:0 0 9px; }
.mm-case-header h2 { margin:0; font:400 clamp(30px,4vw,52px)/1.07 Georgia,serif; letter-spacing:-.035em; }
.mm-clock-module { min-width:125px; flex:0 0 auto; text-align:right; padding-left:20px; border-left:1px solid var(--line); }
.mm-clock-module .mm-small-label { font-size:8px; margin-bottom:5px; }
.mm-clock { color:var(--accent-text); font:600 clamp(35px,5vw,57px)/1 ui-monospace,monospace; letter-spacing:-.06em; font-variant-numeric:tabular-nums; white-space:nowrap; }
.mm-clock[data-mode=waiting] { font:400 clamp(24px,3.1vw,37px)/1 Georgia,serif; letter-spacing:-.025em; }
.mm-clock[data-urgent=true] { color:var(--danger); }
#mm-game-notice:empty { display:none; }
.mm-game-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(260px,340px); gap:22px; align-items:start; }
.mm-game-layout:has(>.mm-case-sidebar[hidden]) { grid-template-columns:minmax(0,1fr); }
.mm-stage-column,.mm-case-sidebar { min-width:0; display:grid; align-content:start; gap:20px; }
.mm-stage-column { max-width:100%; }
.mm-narrative {
  padding:24px 27px; border:1px solid var(--line); border-left:4px solid var(--mm-gold);
  background:var(--surface); box-shadow:4px 5px 0 var(--mm-shadow); position:relative;
}
.mm-narrative::after { content:''; position:absolute; right:17px; top:14px; width:24px; height:5px; border-block:1px solid var(--line); transform:rotate(-25deg); }
.mm-narrative .mm-kicker { margin-bottom:10px; padding-right:24px; }
.mm-narrative>p { margin:0; font:400 clamp(17px,1.8vw,22px)/1.65 Georgia,serif; max-width:70ch; }
.mm-narrative>small { display:block; margin-top:12px; color:var(--muted); line-height:1.6; }
.mm-private-card { display:flex; flex-direction:column; align-items:flex-start; gap:12px; padding:19px 24px; border:1px solid var(--line); background:var(--surface); }
.mm-private-card:empty { display:none; }
.mm-private-card:has(h3) { border:2px solid var(--mm-gold); background:var(--surface-raised); }
.mm-private-card h3 { font:400 32px/1.2 Georgia,serif; margin:0; }
.mm-private-card :is(p,h4) { margin:0; }
.mm-private-card ul { padding-left:20px; line-height:1.8; margin:0; }
.mm-private-card>strong:not(.mm-eliminated-note) { font-size:13px; line-height:1.7; }
.mm-eliminated-note { padding:9px 12px; border-left:3px solid var(--danger); background:var(--surface-raised); font-size:13px; }
.mm-phase-body {
  padding:26px; background:var(--surface-raised); border:1px solid var(--line);
  border-top:3px solid var(--accent-text); box-shadow:4px 5px 0 var(--mm-shadow); min-height:170px;
}
.mm-phase-body>h3 { font:400 clamp(25px,3vw,35px)/1.15 Georgia,serif; max-width:30ch; margin:10px 0 14px; }
.mm-phase-body>p { max-width:72ch; line-height:1.8; color:var(--muted); font-size:14px; }
.mm-waiting-tag { display:inline-flex; align-items:center; gap:8px; font:700 9px/1.5 var(--body-font); letter-spacing:.15em; color:var(--accent-text); }
.mm-waiting-tag::before { content:''; width:6px; height:6px; border:1px solid currentColor; transform:rotate(45deg); }
.mm-target-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(140px,100%),1fr)); gap:10px; margin:18px 0; }
.mm-target { border:1px solid var(--line); border-bottom-width:3px; padding:16px 13px; background:var(--surface); color:var(--text); font:600 14px/1.5 var(--body-font); min-height:60px; overflow-wrap:anywhere; text-align:left; cursor:pointer; transition:transform .12s,border-color .12s; }
.mm-target:hover:not(:disabled) { border-color:var(--accent-text); transform:translateY(-2px); }
.mm-target[aria-pressed=true] { border-color:var(--mm-gold); background:color-mix(in srgb,var(--mm-gold) 16%,var(--surface)); box-shadow:inset 4px 0 var(--mm-gold); }
.mm-target[aria-pressed=true]::after { content:' ✓'; color:var(--accent-text); }
.mm-target:active:not(:disabled) { transform:translateY(1px); }
.mm-target:disabled { cursor:not-allowed; opacity:.6; }
.mm-action-file { padding:0; }
.mm-action-file h3 { font:400 clamp(25px,3vw,33px)/1.2 Georgia,serif; margin:12px 0; }
.mm-action-file>p { font-size:13px; line-height:1.8; color:var(--muted); }
.mm-action-file .mm-kicker { margin:0; color:var(--accent-text); font-size:9px; }
.mm-advanced { margin:25px 0; }
.mm-advanced fieldset { border:0; border-top:1px solid var(--line); padding:20px 0; margin-top:15px; min-width:0; }
.mm-advanced legend { font:700 20px var(--heading-font); padding-right:14px; }
.mm-advanced select,.mm-gm-desk select,.mm-gm-desk textarea { width:100%; min-height:48px; background:var(--surface); color:var(--text); border:1px solid var(--line); padding:12px; font:inherit; }
.mm-advanced label,.mm-gm-desk label { display:flex; flex-direction:column; gap:9px; margin:12px 0; }
.mm-advanced input { min-height:48px; }
.mm-case-launch { display:flex; gap:25px; align-items:center; justify-content:space-between; padding:25px; border:1px solid var(--line); border-left:4px solid var(--mm-gold); background:var(--surface); margin-top:22px; }
.mm-case-launch h3 { margin-top:0; }
.mm-case-launch ul { padding-left:20px; line-height:1.8; color:var(--muted); }
.mm-gm-desk { padding:22px; border:1px solid var(--line); border-top:3px solid var(--mm-gold); background:var(--surface); box-shadow:4px 5px 0 var(--mm-shadow); }
.mm-gm-desk>h3 { font:400 29px/1.2 Georgia,serif; margin:6px 0 12px; }
.mm-gm-desk>p { font-size:12px; color:var(--muted); line-height:1.7; }
.mm-gm-desk summary { cursor:pointer; padding:12px 0; font-size:12px; line-height:1.7; }
.mm-gm-desk details { border-block:1px solid var(--line); margin:15px 0; }
.mm-gm-desk .mm-gm-tools { margin:18px 0 0; border-bottom:0; }
.mm-gm-tools>summary { color:var(--muted); }
.mm-gm-tools>.mm-gm-actions { padding-top:10px; }
.mm-gm-desk details ul { padding-left:18px; font-size:12px; line-height:1.9; overflow-wrap:anywhere; }
.mm-gm-desk form { margin-top:20px; padding-top:15px; border-top:1px solid var(--line); }
.mm-gm-desk label { font-size:11px; }
.mm-gm-desk textarea { font-size:14px; resize:vertical; min-height:100px; }
.mm-gm-actions { display:grid; gap:12px; }
.mm-gm-actions>.mm-button { width:100%; min-width:0; font-size:12px; }
.mm-gm-wait,.mm-live-window-note { padding:12px; border-left:2px solid var(--mm-gold); background:var(--surface-raised); }
.mm-assignment-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr)); gap:12px; }
.mm-suspects-board { background:var(--surface); border:1px solid var(--line); box-shadow:4px 5px 0 var(--mm-shadow); overflow:hidden; }
.mm-suspects-board>img { display:block; width:100%; height:auto; border-bottom:2px solid var(--mm-gold); }
.mm-suspects-copy { padding:20px; }
.mm-suspects-copy h3 { margin:6px 0 20px; font:400 28px/1.1 Georgia,serif; }
.mm-suspects-copy>.mm-caption { margin:18px 0 0; font-size:10px; color:var(--muted); line-height:1.7; }
.mm-suspect-tokens { list-style:none; padding:0; margin:0; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px 10px; }
.mm-suspect-tokens li { min-width:0; text-align:center; }
.mm-suspect-token { display:grid; place-items:center; width:43px; height:47px; margin:0 auto 9px; background:#e1c38f; border:2px solid #f3ddb5; box-shadow:0 3px 0 #5e675b; color:#3c4033; font:700 24px/1 Georgia,serif; border-radius:40% 40% 4px 4px; }
.mm-suspect-tokens [data-ink="1"] .mm-suspect-token { background:#a7c2b5; border-color:#cde0ca; }
.mm-suspect-tokens [data-ink="2"] .mm-suspect-token { background:#a5b8c7; border-color:#ccdae2; }
.mm-suspect-tokens [data-ink="3"] .mm-suspect-token { background:#c6a4a0; border-color:#e4c3b8; }
.mm-suspect-tokens strong { display:block; font:600 11px/1.4 var(--body-font); overflow-wrap:anywhere; }
.mm-suspect-tokens small { display:block; margin-top:4px; font-size:8px; color:var(--muted); }
.mm-suspect-tokens [data-alive=false] { opacity:.5; }
.mm-suspect-tokens [data-alive=false] .mm-suspect-token { filter:grayscale(1); position:relative; }
.mm-suspect-tokens [data-alive=false] .mm-suspect-token::after { content:''; position:absolute; height:2px; width:48px; background:var(--mm-scarlet); transform:rotate(-45deg); }
.mm-history { padding:22px; background:var(--surface); border:1px solid var(--line); }
.mm-history>h3 { font:400 25px/1.2 Georgia,serif; margin:0 0 10px; }
.mm-history>p { font-size:11px; color:var(--muted); line-height:1.7; }
.mm-history ol { padding:0; margin:0; list-style:none; max-height:450px; overflow-y:auto; }
.mm-history li { padding:14px 0; border-top:1px solid var(--line); line-height:1.7; font-size:12px; overflow-wrap:anywhere; }
.mm-history li p { color:var(--muted); font-size:11px; margin:6px 0 0; }
.mm-results { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:0; list-style:none; }
.mm-results li { padding:15px; border:1px solid var(--line); background:var(--surface); font-size:13px; line-height:1.7; overflow-wrap:anywhere; }
.mm-in-case[data-mm-phase=ended] .mm-phase-body { border-top:4px solid var(--mm-gold); }
.mm-activities { margin-top:25px; border-top:1px solid var(--line); padding-top:22px; }
.mm-activity-tabs { display:flex; gap:8px; flex-wrap:wrap; }
.mm-activity-choice { min-height:48px; padding:12px 15px; border:1px solid var(--line); color:var(--text); background:var(--surface); font:600 13px/1.5 var(--body-font); cursor:pointer; }
.mm-activity-choice[aria-pressed=true] { border-color:var(--mm-gold); box-shadow:inset 0 -3px var(--mm-gold); }
.mm-evidence-card { padding:22px; margin-top:14px; background:var(--surface); border:1px solid var(--line); }
.mm-clue { font:400 22px/1.6 Georgia,serif; }
.mm-memory-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; list-style-position:inside; padding:0; }
.mm-memory-row li { padding:16px; border:1px dashed var(--line); line-height:1.6; font-size:13px; }
body[data-mm-story=village] { --mm-gold:#a2b77d; --mm-case-accent:#54723f; }
html[data-theme=dark] body[data-mm-story=village] { --mm-case-accent:#b6cc90; }
body[data-mm-story=station] { --mm-gold:#7bc6cd; --mm-case-accent:#306d7c; }
html[data-theme=dark] body[data-mm-story=station] { --mm-case-accent:#8ed9df; }
.mm-room-dialog { width:min(1040px,calc(100% - 28px)); max-height:calc(100svh - 28px); padding:24px; border-top-color:var(--mm-gold); }
.mm-room-dialog::backdrop { background:#020d14d9; backdrop-filter:blur(4px); }
.mm-room-dialog-header { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:20px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.mm-room-dialog-header h2 { margin:0; font:400 32px/1.1 Georgia,serif; }
.mm-room-dialog .mm-room-heading { padding:15px 0 20px; background:none; border:0; border-bottom:1px solid var(--line); }
.mm-room-dialog .mm-room-heading h2 { font-size:23px; }
.mm-room-dialog .mm-room-grid { margin-top:0; }
.mm-room-dialog .mm-room-summary,.mm-room-dialog .mm-caption { font-size:12px; line-height:1.8; }
.mm-room-dialog .mm-room-settings { min-width:0; }
.mm-page button:focus-visible,.mm-page select:focus-visible { outline:3px solid var(--accent-text); outline-offset:3px; }
@media(min-width:1600px) { .mm-in-case .mm-workspace { padding-inline:40px; } }
@media(max-width:1000px) {
  .mm-game-layout { grid-template-columns:minmax(0,1fr); }
  .mm-case-sidebar { display:contents; }
  .mm-gm-desk { order:-1; }
  .mm-suspects-board { display:none; }
  .mm-game-hud { gap:12px; }
  .mm-game-brand strong { font-size:18px; }
}
@media(max-width:680px) {
  .mm-in-case .mm-workspace { padding-inline:max(12px,env(safe-area-inset-left)); }
  .mm-game-hud { flex-wrap:wrap; padding:14px 0; gap:12px; }
  .mm-game-brand { flex:1 1 auto; }
  .mm-game-brand>span { width:37px; height:42px; font-size:15px; }
  .mm-game-brand strong { font-size:17px; }
  .mm-game-brand small { font-size:9px; }
  .mm-hud-connection { max-width:110px; font-size:9px; }
  .mm-hud-actions { width:100%; }
  .mm-hud-actions .mm-copy { flex:1; min-height:40px; font-size:11px; }
  .mm-phase-rail { margin-top:12px; gap:6px; }
  .mm-phase-rail li { display:block; padding:6px 0 8px; }
  .mm-phase-rail li>span { display:block; font-size:8px; margin-bottom:5px; }
  .mm-phase-rail strong { font-size:8px; letter-spacing:0; }
  .mm-case-header { grid-template-columns:minmax(0,1fr) 112px; padding:22px 0; gap:12px; }
  .mm-case-header h2 { font-size:29px; }
  .mm-case-header .mm-kicker { font-size:8px; }
  .mm-clock-module { min-width:0; width:100%; max-width:none; padding-left:12px; }
  .mm-clock-module .mm-small-label { font-size:7px; letter-spacing:0; white-space:normal; }
  .mm-clock { font-size:35px; }
  .mm-clock[data-mode=waiting] { font-size:22px; }
  .mm-game-layout,.mm-stage-column,.mm-case-sidebar { gap:16px; }
  .mm-case-sidebar { grid-template-columns:minmax(0,1fr); }
  .mm-narrative,.mm-phase-body,.mm-private-card,.mm-gm-desk,.mm-history { padding:19px; }
  .mm-narrative>p { font-size:17px; }
  .mm-phase-body>h3 { font-size:26px; }
  .mm-phase-body>p { font-size:13px; }
  .mm-target-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .mm-target { font-size:13px; padding:13px 11px; }
  .mm-case-launch { flex-direction:column; align-items:stretch; }
  .mm-case-launch>.mm-button { width:100%; }
  .mm-in-room .mm-room-heading { padding:20px; }
  .mm-in-room .mm-room-heading h2 { font-size:30px; }
  .mm-activity-body .mm-target-grid { grid-template-columns:repeat(auto-fit,minmax(min(100px,100%),1fr)); }
  .mm-evidence-card { padding:16px; }
  .mm-memory-row { grid-template-columns:minmax(0,1fr); }
  .mm-results { grid-template-columns:minmax(0,1fr); }
  .mm-room-dialog { padding:18px; }
  .mm-room-dialog-header { gap:12px; }
  .mm-room-dialog-header h2 { font-size:26px; }
  .mm-room-dialog .mm-room-heading { padding-inline:0; }
  .mm-caption { font-size:12px; line-height:1.7; }
}
@media(prefers-reduced-motion:no-preference) {
  .mm-phase-body { animation:mm-file-open .2s ease-out both; }
  @keyframes mm-file-open { from { opacity:.5; transform:translateY(7px); } to { opacity:1; transform:none; } }
}
@media(prefers-reduced-motion:reduce) { .mm-target { transition:none; } }
