:root { color-scheme: dark; --ink:#172b3b; --paper:#eee1c5; --muted:#a9b8bd; --cyan:#7be4ef; --coral:#e77d69; font-family:Arial,Helvetica,sans-serif; }
.floor-bar { display:flex; justify-content:center; align-items:center; gap:8px; margin:10px 0; font:10px Arial,sans-serif; }
.floor-bar select { color:var(--ink); background:#f5ead4; border:1px solid #6c7979; padding:4px; font:11px Arial,sans-serif; }
.floor-bar select:disabled { opacity:.8; }
.enemy-key { gap:12px; font-size:9px; }
.sentinel-key { color:#984e43; }
.courier-key { color:#80602b; }
@media (max-width:760px) { header { flex-wrap:wrap; } .floor-bar { width:100%; margin:7px 0 0; } footer .enemy-key { display:flex; justify-content:center; font-size:9px; margin-bottom:8px; } }
* { box-sizing:border-box; -webkit-user-select:none; user-select:none; -webkit-tap-highlight-color:transparent; }
body { margin:0; background:#101e29; color:var(--paper); min-height:100svh; display:flex; align-items:center; justify-content:center; padding:22px; background-image:radial-gradient(ellipse at 30% 40%,#354c5944 0,transparent 70%),url('./assets/archive-pattern.svg'),radial-gradient(ellipse at 50% 30%,#263d4b 0,#101e29 85%); background-size:auto,240px 240px,auto; }
button { font:inherit; cursor:pointer; touch-action:manipulation; }
button:disabled { cursor:default; }
button:focus-visible,canvas:focus-visible { outline:3px solid var(--cyan); outline-offset:4px; }
.game-shell { width:min(1450px,100%); display:grid; grid-template-columns:minmax(0,1fr) minmax(244px,27%); gap:0 17px; }
.archive { position:relative; align-self:center; border:1px solid #a4a08d; padding:7px; background:#172b3b; box-shadow:0 16px 50px #0005; }
canvas { width:100%; height:auto; display:block; aspect-ratio:19/15; touch-action:none; background:#607687; }
.map-caption { position:absolute; bottom:0; left:0; right:0; transform:translateY(100%); display:flex; justify-content:space-between; padding:10px 1px; color:#9aa9ae; letter-spacing:1.8px; font-size:9px; }
.case-file { position:relative; color:var(--ink); background-color:var(--paper); background-image:linear-gradient(#eee1c5ed,#eee1c5ed),url('./assets/watercolor-floor.png'); background-size:cover; padding:27px 27px 20px; border:5px double #43515b; outline:1px solid #bfb59e; box-shadow:0 10px 40px #0003; }
.case-file:before { content:''; position:absolute; inset:6px; pointer-events:none; border:1px solid #263e4a45; }
header { text-align:center; }
.eyebrow { font-size:9px; letter-spacing:2.5px; font-weight:600; }
h1 { font:clamp(30px,3.25vw,48px)/.97 Georgia,serif; margin:17px 0 12px; font-weight:normal; letter-spacing:-1.5px; }
h1 em { font-weight:normal; }
.ornament { font-size:16px; color:#6b766e; letter-spacing:7px; }
.case-file section { margin-top:20px; padding-top:20px; border-top:1px solid #243c4866; }
h2 { font:600 11px/1.3 Arial,sans-serif; text-transform:uppercase; letter-spacing:1.4px; margin:0; }
.label-row { display:flex; justify-content:space-between; align-items:center; gap:8px; }
#count { font:22px Georgia,serif; white-space:nowrap; }
.slots { display:flex; gap:13px; margin:16px 0 11px; }
.slots span { width:42px; height:47px; background:#1b35400a; border:1px dashed #334d5c77; clip-path:polygon(3% 0,19% 3%,44% 0,64% 5%,98% 0,94% 24%,100% 57%,93% 81%,100% 98%,72% 94%,48% 100%,23% 94%,0 100%,6% 67%,0 33%); }
.slots span.taken { background:repeating-linear-gradient(0deg,transparent 0 5px,#334852 6px 7px,transparent 8px 10px) center/58% 57% no-repeat,#f9efd8; border:1px solid #344550; filter:drop-shadow(1px 2px 1px #172b3b44); }
.fine { font-size:11px; line-height:1.55; color:#52616a; margin:0; }
#shadow-detail { margin:10px 0; font:17px Georgia,serif; }
.ink-mark { font-size:24px; line-height:.6; }
.progress { height:6px; border:1px solid #526a73; background:#23384716; overflow:hidden; }
.progress i { display:block; height:100%; width:0; background:#408e9a; transition:width .12s linear; }
.shadow-button { color:var(--paper); background:var(--ink); width:100%; padding:13px 8px; display:flex; justify-content:center; align-items:center; gap:9px; margin:12px 0 9px; border:1px solid var(--ink); border-radius:2px; font-size:12px; }
.shadow-button:enabled:hover { background:#285666; }
.shadow-button:disabled { opacity:.48; }
kbd { font:10px Arial,sans-serif; border:1px solid currentColor; border-radius:3px; padding:3px 4px; white-space:nowrap; }
.time-controls { display:flex; justify-content:space-between; align-items:center; margin-top:8px; }
#timer { font:33px Georgia,serif; font-variant-numeric:tabular-nums; }
.quiet-button { width:37px; height:37px; border:1px solid #334c5d77; background:transparent; color:var(--ink); font-size:22px; }
.quiet-button:enabled:hover { background:#334c5d16; }
.quiet-button:disabled { opacity:.4; }
footer { margin-top:22px; border-top:1px solid #243c4866; padding-top:15px; }
footer p { font-size:10px; margin:0 0 11px; display:flex; align-items:center; gap:6px; }
footer .rule { display:block; margin:17px 0; font-size:11px; }
.touch-help { display:none; }
.message { grid-column:1/-1; color:#aebdc3; text-align:center; margin:38px 0 0; font:italic 14px Georgia,serif; min-height:20px; }
.message:empty { visibility:hidden; }
.overlay { position:absolute; inset:7px; z-index:2; background:#142a3b73; display:flex; justify-content:center; align-items:center; backdrop-filter:blur(2px); }
.overlay[hidden] { display:none; }
.case-card { color:var(--ink); width:min(420px,88%); background:#eee1c5; background-image:linear-gradient(#eee1c5ee,#eee1c5ee),url('./assets/watercolor-floor.png'); background-size:cover; padding:30px; border:5px double #52616a; box-shadow:5px 9px 0 #0a202d44; transform:rotate(-.6deg); }
.case-card h2 { font:normal 37px/1.05 Georgia,serif; text-transform:none; letter-spacing:-1px; margin:18px 0; }
.case-card p { font-size:13px; line-height:1.6; }
.intro-steps { padding:4px 0 13px; }
.intro-steps p { font-size:12px; margin:6px 0; }
.intro-steps b { font:italic 17px Georgia,serif; color:#687b85; margin-right:8px; }
.primary { background:var(--ink); color:var(--paper); border:0; width:100%; padding:16px; display:flex; justify-content:space-between; gap:12px; font-size:13px; }
.primary:hover { background:#2c5262; }
.case-card .fine { font-size:10px; margin:12px 0 0; }
@media (min-width:900px) and (max-height:1000px) { body { padding:18px; } .game-shell { max-width:1200px; grid-template-columns:minmax(0,1fr) 270px; } .case-file { padding:18px 22px 15px; } h1 { font-size:36px; margin:12px 0; } .case-file section { margin-top:13px; padding-top:13px; } .slots { margin:10px 0; } .slots span { height:35px; width:33px; } footer { margin-top:14px; padding-top:12px; } footer .rule { margin:13px 0; } .message { margin-top:35px; } }
@media (max-width:760px) { body { padding:10px 10px max(12px,env(safe-area-inset-bottom)); align-items:flex-start; } .game-shell { display:flex; flex-direction:column; gap:0; max-width:560px; } .archive { width:100%; padding:4px; } .map-caption { display:none; } .case-file { margin-top:9px; padding:14px 16px 12px; display:grid; grid-template-columns:1fr 1.15fr; gap:12px 18px; } header { grid-column:1/-1; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid #243c4866; padding-bottom:10px; } h1 { font:normal 24px Georgia,serif; letter-spacing:-1px; margin:0; } h1 br { display:none; } h1 em { margin-left:4px; } header .eyebrow { font-size:7px; letter-spacing:1.2px; } .ornament { display:none; } .case-file section { margin:0; padding:0; border:0; } .case-file h2 { font-size:9px; letter-spacing:1px; } #count { font-size:19px; } .slots { margin:10px 0 8px; gap:9px; } .slots span { width:28px; height:32px; } .shadow-panel { grid-column:2; grid-row:2/4; } #shadow-detail { font-size:15px; margin:8px 0; } .shadow-button { min-height:49px; margin:10px 0 6px; font-size:11px; flex-direction:column; gap:6px; padding:9px 5px; } .shadow-button kbd { display:none; } .shadow-hint { font-size:9px; } .time-panel { grid-column:1; } #timer { font-size:24px; } .time-controls { gap:3px; } .quiet-button { width:29px; height:32px; font-size:18px; } footer { grid-column:1/-1; margin:0; padding-top:10px; } footer>p:not(.touch-help),footer .rule,.file-number { display:none; } footer .touch-help { display:block; font-size:10px; text-align:center; margin:0; } .message { font-size:12px; margin:14px 0 0; line-height:1.45; } .overlay { inset:4px; } .case-card { padding:15px 18px; width:88%; } .case-card h2 { font-size:27px; margin:10px 0; } .case-card p { font-size:11px; margin:8px 0; } .case-card .eyebrow { font-size:7px; } .intro-steps { padding:0 0 5px; } .intro-steps p { font-size:10px; margin:3px 0; } .intro-steps b { font-size:13px; } .primary { padding:12px; font-size:12px; } .case-card .fine { font-size:9px; margin-top:8px; } }
@media (prefers-reduced-motion:reduce) { .progress i { transition:none; } }
@media (max-width:400px) { .case-card { padding:10px 15px; } .case-card h2 { font-size:24px; margin:8px 0; } .case-card p { font-size:10px; margin:6px 0; } .intro-steps p { font-size:9px; margin:3px 0; } .case-card .fine { font-size:8px; margin-top:6px; } .primary { padding:10px; } }
@media (min-width:900px) and (max-height:780px) {
  body { padding:12px; }
  .game-shell { max-width:min(1200px,calc((100svh - 95px) * 1.2667 + 287px)); }
  .case-file { padding:12px 20px 10px; }
  .case-file header .eyebrow { display:none; }
  h1 { font-size:30px; margin:8px 0; }
  .ornament { font-size:12px; }
  .case-file section { margin-top:10px; padding-top:10px; }
  .slots span { height:30px; }
  .slots { margin:8px 0; }
  #shadow-detail { margin:7px 0; font-size:16px; }
  .shadow-button { padding:10px 6px; margin:9px 0 6px; }
  footer { margin-top:10px; padding-top:10px; }
  footer .rule { display:none; }
  .message { margin-top:29px; }
}

/* Ink drawings on little archive-paper controls. */
.button-art { display:block; width:104px; height:65px; aspect-ratio:8/5; background:transparent; pointer-events:none; touch-action:manipulation; }
.art-button { position:relative; isolation:isolate; border:1.5px solid #425b67; border-radius:4px 7px 3px 6px; background:#e6d9ba; background-image:linear-gradient(#eee1c5d9,#d7cbaaef),url('./assets/watercolor-floor.png'); background-size:cover; box-shadow:2px 3px 0 #243d4c4d,inset 0 0 7px #51677418; color:var(--ink); padding:0; transition:transform .1s,box-shadow .1s; }
.art-button:before { content:''; position:absolute; z-index:-1; inset:3px 4px; border:1px solid #526c7355; border-radius:3px 6px 4px 2px; transform:rotate(-.6deg); pointer-events:none; }
.art-button:enabled:hover { background-color:#f3e8ce; background-image:linear-gradient(#f4ead1d9,#dfd3b6ef),url('./assets/watercolor-floor.png'); filter:brightness(1.06); transform:translateY(-1px); }
.art-button:enabled:active,.art-button.queued { transform:translate(1px,2px); box-shadow:0 1px 0 #243d4c55,inset 0 0 12px #438c9a44; }
.art-button:disabled { opacity:.58; }
.shadow-button { min-height:78px; flex-direction:row; gap:7px; margin:12px 0 8px; background-color:#c7d8cc; background-image:linear-gradient(#e1e3cbcf,#b6cfcbd9),url('./assets/watercolor-floor.png'); }
.shadow-button:enabled:hover { background-color:#deeee3; background-image:linear-gradient(#e1e3cbcf,#b6cfcbd9),url('./assets/watercolor-floor.png'); }
.shadow-button .button-art { width:112px; height:70px; }
.shadow-button kbd { color:#42616a; border-color:#42616a77; font-size:9px; }
.shadow-button[data-state='ready'] { border-color:#277e8b; box-shadow:2px 3px 0 #243d4c4d,0 0 0 2px #66c8cd44; }
.quiet-button { width:44px; height:44px; display:inline-flex; justify-content:center; align-items:center; }
.quiet-button .button-art { width:64px; height:40px; max-width:none; flex-shrink:0; }
.time-controls>div { display:flex; gap:7px; }
.primary { display:flex; flex-direction:row; justify-content:center; align-items:center; gap:12px; width:100%; min-height:65px; margin-top:10px; }
.primary .button-art { width:96px; height:60px; }
#primary-caption { font:italic 19px Georgia,serif; }
.illustrated-steps { display:flex; justify-content:space-between; gap:6px; padding:6px 0 0; margin:10px 0; }
.illustrated-steps figure { flex:1; margin:0; min-width:0; text-align:center; }
.illustrated-steps .button-art { width:100%; height:auto; }
.illustrated-steps figcaption { font:italic 12px Georgia,serif; color:#52646c; }
.movement-controls { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:12px 0; }
.movement-pad { display:grid; grid-template-columns:repeat(3,44px); grid-template-rows:repeat(2,44px); gap:4px; }
.direction-button { width:44px; height:44px; display:flex; justify-content:center; align-items:center; }
.direction-button .button-art { width:64px; height:40px; max-width:none; flex-shrink:0; }
.dir-up { grid-column:2; grid-row:1; }.dir-left { grid-column:1; grid-row:2; }.dir-down { grid-column:2; grid-row:2; }.dir-right { grid-column:3; grid-row:2; }
.movement-hint { font-size:9px; line-height:1.7; color:#52646c; }
@media (min-width:900px) and (max-height:1000px) { .shadow-hint { display:none; } footer .rule { display:none; } }
@media (min-width:900px) and (max-height:780px) { .ornament { display:none; } .shadow-button { min-height:66px; margin:9px 0 6px; } .shadow-button .button-art { width:96px; height:60px; } .movement-controls { margin:7px 0; } footer .enemy-key { margin-bottom:5px; } .file-number { display:none; } }
@media (max-width:760px) {
  .shadow-button { flex-direction:column; min-height:78px; padding:0; margin:9px 0 6px; }
  .shadow-button .button-art { width:112px; height:70px; }
  .quiet-button { width:44px; height:44px; }
  .time-controls { flex-wrap:wrap; gap:7px; }
  footer .movement-controls { margin:0; justify-content:center; gap:25px; }
  .case-card .illustrated-steps { display:none; }
  .primary { min-height:51px; padding:0; margin-top:10px; }
  .primary .button-art { width:80px; height:50px; }
  #primary-caption { font-size:18px; }
  .shadow-hint { display:none; }
}
@media (prefers-reduced-motion:reduce) { .art-button { transition:none; } }

.enemy-key { flex-wrap:wrap;gap:5px 11px; }
.enemy-key span:before { content:'◆'; margin-right:4px; font-size:8px; }
.warden-key { color:#346c5e; }.tracker-key {color:#77557c;}

.illustrated-steps[hidden] { display:none; }
