* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: #00d4aa;
}

.controls {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-primary {
  background: #00d4aa;
  color: #1a1a2e;
}

.btn-primary:hover {
  background: #00b894;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-bar {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #aaa;
}

.status-bar span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.idle {
  background: #888;
}

.status-dot.processing {
  background: #f39c12;
}

.status-dot.matched {
  background: #00d4aa;
}

.preview-container {
  position: relative;
  border: 2px solid #333;
  border-radius: 12px;
  overflow: hidden;
  max-width: 100%;
  background: #0f0f1a;
}

#previewVideo {
  display: none;
  max-width: 100%;
  max-height: 70vh;
}

#previewCanvas {
  display: block;
  max-width: 100%;
  max-height: 70vh;
}

#answerOverlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.result-panel {
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: 10px;
  background: #16213e;
  min-width: 320px;
  max-width: 600px;
  width: 100%;
}

.result-panel h3 {
  font-size: 0.9rem;
  color: #00d4aa;
  margin-bottom: 8px;
}

.result-panel .question {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #ddd;
  margin-bottom: 8px;
}

.result-panel .answer {
  font-size: 1rem;
  color: #e74c3c;
  font-weight: bold;
}

.log-panel {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #0f0f1a;
  font-size: 0.75rem;
  color: #666;
  max-width: 600px;
  width: 100%;
  max-height: 120px;
  overflow-y: auto;
  font-family: "SF Mono", Monaco, monospace;
}

.hidden {
  display: none !important;
}
