* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #2a1c13; overflow: hidden; }
body { font: 14px/1.4 Helvetica, Arial, sans-serif; color: #f3e6cf; }
#room { display: block; width: 100vw; height: 100vh; height: 100dvh; touch-action: manipulation; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; font-size: 20px; color: #d9b44a; pointer-events: none; }

#overlay {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(390px, 100vw); overflow-y: auto;
  background: #1d1510; border-left: 2px solid #d9b44a; padding: 10px 12px 18px;
  box-shadow: -8px 0 24px rgba(0,0,0,.45);
}
#overlay[hidden] { display: none; }
#overlay h3 { margin: 12px 0 4px; font-size: 13px; color: #d9b44a; letter-spacing: .04em; }
.row { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.row.wrap { flex-wrap: wrap; gap: 4px 12px; }
.grow { flex: 1; }
.title { color: #d9b44a; font-size: 14px; }
button, select, input[type=number] {
  background: #3a2a1e; color: #f3e6cf; border: 0; border-radius: 4px; padding: 6px 10px; font: inherit; cursor: pointer;
}
button:hover { background: #5a4230; }
.controls button { font-size: 16px; min-width: 40px; }
input[type=number] { width: 70px; cursor: text; }
input[type=range] { width: 130px; vertical-align: middle; accent-color: #d9b44a; }
input[type=radio], input[type=checkbox] { accent-color: #d9b44a; }
label { cursor: pointer; }
.info { margin: 6px 0 0; color: #d8c8ae; font-size: 13px; }
.tags { margin: 2px 0 0; color: #d9b44a; font-size: 12.5px; min-height: 1em; }
.grid { display: grid; grid-template-columns: 70px auto auto; gap: 2px 10px; }
.panel {
  background: #f4ead6; color: #2a1c13; border-radius: 4px; padding: 8px 10px; white-space: pre-wrap;
  max-height: 260px; overflow-y: auto; font-size: 13px; line-height: 1.45;
}
dialog { max-width: 560px; background: #f4ead6; color: #2a1c13; border: 2px solid #d9b44a; border-radius: 8px; padding: 18px 22px; }
dialog::backdrop { background: rgba(0,0,0,.55); }
dialog h2 { margin-top: 0; font-family: Georgia, serif; }
dialog p { margin: 0 0 10px; }
dialog .small { font-size: 12px; color: #6b5a48; }
dialog button { margin-top: 6px; }
