:root {
  --bg-deep: #241608;
  --wood: #5b3a20;
  --wood-2: #79512e;
  --parchment: #f6ecd4;
  --parchment-2: #ece0bf;
  --border: #c8a86a;
  --text: #2c1d0e;
  --text-dim: #7a6647;
  --gold: #caa23a;
  --ok: #2f7d43;
  --warn: #b8791f;
  --danger: #a3311b;
  --info: #2f6fa3;
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  font-family: "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; touch-action: manipulation; }

html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 0%, #3c2811 0%, #24160a 45%, #150c05 100%);
  color: var(--text);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.game-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 18px;
  background: linear-gradient(180deg, var(--wood-2), var(--wood));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.brand { display: flex; flex-direction: column; gap: 2px; min-width: 190px; }
.brand-title { margin: 0; font-size: 22px; color: var(--gold); font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
.brand-sub { font-size: 13px; color: #fdf3da; font-weight: 700; }

.head-progress-wrap { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 4px; }
.head-progress-label { font-size: 11.5px; color: #fdf3da; font-weight: 800; }
.head-progress { height: 14px; background: rgba(255, 255, 255, .18); border-radius: 999px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .3); }
.head-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #e7c873, var(--gold)); border-radius: 999px; transition: width .4s; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.head-btn {
  height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.10);
  color: #fdf3da;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
}
.head-btn:hover { background: rgba(255, 255, 255, .2); }

#home-link {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; text-decoration: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(202, 162, 58, .5), #2c1d0e 75%);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .25), 0 0 10px -2px var(--gold);
  transition: transform .15s ease, box-shadow .15s ease;
}
#home-link:hover { transform: translateY(-2px) scale(1.07); box-shadow: 0 0 0 3px rgba(0, 0, 0, .25), 0 0 16px 0 var(--gold); }

/* ── Layout (cpu_quest/net-questと共通構造) ── */
.game-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
  transition: grid-template-columns .25s ease;
}

.side-panel {
  background: linear-gradient(180deg, var(--wood-2), var(--wood));
  position: sticky;
  top: 8px;
  align-self: start;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0;
  color: #fdf3da;
  overflow: hidden;
  transition: width .25s ease;
}
.side-head {
  font-size: 14px;
  font-weight: 900;
  color: #fdf3da;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
}
.side-head-text { white-space: nowrap; }
.side-toggle {
  width: 36px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 7px;
  background: rgba(255, 255, 255, .10);
  color: #fdf3da;
  font-weight: 950;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.side-backdrop { display: none; }

.step-list { display: flex; flex-direction: column; }
.side-step {
  display: grid;
  grid-template-columns: 28px 1fr 20px;
  gap: 6px;
  align-items: center;
  min-height: 64px;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  color: #e9dfc4;
  position: relative;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  background: none;
  text-align: left;
  font-family: inherit;
  width: 100%;
}
.side-step:hover { background: rgba(255, 255, 255, .07); }
.side-step .paw { font-size: 18px; text-align: center; }
.side-step .side-step-label { font-size: 13px; font-weight: 950; line-height: 1.25; }
.side-step .status-icon { font-size: 16px; }
.side-step.active { background: rgba(0, 0, 0, .3); outline: 2px solid var(--gold); outline-offset: -3px; color: #fff; }
.side-step.done .paw { color: var(--gold); }
.side-step.locked { opacity: 0.5; cursor: not-allowed; }

.app-shell.side-collapsed .game-layout { grid-template-columns: 64px minmax(0, 1fr); }
.app-shell.side-collapsed .side-panel { width: 64px; }
.app-shell.side-collapsed .side-head { justify-content: center; padding: 8px 6px; }
.app-shell.side-collapsed .side-head-text { display: none; }
.app-shell.side-collapsed .step-list { flex-direction: column; }
.app-shell.side-collapsed .side-step { grid-template-columns: 1fr; justify-items: center; min-height: 48px; padding: 6px 4px; }
.app-shell.side-collapsed .side-step .side-step-label,
.app-shell.side-collapsed .side-step .status-icon { display: none; }

/* ── Desktop: サイドバーは常に展開 ── */
@media (min-width: 901px) {
  .app-shell.side-collapsed .game-layout { grid-template-columns: 230px minmax(0, 1fr) !important; }
  .app-shell.side-collapsed .side-panel { width: auto !important; }
  .app-shell.side-collapsed .side-head { justify-content: space-between !important; padding: 10px !important; }
  .app-shell.side-collapsed .side-head-text { display: block !important; }
  .app-shell.side-collapsed .side-step { grid-template-columns: 28px 1fr 20px !important; justify-items: start !important; min-height: 64px !important; padding: 8px 10px !important; }
  .app-shell.side-collapsed .side-step .side-step-label,
  .app-shell.side-collapsed .side-step .status-icon { display: block !important; }
}

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }

#dialogue-panel:empty { display: none; }

/* ── 会話システム（互い違い・全幅、net-quest/oop-gameと共通構造） ── */
.dialog-scene {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dialog-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  border: 1px solid var(--border);
  background: var(--parchment-2);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}
.dialog-row.right {
  grid-template-columns: minmax(0, 1fr) 110px;
}
.dialog-row.right .dialog-character { order: 2; }
.dialog-row.right .dialog-bubble { order: 1; }
.dialog-character {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-width: 0;
}
.dialog-character img {
  width: 64px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .3));
}
.dialog-name {
  margin-top: -2px;
  padding: 3px 10px;
  border-radius: 7px;
  color: #fdf3da;
  font-weight: 900;
  font-size: 12px;
  line-height: 1.2;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  white-space: nowrap;
}
.dialog-name.npc { background: linear-gradient(var(--wood-2), var(--wood)); }
.dialog-name.you { background: linear-gradient(#e7c873, var(--gold)); color: #2c1d0e; }
.dialog-bubble {
  position: relative;
  align-self: center;
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.8;
  font-weight: 700;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dialog-bubble::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid var(--border);
}
.dialog-bubble::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 9px solid var(--parchment);
}
.dialog-row.right .dialog-bubble::before {
  left: auto; right: -10px;
  border-right: 0;
  border-left: 10px solid var(--border);
}
.dialog-row.right .dialog-bubble::after {
  left: auto; right: -8px;
  border-right: 0;
  border-left: 9px solid var(--parchment);
}

@media (max-width: 700px) {
  .dialog-row, .dialog-row.right { grid-template-columns: 74px minmax(0, 1fr); padding: 8px; gap: 8px; }
  .dialog-row.right .dialog-character { order: 0; }
  .dialog-row.right .dialog-bubble { order: 1; }
  .dialog-character img { width: 52px; }
  .dialog-name { font-size: 10px; padding: 3px 7px; }
  .dialog-bubble { font-size: 13px; padding: 9px 11px; min-height: 0; }
  /* アバターは常に左側に寄せるため、吹き出しの三角形も左向きに揃える */
  .dialog-row.right .dialog-bubble::before {
    left: -10px; right: auto;
    border-right: 10px solid var(--border);
    border-left: 0;
  }
  .dialog-row.right .dialog-bubble::after {
    left: -8px; right: auto;
    border-right: 9px solid var(--parchment);
    border-left: 0;
  }
}

#mission-banner {
  background: var(--parchment-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
}
#mission-title { font-weight: 900; font-size: 15px; color: var(--wood); }
#mission-text { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
#mission-status { font-weight: 700; margin-top: 4px; min-height: 18px; }
#mission-status.ok { color: var(--ok); }
#mission-status.err { color: var(--danger); }

#stage-area {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 340px;
  min-width: 0;
}

#visual-wrap, #visual-stage { min-width: 0; }

.stage-info { font-size: 13px; color: var(--text-dim); font-weight: 700; line-height: 1.4; min-height: 2.8em; }
.stage-info.stage-info--tall { min-height: 4.2em; }

.villager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px;
}
.villager-card {
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fffdf5;
  color: var(--text);
  font-size: 12px;
  cursor: not-allowed;
  opacity: 0.55;
}
.villager-card.checked { opacity: 0.3; text-decoration: line-through; }
.villager-card.next { opacity: 1; cursor: pointer; border-color: var(--gold); background: #fff6da; font-weight: 700; }
.villager-card.next:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); }
.villager-card.found { opacity: 1; background: #dff3e2; border-color: var(--ok); color: var(--ok); font-weight: 900; }

.auto-scan-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: #1c1208;
  border-radius: 10px;
  font-family: "Consolas", monospace;
}
.auto-scan-line .scan-index { color: var(--gold); font-weight: 900; font-size: 20px; }
.auto-scan-line .scan-name { color: #fdf3da; font-size: 18px; }
.auto-scan-line .hint { color: #cbb98a; }

.binary-track { display: flex; gap: 12px; flex-wrap: wrap; }
.binary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 20px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #fffdf5;
  min-width: 100px;
}
.binary-card .tag { font-size: 11px; color: var(--text-dim); font-weight: 700; }
.binary-card .name { font-size: 16px; font-weight: 900; }
.binary-card .num { font-size: 10px; color: var(--text-dim); font-weight: 700; }
.binary-card.lo { border-color: #7d97c9; }
.binary-card.hi { border-color: #c97d7d; }
.binary-card.mid { border-color: var(--gold); background: #fff6da; transform: scale(1.08); }
.binary-card.found { border-color: var(--ok); background: #dff3e2; color: var(--ok); }

.cave-map { display: block; width: 100%; max-width: 100%; height: auto; background: #1c1208; border-radius: 10px; padding: 8px; }
.cave-edge { stroke: rgba(200, 168, 106, 0.35); stroke-width: 3; }
.cave-edge.on-path { stroke: var(--gold); stroke-width: 4; }
.cave-edge.final-path { stroke: var(--ok); stroke-width: 5; }

.cave-room rect { fill: #2c1d0e; stroke: var(--border); stroke-width: 2; }
.cave-room text { fill: #fdf3da; font-size: 16px; font-weight: 700; }

.cave-room.unvisited rect { fill: #241608; stroke: rgba(200, 168, 106, 0.3); }
.cave-room.unvisited text { fill: rgba(253, 243, 218, 0.35); }

.cave-room.onpath rect { fill: #3d2a12; stroke: var(--gold); }

.cave-room.candidate rect { fill: #1c3548; stroke: var(--info); }
.cave-room.candidate text { fill: #8ec9ef; }

.cave-room.final-path rect { fill: #163d24; stroke: var(--ok); stroke-width: 3; }
.cave-room.final-path text { fill: #8fe3a3; }

.graph-node-sub { fill: #cbb98a; font-size: 12px; font-weight: 700; }
.graph-edge-label { fill: #cbb98a; font-size: 11px; }

.legend-swatch.cave-onpath { background: #3d2a12; border: 2px solid var(--gold); }
.legend-swatch.cave-unvisited { background: #241608; border: 2px solid rgba(200, 168, 106, 0.3); }
.legend-swatch.cave-candidate { background: #1c3548; border: 2px solid var(--info); }
.legend-swatch.cave-final-path { background: #163d24; border: 2px solid var(--ok); }

.queue-track { display: flex; gap: 10px; flex-wrap: wrap; }
.queue-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #fffdf5;
  min-width: 80px;
}
.queue-card .tag { font-size: 11px; color: var(--text-dim); font-weight: 700; }
.queue-card .name { font-size: 15px; font-weight: 900; }
.queue-card.front { border-color: var(--gold); background: #fff6da; transform: scale(1.08); }

.chest-riddle {
  background: linear-gradient(180deg, #3a2812, #241608);
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  color: #e9dfc4;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  letter-spacing: 0.15em;
  text-align: center;
  font-size: 14px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5), 0 0 8px rgba(202, 162, 58, 0.4);
}

.stair-visual {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 150px;
  padding: 8px;
  background: #1c1208;
  border-radius: 10px;
  position: relative;
}
.stair-step {
  width: 16px;
  background: rgba(200, 168, 106, 0.25);
  border-radius: 3px 3px 0 0;
}
.stair-step.done { background: linear-gradient(180deg, #e7c873, var(--gold)); }
.chest-icon {
  position: absolute;
  top: 4px;
  right: 10px;
  width: 34px;
  height: 22px;
  background: linear-gradient(180deg, #8a5a2c, #5b3a1c);
  border: 2px solid var(--gold);
  border-radius: 4px 4px 2px 2px;
}
.chest-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 4px rgba(202, 162, 58, 0.8);
}

.chest-unlock { display: flex; gap: 8px; align-items: center; }
.chest-unlock-input {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
  background: #fffdf5;
  color: var(--text);
  width: 160px;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 220px;
  padding: 8px;
  background: #1c1208;
  border-radius: 10px;
}
.bar {
  flex: 1;
  min-width: 4px;
  background: linear-gradient(180deg, #e7c873, var(--gold));
  border-radius: 3px 3px 0 0;
}
.bar.compare {
  background: linear-gradient(180deg, #8ec9ef, var(--info));
  outline: 2px solid #dff0ff;
}
.bar.swap { background: linear-gradient(180deg, #ff9d8a, var(--danger)); }
.bar.pivot { outline: 2px solid #fff; }
.bar.sorted { background: linear-gradient(180deg, #9fe0ae, var(--ok)); }
.bar.out-of-range:not(.sorted) { opacity: 0.3; }

.bar-boundary {
  align-self: stretch;
  width: 1px;
  margin: 0 1px;
  background-image: repeating-linear-gradient(to bottom, #fff 0, #fff 6px, transparent 6px, transparent 12px);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.live-desc {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--wood);
  background: var(--parchment-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  min-height: calc(3em + 20px);
}
.live-desc.live-desc--tall { min-height: calc(4.5em + 20px); }

.bar-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  background: var(--gold);
}
.legend-swatch.compare { background: var(--info); }
.legend-swatch.swap { background: var(--danger); }
.legend-swatch.sorted { background: var(--ok); }
.legend-swatch.pivot { background: var(--gold); outline: 2px solid #fff; }
.legend-swatch.boundary {
  width: 4px;
  background-image: repeating-linear-gradient(to bottom, #fff 0, #fff 4px, transparent 4px, transparent 8px);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

#stage-actions { display: flex; gap: 10px; flex-wrap: wrap; min-width: 0; }
#stage-actions button, #control-bar button {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fffdf5;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}
#stage-actions button:disabled { opacity: 0.4; cursor: not-allowed; }
#stage-actions button.primary, #control-bar button.primary { background: var(--gold); border-color: var(--gold); }
.hint { color: var(--text-dim); font-size: 13px; }

#status-box, #compare-box {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
#status-box h3 { margin: 0 0 8px; font-size: 13px; color: var(--wood); }
.algo-name { font-weight: 900; font-size: 15px; margin: 0 0 4px; }
.algo-meta, .algo-ops { font-size: 12px; color: var(--text-dim); margin: 2px 0; }
.algo-meta span, .algo-ops span { color: var(--text); font-weight: 700; }

#control-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--parchment-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  flex-wrap: wrap;
}
.speed-label { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.speed-label input[type="range"] { max-width: 120px; }

#log-panel {
  background: #1c1208;
  border-radius: 12px;
  padding: 10px 14px;
  max-height: 160px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
#log-panel h3 { margin: 0 0 6px; font-size: 12px; color: var(--gold); }
#log-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
#log-list li { font-size: 12px; color: #e9dfc4; }
#log-list li.ok { color: #8fe3a3; }
#log-list li.err { color: #ff9d8a; }

#book-recommend {
  margin-top: 10px;
  background: var(--parchment-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.book-recommend-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  color: var(--text-dim);
  border: 1px solid var(--text-dim);
  border-radius: 4px;
  padding: 0 4px;
  margin: 0 0 6px;
}
.book-recommend-body { display: flex; align-items: center; gap: 12px; }
.book-recommend-cover { width: 60px; height: auto; border-radius: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); flex-shrink: 0; }
.book-recommend-lead { font-size: 12px; color: var(--text-dim); margin: 0 0 4px; font-weight: 700; }
#book-recommend a { font-size: 13px; color: var(--wood); font-weight: 900; text-decoration: underline; }

@media (max-width: 900px) {
  .app-shell { padding: 8px; gap: 8px; }
  .brand-title { font-size: 20px; }
  .game-layout { grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
  .app-shell:not(.side-collapsed) .game-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .side-panel { display: block; order: 0; position: sticky; top: 8px; }
}
@media (max-width: 700px) {
  .game-layout { grid-template-columns: 1fr; }
  .app-shell.side-collapsed .game-layout,
  .app-shell:not(.side-collapsed) .game-layout { grid-template-columns: 1fr; }
  .side-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: min(82vw, 300px);
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 10px 0 30px rgba(0, 0, 0, .45);
    overflow-y: auto;
    z-index: 80;
  }
  .app-shell.side-collapsed .side-panel { transform: translateX(-100%); }
  .app-shell:not(.side-collapsed) .side-panel { transform: translateX(0); }
  .side-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(6, 12, 18, .55);
    z-index: 70;
  }
  .app-shell:not(.side-collapsed) .side-backdrop { display: block; }
  .game-header { padding: 8px 12px; }
  .brand-title { font-size: 18px; }
  .main-area { gap: 8px; }
}
