:root { color-scheme: dark; --ink:#f1e8d6; --muted:#a99f8d; --line:#3b382f; --turnip:#b9d45d; --paper:#181915; --panel:#21231e; --deep:#141510; --danger:#d9654f; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 13px/1.4 "DM Mono", ui-monospace, monospace; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; }
header { height: 52px; display: flex; align-items: center; gap: 16px; padding: 6px 14px; border-bottom: 1px solid var(--line); background: var(--deep); }
.brand { white-space: nowrap; } .brand a { color: var(--turnip); text-decoration: none; margin-right: 6px; }
.brand strong { font-family: Fraunces, serif; font-size: 19px; }
/* the room palette (2026-10-12): top of the left column, grouped by building type, its own scroll; the stage keeps its height */
#left { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--deep); }
#leftPanels { flex: 1 1 0; min-height: 120px; }
#palette { flex: 0 1 auto; max-height: 58%; min-height: 0; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
#palette .phead { flex: none; padding: 8px 12px 6px; }
#roomSearch { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px; }
#roomSearch:focus { outline: none; border-color: var(--turnip); }
#ptabs { flex: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 8px; }
#palette .pt { display: flex; align-items: baseline; gap: 5px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); font-size: 12px; cursor: pointer; user-select: none; }
#palette .pt small { font-size: 10px; opacity: .8; }
#palette .pt:hover, #palette .pt:focus-visible { border-color: var(--turnip); outline: none; }
#palette .pt.open { color: var(--deep); background: var(--turnip); border-color: var(--turnip); }
#palette .pt.has:not(.open) { color: var(--turnip); border-color: #5d6e33; }
#pgroups { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 12px; scrollbar-width: thin; }
#pnone { padding: 0 12px 10px; }
#palette section.pg { border: 0; border-top: 1px solid var(--line); padding: 6px 0 2px; }
#palette section.pg h4 { margin: 0 0 6px; font: 500 11px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .07em; color: var(--turnip); }
#palette .pgrid { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 0 8px; }
#palette button { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; text-align: left; }
#palette button i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
#palette button kbd { color: var(--muted); font: 11px "DM Mono", monospace; }
#palette button kbd:empty { display: none; }
#palette [hidden] { display: none !important; }
#palette button.active { border-color: var(--turnip); background: #2d3322; }
.hint { position: absolute; left: 50%; bottom: 58px; transform: translateX(-50%); max-width: calc(100% - 380px); padding: 5px 10px; background: rgba(20,21,16,.78); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); pointer-events: none; text-align: center; }
main { display: grid; grid-template-columns: 290px minmax(0, 1fr) 330px; min-height: 0; }
.panel { overflow-y: auto; background: var(--deep); padding: 8px 12px 30px; scrollbar-width: thin; }
#left { border-right: 1px solid var(--line); } #right { border-left: 1px solid var(--line); }
section { border-bottom: 1px solid var(--line); padding: 8px 0 12px; }
h2 { font: 700 15px Fraunces, serif; margin: 4px 0 8px; } h3 { font: 500 11px "DM Mono"; text-transform: uppercase; letter-spacing: .07em; color: var(--turnip); margin: 12px 0 5px; }
.muted { color: var(--muted); } .small { font-size: 11px; }
button, select, input, textarea { font: inherit; color: var(--ink); }
button { padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; background: #2a2d26; cursor: pointer; }
button:hover { border-color: var(--turnip); } button.primary { background: #3a4524; border-color: #5d6e33; } button.danger { background: #4a2620; border-color: #7a3a2f; }
button.active { background: var(--turnip); color: var(--deep); }
select, input[type=text], input:not([type]), textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px; }
textarea { width: 100%; resize: vertical; margin-top: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; align-items: center; }
.row input { flex: 1; min-width: 0; }
.tabs { display: flex; gap: 4px; margin-bottom: 6px; } .tabs button { flex: 1; }
.dial { display: block; margin: 5px 0; } .dial span { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.dial output { color: var(--ink); } .dial input[type=range] { width: 100%; accent-color: var(--turnip); margin: 1px 0; }
.dial select { width: 100%; margin-top: 2px; }
.check { display: flex; gap: 7px; align-items: center; margin: 4px 0; cursor: pointer; font-size: 12px; }
.check input { accent-color: var(--turnip); }
details { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; margin: 6px 0; background: var(--panel); }
details summary { cursor: pointer; color: var(--turnip); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
#stage { position: relative; min-width: 0; min-height: 240px; overflow: hidden; }
#c { display: block; width: 100%; height: 100%; touch-action: none; }
#hud { position: absolute; top: 8px; left: 8px; padding: 6px 8px; background: rgba(20,21,16,.78); border: 1px solid var(--line); border-radius: 6px; pointer-events: none; }
#fps { font-size: 12px; } #fpsGraph { display: block; margin-top: 3px; }
#tooltip { position: absolute; pointer-events: none; padding: 6px 8px; background: rgba(20,21,16,.92); border: 1px solid var(--line); border-radius: 6px; max-width: 320px; font-size: 12px; white-space: pre-line; z-index: 3; }
#toast { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 8px 12px; background: rgba(20,21,16,.92); border: 1px solid var(--turnip); border-radius: 6px; max-width: 80%; z-index: 4; }
#toast.err { border-color: var(--danger); }
#loading { position: absolute; right: 10px; top: 8px; padding: 5px 9px; background: rgba(20,21,16,.85); border: 1px solid var(--line); border-radius: 6px; }
.roomTitle { display: flex; gap: 8px; align-items: center; } #roomSwatch { width: 14px; height: 14px; border-radius: 3px; } .roomTitle select { flex: 1; }
.summary { white-space: pre-wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin: 0; font-size: 12px; max-height: 340px; overflow: auto; }
.json { white-space: pre; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-size: 11px; max-height: 300px; overflow: auto; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; font-size: 12px; margin-bottom: 6px; } .stats b { font-weight: 500; text-align: right; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--muted); } .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.help { line-height: 1.6; }
@media (max-width: 900px) {
  body { overflow: auto; display: block; height: auto; }
  .hint { position: static; transform: none; max-width: none; margin: 6px; }
  header { height: auto; flex-wrap: wrap; padding: 8px 12px; } .hint { max-width: 100%; }
  main { grid-template-columns: 1fr; height: auto; }
  #stage { height: 72vh; order: -1; } #left { display: block; overflow: visible; } #palette { max-height: 60vh; } .panel { overflow: visible; border: 0 !important; }
}
.objTag { font: 900 30px/1 Fraunces, serif; letter-spacing: .12em; color: #141510; background: #4fe3ff; padding: 4px 10px; border-radius: 6px; }
#net { font-size: 11px; margin-top: 6px; max-width: 300px; line-height: 1.35; } #netGraph { display: block; margin-top: 3px; }
.loadBound { margin-top: 5px; padding: 3px 6px; border-radius: 4px; background: #e8b460; color: #141510; font-size: 11px; font-weight: 500; }
.noteList { font-size: 12px; margin-top: 4px; } .noteList div { display: flex; gap: 6px; align-items: baseline; padding: 2px 0; border-bottom: 1px dotted var(--line); }
.noteList b { color: #4fe3ff; font-weight: 500; cursor: pointer; } .noteList span { flex: 1; } .noteList button { padding: 0 6px; font-size: 11px; }

/* major panel groups: fold by default, remember per viewer */
details.major { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; margin: 0; background: none; }
details.major > summary { font: 700 15px Fraunces, serif; text-transform: none; letter-spacing: 0; color: inherit; padding: 10px 0; list-style: none; }
details.major > summary::before { content: '▸ '; color: var(--turnip); }
details.major[open] > summary::before { content: '▾ '; }
details.major > section { border-bottom: 0; padding-top: 0; }

/* "Use in game" vs "Send" (js/fx/houselink.js): the game's button leads, and a line says what the game is using */
.houseBox { margin: 6px 0 4px; padding: 6px; border: 1px solid #5d6e33; border-radius: 6px; background: rgba(58, 69, 36, 0.25); }
.houseBox button.houseUse { width: 100%; font-weight: 700; padding: 7px 8px; }
.houseState { margin-top: 5px; line-height: 1.35; color: var(--muted); }
.houseState.ok { color: #a9c77a; }
.houseState.warn { color: #e0b04a; }
.houseState.loud { color: #1d1f1a; background: #e0b04a; font-weight: 700; padding: 4px 6px; border-radius: 4px; }
button.houseSend { opacity: 0.85; }
/* Far-fire glow panel (fx/glowpanel.js, 2026-10-12): the three-way view switch and the "difference from real" readout */
.fxGlow .glowViews button { flex: 1 1 0; }
.fxGlow .glowDiff { margin: 6px 0; padding: 6px 8px; border: 1px solid #6b5a2e; border-radius: 6px; background: rgba(90, 70, 30, 0.22); line-height: 1.45; }
