.md-game { --md-paper:#e9ddc2; --md-gold:#efca8c; color:var(--ui-ink); min-width:0; }
.md-game *, .md-game *::before, .md-game *::after { box-sizing:border-box; }
.md-game [hidden] { display:none !important; }
.md-stage { position:relative; width:100%; height:clamp(560px,74vh,840px); overflow:hidden; isolation:isolate; border:1px solid var(--ui-line); border-radius:20px; background:#292c26; color:#f5f0e4; }
.md-stage:focus-visible { outline:2px solid var(--md-gold); outline-offset:3px; }
.md-canvas { display:block; width:100%; height:100%; outline:none; touch-action:none; }
.md-vignette { position:absolute; inset:0; pointer-events:none; background:linear-gradient(#10201e80,transparent 23%,transparent 75%,#0a151b88); }
.md-topbar { position:absolute; z-index:15; top:0; left:0; right:0; display:flex; gap:15px; justify-content:space-between; align-items:flex-start; padding:22px; pointer-events:none; }
.md-location span,.md-case-badge>span,.md-eyebrow { display:block; font:600 10px/1.5 Inter,system-ui,sans-serif; letter-spacing:.16em; color:var(--md-gold); }
.md-location strong { display:block; margin-top:4px; font:500 20px/1.2 Georgia,serif; color:#fff6e0; text-shadow:0 2px 8px #000; }
.md-stage-buttons { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; max-width:65%; pointer-events:auto; }
:root .md-game button { font:600 12px/1.3 Inter,system-ui,sans-serif; border-radius:8px; padding:10px 14px; cursor:pointer; transition:background .15s,border-color .15s; }
:root .md-stage button { color:#f7f0e0; background:#142226e8; border:1px solid #f3dfbb40; box-shadow:0 2px 12px #0001; }
:root .md-stage button:hover { color:#fff5d7; background:#33413e; border-color:#ecd6a993; transform:none; }
:root .md-stage button:focus-visible { outline:2px solid #ffdb93; outline-offset:3px; }
:root .md-stage button:disabled { opacity:.6; cursor:wait; }
:root .md-stage .md-primary { background:#e8c58a; color:#1d2a2a; padding:14px 22px; border-color:#f8dda5; font-size:13px; }
:root .md-stage .md-primary:hover { background:#ffdfa4; }
:root .md-stage kbd { display:inline-block; font:500 10px/1.3 monospace; padding:2px 4px; margin-left:3px; background:#ffffff14; color:#e7d6b4; border:1px solid #ffffff20; border-radius:3px; box-shadow:none; }
.md-case-badge { position:absolute; top:105px; left:22px; background:#132024e6; border:1px solid #f6d8a22b; border-radius:12px; padding:14px 16px; backdrop-filter:blur(10px); }
.md-case-badge strong { display:block; color:#f7e9d3; font:400 27px/1.2 Georgia,serif; margin:7px 0 10px; }
.md-case-badge strong b { font-weight:400; color:#ffdda3; }
.md-case-badge strong small { font:400 11px Inter,sans-serif; color:#c4cec9; }
:root .md-case-badge button { padding:6px 10px; background:#ffffff08; }
.md-minimap { position:absolute; right:22px; top:105px; width:230px; background:#142226e8; border:1px solid #f6d8a22b; border-radius:12px; overflow:hidden; }
.md-minimap>div { display:flex; align-items:center; justify-content:space-between; padding:8px 10px; gap:8px; }
.md-minimap strong { font-size:9px; letter-spacing:.12em; color:#e5d8bd; }
:root .md-minimap button { padding:4px 7px; font-size:9px; background:transparent; }
.md-minimap canvas { display:block; width:100%; height:auto; }
.md-minimap p { display:flex; justify-content:center; align-items:center; gap:5px; margin:7px 0; font-size:8px; color:#c5d0cc; }
.md-minimap i { width:5px; height:5px; background:#7ae3f3; border-radius:50%; margin-left:3px; }.md-minimap i:nth-of-type(2) { background:#f2ba72; }.md-minimap i:nth-of-type(3) { background:#8cdbc1; }
.md-game[data-map-size=medium] .md-minimap { width:300px; }.md-game[data-map-size=large] .md-minimap { width:370px; }
.md-reticle { position:absolute; left:50%; top:50%; width:20px; height:20px; border:1px solid #f9f5e17a; border-radius:50%; transform:translate(-50%,-50%); pointer-events:none; box-shadow:0 0 3px #152028; display:grid; place-items:center; }
.md-reticle i { width:3px; height:3px; background:#fff6d8; border-radius:50%; }.md-reticle.is-target { width:29px; height:29px; border-color:#f2c778; box-shadow:0 0 18px #e7c68a77; }
:root .md-interact { position:absolute; bottom:100px; left:50%; transform:translateX(-50%) !important; background:#172a2af0; border-color:#eec58f; display:flex; align-items:center; gap:12px; max-width:90%; }
.md-toast { position:absolute; bottom:32px; left:50%; transform:translateX(-50%); width:min(550px,85%); text-align:center; font-size:12px; line-height:1.5; color:#fff4dd; text-shadow:0 2px 6px #000; pointer-events:none; }
.md-screen { position:absolute; inset:0; z-index:10; display:grid; align-items:center; padding:100px 6% 45px; background:linear-gradient(90deg,#0a181de8,#0a181dc2 48%,#0a181d10); overflow:auto; }
.md-intro-content { max-width:450px; }.md-intro h3 { font:400 clamp(30px,4.6vw,52px)/1.08 Georgia,serif; letter-spacing:-.03em; color:#fff2d8; margin:14px 0 20px; }.md-intro-content>p:not(.md-eyebrow) { color:#d5dcd4; line-height:1.75; font-size:13px; }
.md-intro-facts { display:grid; gap:13px; margin:26px 0; font-size:12px; color:#d8ded4; }.md-intro-facts b { color:#e6bd7d; font-size:10px; margin-right:13px; }
.md-load-note { font-size:10px !important; max-width:380px; margin-top:14px; }
.md-game[data-started=false] :is(.md-case-badge,.md-minimap,.md-reticle,.md-touch),.md-game[data-paused=true] .md-reticle { visibility:hidden; }
.md-pause-screen { background:#0b1c23bb; place-items:center; backdrop-filter:blur(6px); text-align:center; }.md-card { max-width:420px; }.md-card h3 { font:400 36px Georgia,serif; color:#ffedcd; margin:15px 0; }.md-card p { color:#d0dad7; font-size:14px; line-height:1.7; }
.md-dialog { position:absolute; inset:0; z-index:30; display:grid; place-items:center; background:#071216b8; backdrop-filter:blur(7px); padding:24px; }
.md-dialog-card { position:relative; background:linear-gradient(135deg,#21322f,#142227); border:1px solid #d4b57860; border-radius:16px; width:min(790px,100%); max-height:100%; overflow:auto; padding:32px; box-shadow:0 30px 100px #0007; color:#e3e3d4; }
:root .md-close { position:absolute; top:10px; right:10px; border:0; background:transparent; font-size:26px; line-height:1; padding:4px 10px; }
.md-dialog h3 { font:400 30px/1.2 Georgia,serif; margin:12px 30px 24px 0; color:#fff1d6; }.md-dialog h3 small { color:#d7c49d; font:400 15px Georgia,serif; margin-left:10px; }.md-dialog h4 { color:#f6dfb9; margin:6px 0 8px; }.md-dialog p { color:#cdd7d3; font-size:13px; line-height:1.8; }.md-dialog .md-eyebrow { color:#e9bd7e; font-size:10px; }.md-dialog button { margin-right:8px; }
.md-dialog .md-clue-detail { font:400 19px/1.8 Georgia,serif; color:#ece5d2; margin-bottom:26px; }.md-small { font-size:11px !important; color:#b8c7c3 !important; }
.md-evidence { list-style:none; padding:0; margin:0 0 20px; display:grid; gap:18px; }.md-evidence li { border-left:2px solid #ae9565; padding:0 0 3px 17px; }.md-evidence span { font-size:9px; letter-spacing:.12em; text-transform:uppercase; color:#b9c5bb; }.md-evidence p { margin:0; }
.md-large-map { display:block; width:100%; height:auto; border-radius:8px; border:1px solid #e0d2ac40; }.md-map-index { columns:2; list-style:none; padding:0; color:#d5d6c8; font-size:11px; line-height:2.3; }.md-map-index b { color:#ffc978; margin-right:6px; }.md-map-index .is-found b { color:#86dec0; }
.md-option { display:flex; align-items:center; gap:12px; margin:14px 0; font-size:13px; }.md-option input { accent-color:#e8c58a; }.md-stage select,.md-stage input[type=password] { color:#f6e9d0; background:#0c1b21; border:1px solid #c7bd9b66; padding:8px; border-radius:6px; font:inherit; }
.md-speed { display:grid; gap:12px; margin:18px 0 8px; color:#f6e9d0; font-size:13px; }
.md-speed>span { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.md-speed output { color:#ffdb93; font-weight:600; font-variant-numeric:tabular-nums; }
:root .md-stage .md-speed input { width:100%; min-width:0; padding:0; height:28px; accent-color:#e8c58a; background:transparent; cursor:pointer; }
.md-speed-scale { color:#bacbc5; }.md-speed-scale small { font-size:10px; }
.md-audio-settings { border:1px solid #d6c39340; border-radius:10px; margin:22px 0; padding:12px 18px 4px; min-width:0; }
.md-audio-settings legend { color:#f6dfb9; font-size:14px; font-weight:600; padding:0 7px; }
.md-audio-settings .md-speed { margin-top:18px; gap:7px; }
.md-difficulty { padding:0; border:0; margin:18px 0 22px; min-width:0; }
.md-difficulty legend { color:#f6dfb9; font-size:12px; margin-bottom:9px; }
.md-difficulty>div { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
:root .md-difficulty button { margin:0; padding:10px 7px; min-height:47px; }
:root .md-difficulty button[aria-pressed=true] { color:#1d2a2a; background:#efd09a; border-color:#ffe4b3; }
.md-difficulty small { display:block; font-size:9px; font-weight:400; margin-top:3px; }
.md-difficulty p { font-size:11px; line-height:1.55; color:#cdd7d3; margin:9px 0 0; }
.md-case-badge .md-mode-label { display:inline-block; font:500 8px Inter,system-ui,sans-serif; letter-spacing:.03em; color:#cfdfdd; padding:3px 5px; border:1px solid #cfdfdd55; border-radius:4px; margin-left:4px; }
.md-minimap p>span { display:inline-flex; align-items:center; gap:4px; }
.md-minimap i.md-map-arrow { background:#398fff; width:9px; height:11px; border-radius:0; clip-path:polygon(50% 0,100% 100%,50% 78%,0 100%); }
.md-minimap i.md-map-unfound { background:#f2ba72; }.md-minimap i.md-map-found { background:#8cdbc1; }
.md-debug-settings { border-top:1px solid #d6c39340; border-bottom:1px solid #d6c39340; padding:20px 0; margin:22px 0; }.md-unlock { display:flex; flex-wrap:wrap; gap:14px; align-items:flex-end; }.md-unlock label { display:grid; gap:8px; font-size:12px; }.md-unlock p { width:100%; margin:0; }.md-unlocked { color:#a3dfc8 !important; }
.md-debugbar { position:absolute; z-index:8; bottom:0; left:0; right:0; display:flex; gap:7px; padding:10px; align-items:center; flex-wrap:wrap; background:#0a2128eb; border-top:1px solid #85d8bc70; }.md-debugbar>span { font-size:9px; letter-spacing:.1em; color:#94e4c7; }.md-debugbar output { font:10px monospace; color:#bcd7cf; }.md-debugbar button { font-size:10px !important; padding:6px 8px !important; }.md-debugbar button[aria-pressed=true] { color:#152626; background:#8edbbb; }
.md-recovered { width:110px; margin:18px auto; border:8px ridge #b38f4e; box-shadow:0 10px 30px #0006; }.md-recovered img { display:block; width:100%; height:auto; }.md-ending { text-align:center; }.md-ending h3 { margin-right:0; }.md-ending>p { max-width:550px; margin:15px auto; }.md-ending .md-primary { margin-top:14px; }
.md-below { display:flex; align-items:center; gap:16px; justify-content:space-between; padding:13px 3px; }.md-below p { font-size:12px; line-height:1.65; margin:0; color:var(--ui-muted); }.md-below button { flex-shrink:0; color:var(--ui-ink); background:var(--ui-soft); border:1px solid var(--ui-line); }
.md-instructions { background:var(--ui-panel); border:1px solid var(--ui-line); border-radius:12px; padding:16px 20px; margin-top:8px; }.md-instructions summary { cursor:pointer; font-weight:600; color:var(--ui-ink); }.md-instructions>div { display:grid; grid-template-columns:1fr 1fr; gap:8px 25px; margin-top:16px; }.md-instructions p { font-size:12px; line-height:1.8; color:var(--ui-muted); margin:0; }.md-instructions b { color:var(--ui-ink); }
.md-touch { display:none; position:absolute; z-index:6; bottom:18px; left:18px; right:18px; justify-content:space-between; align-items:flex-end; pointer-events:none; }.md-touch>span { font-size:10px; color:#f9eed5; text-shadow:0 1px 4px #000; }.md-touch button { pointer-events:auto; touch-action:none; user-select:none; }.md-dpad { display:grid; grid-template-columns:repeat(3,42px); grid-template-rows:repeat(2,42px); gap:3px; pointer-events:auto; }.md-dpad button { padding:0; font-size:20px; }.md-dpad [data-move=forward] { grid-column:2; }.md-dpad [data-move=left] { grid-column:1; grid-row:2; }.md-dpad [data-move=back] { grid-column:2; grid-row:2; }.md-dpad [data-move=right] { grid-column:3; grid-row:2; }.md-dpad .is-held { background:#efd09a; color:#152626; }
.md-stage:fullscreen,.md-stage.md-expanded { width:100vw; height:100dvh; max-width:none; max-height:none; border:0; border-radius:0; }.md-stage.md-expanded { position:fixed; inset:0; z-index:10000; }
/* A backdrop filter otherwise makes fixed-position fallback fullscreen relative
   to the game card instead of the browser viewport. */
.game-card:has(.md-stage.md-expanded) { backdrop-filter:none; -webkit-backdrop-filter:none; }
@media (pointer:coarse) { .md-touch { display:flex; }.md-toast { bottom:120px; }.md-interact { bottom:150px !important; }.md-debugbar { bottom:112px; } }
@media (max-width:700px) { .md-topbar { padding:12px; gap:8px; }.md-location span { font-size:8px; }.md-location strong { font-size:16px; }.md-stage-buttons { max-width:59%; gap:4px; }:root .md-stage-buttons button { font-size:10px; padding:7px; }.md-stage-buttons kbd { display:none; }.md-stage { height:700px; min-height:500px; }.md-case-badge { top:110px; left:12px; padding:9px 11px; }.md-case-badge>span { font-size:7px; letter-spacing:.08em; }.md-case-badge strong { font-size:23px; }.md-case-badge strong small { display:block; font-size:9px; margin-top:4px; }:root .md-case-badge button { font-size:9px; }.md-minimap,.md-game[data-map-size=medium] .md-minimap,.md-game[data-map-size=large] .md-minimap { top:110px; right:12px; width:140px; }.md-minimap>div { padding:5px 7px; }.md-minimap strong { font-size:7px; }.md-minimap p { font-size:6px; gap:3px; }.md-minimap p i { width:4px; height:4px; }.md-intro { padding:125px 24px 30px; }.md-intro h3 { font-size:36px; }.md-intro-content>p:not(.md-eyebrow) { font-size:12px; }.md-intro-facts { font-size:11px; }.md-dialog { padding:12px; }.md-dialog-card { padding:24px 18px; }.md-dialog h3 { font-size:25px; }.md-map-index { columns:1; }.md-instructions>div { grid-template-columns:1fr; gap:14px; }.md-below { align-items:flex-start; }.md-touch>span { display:none; }.md-topbar .md-location { max-width:40%; }.md-screen { align-items:start; }.md-card { margin-top:20px; }.md-stage:fullscreen,.md-stage.md-expanded { min-height:0; } }
@media (max-height:550px) { .md-stage:fullscreen .md-intro,.md-stage.md-expanded .md-intro { padding-top:75px; }.md-stage:fullscreen .md-intro h3,.md-stage.md-expanded .md-intro h3 { font-size:30px; }.md-stage:fullscreen .md-intro-facts,.md-stage.md-expanded .md-intro-facts { margin:14px 0; gap:6px; } }
@media (prefers-reduced-motion:reduce) { .md-game * { transition:none !important; } }
@media (max-width:700px) {
  .md-case-badge { width:calc(45% - 16px); padding:9px 8px; }
  .md-minimap,.md-game[data-map-size=medium] .md-minimap,.md-game[data-map-size=large] .md-minimap { width:calc(55% - 20px); }
  .md-minimap>div { flex-wrap:wrap; gap:3px; }
  .md-minimap p { flex-wrap:wrap; }
  :root .md-case-badge button { padding:6px; }
  .md-case-badge kbd { display:none; }
}
