* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1115;
  color: #f0f0f0;
}

.gate {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.join-card {
  background: #1a1d24;
  padding: 2.5rem;
  border-radius: 12px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.join-card h1 { margin: 0; font-size: 1.5rem; }
.subtitle { margin: 0 0 0.5rem; color: #9aa0ac; font-size: 0.9rem; }

.join-card input {
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #2b2f3a;
  background: #0f1115;
  color: #f0f0f0;
  font-size: 1rem;
}

.join-card button {
  padding: 0.75rem;
  border-radius: 8px;
  border: none;
  background: #4f7cff;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
}

.join-card button:hover { background: #3d64e0; }

.error { color: #ff6b6b; font-size: 0.85rem; margin: 0; }

.room {
  height: 100%;
  display: flex;
}

.stream-pane {
  flex: 3;
  min-width: 0;
}

.call-pane {
  flex: 1;
  min-width: 260px;
  max-width: 340px;
  background: #14161c;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #22262f;
}

.call-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-bottom: 1px solid #22262f;
  font-size: 0.85rem;
  color: #9aa0ac;
}

.icon-btn {
  margin-left: auto;
  background: #22262f;
  border: none;
  color: #f0f0f0;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
}

.icon-btn.off { background: #5a2a2a; }

.video-grid {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  align-content: start;
}

.tile {
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

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

.tile .label {
  position: absolute;
  bottom: 4px;
  left: 6px;
  font-size: 0.75rem;
  background: rgba(0,0,0,0.5);
  padding: 2px 6px;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .room { flex-direction: column; }
  .stream-pane { flex: none; height: 45%; }
  .call-pane { flex: 1; max-width: none; border-left: none; border-top: 1px solid #22262f; }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}
