/* ===== Base / Theme ===== */
* { margin:0; padding:0; box-sizing:border-box; }
:root{
  --bg:#000; --panel:#0a0a0a; --text:#fff; --muted:#b0b0b0;
  --line:rgba(0,245,255,.22); --brand:#00f5ff; --brand-soft:rgba(0,245,255,.08);
}
html,body{ height:100%; }
body{
  background:
    radial-gradient(700px 380px at 18% 18%, rgba(0,245,255,.045), transparent),
    radial-gradient(780px 420px at 82% 85%, rgba(0,140,255,.04), transparent),
    #020303;
  color:var(--text);
  font-family:'JetBrains Mono', monospace;
}

/* ===== Topbar ===== */
.status-bar{
  position:fixed; inset:0 0 auto 0; height:48px; z-index:30;
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 16px; background:rgba(10,10,10,.8); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line); color:var(--brand); font-size:12px;
}
.status-bar .ghost{
  background:none; border:1px solid var(--line); color:var(--brand);
  padding:6px 10px; border-radius:8px; cursor:pointer;
}
.status-bar .ghost:hover{ background:var(--brand-soft); }
.brand{ font-weight:700; letter-spacing:.4px; }

/* ===== Landing (Hero + Features) ===== */
.page-home .container{ min-height:100dvh; padding:60px 16px 40px; }
.hero-wrap{ display:grid; gap:18px; max-width:1040px; margin:0 auto; }
.hero{ text-align:center; padding-top:32px; }

.grad-text{
  font-size:clamp(26px, 3.6vw, 42px);
  background:linear-gradient(90deg, #00f5ff, #41e2ff, #00ffd1);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  letter-spacing:.2px; margin-bottom:8px;
}
.sub{ color:var(--muted); margin-bottom:16px; line-height:1.5; max-width:760px; margin-inline:auto; }
.buttons{ display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }
.btn, .btn-primary{
  padding:10px 16px; border-radius:10px; cursor:pointer; font-size:14px; letter-spacing:.4px;
  border:1px solid var(--line); background:rgba(16,16,16,.65); color:#fff; transition:.2s;
}
.btn:hover{ background:var(--brand-soft); box-shadow:0 0 0 1px var(--brand); }
.btn-primary{
  background:linear-gradient(180deg, #00f5ff, #00d1c7); color:#001014;
  border:1px solid rgba(0,0,0,.25); font-weight:700;
}
.small{ margin-top:6px; color:var(--muted); font-size:12px; }

/* === Feature cards (4 on desktop, 2 on tablet, 1 on mobile) === */
.features{
  display:grid;
  gap:12px;
  grid-template-columns: repeat(4, 1fr);
  margin:18px auto 0;
  max-width:1100px;
  align-items:start;
}
@media (max-width: 1100px){
  .features{ grid-template-columns: repeat(2, 1fr); max-width:820px; }
}
@media (max-width: 700px){
  .features{ grid-template-columns: 1fr; max-width:560px; }
}

.feature{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:10px;
  padding:12px;
  text-align:center;
  display:grid;
  gap:6px;
  min-height:auto;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.feature:hover{
  transform: translateY(-6px);
  border-color: var(--brand);
  box-shadow:0 0 12px rgba(0,245,255,.18);
}

.f-ico{ font-size:16px; line-height:1; }
.feature h3{ margin:2px 0; font-size:13.5px; }
.feature p{ color:var(--muted); font-size:12px; line-height:1.4; }

/* extra-tight on huge monitors */
@media (min-width: 1400px){
  .feature{ padding:10px; }
  .feature h3{ font-size:13px; }
  .feature p{ font-size:11.5px; }
  .f-ico{ font-size:15px; }
}

/* ===== Desktop-only: Center Hero, cards below ===== */
@media (min-width: 1024px) {
  .page-home .container {
    min-height: auto;
    padding-top: 72px;
    padding-bottom: 48px;
  }
  .hero-wrap {
    max-width: 1100px;
    margin: 0 auto;
  }
  .hero {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(60vh - 48px);
    text-align: center;
  }
  .grad-text { margin-bottom: 10px; }
  .sub { margin-bottom: 18px; }
  .buttons { margin-bottom: 8px; }
  .small { margin-top: 6px; }
  .features { margin-top: 28px; max-width: 1100px; }
}

/* ===== Modals ===== */
.modal{
  display:none; position:fixed; inset:0; background:rgba(0,0,0,.9);
  z-index:100; align-items:center; justify-content:center; padding:18px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn{ from{ opacity:0 } to{ opacity:1 } }
.modal-content{
  background:var(--panel); border:1px solid var(--line); color:var(--text);
  width:min(440px,92vw); border-radius:12px; padding:22px; text-align:center;
  box-shadow:0 10px 30px rgba(0,0,0,.45);
}
.modal-content h2{ font-size:18px; margin-bottom:10px; }
.field{ margin:10px 0 0; }
.field input{
  width:100%; padding:12px 12px; border-radius:10px; border:1px solid var(--line);
  background:#060606; color:var(--text); letter-spacing:.12em; outline:none;
}
.modal-buttons{ display:flex; gap:10px; margin-top:16px; flex-wrap:wrap; }
.modal-buttons button{
  flex:1; min-width:120px; padding:10px 12px; border-radius:10px; cursor:pointer;
  border:1px solid var(--line); background:var(--brand-soft); color:var(--brand);
}
.modal-buttons .primary{ background:var(--brand); color:#000; border-color:transparent; }
.code{
  font-size:26px; margin:14px 0; letter-spacing:2px; color:var(--brand); user-select:all;
}

/* ===== Room Layout ===== */
.room-stage{
  position:fixed; inset:48px 0 0 0;
  display:grid; gap:10px; padding:10px;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px){ .room-stage{ grid-template-columns:1fr; } }

.video-box{
  position:relative; background:#000; border:1px solid var(--line);
  border-radius:12px; overflow:hidden; min-height: min(48vh, 62dvh);
}
.video-box video{
  width:100%; height:100%; display:block; object-fit:cover; background:#000;
}

/* Connected glow */
.video-box.connected{ box-shadow:0 0 0 1.5px var(--brand); transition: box-shadow .25s; }

/* Overlays on video */
.v-label{
  position:absolute; top:10px; left:10px; z-index:2;
  font-size:12px; color:rgba(255,255,255,.75);
  background:rgba(0,0,0,.55); border:1px solid var(--line);
  padding:4px 8px; border-radius:8px; letter-spacing:.4px;
}
.v-action{
  position:absolute; z-index:3; width:40px; height:40px;
  display:grid; place-items:center; cursor:pointer; border-radius:10px;
  background:rgba(16,16,16,.65); border:1px solid var(--line); color:#fff;
  opacity:0; transform: translateY(8px); transition:opacity .2s, transform .2s;
}
.video-box:hover .v-action{ opacity:1; transform:none; }
.v-action.expand{ top:10px; right:10px; }
.v-action.swap{ top:10px; right:58px; }
.v-action:hover{ background:var(--brand-soft); box-shadow:0 0 0 1px var(--brand); }

/* Tile fullscreen */
body.fullscreen-you .room-stage,
body.fullscreen-them .room-stage{ grid-template-columns:1fr; }
body.fullscreen-you #themBox,
body.fullscreen-them #youBox{ display:none; }

/* Call controls */
.controls{
  position:fixed; bottom:16px; right:16px; z-index:35;
  display:flex; gap:8px; opacity:.9; transition:opacity .2s;
}
.controls:hover{ opacity:1; }
.controls button{
  width:40px; height:40px; border-radius:10px;
  border:1px solid var(--line); background:rgba(16,16,16,.65); color:#fff; cursor:pointer;
}
.controls button:hover{ background:var(--brand-soft); box-shadow:0 0 0 1px var(--brand); }

/* Approval popup */
.popup{
  position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); z-index:40;
  background:var(--panel); color:var(--text); border:1px solid var(--line);
  width:min(360px,92vw); padding:16px; border-radius:12px; text-align:center;
}
.popup button{
  margin:0 8px; padding:10px 12px; border:1px solid var(--line);
  background:var(--brand-soft); color:var(--brand); cursor:pointer; border-radius:10px;
}
.popup button:hover{ background:rgba(0,245,255,.14); }
