* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: #e8e6e1;
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
/* A long press (iPad, phones) mustn't select the page like text or pop up the copy/look-up callout.
   Text boxes stay selectable so names, room codes and the invite link can still be edited and copied. */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
canvas { display: block; width: 100vw; height: 100vh; touch-action: none; cursor: grab; }
canvas.dragging { cursor: grabbing; }

#panel { position: fixed; top: 12px; right: 12px; width: 300px; max-height: calc(100vh - 24px); overflow-y: auto;
  background: rgba(14, 16, 20, 0.86); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 12px 14px;
  backdrop-filter: blur(6px); }
h1 { font-size: 16px; margin: 0 0 10px; font-weight: 650; letter-spacing: 0.2px; }
h1 .sub { font-weight: 400; font-size: 12px; color: #9a988f; margin-left: 6px; }
section { border-top: 1px solid rgba(255,255,255,0.07); padding: 8px 0; }
label { display: flex; justify-content: space-between; margin-top: 6px; color: #b9b6ad; }
label b { color: #f2d3a4; font-weight: 600; }
#panel label select { font: inherit; font-size: 13px; color: #e8e6e1; color-scheme: dark; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 6px; padding: 2px 6px; margin-left: 8px; }
#panel label select option { background: #1b1e24; color: #e8e6e1; }
label.check { justify-content: flex-start; gap: 6px; align-items: center; }
input[type=range] { width: 100%; accent-color: #f0b46a; }
.row { display: flex; gap: 4px; margin-top: 4px; }
button { flex: 1; background: #22262d; color: #ddd; border: 1px solid #343a44; border-radius: 5px; padding: 3px 0; cursor: pointer; font: inherit; }
button:hover { background: #2d333c; }
.hint { color: #8d8a82; font-size: 12px; margin-top: 6px; }
.stats { font-variant-numeric: tabular-nums; color: #b9b6ad; font-size: 12px; }
.stats div { display: flex; justify-content: space-between; }
.stats b { color: #e8e6e1; font-weight: 500; }
details { border-top: 1px solid rgba(255,255,255,0.07); padding-top: 8px; color: #9a988f; font-size: 12px; }
summary { cursor: pointer; color: #b9b6ad; }

.search { position: relative; }
#search { width: 100%; background: #1b1e24; border: 1px solid #343a44; color: #eee; border-radius: 6px; padding: 6px 8px; font: inherit; }
#results { position: absolute; left: 0; right: 0; top: 100%; background: #1b1e24; border: 1px solid #343a44; border-radius: 6px; z-index: 5; display: none; }
#results div { padding: 4px 8px; cursor: pointer; display: flex; justify-content: space-between; }
#results div:hover, #results div.sel { background: #2d333c; }
#results span { color: #8d8a82; }

#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font-size: 12px; color: #fff;
  text-shadow: 0 0 3px #000, 0 0 2px #000; padding-bottom: 4px; }
.lbl::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 3px; height: 3px; margin-left: -1.5px; background: #fff; border-radius: 50%; }
.lbl small { color: #cfc9bb; }

#loading { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #aaa; font-size: 15px; }
