:root {
  color-scheme: dark;
  font-family: "Orbitron", "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --bg-1: #06030f;
  --bg-2: #160b2f;
  --neon-cyan: #00f5ff;
  --neon-pink: #ff2bd6;
  --neon-purple: #8b5cf6;
  --panel-bg: rgba(9, 9, 25, 0.72);
  --text-main: #e9f7ff;
  --text-soft: #b0b7d8;
}

body {
  background: radial-gradient(circle at 20% 10%, #2a0c51 0%, var(--bg-2) 30%, var(--bg-1) 100%);
  color: var(--text-main);
  margin: 0;
  min-height: 100vh;
}

.container {
  max-width: 760px;
  margin: 1rem auto;
  padding: 1.1rem;
  border: 1px solid rgba(0, 245, 255, 0.35);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(8, 9, 27, 0.74), rgba(17, 8, 31, 0.82));
  box-shadow:
    0 0 0 1px rgba(255, 43, 214, 0.2),
    0 0 24px rgba(0, 245, 255, 0.18),
    inset 0 0 30px rgba(139, 92, 246, 0.1);
}

h1 {
  margin-bottom: 0.2rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.55);
  letter-spacing: 0.04em;
}

.subtitle {
  margin-top: 0;
  color: #d9ccff;
}

.camera-wrapper {
  position: relative;
  border: 1px solid rgba(0, 245, 255, 0.6);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 22px rgba(0, 245, 255, 0.2);
}

.camera-wrapper video,
.camera-wrapper canvas#overlay {
  width: 100%;
  display: block;
}

.camera-wrapper canvas#overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.controls {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.75rem;
}

button {
  background: linear-gradient(150deg, rgba(17, 25, 44, 0.95), rgba(35, 10, 53, 0.95));
  color: var(--text-main);
  border: 1px solid rgba(0, 245, 255, 0.55);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.12);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: rgba(255, 43, 214, 0.75);
  box-shadow:
    0 0 16px rgba(255, 43, 214, 0.35),
    0 0 26px rgba(0, 245, 255, 0.2);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  background: var(--panel-bg);
  border: 1px solid rgba(0, 245, 255, 0.42);
  border-radius: 10px;
  padding: 0.75rem;
  margin-top: 1rem;
  min-height: 1.4rem;
  color: #d6f7ff;
  box-shadow: inset 0 0 16px rgba(0, 245, 255, 0.08);
}

.fps {
  color: var(--text-soft);
  font-size: 0.8rem;
  margin-top: 0.4rem;
  text-align: right;
}

/* ── detections table ── */
.detections-panel {
  background: var(--panel-bg);
  border: 1px solid rgba(0, 245, 255, 0.42);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  box-shadow: inset 0 0 16px rgba(0, 245, 255, 0.08);
}

.detections-panel h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.4);
}

#detections-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#detections-table thead th {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.5);
  color: var(--neon-pink);
  font-weight: 700;
  letter-spacing: 0.02em;
}

#detections-table tbody td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(0, 245, 255, 0.12);
  color: var(--text-main);
}

#detections-table tbody tr:hover {
  background: rgba(0, 245, 255, 0.06);
}

#detections-table tbody td.color-swatch {
  width: 6px;
  padding: 0;
}

.no-detections {
  color: var(--text-soft);
  text-align: center;
  font-size: 0.85rem;
  margin: 0.4rem 0 0;
}
