:root {
  --bg: #0f172a;
  --card: #1e293b;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --danger: #f87171;
  --text: #e2e8f0;
  --muted: #94a3b8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.card {
  background: var(--card);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  width: 90%;
  max-width: 420px;
  text-align: center;
}

h1 {
  margin-top: 0;
  font-size: 1.6rem;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: var(--text);
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: 0.3em;
  margin-bottom: 1rem;
}

button {
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #0f172a;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: background 0.15s ease;
}

button:hover { background: var(--accent-hover); }

button.danger {
  background: var(--danger);
  color: #1e293b;
}

.hidden { display: none !important; }

.error {
  color: var(--danger);
  min-height: 1.2em;
  font-size: 0.9rem;
}

.status {
  font-weight: 600;
  color: #4ade80;
  margin-bottom: 0.5rem;
}

.mono {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-all;
}

#viewer-url {
  display: block;
  word-break: break-all;
  color: var(--accent);
  margin-bottom: 1rem;
}

#qr-code {
  width: 220px;
  height: 220px;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}

#camera-preview {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  background: #000;
  margin: 1rem 0;
  transform: scaleX(-1); /* mirror front camera, feels natural for the coach */
}

.camera-row {
  display: flex;
  gap: 0.75rem;
}

.camera-row button {
  margin-bottom: 1rem;
}

#remote-video {
  width: 100%;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
  border-radius: 12px;
  margin: 1rem 0;
}

/* Developer diagnostics dashboard (Milestone 2E) - additive only, does not
   affect any existing page's layout. */
.dev-dashboard-body {
  align-items: flex-start;
  padding: 2rem 1rem;
}

.dev-dashboard {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.dev-dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dev-dashboard-header h1 {
  margin: 0;
}

.dev-dashboard-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dev-dashboard-controls button {
  width: auto;
  padding: 0.6rem 1.2rem;
  margin-bottom: 0;
}

.auto-refresh-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.auto-refresh-label input {
  width: auto;
  margin-bottom: 0;
}

.dev-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.dev-card {
  max-width: 100%;
  width: auto;
  text-align: left;
}

.dev-card h2 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--accent);
}

.dev-card p {
  margin: 0.4rem 0;
  font-size: 0.9rem;
  word-break: break-word;
}

.dev-card ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.8rem;
  color: var(--muted);
  max-height: 150px;
  overflow-y: auto;
}
