@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;700;800&display=swap');

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

:root {
  --bg:      #0a0a0f;
  --surface: #13131a;
  --border:  #2a2a3a;
  --accent:  #00ff88;
  --accent2: #ff3366;
  --text:    #e8e8f0;
  --muted:   #6b6b8a;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
}
.logo span { color: var(--accent); }

.status-pill {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  padding: 5px 14px;
  border-radius: 99px;
  letter-spacing: 0.05em;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.status-pill.idle     { background: rgba(107,107,138,0.15); color: var(--muted);   border: 1px solid var(--border); }
.status-pill.waiting  { background: rgba(255,180,0,0.10);   color: #ffb400;        border: 1px solid rgba(255,180,0,0.3); }
.status-pill.chatting { background: rgba(0,255,136,0.10);   color: var(--accent);  border: 1px solid rgba(0,255,136,0.3); }

.online-count {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  padding: 5px 14px;
  border-radius: 99px;
  letter-spacing: 0.05em;
  background: rgba(33, 72, 24, 0.796);
  color: #38f658;
  border: 1px solid #38f658;
}

.chat-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.videos-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 61px - 72px);
}

.video-box {
  position: relative;
  background: #07070d;
  overflow: hidden;
}

.video-box:first-child {
  border-right: 1px solid var(--border);
}

.video-box::after {
  content: attr(data-label);
  position: absolute;
  bottom: 14px;
  left: 14px;
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  padding: 4px 10px;
  background: rgba(0,0,0,0.55);
  border-radius: 4px;
  color: var(--muted);
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 2;
}

.video-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.4s;
}

.video-box video {
  transform: scaleX(-1);
}
.placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #07070d;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  z-index: 1;
}

.placeholder .icon {
  font-size: 2.8rem;
  opacity: 0.28;
}

.placeholder.hidden {
  display: none;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.controls {
  height: 72px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 24px;
  flex-shrink: 0;
}

.btn {
  cursor: pointer;
  padding: 11px 36px;
  border-radius: 6px;
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: none;
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-skip {
  background: var(--accent2);
  color: #fff;
  box-shadow: 0 0 20px rgba(255,51,102,0.2);
}
.btn-skip:hover {
  box-shadow: 0 0 36px rgba(255,51,102,0.45);
}

#toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 9px 20px;
  border-radius: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.28s, transform 0.28s;
  pointer-events: none;
  z-index: 999;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
  .videos-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    height: calc(100vh - 61px - 72px);
  }
  .video-box:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}