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

:root {
  color-scheme: dark;
  --bg: #0a0a0f;
  --text: #e8e8ed;
  --muted: rgba(255, 255, 255, 0.35);
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-hover: rgba(255, 255, 255, 0.07);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  --primary: #256af4;
  --dash-bg: #101622;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 80vw;
  background: radial-gradient(circle, rgba(90, 120, 220, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.view {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  animation: fadeUp 0.6s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.selection-heading {
  text-align: center;
  font-weight: 300;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
  color: rgba(255, 255, 255, 0.7);
}

.selection-heading span {
  color: #fff;
  font-weight: 500;
}

.selection-sub {
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  letter-spacing: 0.02em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.cards > .card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: calc(50% - 0.625rem);
  justify-self: center;
}

@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  .cards > .card:last-child:nth-child(odd) { max-width: 100%; }
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  outline: none;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
  background: var(--card-hover);
  box-shadow: var(--shadow), 0 0 60px var(--glow);
}

.card-icon {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.card-title {
  font-weight: 500;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.card-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.5;
}

footer {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.04em;
}

/* Dashboard (Avatar) */

body.dashboard {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--dash-bg);
  color: #f3f4f6;
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}

body.dashboard::before {
  background: none;
}

.dashboard-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(16, 22, 34, 0.6);
  backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-btn {
  height: 36px;
  width: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(148, 163, 184, 0.1);
  color: rgba(148, 163, 184, 0.7);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--primary);
}

.topbar-title {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.7);
}

.topbar-title span {
  color: #fff;
  font-weight: 700;
}

.dashboard-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  overflow: hidden;
}

.stage {
  position: relative;
  background: #0a0f1a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
}

.stage-grid {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  pointer-events: none;
  background-image: radial-gradient(circle at 2px 2px, #256af4 1px, transparent 0);
  background-size: 40px 40px;
}

.stage-frame {
  position: relative;
  width: min(1200px, 90%);
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: #000;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.stage-video {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, rgba(37, 106, 244, 0.15), transparent 60%);
}

.video-container {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-placeholder {
  color: rgba(226, 232, 240, 0.7);
  font-size: 0.9rem;
}

.stage-live {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 0.5rem;
  z-index: 2;
}

.live-pill {
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.2s infinite;
}

.viewer-pill {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.viewer-pill .material-symbols-outlined {
  font-size: 14px;
}

.highlight-card {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 280px;
  background: rgba(99, 102, 241, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 1rem;
  transform: rotate(1deg);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.highlight-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.highlight-avatar {
  height: 32px;
  width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #facc15, #f97316);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.highlight-name {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.highlight-text {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.highlight-tag {
  position: absolute;
  bottom: -10px;
  left: -10px;
  background: #facc15;
  color: #111827;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  transform: rotate(-12deg);
}

.transcript {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  text-align: center;
  font-size: clamp(1.1rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.chat {
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(148, 163, 184, 0.2);
  background: #101622;
}

.chat-header {
  padding: 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.8);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.chat-list {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  padding: 1rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.chat-list::-webkit-scrollbar {
  width: 4px;
}

.chat-list::-webkit-scrollbar-thumb {
  background: #222f49;
  border-radius: 10px;
}

.chat-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.chat-name {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.chat-text {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.9);
}

.chat-input {
  padding: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-input input {
  flex: 1;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: #1f2937;
  color: #f8fafc;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
}

.chat-input input::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.chat-input button {
  background: transparent;
  border: none;
  color: var(--primary);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-input button .material-symbols-outlined {
  font-size: 22px;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@media (max-width: 980px) {
  .dashboard-main {
    grid-template-columns: 1fr;
  }

  .chat {
    height: 320px;
  }

  .stage-frame {
    width: 100%;
  }
}
