* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0d0f12;
  color: #f2f2f2;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Segoe UI", Roboto, sans-serif;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 16px 20px;
  border-bottom: 1px solid #2a2d33;
}

.app-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.screen-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.screen[hidden] {
  display: none;
}

.card {
  width: 100%;
  max-width: 360px;
  background: #17191d;
  border: 1px solid #2a2d33;
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
}

.card p {
  line-height: 1.6;
  font-size: 15px;
  color: #d7d9dc;
}

.card-warning {
  border-color: #6b3b1f;
  background: #1f1712;
}

.warning-title {
  font-weight: 700;
  font-size: 16px;
  color: #ffb15e;
  margin-top: 0;
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 12px 16px;
  margin-top: 12px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: #3d8bfd;
  color: #fff;
}

.btn-primary:active {
  background: #2f6fd1;
}

.camera-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}

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

.scan-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 65%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(61, 139, 253, 0.9);
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

.hint {
  margin-top: 16px;
  color: #a9adb3;
  font-size: 14px;
}

.result-title {
  font-weight: 700;
  font-size: 16px;
  color: #f2f2f2;
  margin-top: 0;
}

.result-text {
  white-space: pre-wrap;
  word-break: break-all;
  text-align: left;
  background: #0d0f12;
  border: 1px solid #2a2d33;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  color: #7ee787;
  max-height: 240px;
  overflow: auto;
}
