:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #14171c;
  --border: #262b33;
  --text: #e8eaed;
  --text-dim: #8b92a0;
  --accent: #ff3b30;
  --accent-dim: #5c1a16;
  --ok: #2ecc71;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status.live .dot {
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.6);
  animation: pulse 1.6s infinite;
}

.status.live { color: var(--accent); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.session-code {
  margin: 22px 0 30px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

button.listen {
  width: 100%;
  padding: 18px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

button.listen:hover:not(:disabled) { background: #ff5147; }
button.listen:active:not(:disabled) { transform: scale(0.98); }

button.listen.playing { background: #2a2f38; border: 1px solid var(--border); }
button.listen.playing:hover { background: #333944; }

button.listen:disabled {
  background: var(--accent-dim);
  color: #9c6b68;
  cursor: not-allowed;
}

.meta {
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.debug {
  margin-top: 18px;
  font-size: 11px;
  color: #565d6b;
  font-family: "SF Mono", Consolas, monospace;
  white-space: pre-wrap;
  text-align: left;
  min-height: 14px;
}

.retry {
  margin-top: 14px;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  display: none;
}

.retry.visible { display: inline-block; }

/* TEMP DIAGNOSTIC (see receiver/app.js) - remove once the iPhone/Safari
   connection issue is understood; visible event log for debugging on
   devices without attached devtools. */
.msglog {
  margin-top: 14px;
  max-height: 160px;
  overflow-y: auto;
  font-size: 10px;
  line-height: 1.4;
  color: #454b57;
  font-family: "SF Mono", Consolas, monospace;
  white-space: pre-wrap;
  text-align: left;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}
