/* ---------------------------------------------------------------------------
   MEET-CERCLE — style global (lobby + salon)
--------------------------------------------------------------------------- */

:root {
  --bg: #0b0f17;
  --bg-elev: #111827;
  --bg-card: #151d2e;
  --border: #233047;
  --text: #e6ebf4;
  --muted: #8b98ad;
  --accent: #4f7cff;
  --accent-2: #22d3ee;
  --danger: #ef4444;
  --ok: #34d399;
  --radius: 14px;
}

.cm-header-unified{position:fixed;top:0;left:0;right:0;height:64px;display:flex;align-items:center;justify-content:space-between;padding:0 24px;z-index:100;background:rgba(8,12,20,0.92);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid rgba(255,255,255,0.08)}
.cm-header-unified .cm-logo{display:flex;align-items:center;gap:10px;color:#f8fafc;text-decoration:none;font-weight:700;letter-spacing:0.04em}
.cm-header-unified .cm-logo img{width:32px;height:32px}
.cm-nav-unified{display:flex;align-items:center;gap:18px}
.cm-nav-unified a{color:#e8eef6;text-decoration:none;font-weight:600;font-size:14px;opacity:0.92;padding:4px 2px;position:relative}
.cm-nav-unified a:hover,.cm-nav-unified a.active{color:#38bdf8;opacity:1}
.cm-nav-unified a.active::after{content:"";position:absolute;left:0;right:0;bottom:-6px;height:2px;background:#38bdf8;border-radius:2px}
@media(max-width:640px){.cm-header-unified{height:56px;padding:0 14px}.cm-nav-unified{gap:12px}.cm-nav-unified a{font-size:13px}}
body{padding-top:64px}
@media(max-width:640px){body{padding-top:56px}}
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100vh;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.error {
  color: #fca5a5;
  font-size: 0.9rem;
}

/* --- Barre supérieure ---------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(8, 12, 20, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
}
body { padding-top: 64px; }
@media (max-width: 640px){ body{ padding-top: 56px; } }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px rgba(79, 124, 255, 0.7);
}

.tagline {
  color: var(--muted);
  font-size: 0.85rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background: rgba(15, 23, 42, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.topnav a {
  font-size: 14px;
  font-weight: 600;
  color: #e8eef6;
  padding: 4px 2px;
  border: none;
  opacity: 0.92;
  text-decoration: none;
}
.topnav a:hover { color: #38bdf8; opacity:1; }
.topnav a.active { color: #38bdf8; opacity:1; position:relative; }
.topnav a.active::after{
  content:""; position:absolute; left:0; right:0; bottom:-6px; height:2px;
  border-radius:2px; background:#38bdf8;
}

/* --- Lobby ----------------------------------------------------------------- */

.lobby-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 24px 24px;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.15;
  margin: 0 0 14px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 28px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.actions-card {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.85rem;
  color: var(--muted);
}

input[type="text"] {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 1rem;
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--accent);
}

.btn {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.05s;
}

.btn:hover {
  border-color: var(--accent);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: linear-gradient(90deg, var(--accent), #3b5fd9);
  border: none;
  font-weight: 600;
}

.btn.wide {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.join-row {
  display: flex;
  gap: 10px;
}

.join-row input {
  flex: 1;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.feature-icon {
  display: block;
  color: var(--accent);
  margin-bottom: 12px;
}

.feature-icon svg {
  width: 26px;
  height: 26px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 28px 0 40px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* --- Salon ------------------------------------------------------------------ */

body.room {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.roombar {
  flex: 0 0 auto;
}

.room-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-code {
  font-family: ui-monospace, Consolas, monospace;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.9rem;
}

.mode-badge {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.mode-badge.p2p {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.4);
}

.mode-badge.sfu {
  color: var(--accent-2);
  border-color: rgba(34, 211, 238, 0.4);
}

.presence {
  color: var(--muted);
  font-size: 0.85rem;
}

.banner {
  background: rgba(79, 124, 255, 0.12);
  border-bottom: 1px solid rgba(79, 124, 255, 0.35);
  color: var(--text);
  text-align: center;
  padding: 9px 16px;
  font-size: 0.9rem;
}

.banner.error {
  background: rgba(239, 68, 68, 0.12);
  border-bottom-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.room-main {
  flex: 1;
  display: flex;
  min-height: 0;
}

.video-area {
  flex: 1;
  position: relative;
  padding: 16px;
  min-width: 0;
}

.video-grid {
  --cols: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 12px;
  height: 100%;
  align-content: stretch;
}

.tile {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 0;
}

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

.tile.local video {
  transform: scaleX(-1);
}

.tile-name {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.join-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(4px);
  z-index: 5;
}

.join-card {
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.join-card h2 {
  margin: 0;
}

.preview-box video {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 10px;
  object-fit: cover;
  transform: scaleX(-1);
}

.chat-panel {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--bg-card);
  min-height: 0;
}

.chat-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.92rem;
}

.chat-line b {
  color: var(--accent-2);
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.chat-form input {
  flex: 1;
}

.controls {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 12px 0 16px;
  border-top: 1px solid var(--border);
  background: rgba(11, 15, 23, 0.9);
}

.ctl {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ctl:hover {
  border-color: var(--accent);
}

.ctl.off {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
}

.ctl.danger {
  color: #fca5a5;
}

/* --- Responsive --------------------------------------------------------------- */

@media (max-width: 760px) {
  .chat-panel {
    display: none;
  }
  .tagline {
    display: none;
  }
}
