* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2937, #111827);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  padding: 20px;
}

.panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  text-align: center;
}

h1 {
  font-size: 1.3rem;
  color: #111827;
  margin-bottom: 20px;
}

.btn-scan, .btn-stop {
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 20px;
  border-radius: 10px;
  width: 100%;
  transition: transform 0.1s ease, opacity 0.2s ease;
}

.btn-scan {
  background: #2563eb;
  color: #fff;
}

.btn-scan:active {
  transform: scale(0.98);
}

.btn-stop {
  background: #dc2626;
  color: #fff;
  margin-top: 10px;
}

.btn-stop:active {
  transform: scale(0.98);
}

.video-wrapper {
  position: relative;
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 1 / 1;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-frame {
  position: absolute;
  top: 15%;
  left: 15%;
  width: 70%;
  height: 70%;
  border: 3px solid #22c55e;
  border-radius: 12px;
  pointer-events: none;
}

.label {
  margin-top: 20px;
  margin-bottom: 6px;
  font-weight: 600;
  color: #374151;
  text-align: left;
}

.result-box {
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  min-height: 70px;
  background: #f9fafb;
  color: #111827;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.95rem;
  word-break: break-word;
  white-space: pre-wrap;
  text-align: left;
}

.status {
  margin-top: 12px;
  font-size: 0.85rem;
  color: #6b7280;
  min-height: 18px;
}

.hidden {
  display: none !important;
}
