:root {
  --steel: #16181c;
  --steel-2: #1e2228;
  --brass: #c4a574;
  --brass-d: #8a6a3e;
  --cyan: #3ecfff;
  --ink: #e8e0d4;
  --dim: #9a9184;
  --fail: #e07050;
  --ok: #7dcea0;
  --frame: 14px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background: radial-gradient(1200px 800px at 50% 20%, #242830, var(--steel));
  color: var(--ink);
  overflow: hidden;
}
.shell {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  padding: 10px;
  gap: 8px;
}
.mobile-dock {
  display: none;
}
.hud, .dock {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 14px;
  background: linear-gradient(#2a2e36, #16181c);
  border: 1px solid #3a3428;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 #4a4030, 0 8px 24px #0008;
}
.hud { max-height: none; }
.hud > aside.hof,
header.hud .hof { display: none !important; }
.brand {
  display: flex; align-items: center; gap: 8px;
  font-family: Cinzel, Palatino, serif;
  letter-spacing: 0.12em;
  color: var(--brass);
}
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.stat { display: flex; flex-direction: column; min-width: 64px; }
.stat b { font-variant-numeric: tabular-nums; font-size: 1.05rem; color: var(--cyan); }
.stat span { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.grow { flex: 1; }
.level-title { font-family: Cinzel, Palatino, serif; }
.level-title small { display: block; color: var(--dim); font-family: "Source Sans 3", sans-serif; letter-spacing: 0.08em; }
#view-wrap {
  position: relative;
  border: 2px solid var(--brass-d);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 4px #0c0c0e, inset 0 0 40px #0006;
  background: #000;
}
#view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  touch-action: none;
}
.compass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
  padding: 8px;
  background: #16181cee;
  border: 1px solid var(--brass-d);
  border-radius: 12px;
  pointer-events: auto;
}
.zoom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.compass-pad {
  display: grid;
  grid-template-columns: 36px 36px 36px;
  gap: 4px;
}
.compass button {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1rem;
  pointer-events: auto;
  position: relative;
  z-index: 31;
}
.zoom-row button { width: 100%; }
#hint-flash {
  display: none !important;
}
#hint-flash[hidden] { display: none !important; }
@keyframes hintblink {
  0%, 100% { opacity: 0.15; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}
.split-banner {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  background: #16181cee;
  border: 1px solid var(--brass-d);
  color: var(--brass);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
}
.vol-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.vol-line input { flex: 1; min-width: 8rem; }
.status {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  pointer-events: none; letter-spacing: 0.16em; text-transform: uppercase;
  font-size: 0.8rem;
}
.status.fail { color: var(--fail); }
.chip {
  border: 1px solid var(--brass-d); color: var(--brass); padding: 2px 8px; border-radius: 999px;
  font-size: 0.75rem; letter-spacing: 0.08em;
}
button, select, input {
  font: inherit; color: var(--ink);
  background: #2a241c; border: 1px solid var(--brass-d); border-radius: 8px;
  padding: 6px 10px; cursor: pointer;
}
button:hover { border-color: var(--brass); color: var(--brass); }
.pad {
  display: grid; grid-template-columns: 36px 36px 36px; gap: 3px;
}
.pad button { width: 36px; height: 30px; padding: 0; }
.pad .n { grid-column: 2; }
.pad .w { grid-column: 1; grid-row: 2; }
.pad .s { grid-column: 2; grid-row: 2; }
.pad .e { grid-column: 3; grid-row: 2; }
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0c0c0ef2;
  z-index: 200;
  overflow: hidden;
  padding: 12px;
}
.modal[hidden] { display: none !important; }
.panel {
  width: min(480px, 94vw);
  max-height: min(92vh, 760px);
  background: linear-gradient(#2a2e36, #14161a);
  border: 1px solid var(--brass);
  border-radius: 12px; padding: 18px 22px 22px;
  box-shadow: 0 20px 60px #000a;
  overflow: auto;
}
.pause-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.panel-head, .panel-foot {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 18px;
  background: #1a1612;
}
.panel-head {
  justify-content: space-between;
  border-bottom: 1px solid var(--brass-d);
}
.panel-head h2 { margin: 0; }
.panel-foot {
  border-top: 1px solid var(--brass-d);
  flex-wrap: wrap;
}
.panel-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 18px 16px;
}
.panel h2 { font-family: Cinzel, Palatino, serif; color: var(--brass); margin: 0 0 8px; }
.panel p { color: var(--dim); }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.hint { color: var(--dim); font-size: 0.8rem; }
.who { color: var(--brass); font-size: 0.85rem; }
.fatal { padding: 2rem; color: var(--fail); }
a.hall-exit, .hud a.hall-exit {
  color: var(--brass); border: 1px solid var(--brass-d); padding: 6px 10px; border-radius: 8px;
}
.drama-toggle {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px;
}
.drama-toggle button.on {
  background: var(--brass); color: #16181c; border-color: var(--brass);
}
body.drama #view-wrap {
  border-color: #e0a050;
  box-shadow: 0 0 0 4px #0c0c0e, 0 0 48px #ff6a2a44, inset 0 0 50px #3ecfff18;
}
#guest-name, #login-name, #reg-name, #auditor-key, #login-pass, #reg-pass {
  min-width: 12rem;
}
@media (max-width: 820px) {
  .shell { grid-template-rows: auto 1fr auto; }
  .mobile-dock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 12px;
    background: linear-gradient(#2a2e36, #16181c);
    border: 1px solid #3a3428;
    border-radius: 10px;
  }
  .mobile-dock .pad button { width: 48px; height: 40px; }
  .hud { flex-wrap: wrap; }
  .stat { min-width: 48px; }
}
