/* Midnight V0.21 — shared stage geometry, scoped to the Midnight guide only. */
.guide-mode[data-game=midnight] {
  --mn-rail: 164px;
  --mn-gap: 26px;
  --mn-frame: 1480px;
  --mn-clock: 138px;
  --mn-ink: #f2e5d1;
  --mn-muted: #c7b7a0;
  --mn-line: #b797684d;
}
.guide-mode[data-game=midnight] .guide-scene .art {opacity:1}
.guide-mode[data-game=midnight] .guide-scene:after {
  background:linear-gradient(180deg,#100d0acc 0%,#15100c40 23%,#0b0909a8 78%,#080708e6 100%);
}
.guide-mode[data-game=midnight] .guide {
  width:100%;max-width:var(--mn-frame);padding:12px clamp(16px,3vw,48px) 16px;
}
.guide-mode[data-game=midnight] .guide-heading {
  text-align:left;padding:6px 0 14px;flex:0 0 auto;
}
.guide-mode[data-game=midnight] .guide-heading h1 {
  font-size:clamp(1.85rem,3.6vw,3.1rem);line-height:1.16;margin:3px 0 4px;letter-spacing:.015em;
}
.guide-mode[data-game=midnight] .guide-heading .muted {margin:0;color:var(--mn-muted);font-size:.82rem}
.guide-mode[data-game=midnight] .guide-dock {
  padding:8px clamp(12px,2vw,32px);gap:8px 18px;background:#13100eea;border-color:var(--mn-line);
}
.guide-mode[data-game=midnight] .guide-dock label:has(#voice) {display:none}
.guide-mode[data-game=midnight] .guide-shell {
  min-width:0;min-height:0;padding:clamp(16px,2.2vw,32px);
  border:1px solid var(--mn-line);border-radius:12px;
  background:linear-gradient(145deg,#1b1612f5,#171411ed);box-shadow:0 16px 56px #0006;
}
.guide-mode[data-game=midnight] .guide-shell .tabs {
  margin:0 0 8px;width:100%;min-width:0;
}
.guide-mode[data-game=midnight] .chapter-main {gap:6px}
.guide-mode[data-game=midnight] .chapter-main button {
  min-height:42px;padding:8px 4px;border-radius:5px;border-color:var(--mn-line);font-size:.88rem;
}
.guide-mode[data-game=midnight] .chapter-main button[aria-current=step] {
  background:#dcb785;color:#271b10;box-shadow:inset 0 -2px 0 #9f7852;
}
.guide-mode[data-game=midnight] .chapter-sub {margin:7px 0 0}
.guide-mode[data-game=midnight] .guide-progress-label {color:var(--mn-muted);font-size:.8rem}
.guide-mode[data-game=midnight] .guide-shell .progress {margin:5px 0 12px;height:3px}
.guide-mode[data-game=midnight] .guide-shell .stage,
.guide-mode[data-game=midnight] .guide-shell .stage.mn-setup-mode {
  display:grid;grid-template-columns:minmax(0,1fr) var(--mn-rail);grid-template-rows:minmax(0,1fr);
  align-content:start;align-items:start;column-gap:var(--mn-gap);
  min-width:0;min-height:0;overflow:visible;padding:0;text-align:left;
}
.guide-mode[data-game=midnight] .guide-shell .stage > :first-child {
  min-width:0;min-height:0;max-width:100%;text-align:left;
}
.guide-mode[data-game=midnight] .guide-shell .stage h2 {
  font-family:Georgia,"Noto Serif KR","Malgun Gothic",serif;
  font-size:clamp(1.5rem,2.3vw,2.15rem);line-height:1.35;color:#e8c99b;margin:5px 0 12px;
}
.guide-mode[data-game=midnight] .guide-shell .story {
  font-size:clamp(1rem,1.2vw,1.2rem);line-height:1.9;
  padding:16px 20px;background:#0b090733;border-color:var(--mn-line);
  max-height:none;min-height:0;overflow:visible;text-align:left;
}
.guide-mode[data-game=midnight] .guide-shell .timer-wrap {
  grid-column:2;grid-row:1;align-self:start;justify-self:center;position:relative;top:auto;
  padding:0;margin:0;width:100%;
}
.guide-mode[data-game=midnight] .guide-shell .timer {
  width:var(--mn-clock);height:var(--mn-clock);margin:0 auto;
  border:1px solid #a7855a80;padding:3px;background:conic-gradient(#dab37d var(--progress),#5d4c3b 0);
}
.guide-mode[data-game=midnight] .guide-shell .timer>div {background:#201b16}
.guide-mode[data-game=midnight] .clock {
  font-family:inherit;font-size:clamp(1.45rem,2.4vw,1.9rem);font-weight:500;
  line-height:1.1;font-variant-numeric:tabular-nums;letter-spacing:.02em;
}
.guide-mode[data-game=midnight] .timer .muted {font-size:.68rem;color:#c7b69d;margin-top:6px}
.guide-mode[data-game=midnight] .guide-shell .controls {
  width:calc(100% - var(--mn-rail) - var(--mn-gap));margin:12px 0 0;
  padding:12px 0 0;border-top:1px solid var(--mn-line);
}
.guide-mode[data-game=midnight] .controls button {border-radius:5px;font-size:.88rem;min-height:40px}
.guide-mode[data-game=midnight] .controls .primary {background:#dcb785;color:#271b10}
.guide-mode[data-game=midnight] .mn-setup-panel {padding:0}
.guide-mode[data-game=midnight] .mn-guided-action,.guide-mode[data-game=midnight] .mn-setup-actions {
  color:var(--mn-ink);font-size:clamp(1rem,1.35vw,1.17rem);line-height:1.75;
}
.guide-mode[data-game=midnight] .mn-setup-tabs {margin:8px 0 14px}
.guide-mode[data-game=midnight] .mn-setup-materials {margin-top:16px;padding-top:12px}
.guide-mode[data-game=midnight] .mn-material-grid {gap:8px}
.guide-mode[data-game=midnight] .mn-material-thumb {width:64px;height:54px;flex-basis:64px}
.guide-mode[data-game=midnight] .mn-material>span:last-child {min-width:0;overflow-wrap:anywhere}
.guide-mode[data-game=midnight] #message:empty {min-height:0}
.guide-mode[data-game=midnight] .guide-footnote {font-size:.72rem;margin:8px 0 0;flex:0 0 auto}
@media (min-width:900px) and (min-height:640px) {
  /* Both modes use the same stable frame. Only the reading column scrolls. */
  .guide-mode[data-game=midnight] #app {
    height:100vh;height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden;
  }
  .guide-mode[data-game=midnight] .guide-topbar,
  .guide-mode[data-game=midnight] .guide-dock {flex:0 0 auto;position:relative;top:auto}
  .guide-mode[data-game=midnight] .guide {
    flex:1;min-height:0;display:flex;flex-direction:column;
  }
  .guide-mode[data-game=midnight] .guide-shell {
    flex:1;min-height:0;display:flex;flex-direction:column;
  }
  .guide-mode[data-game=midnight] .guide-shell .tabs {height:83px;flex:0 0 83px}
  .guide-mode[data-game=midnight] .guide-progress-label {flex:0 0 auto}
  .guide-mode[data-game=midnight] .guide-shell .progress {flex:0 0 3px}
  .guide-mode[data-game=midnight] .guide-shell .stage,
  .guide-mode[data-game=midnight] .guide-shell .stage.mn-setup-mode {
    flex:1;min-height:0;overflow:hidden;align-items:stretch;
  }
  .guide-mode[data-game=midnight] .guide-shell .stage > :first-child {
    overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;
    padding-right:12px;scrollbar-width:thin;scrollbar-color:#94764f #2b231b;
  }
  .guide-mode[data-game=midnight] .guide-shell .controls {flex:0 0 auto}
  .guide-mode[data-game=midnight].cinema-mode .guide-heading {padding:6px 0 14px}
  .guide-mode[data-game=midnight].cinema-mode .guide-heading h1 {font-size:clamp(1.85rem,3.6vw,3.1rem)}
}
@media (max-width:899px), (max-height:639px) {
  .guide-mode[data-game=midnight] {--mn-rail:112px;--mn-gap:14px;--mn-clock:100px}
  .guide-mode[data-game=midnight].cinema-mode #app {height:auto;min-height:100dvh;overflow:visible;display:block}
  .guide-mode[data-game=midnight].cinema-mode .guide {display:block}
  .guide-mode[data-game=midnight].cinema-mode .guide-shell {display:block}
  .guide-mode[data-game=midnight] .guide-shell .stage {overflow:visible;grid-template-rows:auto}
  .guide-mode[data-game=midnight] .guide-shell .controls {width:100%}
}
@media (max-width:650px) {
  .guide-mode[data-game=midnight] {--mn-rail:84px;--mn-gap:10px;--mn-clock:80px}
  .guide-mode[data-game=midnight] .guide {padding:8px 10px 18px}
  .guide-mode[data-game=midnight] .guide-shell {padding:12px}
  .guide-mode[data-game=midnight] .guide-shell .stage,
  .guide-mode[data-game=midnight] .guide-shell .stage.mn-setup-mode {grid-template-columns:minmax(0,1fr) var(--mn-rail);grid-template-rows:auto auto;row-gap:8px}
  .guide-mode[data-game=midnight] .guide-shell .stage > :first-child {grid-column:1/-1;grid-row:2}
  .guide-mode[data-game=midnight] .guide-shell .timer-wrap {grid-column:2;grid-row:1}
  .guide-mode[data-game=midnight] .clock {font-size:1.2rem}
  .guide-mode[data-game=midnight] .timer .muted {font-size:.58rem;margin-top:3px}
  .guide-mode[data-game=midnight] .guide-shell .story {padding:12px;font-size:1rem}
  .guide-mode[data-game=midnight] .guide-dock {gap:5px 10px;justify-content:center}
  .guide-mode[data-game=midnight] .chapter-main button {font-size:.75rem;min-height:36px}
  .guide-mode[data-game=midnight] .guide-shell .controls button {font-size:.78rem}
  .guide-mode[data-game=midnight] .mn-material-grid {grid-template-columns:1fr}
}
