* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #050510; color: #ccddff; font-family: 'Courier New', monospace; }

#app { width: 100%; height: 100%; display: flex; flex-direction: column; }

/* Input bar (normal flow, always visible at top) */
.input-bar {
  flex-shrink: 0; background: rgba(8, 8, 20, 0.95); border-bottom: 1px solid #1a2235;
  padding: 8px 12px; font-size: 11px; z-index: 30;
}
.input-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#url-select {
  padding: 4px 6px; background: #0a0a18; border: 1px solid #223; border-radius: 4px;
  color: #0af; font: inherit; font-size: 11px; max-width: 260px; cursor: pointer; outline: none;
}
#url-select:hover { border-color: #0af; }
#url-select optgroup { color: #668; }
#url-select option { color: #0af; background: #0a0a18; }
#url-input {
  flex: 1; min-width: 200px; padding: 4px 8px;
  background: #0a0a18; border: 1px solid #223; border-radius: 4px;
  color: #ccddff; font: inherit; font-size: 11px; outline: none;
}
#url-input:focus { border-color: #0af; }
#url-input::placeholder { color: #335; }
.src-btn {
  padding: 4px 14px; background: rgba(0, 170, 255, 0.15); color: #0af;
  border: 1px solid #335; border-radius: 4px;
  cursor: pointer; font: inherit; font-size: 11px; white-space: nowrap;
}
.src-btn:hover { border-color: #0af; background: rgba(0, 170, 255, 0.25); text-shadow: 0 0 6px #0af; }
#status-msg { color: #446; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-zone {
  margin-top: 6px; padding: 10px; border: 2px dashed #223; border-radius: 4px;
  text-align: center; color: #446; cursor: pointer; font-size: 11px;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: #0af; background: rgba(0, 170, 255, 0.04); color: #88aacc;
}

/* Canvas (fills remaining space) */
#viewer-container { flex: 1; position: relative; overflow: hidden; }
#three-canvas { width: 100%; height: 100%; display: block; }

/* HUD Overlay */
#hud-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
.hud-time { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); font-size: 18px; color: #0af; text-shadow: 0 0 10px #0af; letter-spacing: 2px; }
.hud-event { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); font-size: 12px; color: #668; }
.hud-alert { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); font-size: 16px; font-weight: bold; padding: 6px 20px; border-radius: 4px; opacity: 0; transition: opacity 0.3s; white-space: nowrap; }
.hud-alert.visible { opacity: 1; }
.hud-alert-danger { color: #ff4444; text-shadow: 0 0 12px #ff0000; }
.hud-alert-success { color: #44ff44; text-shadow: 0 0 12px #00ff00; }
.hud-legend { position: absolute; bottom: 60px; left: 16px; display: flex; gap: 16px; font-size: 11px; }
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend-dot.danger { background: #ff4444; box-shadow: 0 0 4px #ff0000; }
.legend-dot.warning { background: #ff8800; box-shadow: 0 0 4px #ff6600; }
.legend-dot.success { background: #44ff44; box-shadow: 0 0 4px #00ff00; }
.legend-dot.info { background: #4488ff; box-shadow: 0 0 4px #0066ff; }

/* Stats Panel */
#stats-panel {
  position: fixed; top: 0; right: 0; width: 240px; height: calc(100% - 52px);
  background: rgba(8, 8, 20, 0.92); border-left: 1px solid #112;
  padding: 16px; overflow-y: auto; z-index: 20;
  font-size: 12px;
}
#stats-panel h2 { font-size: 13px; color: #0af; letter-spacing: 3px; margin-bottom: 12px; text-shadow: 0 0 8px #06a; }
#stats-panel h3 { font-size: 11px; color: #668; letter-spacing: 2px; margin: 8px 0 6px; }
.stat-row { display: flex; justify-content: space-between; padding: 4px 0; }
.stat-label { color: #668; }
.stat-value { color: #0af; font-weight: bold; }
.stat-danger { color: #ff4444; }
.stat-success { color: #44ff44; }
.stat-warning { color: #ff8800; }
.stat-divider { border-top: 1px solid #112; margin: 10px 0; }
.stat-list { font-size: 11px; }
.stat-item { display: flex; justify-content: space-between; padding: 2px 0; }
.stat-ip { color: #ff6644; }
.stat-user { color: #cc88ff; }
.stat-count { color: #556; }

/* Timeline Bar */
#timeline-bar {
  flex-shrink: 0; height: 52px;
  background: rgba(8, 8, 20, 0.95); border-top: 1px solid #112;
  padding: 8px 16px; padding-right: 256px; z-index: 20;
}
.tl-row { display: flex; align-items: center; gap: 10px; height: 100%; }
.tl-btn { background: none; border: 1px solid #335; color: #0af; padding: 4px 10px; cursor: pointer; font-family: inherit; font-size: 14px; border-radius: 3px; }
.tl-btn:hover { border-color: #0af; text-shadow: 0 0 6px #0af; }
.tl-mode-btn { font-size: 10px; letter-spacing: 1px; }
.tl-mode-btn.analysis-mode { color: #ff8800; border-color: #ff8800; }
.tl-speed-group { display: flex; gap: 2px; }
.tl-speed { background: none; border: 1px solid #223; color: #446; padding: 2px 6px; cursor: pointer; font-family: inherit; font-size: 10px; border-radius: 2px; }
.tl-speed:hover { border-color: #0af; color: #0af; }
.tl-speed.active { border-color: #0af; color: #0af; text-shadow: 0 0 4px #06a; }
#tl-scrubber { flex: 1; height: 4px; -webkit-appearance: none; appearance: none; background: #112; border-radius: 2px; outline: none; cursor: pointer; }
#tl-scrubber::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #0af; cursor: pointer; box-shadow: 0 0 6px #0af; }
.tl-time { font-size: 13px; color: #0af; white-space: nowrap; letter-spacing: 1px; min-width: 110px; }
.tl-fade-group { display: flex; align-items: center; gap: 4px; font-size: 10px; color: #446; }
.tl-fade-group label { white-space: nowrap; }
#tl-fade { width: 60px; height: 3px; -webkit-appearance: none; appearance: none; background: #112; border-radius: 2px; outline: none; }
#tl-fade::-webkit-slider-thumb { -webkit-appearance: none; width: 8px; height: 8px; border-radius: 50%; background: #668; cursor: pointer; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #050510; }
::-webkit-scrollbar-thumb { background: #223; border-radius: 2px; }
