:root {
  --primary: #2563eb;
  --border: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #ffffff;
  color: var(--text);
}

.container {
  max-width: 820px;
  margin: auto;
  padding: 12px;
}

h1 {
  font-size: 18px;
  margin-bottom: 12px;
}

/* Grid (index) */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 600px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Cards */
.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-decoration: none;
  color: inherit;
  transition: 0.2s;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card:hover {
  border-color: var(--primary);
  background: #f8fafc;
}

.card:active {
  transform: scale(0.98);
}

.card h2 {
  font-size: 15px;
  margin: 0 0 4px;
}

.card p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* Video area */
.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

video, canvas {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  top: 0;
  left: 0;
}

canvas {
  pointer-events: none;
}

/* Controls */
.controls {
  margin-top: 10px;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Back button */
.back {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.back:hover {
  color: var(--primary);
}

/* Footer */
.footer {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

/* HUD overlay inside video */
.hud {
  position: absolute;
  bottom: 10px;
  left: 10px;

  width: max-content;
  max-width: 65%;

  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);

  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;

  font-size: 12px;
  line-height: 1.3;

  pointer-events: none;
}

/* Highlight */
.hud strong {
  color: #93c5fd;
}

/* Bars */
.bar {
  height: 5px;
  border-radius: 4px;
  margin-top: 2px;
  margin-bottom: 4px;
  background: rgba(255,255,255,0.2);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: #60a5fa;
}

.main-bar {
  background: #22c55e !important;
}

/* Confidence colors */
.conf-high { color: #22c55e; }
.conf-mid { color: #facc15; }
.conf-low { color: #ef4444; }

/* Warning */
.warning {
  margin-top: 6px;
  font-size: 11px;
  color: #f87171;
}

/* Mobile */
@media (max-width: 500px) {
  .hud {
    max-width: 70%;
    font-size: 11px;
    padding: 6px 8px;
  }

  .bar {
    height: 4px;
  }
}
