/* A meeting in Chris's office (round 8, part Q): the studio's dark and gold, the tiles as large as the window allows. */
:root {
  --bg: #0d0c0b; --panel: #171512; --panel-2: #201d19; --line: #2e2a25;
  --text: #f3f1ed; --muted: #b9b2a8; --gold: #e5af4f; --on-gold: #1a1408; --ok: #82c99b; --stop: #ec9191;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 16px/1.45 var(--font); display: flex; flex-direction: column; min-height: 100dvh; }
.m-top { padding: max(12px, env(safe-area-inset-top)) 16px 8px; border-bottom: 1px solid var(--line); }
.m-title { margin: 0; font-weight: 650; color: var(--gold); }
.m-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
main { flex: 1; display: flex; min-height: 0; }
.m-card { margin: auto; width: min(420px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 20px; }
.m-card h1 { margin: 0 0 6px; font-size: 22px; }
.m-note { color: var(--muted); margin: 0 0 14px; }
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
input { width: 100%; font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
input:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button { font: inherit; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 10px 14px; cursor: pointer; min-height: 44px; }
button[type='submit'], .m-admit { background: var(--pot-clay); color: var(--pot-ink); border-color: var(--pot-edge); box-shadow: inset 0 -2px 0 var(--pot-line); font-weight: 600; }
form button[type='submit'] { margin-top: 12px; width: 100%; }
button:disabled { opacity: 0.55; cursor: default; }
.m-msg { min-height: 1.4em; margin: 10px 0 0; color: var(--stop); }
.m-room { flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; }
.m-door-list { display: flex; flex-direction: column; gap: 8px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.m-knock-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.m-knock-name { flex: 1 1 200px; }
.m-tiles { flex: 1; min-height: 0; display: grid; gap: 8px; padding: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); grid-auto-rows: minmax(160px, 1fr); }
/* One tile in focus (a shared screen, or a tap): it takes the room, and everyone else stays in a strip below it. */
.m-tiles.focused { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); grid-template-rows: minmax(0, 1fr); grid-auto-rows: 96px; }
.m-tiles.focused .m-tile.focus { order: -1; grid-column: 1 / -1; }
.m-tiles.focused .m-tile:not(.focus) .m-face { width: 44px; height: 44px; font-size: 17px; }
.m-tiles.focused .m-tile:not(.focus) .m-name { left: 4px; bottom: 4px; padding: 2px 6px; font-size: 12px; }
.m-tile { position: relative; margin: 0; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.m-tile.speaking { border-color: var(--gold); }
.m-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.m-tile.is-screen video { object-fit: contain; background: #000; }
.m-tile.has-video .m-face { display: none; }
.m-face { width: 84px; height: 84px; border-radius: 50%; background: var(--panel-2); border: 2px solid var(--gold); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 650; }
.m-name { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, 0.6); padding: 3px 9px; border-radius: 8px; font-size: 14px; }
.m-tile.muted .m-name::after { content: ' \00b7  muted'; color: var(--muted); }
.m-audio { display: none; }
.m-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); }
.m-bar button[aria-pressed='true'] { border-color: var(--ok); }
.m-leave { background: #5a1f1f; border-color: #7a2a2a; }
.m-back { display: inline-block; color: var(--gold); font-weight: 600; text-decoration: none; padding: 10px 0; }
@media (max-width: 520px) { .m-bar button { flex: 1 1 40%; } }
