:root {
  --bg: #101827;
  --panel: #17223a;
  --panel-soft: #1f2e4c;
  --text: #f8fafc;
  --muted: #b7c0cf;
  --accent: #f6c344;
  --accent-dark: #7a5200;
  --danger: #ff6b6b;
  --radius: 26px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: radial-gradient(circle at top, #26395f 0%, var(--bg) 48%, #070b13 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100dvh;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  display: flex;
  align-items: stretch;
}

.screen {
  display: none;
  width: 100%;
  min-height: calc(100dvh - 36px);
}

.screen.is-active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.brand-block,
.player-card,
.scanner-card,
.manual-entry {
  background: rgba(23, 34, 58, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand-block,
.player-card {
  padding: 26px;
}

.eyebrow,
.pill {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(246, 195, 68, 0.14);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pill-error {
  background: rgba(255, 107, 107, 0.16);
  color: var(--danger);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.intro,
.question {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.question {
  font-size: clamp(1.25rem, 4.6vw, 1.7rem);
  color: var(--text);
}

.scanner-card {
  position: relative;
  overflow: hidden;
  min-height: 310px;
  display: grid;
  place-items: center;
}

#scanner-video {
  width: 100%;
  height: 100%;
  min-height: 310px;
  object-fit: cover;
  background: #050814;
}

.status {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 12px 14px;
  text-align: center;
}

.scanner-card .status {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  backdrop-filter: blur(10px);
}

.status-large {
  margin: 22px 0;
  font-size: 1.05rem;
}

.actions {
  display: flex;
  gap: 12px;
}

.actions.stacked {
  flex-direction: column;
}

.button {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 15px 18px;
  cursor: pointer;
  font-weight: 800;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-primary {
  background: var(--accent);
  color: #151000;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.button-large {
  min-height: 68px;
  font-size: 1.12rem;
}

.manual-entry {
  padding: 16px 18px;
  color: var(--muted);
}

.manual-entry summary {
  cursor: pointer;
  font-weight: 700;
}

.manual-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.manual-row input {
  min-width: 0;
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 15px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.manual-row .button {
  width: auto;
}

.error-card {
  margin: auto 0;
}

@media (max-height: 720px) {
  .brand-block,
  .player-card {
    padding: 20px;
  }

  .intro,
  .question {
    margin-top: 12px;
  }

  .scanner-card,
  #scanner-video {
    min-height: 250px;
  }
}
