/* Screen Mirror — light theme aligned with Android app (CastBackground / TealAccent) */
:root {
  --primary: #00aaad;
  --primary-dim: #008b8e;
  --primary-container: #d6f5f5;
  --primary-glow: rgba(0, 170, 173, 0.18);
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-muted: #f0f2f5;
  --fg: #1a1a1a;
  --muted: #6b7280;
  --muted-dim: #9ca3af;
  --outline: #e5e7eb;
  --danger: #e53935;
  --danger-container: #fdecea;
  --shadow-sm: 0 1px 3px rgba(26, 26, 26, 0.06);
  --shadow-md: 0 8px 32px rgba(26, 26, 26, 0.08);
  --shadow-lg: 0 16px 48px rgba(0, 170, 173, 0.12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius-lg: 24px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* MirrorAtmosphere — matches Compose MirrorAtmosphere */
.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.atmosphere-base {
  position: absolute;
  inset: 0;
  background: var(--bg);
}

.atmosphere-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 42vh;
  background: linear-gradient(
    180deg,
    rgba(0, 170, 173, 0.10) 0%,
    rgba(0, 170, 173, 0.04) 45%,
    transparent 100%
  );
}

.atmosphere-orb {
  display: none;
}

.atmosphere-orb--a {
  width: 340px;
  height: 340px;
  top: -80px;
  right: -60px;
  background: rgba(0, 170, 173, 0.14);
}

.atmosphere-orb--b {
  width: 280px;
  height: 280px;
  bottom: 8%;
  left: -70px;
  background: rgba(0, 170, 173, 0.08);
}

.stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 40px 28px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 520px;
}

.glass-panel {
  width: 100%;
  padding: 36px 32px 32px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Hero — matches ScreenMirrorScreen 120dp teal circle */
.hero {
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  background: rgba(0, 170, 173, 0.15);
  border: 1px solid rgba(0, 170, 173, 0.12);
  box-shadow: var(--shadow-lg);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(0, 170, 173, 0.28);
  opacity: 0.45;
}

.hero.ready {
  background: var(--primary-container);
  border-color: rgba(0, 170, 173, 0.35);
}

.hero.ready::before { animation: none; opacity: 0; }

.hero.error {
  background: var(--danger-container);
  border-color: rgba(229, 57, 53, 0.25);
  box-shadow: 0 12px 40px rgba(229, 57, 53, 0.12);
}

.hero.error::before { animation: none; opacity: 0; }

.hero-icon {
  width: 52px;
  height: 52px;
  color: var(--primary);
  transition: color 0.35s ease;
}

.hero.error .hero-icon { color: var(--danger); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-dim);
  background: var(--primary-container);
  border: 1px solid rgba(0, 170, 173, 0.22);
}

.status-pill.ready {
  color: var(--primary-dim);
}

.status-pill.error {
  color: #c62828;
  background: var(--danger-container);
  border-color: rgba(229, 57, 53, 0.22);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.status-pill.ready .status-dot {
  animation: none;
  box-shadow: 0 0 0 3px rgba(0, 170, 173, 0.18);
}

.status-pill.error .status-dot {
  background: var(--danger);
  animation: none;
}

.mirror-title {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--fg);
}

.mirror-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
  max-width: 400px;
}

/* MirrorProgressBar */
.progress-track {
  width: 100%;
  max-width: 280px;
  height: 4px;
  margin: 22px auto 0;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 38%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), #33c4c7);
  animation: progress-slide 1.4s ease-in-out infinite;
}

.brand {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

.brand-mark {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

/* Full-screen loading shell (signaling player) */
.loading-shell {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.loading-shell.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-shell .card {
  padding: 0 20px;
}

@keyframes progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .status-dot,
  .progress-bar { animation: none; }
}
