/* TV onboarding — dark theme, matches the kids' app palette. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #0e0e10;
  color: #f1f1f1;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

.tv-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.tv-card {
  max-width: 1200px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.tv-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tv-title {
  margin: 0;
  font-size: 4rem;
  font-weight: 700;
  line-height: 1.05;
  color: #f1f1f1;
}

.tv-subtitle {
  margin: 0;
  font-size: 1.5rem;
  color: #a1a1a8;
  max-width: 32ch;
  line-height: 1.4;
}

.tv-subtitle .uri {
  color: #ff3e3e;
  font-weight: 600;
  word-break: break-all;
}

.code-block {
  margin-top: 24px;
  padding: 24px 32px;
  border-radius: 16px;
  background: #1a1a1d;
  border: 1px solid #2c2c30;
  text-align: center;
}

.code-label {
  display: block;
  font-size: 1rem;
  color: #a1a1a8;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #f1f1f1;
  word-spacing: 0.2em;
  white-space: nowrap;
}

.status-line {
  margin-top: 24px;
  font-size: 1.2rem;
  color: #a1a1a8;
  min-height: 1.5em;
}

.status-line.success { color: #4ade80; }
.status-line.error { color: #ff3e3e; }

.qr-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.qr-card {
  padding: 24px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.qr-card canvas,
.qr-card img {
  display: block;
  width: 400px;
  height: 400px;
  image-rendering: pixelated;
}

.qr-hint {
  font-size: 1rem;
  color: #6f6f76;
}

.retry-btn {
  margin-top: 24px;
  display: none;
  background: #ff3e3e;
  color: #fff;
  border: 0;
  padding: 16px 32px;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
}

.retry-btn:hover, .retry-btn:focus-visible {
  background: #c72e2e;
  outline: 4px solid #ff3e3e;
  outline-offset: 4px;
}

.retry-btn.show { display: inline-block; }

.spinner-dots {
  display: inline-block;
  width: 1em;
}
.spinner-dots::after {
  content: "";
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
  100% { content: ""; }
}

@media (max-width: 1024px) {
  .tv-card { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .tv-text { align-items: center; }
  .tv-subtitle { max-width: none; }
  .tv-title { font-size: 3rem; }
}

@media (max-width: 640px) {
  .tv-wrap { padding: 24px; }
  .tv-title { font-size: 2.4rem; }
  .tv-subtitle { font-size: 1.1rem; }
  .user-code { font-size: 2.2rem; letter-spacing: 0.12em; }
  .qr-card canvas, .qr-card img { width: 280px; height: 280px; }
}
