* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0e1116; font-family: 'Segoe UI', system-ui, sans-serif; color: #e6edf3; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }

#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px; padding: 8px 14px;
  background: linear-gradient(180deg, rgba(14,17,22,0.92), rgba(14,17,22,0.0));
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }
.title { font-weight: 700; font-size: 15px; letter-spacing: 0.3px; }
#viewbar { display: flex; gap: 6px; }
#viewbar button, .ctrls button {
  background: #1b2230; color: #cdd6e0; border: 1px solid #2a3446;
  padding: 5px 11px; border-radius: 7px; font-size: 12px; cursor: pointer;
  transition: all .12s;
}
#viewbar button:hover, .ctrls button:hover { background: #26324a; border-color: #3a4a66; }
.ctrls { margin-left: auto; display: flex; gap: 6px; }

#hud {
  position: fixed; top: 54px; left: 14px; z-index: 10;
  background: rgba(16,20,28,0.82); backdrop-filter: blur(6px);
  border: 1px solid #232d3e; border-radius: 10px; padding: 12px 14px;
  font-size: 12.5px; line-height: 1.55; min-width: 230px;
  font-variant-numeric: tabular-nums;
}
#hud .row { margin-top: 8px; border-top: 1px solid #222c3c; padding-top: 6px; display: flex; align-items: center; gap: 8px; }
#hud .row:first-child { margin-top: 0; border-top: none; padding-top: 0; }
#hud b { color: #fff; }
#hud .ok { color: #5fe08a; }
#hud .bad { color: #ff6b6b; }
.pill { font-size: 10px; padding: 2px 7px; border-radius: 20px; background: #33261b; color: #b98; letter-spacing: .5px; }
.pill.held { background: #123a24; color: #5fe08a; }

#legend {
  position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 10;
  font-size: 11px; color: #7c8aa0; background: rgba(16,20,28,0.7);
  padding: 6px 14px; border-radius: 20px; border: 1px solid #202a3a;
  text-align: center; max-width: 92vw;
}

/* Presentation mode: hide all UI, show only the scene */
body.presentation #topbar,
body.presentation #hud,
body.presentation #legend { display: none !important; }

@media (max-width: 640px) {
  #hud { font-size: 11px; min-width: 180px; top: 90px; }
  #viewbar button { padding: 4px 7px; font-size: 11px; }
  .title { font-size: 13px; }
}
