/* Sala DANIA — marca: negro #0A0A0A, naranja #F47B3F. Sin frameworks. */
:root {
  --void: #0A0A0A;
  --warm: #F47B3F;
  --cream: #F5EFE6;
  --panel: #161616;
  --line: #2A2A2A;
  --muted: #9A9A9A;
  --danger: #E5484D;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--void); color: var(--cream); font-family: 'Instrument Sans', system-ui, sans-serif; }
body { display: flex; flex-direction: column; min-height: 100dvh; }
[hidden] { display: none !important; }
h1, h2 { font-family: 'Syne', sans-serif; margin: 0 0 8px; }
h1 { font-size: 24px; }
h2 { font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 16px; }
.muted { color: var(--muted); }

.top { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.logo { height: 22px; }
.topic { flex: 1; font-family: 'Syne', sans-serif; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.rec .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }

.screen { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.card.center { text-align: center; }
.preview { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; margin: 16px 0; }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.meter { position: absolute; left: 12px; right: 12px; bottom: 10px; height: 4px; background: rgba(255,255,255,.15); border-radius: 2px; }
#meter-bar { height: 100%; width: 0; background: var(--warm); border-radius: 2px; transition: width .08s linear; }
.field { display: block; margin: 12px 0; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--void); color: var(--cream); font: inherit; font-size: 16px; }
.field input:focus { outline: none; border-color: var(--warm); }
.row { display: flex; gap: 8px; }
.notice { font-size: 13px; color: var(--cream); background: rgba(244,123,63,.12); border-left: 3px solid var(--warm); padding: 10px 12px; border-radius: 6px; margin: 16px 0; }
.error { color: var(--danger); font-size: 14px; margin: 0 0 12px; }

button { font: inherit; font-weight: 600; border-radius: 10px; border: 1px solid var(--line); background: #222; color: var(--cream); padding: 12px 16px; cursor: pointer; }
button:hover { border-color: #444; }
button:disabled { opacity: .5; cursor: default; }
button.primary { width: 100%; background: var(--warm); border-color: var(--warm); color: var(--void); font-size: 16px; }
button.ghost { flex: 1; background: transparent; }
button.ghost.off { color: var(--muted); text-decoration: line-through; }
button.danger, button.leave { background: var(--danger); border-color: var(--danger); color: #fff; }
button.small { padding: 6px 10px; font-size: 13px; }

.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--warm); margin: 0 auto 16px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.room { align-items: stretch; padding: 12px; gap: 12px; }
.grid { flex: 1; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-content: center; }
.tile { position: relative; aspect-ratio: 16/9; background: #111; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile.local video { transform: scaleX(-1); }
.tile .label { position: absolute; left: 10px; bottom: 8px; font-size: 13px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.55); }
.tile.speaking { border-color: var(--warm); }
.tile .novideo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'Syne', sans-serif; font-size: 28px; color: var(--muted); }
.panel { width: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; }
.panel ul { list-style: none; margin: 0; padding: 0; }
.panel li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.panel .danger { margin-top: auto; }

.controls { display: flex; justify-content: center; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--void); }

@media (max-width: 720px) {
  .room { flex-direction: column; }
  .panel { width: 100%; max-height: 40vh; overflow: auto; }
  .grid { grid-template-columns: 1fr 1fr; }
  .row { flex-direction: column; }
}
