:root {
  font-family: Arial, sans-serif;
  background: radial-gradient(circle at top, #1e293b, #020617);
  color: #0f172a;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.scan-shell {
  width: min(920px, calc(100vw - 28px));
}

.card {
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

h1 {
  margin: 0 0 8px;
  font-size: 34px;
}

p {
  color: #64748b;
}

input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 13px 14px;
  margin: 10px 0;
  font-size: 16px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.camera-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 20px;
  background: #020617;
}

.scan-card {
  position: fixed;
  inset: 0;
  background: #020617;
  color: #fff;
  overflow: hidden;
}

.scan-card .camera-box {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
}

.scan-card .instruction,
.scan-card .result,
.scan-card .actions {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  z-index: 2;
}

.scan-card .instruction {
  top: max(14px, env(safe-area-inset-top));
  margin: 0;
  text-align: center;
  background: rgba(239, 246, 255, 0.92);
}

.scan-card .result {
  bottom: calc(82px + env(safe-area-inset-bottom));
  margin: 0;
  background: rgba(220, 252, 231, 0.95);
}

.scan-card .actions {
  bottom: max(16px, env(safe-area-inset-bottom));
}

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

.instruction,
.result {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 800;
}

.instruction {
  background: #eff6ff;
  color: #1d4ed8;
}

.result {
  background: #dcfce7;
  color: #166534;
  font-size: 22px;
}

.result strong,
.result span,
.result small {
  display: block;
}

.result small {
  margin-top: 5px;
  font-size: 14px;
  color: #15803d;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.hidden {
  display: none;
}

@media (max-width: 720px) {
  .scan-shell {
    width: 100vw;
  }

  .card {
    width: calc(100vw - 32px);
    border-radius: 16px;
    padding: 16px;
  }

  h1 {
    font-size: 26px;
  }

  .scan-card .instruction {
    font-size: 15px;
  }

  .scan-card .result {
    font-size: 18px;
  }

  .scan-card .actions button {
    flex: 1;
  }
}
