:root {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --accent: #EC4899;
  --bg: #0F0F1A;
  --surface: #1A1A2E;
  --surface2: #252540;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --border: #2D2D50;
  --success: #10B981;
  --warning: #F59E0B;
}

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

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- LANDING PAGE ---- */
.landing { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 0;
}
.logo { font-size: 1.4rem; font-weight: 700; }
.logo span { color: var(--primary); }

.hero {
  text-align: center;
  padding: 80px 0 60px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}
.hero h1 em { color: var(--primary); font-style: normal; }
.hero p {
  font-size: 1.2rem; color: var(--text-muted);
  max-width: 600px; margin: 0 auto 40px;
  line-height: 1.7;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 12px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary); color: white;
}
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; transform: translateY(-1px); }

.btn-outline {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.btn-slack {
  background: #4A154B; color: white; font-size: 1.1rem; padding: 16px 36px;
}
.btn-slack:hover { background: #3b1040; text-decoration: none; }

.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px; margin: 60px 0;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px;
}
.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); line-height: 1.6; font-size: 0.95rem; }

.pricing {
  text-align: center; padding: 60px 0;
}
.pricing h2 { font-size: 2rem; margin-bottom: 12px; }
.pricing .subtitle { color: var(--text-muted); margin-bottom: 48px; }

.pricing-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; max-width: 700px; margin: 0 auto;
}
.pricing-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 36px 28px; position: relative;
}
.pricing-card.featured {
  border-color: var(--primary);
  background: linear-gradient(135deg, #1A1A2E, #1e1b4b);
}
.badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: white;
  padding: 4px 16px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
}
.price { font-size: 3rem; font-weight: 800; margin: 16px 0 4px; }
.price sub { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.price .unit { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 24px; display: block; }
.pricing-card ul { list-style: none; text-align: left; margin-bottom: 28px; }
.pricing-card ul li {
  padding: 8px 0; color: var(--text-muted); font-size: 0.95rem;
  display: flex; gap: 10px; align-items: flex-start;
}
.pricing-card ul li::before { content: '✓'; color: var(--success); flex-shrink: 0; }

.how-it-works { padding: 60px 0; }
.how-it-works h2 { text-align: center; font-size: 2rem; margin-bottom: 48px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.step { text-align: center; }
.step-num {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; margin: 0 auto 16px;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

footer {
  text-align: center; padding: 40px 24px;
  color: var(--text-muted); border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

/* ---- PLAYER PAGE ---- */
.player-layout {
  display: grid; grid-template-columns: 1fr 360px;
  height: 100vh; overflow: hidden;
}
@media (max-width: 768px) {
  .player-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
}

.player-main {
  display: flex; flex-direction: column;
  background: #000;
}

.player-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.player-header .logo { font-size: 1.1rem; }
.ws-name { color: var(--text-muted); font-size: 0.9rem; }

.video-wrapper {
  flex: 1; position: relative; background: #000;
}
.video-wrapper iframe {
  width: 100%; height: 100%;
  border: none; display: block;
}
.empty-state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-muted); text-align: center; padding: 40px;
}
.empty-state .icon { font-size: 4rem; margin-bottom: 20px; }
.empty-state h3 { font-size: 1.4rem; color: var(--text); margin-bottom: 12px; }
.empty-state p { font-size: 1rem; max-width: 400px; line-height: 1.6; }

.player-controls {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; background: var(--surface);
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.now-playing { flex: 1; min-width: 0; }
.now-playing .track-title {
  font-weight: 600; font-size: 0.95rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.now-playing .track-sub { color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }

.btn-skip {
  flex-shrink: 0; background: var(--surface2);
  border: 1px solid var(--border); color: var(--text);
  padding: 8px 18px; border-radius: 8px;
  cursor: pointer; font-size: 0.9rem; transition: background 0.15s;
}
.btn-skip:hover { background: var(--border); }

/* Sidebar */
.player-sidebar {
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-weight: 600; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
}
.queue-count {
  background: var(--primary); color: white;
  padding: 2px 10px; border-radius: 999px; font-size: 0.8rem;
}
.queue-list { flex: 1; overflow-y: auto; }
.queue-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.queue-item:hover { background: var(--surface2); }
.queue-item.active { background: #1e1b4b; border-left: 3px solid var(--primary); }
.queue-thumb {
  width: 56px; height: 42px; object-fit: cover;
  border-radius: 6px; flex-shrink: 0;
}
.queue-info { flex: 1; min-width: 0; }
.queue-title {
  font-size: 0.85rem; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.queue-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 3px; }

.user-count-badge {
  font-size: 0.8rem; color: var(--text-muted); padding: 8px 16px;
  border-top: 1px solid var(--border); flex-shrink: 0;
}

/* ---- SETUP PAGE ---- */
.setup-container {
  max-width: 560px; margin: 60px auto; padding: 0 24px;
}
.setup-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 40px;
}
.setup-card h1 { font-size: 1.6rem; margin-bottom: 8px; }
.setup-card .desc { color: var(--text-muted); margin-bottom: 32px; line-height: 1.6; }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 0.9rem; font-weight: 500;
  margin-bottom: 8px; color: var(--text-muted);
}
.form-group select, .form-group input {
  width: 100%; padding: 10px 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 0.95rem;
  outline: none;
}
.form-group select:focus, .form-group input:focus {
  border-color: var(--primary);
}

.billing-info {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin: 24px 0;
}
.billing-info h3 { font-size: 1rem; margin-bottom: 12px; }
.billing-row {
  display: flex; justify-content: space-between;
  font-size: 0.9rem; padding: 6px 0; color: var(--text-muted);
}
.billing-row span:last-child { color: var(--text); font-weight: 500; }

.alert {
  padding: 12px 16px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 16px;
}
.alert-success { background: #064e3b; border: 1px solid #10b981; color: #6ee7b7; }
.alert-warning { background: #451a03; border: 1px solid #f59e0b; color: #fcd34d; }
.alert-error { background: #450a0a; border: 1px solid #ef4444; color: #fca5a5; }

.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: white;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.conn-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.conn-dot.connected { background: var(--success); }
.conn-dot.disconnected { background: var(--warning); }
