* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.2);
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1f1f1f;
  --text: #ffffff;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --border: #27272a;
  --android: #3ddc84;
  --windows: #0078d4;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

#app {
  width: 100%;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* Landing page layout */
#landing {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

#landing section {
  margin-bottom: 4rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 0 2rem;
}

h1 {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.tagline {
  font-size: 1.5rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 500;
}

.hero .description {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 500px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.btn-large {
  font-size: 1.125rem;
  padding: 1rem 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-note {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-dim);
}

/* Buttons */
button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.875rem 1.75rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-icon {
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem;
  border-radius: 0.5rem;
}

.btn-icon:hover {
  background: var(--surface-hover);
}

/* Use Cases */
.use-cases {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.use-case {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.use-case-icon {
  font-size: 1.25rem;
}

/* Section Headings */
h2 {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--text);
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* How It Works */
.how-it-works {
  background: var(--surface);
  border-radius: 1.5rem;
  padding: 3rem 2rem;
  border: 1px solid var(--border);
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.step {
  text-align: center;
  flex: 1;
  min-width: 150px;
  max-width: 200px;
  position: relative;
}

.step-number {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  background: var(--bg);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.step h3 {
  color: var(--text);
}

.step p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.step-arrow {
  display: flex;
  align-items: center;
  color: var(--text-dim);
  padding-top: 2rem;
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: left;
  transition: all 0.2s ease;
}

.feature:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-glow);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 1rem;
}

.feature h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.feature p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Downloads */
.downloads {
  text-align: center;
}

.download-group {
  margin-bottom: 2rem;
}

.download-group h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.optional-badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.download-group-note {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.download-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  min-width: 180px;
}

.download-btn svg {
  flex-shrink: 0;
}

.download-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
}

.download-name {
  font-weight: 600;
}

.download-size {
  font-size: 0.75rem;
  opacity: 0.8;
}

.download-btn.android {
  background: var(--android);
  color: #0d3e2a;
}

.download-btn.android:hover {
  background: #2bc670;
  transform: translateY(-2px);
}

.download-btn.windows {
  background: var(--windows);
  color: white;
}

.download-btn.windows:hover {
  background: #106ebe;
  transform: translateY(-2px);
}

.download-btn.ios,
.download-btn.macos {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.download-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Sponsor/Ad Section (Google AdSense) */
.sponsor-section {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
  margin-bottom: 2rem;
  max-width: 728px;
  margin-left: auto;
  margin-right: auto;
}

.sponsor-section .adsbygoogle {
  width: 100%;
}

/* Footer */
.footer {
  text-align: center;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.875rem;
}

.footer-note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

/* QR Screen */
#qr-screen {
  max-width: 500px;
  margin: 0 auto;
  padding: 4rem 2rem;
  text-align: center;
}

#qr-container {
  background: white;
  padding: 1.5rem;
  border-radius: 1.5rem;
  display: inline-block;
  margin: 1.5rem 0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

#qr-code {
  display: block;
}

.room-id {
  font-family: monospace;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.room-id span {
  color: var(--primary);
  font-weight: 600;
}

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

/* Video Screen */
#video-screen {
  max-width: 100%;
}

#video-screen.active {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  max-width: none;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

#video-container {
  flex: 1;
  background: black;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

#remote-video {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

#no-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-muted);
}

#no-video .hint {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

#remote-video:not([src=""]):not([srcObject]) + #no-video,
#remote-video.has-stream + #no-video {
  display: none;
}

#controls {
  background: var(--surface);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-top: 1px solid var(--border);
}

#connection-status {
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--border);
}

#connection-status.connected {
  background: #065f46;
  color: #6ee7b7;
}

#connection-status.connecting {
  background: #78350f;
  color: #fcd34d;
}

/* Fullscreen */
#video-screen:fullscreen #controls,
#video-screen:-webkit-full-screen #controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 20, 20, 0.9);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#video-screen:fullscreen:hover #controls,
#video-screen:-webkit-full-screen:hover #controls {
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 2.75rem;
  }

  .tagline {
    font-size: 1.25rem;
  }

  .hero .description {
    font-size: 1rem;
  }

  #landing {
    padding: 1.5rem;
  }

  #landing section {
    margin-bottom: 3rem;
  }

  .use-cases {
    gap: 1rem;
  }

  .use-case {
    font-size: 0.8rem;
  }

  .how-it-works {
    padding: 2rem 1.5rem;
  }

  .steps {
    flex-direction: column;
    align-items: center;
  }

  .step {
    max-width: 250px;
  }

  .step-arrow {
    transform: rotate(90deg);
    padding: 0.5rem 0;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .download-btn {
    width: 100%;
    max-width: 280px;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2.25rem;
  }

  .btn-large {
    width: 100%;
    justify-content: center;
  }

  .use-cases {
    gap: 0.75rem;
  }

  .use-case {
    flex: 0 0 45%;
    justify-content: center;
  }
}
