/* Beam receiver — minimal dark UI for car/TV browsers.
   Big readable text: car displays are viewed from a distance. */

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

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #f2f2f2;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* Full-viewport video, letterboxed */
#video {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Park-safety notice: compact corner chip that never covers the video */
#safety-banner {
  position: fixed;
  left: calc(env(safe-area-inset-left, 0px) + 16px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(12, 12, 12, 0.72);
  border: 1px solid rgba(255, 176, 58, 0.45);
  border-radius: 999px;
  color: #ffc98f;
  font-size: clamp(12px, 1.4vw, 16px);
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
}

#safety-banner .safety-icon {
  color: #ffb03a;
}

/* Shared overlay layout (code entry + status) */
.overlay {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.78);
  padding: calc(env(safe-area-inset-top, 0px) + 24px)
    calc(env(safe-area-inset-right, 0px) + 24px)
    calc(env(safe-area-inset-bottom, 0px) + 24px)
    calc(env(safe-area-inset-left, 0px) + 24px);
}

.brand {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #4da3ff;
}

#code-label,
#status-text {
  font-size: clamp(22px, 3.5vw, 40px);
  font-weight: 500;
  max-width: 28em;
  line-height: 1.4;
}

/* Code entry */
#code-input {
  width: min(9em, 80vw);
  padding: 14px 18px;
  border: 2px solid #3a3a3a;
  border-radius: 12px;
  background: #161616;
  color: #fff;
  font-family: "SF Mono", "Cascadia Mono", Consolas, Menlo, monospace;
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: 0.35em;
  text-align: center;
  text-transform: uppercase;
  outline: none;
}

#code-input:focus {
  border-color: #4da3ff;
}

#code-input::placeholder {
  color: #4a4a4a;
}

button {
  border: 0;
  border-radius: 12px;
  background: #2f6fed;
  color: #fff;
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 600;
  padding: 14px 40px;
  cursor: pointer;
}

button:active {
  background: #275cc4;
}

.error-text {
  color: #ff8a80;
  font-size: clamp(18px, 2.8vw, 28px);
  max-width: 28em;
  line-height: 1.4;
}

/* Status overlay */
#status-overlay.state-error #status-text {
  color: #ff8a80;
}

.spinner {
  width: clamp(40px, 6vw, 64px);
  height: clamp(40px, 6vw, 64px);
  border: 5px solid #333;
  border-top-color: #4da3ff;
  border-radius: 50%;
  animation: beam-spin 0.9s linear infinite;
}

@keyframes beam-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Tap-to-unmute hint */
#unmute-hint {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  z-index: 30;
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: clamp(18px, 2.8vw, 28px);
  color: #fff;
}

/* Fullscreen button */
#fullscreen-btn {
  position: fixed;
  right: calc(env(safe-area-inset-right, 0px) + 20px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  z-index: 30;
  width: clamp(56px, 8vw, 80px);
  height: clamp(56px, 8vw, 80px);
  padding: 0;
  border-radius: 16px;
  background: rgba(20, 20, 20, 0.75);
  border: 1px solid #3a3a3a;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1;
}

#fullscreen-btn:active {
  background: rgba(60, 60, 60, 0.75);
}
