:root {
  --bg: #0e1320;
  --bg-2: #161d2e;
  --card: #1b2438;
  --line: #2a3650;
  --txt: #e8edf7;
  --txt-dim: #8b97b3;
  --accent: #2dd4a7;
  --accent-2: #3b82f6;
  --danger: #f25c6a;
  --warn: #f2b94c;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(59,130,246,.12), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(45,212,167,.10), transparent 55%),
    var(--bg);
  color: var(--txt);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 520px; margin: 0 auto; padding: 20px 18px 90px; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; position: sticky; top: 0; z-index: 10;
  background: rgba(14,19,32,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.3px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 12px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.brand b { font-family: 'Sora', sans-serif; font-size: 17px; }
.rol-tag { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; }
.rol-padre { background: rgba(59,130,246,.18); color: #8fb6ff; }
.rol-hijo  { background: rgba(45,212,167,.18); color: #6ee7c2; }

/* Cards */
.card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card h2 { font-family: 'Sora', sans-serif; font-size: 20px; margin-bottom: 6px; letter-spacing: -.4px; }
.card p.sub { color: var(--txt-dim); font-size: 14px; margin-bottom: 18px; line-height: 1.5; }

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--txt-dim); margin: 14px 0 6px; }
input, select {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #0f1626; color: var(--txt);
  font-size: 15px; outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(59,130,246,.18); }

.btn {
  width: 100%; padding: 14px; border: none; border-radius: 12px; cursor: pointer;
  font-size: 15px; font-weight: 700; font-family: 'Sora', sans-serif;
  margin-top: 18px; transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #1fae89); color: #04201a; }
.btn-blue { background: linear-gradient(135deg, var(--accent-2), #2563eb); color: #fff; }
.btn-danger { background: linear-gradient(135deg, var(--danger), #d63f4e); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--txt-dim); }
.btn:disabled { filter: grayscale(.6) brightness(.7); cursor: not-allowed; }

.switch-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--txt-dim); }
.switch-link a { color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: none; }

.msg { padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-top: 14px; display: none; }
.msg.error { background: rgba(242,92,106,.14); color: #ffa7b0; display: block; }
.msg.ok { background: rgba(45,212,167,.14); color: #6ee7c2; display: block; }
.msg.info { background: rgba(242,185,76,.12); color: #f2cf8f; display: block; }

/* Video */
.video-box {
  position: relative; width: 100%; aspect-ratio: 3/4; background: #05080f;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
}
.video-box video { width: 100%; height: 100%; object-fit: cover; background: #05080f; }
.video-badge {
  position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 7px;
  background: rgba(0,0,0,.55); padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.video-badge .rec { width: 9px; height: 9px; border-radius: 50%; background: var(--danger);
  animation: pulse 1.2s infinite; }
.video-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px; color: var(--txt-dim); font-size: 14px; text-align: center; padding: 20px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.controls { display: flex; gap: 10px; margin-top: 14px; }
.controls .btn { margin-top: 0; }

/* Lista de salas */
.sala-item {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: #0f1626; border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 10px; cursor: pointer; transition: border .15s, transform .08s;
}
.sala-item:active { transform: scale(.99); }
.sala-item:hover { border-color: var(--accent-2); }
.sala-ico { width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
  background: rgba(45,212,167,.15); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.sala-info { flex: 1; min-width: 0; }
.sala-info b { display: block; font-size: 15px; }
.sala-info span { font-size: 12px; color: var(--txt-dim); }
.live-pill { font-size: 10px; font-weight: 800; padding: 4px 8px; border-radius: 999px;
  background: rgba(242,92,106,.18); color: #ff9aa3; letter-spacing: .5px; }

.empty { text-align: center; padding: 40px 20px; color: var(--txt-dim); }
.empty .big { font-size: 38px; margin-bottom: 10px; }

.hidden { display: none !important; }

/* Install hint */
.install-hint {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; font-size: 13px; box-shadow: var(--shadow);
  display: flex; gap: 12px; align-items: center; max-width: 460px; width: calc(100% - 36px);
}
.install-hint button { background: var(--accent); color: #04201a; border: none; padding: 8px 14px;
  border-radius: 8px; font-weight: 700; cursor: pointer; white-space: nowrap; }
