/* Page layout: bar, scene view, bottom buttons, toast, marks; the blurred backdrop and the loupe. */
/* Layout: one-screen game — case bar on top, the night scene fills the middle, evidence controls at the bottom; notebook and accusation slide up as a manila case file. Single dark world by choice (it is night in the mountains). */
:root {
  --night: #0b111d;
  --panel: #131b2b;
  --panel-2: #1b2539;
  --line: #2c3851;
  --ink: #ebe5d6;
  --muted: #9ba5b8;
  --ember: #f08a3c;
  --ember-ink: #1d0f04;
  --file: #dcc58f;
  --file-2: #cdb37a;
  --file-ink: #2b2115;
  --file-muted: #6b5a3e;
  --good: #7cc47f;
  --bad: #e8604f;
  --f-display: "Big Shoulders Stencil Display", "Impact", "Arial Narrow", sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-type: "Special Elite", "Courier New", ui-monospace, monospace;
  color-scheme: dark;
}
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--night); color: var(--ink); font-family: var(--f-body); font-size: 15px; overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

#app { height: 100%; display: grid; grid-template-rows: auto 1fr auto auto; grid-template-columns: minmax(0, 1fr); }

.bar { display: flex; align-items: center; gap: 10px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--panel); border-bottom: 1px solid var(--line); }
.case-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.case-id .no { font-family: var(--f-type); font-size: 11px; letter-spacing: .08em; color: var(--ember); text-transform: uppercase; }
.case-id .nm { font-family: var(--f-display); font-weight: 800; font-size: 22px; line-height: 1; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { font-variant-numeric: tabular-nums; font-size: 13px; padding: 5px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); flex: none; }
.icon-btn[aria-pressed="true"] { background: var(--ember); color: var(--ember-ink); border-color: var(--ember); }
.icon-btn svg { width: 20px; height: 20px; }

#view { position: relative; overflow: hidden; touch-action: none; background: #070b13; user-select: none; -webkit-user-select: none; }
#stage { position: absolute; left: 0; top: 0; width: 1254px; height: 1254px; transform-origin: 0 0; transition: opacity .22s; }
#stage.anim { transition: transform .38s cubic-bezier(.3,.7,.2,1), opacity .22s; }
#stage.fade { opacity: 0; }
#stage img { width: 1254px; height: 1254px; max-width: none; display: block; pointer-events: none; -webkit-user-drag: none; }
#fx { position: absolute; inset: 0; width: 1254px; height: 1254px; pointer-events: none; }
.pin, .badge, .ring, .ripple { position: absolute; left: 0; top: 0; pointer-events: none; }
.badge { width: 30px; height: 30px; margin: -15px 0 0 -15px; transform: scale(var(--inv)); border-radius: 50%; background: #f7f1e3; color: #141414; border: 2px solid #141414; display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 18px; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.badge.struck { opacity: .45; }
.badge.struck::after { content: ""; position: absolute; width: 34px; height: 3px; background: var(--bad); transform: rotate(-35deg); border-radius: 2px; }
.badge .flag { position: absolute; right: -7px; top: -7px; width: 16px; height: 16px; border-radius: 50%; background: var(--bad); color: #fff; font: 700 11px/16px var(--f-body); text-align: center; }
.pin { width: 22px; height: 22px; margin: -11px 0 0 -11px; transform: scale(var(--inv)); border-radius: 50%; background: var(--ember); border: 2px solid var(--ember-ink); display: grid; place-items: center; box-shadow: 0 0 0 4px rgba(240,138,60,.25); }
.pin svg { width: 12px; height: 12px; }
.ring { border-radius: 50%; border: 3px solid var(--file); box-shadow: 0 0 24px rgba(220,197,143,.6); animation: pulse 1.4s ease-in-out infinite; }
.ring.hint { border-color: var(--ember); box-shadow: 0 0 40px rgba(240,138,60,.55); }
.ring.tut { border-width: calc(4px * var(--inv)); box-shadow: 0 0 calc(30px * var(--inv)) rgba(240,138,60,.8), inset 0 0 calc(20px * var(--inv)) rgba(240,138,60,.4); }
.ripple { width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid rgba(235,229,214,.7); transform: scale(calc(var(--inv) * .3)); animation: rip .5s ease-out forwards; }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes rip { to { transform: scale(calc(var(--inv) * 1.4)); opacity: 0; } }

#dark { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle 150px at var(--fx, 50%) var(--fy, 45%), rgba(3,5,10,0) 0%, rgba(3,5,10,.15) 45%, rgba(3,5,10,.95) 100%); transition: opacity .3s; }
#roomnav { position: absolute; left: 12px; top: 12px; right: 12px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
#hallBtn { pointer-events: auto; min-height: 38px; padding: 0 12px 0 8px; border-radius: 999px; border: 1px solid var(--line); background: rgba(19,27,43,.92); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
#hallBtn svg { width: 18px; height: 18px; }
#roomName { font-family: var(--f-type); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); background: rgba(11,17,29,.8); border: 1px solid var(--line); padding: 5px 10px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

#toast { position: absolute; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: 12px; margin: 0 auto; max-width: 460px; background: var(--file); color: var(--file-ink); border-radius: 4px; padding: 12px 14px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.55); transform: translateY(16px) rotate(-.6deg); opacity: 0; transition: transform .25s, opacity .25s; pointer-events: none; }
#toast.show { transform: translateY(0) rotate(-.6deg); opacity: 1; pointer-events: auto; }
#toast .tt { font-family: var(--f-display); font-weight: 800; font-size: 20px; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; }
#toast .tn { font-family: var(--f-type); font-size: 14px; line-height: 1.45; margin-top: 4px; }
#toast .tk { font-family: var(--f-type); font-size: 11px; color: var(--file-muted); text-transform: uppercase; letter-spacing: .08em; }
#toast .tk:empty, #toast .tt:empty { display: none; }
#toast .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
#toast .acts button { min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1.5px solid var(--file-ink); background: var(--file-ink); color: var(--file); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
#toast .acts button svg { width: 16px; height: 16px; }

.bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--panel); border-top: 1px solid var(--line); }
.btn { min-height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--ember); color: var(--ember-ink); border-color: var(--ember); font-family: var(--f-display); font-weight: 800; font-size: 20px; text-transform: uppercase; letter-spacing: .04em; }
.btn svg { width: 18px; height: 18px; }
.btn .count { font-variant-numeric: tabular-nums; font-size: 12px; padding: 2px 7px; border-radius: 999px; background: var(--night); color: var(--muted); }

/* blurred copy of the current room behind the picture: fills the space a square scene leaves on any screen */
#blur { position: absolute; inset: -60px; background: center / cover no-repeat; filter: blur(30px) brightness(.45) saturate(1.15); transform: scale(1.08); pointer-events: none; transition: background-image .3s; }
[data-theme="cozy"] #blur { filter: blur(30px) brightness(1.02) saturate(.9); opacity: .55; }

#loupe { position: absolute; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 0 0 3px #b9825a, 0 10px 26px rgba(75,58,42,.45); background-color: #fff; background-repeat: no-repeat; pointer-events: none; z-index: 1; }
