/* =========================================================================
   Town Hall — HUD / overlay styling (retro pixel arcade look)
   The Phaser canvas sits full-screen behind everything; all DOM UI here is
   an overlay layer (pointer-events selectively re-enabled per widget).
   ========================================================================= */

:root {
  --bg: #10131c;
  --panel: #1b2130;
  --panel-2: #232c40;
  --ink: #e8ecf5;
  --muted: #8a93a8;
  --accent: #ffd23f;
  --accent-2: #35d0a5;
  --danger: #ff5a5a;
  --warn: #ff9f40;
  --border: #3a4357;
  --pixel: 'VT323', 'Courier New', monospace;
  --term: 'VT323', 'Courier New', monospace;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must win over the `display:flex` on .overlay/.sidebar
   (the UA [hidden] rule is not !important, so author `display:` would defeat it). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--term);
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button { font-family: var(--pixel); cursor: pointer; text-transform: uppercase; }
canvas { image-rendering: pixelated; }

#game-root { position: fixed; inset: 0; z-index: 0; }
#game-root canvas { display: block; width: 100%; height: 100%; }

/* ---------- Overlays / panels ------------------------------------------- */
/* Plain black for now on the entry-flow modals (was a blocky yellow gradient)
   — the whole app is getting a redesign later. */
.overlay {
  background: #000;
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
/* Modals that sit on top of the map (running or the entry-screen preview)
   dim it rather than hiding it. */
#room-overlay, #avatar-overlay, #permission-modal,
#avatar-modal, #credits-modal, #object-modal {
  background: rgba(6, 8, 14, 0.78);
  backdrop-filter: blur(2px);
}

.panel {
  background: var(--panel);
  border: 3px solid var(--border);
  box-shadow: 0 0 0 3px #0a0d15, 8px 8px 0 rgba(0,0,0,0.5);
  padding: 22px;
  max-width: 460px;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
}

.entry-panel { max-width: 480px; }
/* Even vertical rhythm for the entry / lobby modals. */
.entry-panel { display: flex; flex-direction: column; gap: 12px; }
.entry-panel > * { margin: 0; }
.entry-panel form { display: flex; flex-direction: column; gap: 10px; }
.entry-panel form label { margin: 0; }
.entry-panel h4 { margin: 4px 0 0; color: #fff; }

.logo {
  font-family: var(--pixel);
  font-size: 30px;
  letter-spacing: 2px;
  color: var(--accent);
  text-shadow: 3px 3px 0 #0a0d15;
  margin: 0 0 8px;
}

h1 { text-transform: uppercase; }
h1, h4, legend, .stage-dock-label { font-family: var(--pixel); }
h4 { font-size: 17px; color: #fff; padding: 16px 0 6px; letter-spacing: 1px; }
hr {
  border: none; border-bottom: 2px solid var(--border); padding: 12px 0;
}

.muted { color: var(--muted); }
.tiny  { font-size: 16px; }
.hint  { color: var(--accent-2); min-height: 1.2em; font-size: 15px; }
.error { color: var(--danger); font-size: 15px; }

/* ---------- Forms ------------------------------------------------------- */
form label,
.avatar-controls label {
  display: block;
  margin: 10px 0;
  font-family: var(--term);
  font-size: 16px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* Text inputs + selects share the button box model: same padding-y, border,
   font-size and line-height, so a field and a button line up pixel-for-pixel. */
input[type=text], input[type=password], input[type=email], input[type=url],
input[type=number], input[type=search], select {
  width: 100%;
  margin-top: 6px;
  padding: 9px 14px;
  background: #0d1019;
  color: var(--ink);
  border: 2px solid var(--border);
  font-family: var(--term);
  font-size: 17px;
  line-height: 1.2;
}
input[type=color] {
  width: 100%; height: 42px; margin-top: 6px; padding: 2px;
  background: #0d1019; border: 2px solid var(--border);
}
input:focus, select:focus, button:focus-visible, a.btn-primary:focus-visible,
a.btn-secondary:focus-visible, a.btn-tertiary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------- Buttons — one size, three emphasis tiers -------------------- */
/*   primary   → solid accent fill                                          */
/*   secondary → outlined (accent border, no fill)                          */
/*   tertiary  → bare text button (no fill, no outline)                     */
/*   + optional .danger / .warn colour modifiers on any tier.               */
.btn-primary, .btn-secondary, .btn-tertiary {
  display: inline-block;
  padding: 9px 22px;
  font-family: var(--pixel);
  font-size: 17px;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  background: none;
  color: var(--accent);
  border: 2px solid transparent;
}
.btn-primary   { background: var(--accent); border-color: var(--accent); color: #1a1400; }
.btn-secondary { border-color: var(--accent); }

.btn-primary, .btn-secondary { box-shadow: 0 4px 0 #a9861f; }
.btn-primary:hover, .btn-secondary:hover { filter: brightness(1.08); }
.btn-tertiary:hover { background: var(--panel-2); }
.btn-primary:active, .btn-secondary:active { transform: translateY(2px); box-shadow: 0 2px 0 #a9861f; }
.btn-tertiary:active { transform: translateY(1px); }

/* Semantic colour — combine with any tier. */
.btn-primary.danger { background: var(--danger); border-color: var(--danger); color: #2a0000; }
.btn-primary.warn   { background: var(--warn);   border-color: var(--warn);   color: #2a1400; }
.btn-secondary.danger, .btn-tertiary.danger { border-color: var(--danger); color: var(--danger); }
.btn-secondary.warn,   .btn-tertiary.warn   { border-color: var(--warn);   color: var(--warn); }
.btn-primary.danger, .btn-primary.warn { box-shadow: none; }

.btn-primary:disabled, .btn-secondary:disabled, .btn-tertiary:disabled,
.btn-primary[disabled], .btn-secondary[disabled], .btn-tertiary[disabled] {
  opacity: 0.45; cursor: not-allowed; filter: none; transform: none;
}

/* ---------- Entry / lobby modals ------------------------------------- */
/* CTAs: bottom row, right-aligned — back sits alongside the primary button. */
.entry-cta { justify-content: flex-end; align-items: stretch; margin-top: 6px; flex-wrap: wrap; }
.entry-cta .btn-primary,
.entry-cta .btn-secondary,
.entry-cta .btn-tertiary,
.entry-cta a { flex: 0 0 auto; min-width: 132px; }

/* "Art & licences" sits apart from the action buttons. */
.credits-btn { margin-right: auto; min-width: 0 !important; }
.credits-list { list-style: none; margin: 4px 0 0; padding: 0; max-height: 46vh; overflow-y: auto; }
.credits-list li { padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: 16px; }
.credits-list li:last-child { border-bottom: none; }

/* Readable text links inside panels (browser-default blue is invisible on dark). */
.panel p a, .credits-list a {
  color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px;
}
.panel p a:hover, .credits-list a:hover { color: var(--ink); }

/* Keyboard-controls table on the name screen — two key/action pairs per row. */
.controls-table {
  width: 100%; border-collapse: separate; border-spacing: 0 6px;
  margin-top: 4px;
}
.controls-table th {
  font-family: var(--pixel); font-weight: normal; font-size: 15px;
  color: var(--ink); background: var(--panel-2);
  border: 2px solid var(--border); box-shadow: 0 2px 0 #0a0d15;
  padding: 3px 9px; white-space: nowrap; text-align: center; width: 1%;
}
.controls-table th:empty { background: none; border: none; box-shadow: none; }
.controls-table td {
  color: var(--muted); font-size: 16px; padding: 0 14px 0 10px; text-align: left;
}

/* ---------- Avatar editor --------------------------------------------- */
.avatar-editor { border: 2px solid var(--border); padding: 12px; margin-top: 10px; }
.avatar-editor legend { font-size: 15px; color: var(--accent); padding: 0 6px; }
.avatar-preview-wrap {
  display: flex; justify-content: center; align-items: flex-end;
  background: #0d1019; border: 2px solid var(--border);
  padding: 6px; margin-bottom: 10px;
}
#avatar-preview, #avatar-preview-2 { image-rendering: pixelated; display: block; }
.avatar-controls {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px;
}

/* Preview on the left, customisation in 3 columns on the right. */
.avatar-wide { max-width: 820px; }
.avatar-layout { display: flex; gap: 16px; align-items: flex-start; margin-top: 4px; }
.avatar-layout .avatar-preview-wrap { flex: 0 0 auto; margin-bottom: 0; position: sticky; top: 0; }
.avatar-layout .avatar-controls {
  flex: 1 1 auto; grid-template-columns: repeat(3, 1fr); gap: 6px 12px;
}

/* Left column of the edit-avatar modal: preview + a vertical key list. */
.avatar-layout .avatar-preview-col {
  flex: 0 0 auto; position: sticky; top: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.avatar-layout .avatar-preview-col .avatar-preview-wrap { position: static; }
.controls-list { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.controls-list > div { display: flex; align-items: baseline; gap: 8px; }
.controls-list dt {
  font-family: var(--pixel); font-size: 14px; color: var(--ink);
  background: var(--panel-2); border: 2px solid var(--border); box-shadow: 0 2px 0 #0a0d15;
  padding: 2px 7px; min-width: 58px; text-align: center; white-space: nowrap;
}
.controls-list dd { margin: 0; color: var(--muted); font-size: 14px; }

.row-buttons { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; flex-wrap: wrap; }
/* Avatar modal actions — pinned bottom-right, not stretched. */
.avatar-actions { justify-content: flex-end; }
.avatar-actions .btn-primary,
.avatar-actions .btn-secondary,
.avatar-actions .btn-tertiary { flex: 0 0 auto; }

/* Raised-hand roster, top-right */
.hand-list {
  position: absolute; top: 10px; right: 10px; z-index: 22; pointer-events: none;
  background: var(--panel); border: 2px solid var(--accent-2);
  box-shadow: 0 0 0 3px #0a0d15;
  padding: 8px 12px; min-width: 150px; max-width: 240px;
}
.hand-list .hl-head { font-family: var(--pixel); font-size: 14px; color: var(--accent-2); margin-bottom: 5px; }
.hand-list .hl-name { font-family: var(--term); font-size: 16px; line-height: 1.3; color: var(--ink); }
/* nudge the right-hand sidebars down so the hand list has room */
body.has-hands #chat-sidebar,
body.has-hands #admin-sidebar { top: 120px; }

/* ---------- HUD ------------------------------------------------------- */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#hud .host-only { display: none; }
#hud.is-host .host-only { display: flex; }

/* Bottom action bar */
.action-bar {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; gap: 4px; align-items: stretch;
  background: var(--panel); border: 3px solid var(--border);
  box-shadow: 0 0 0 3px #0a0d15;
  padding: 6px; pointer-events: auto;
  max-width: 96vw; overflow-x: auto;
}
.ab-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 56px; padding: 6px 4px;
  background: var(--panel-2); border: 2px solid var(--border);
  color: var(--ink); font-size: 16px; line-height: 1;
}
.ab-btn .ab-label { font-size: 15px; text-transform: uppercase; font-family: var(--term); color: var(--muted); letter-spacing: 0.5px; }
.ab-btn:hover { background: var(--border); }
a.ab-btn { text-decoration: none; }
/* Chunky low-res emoji so they sit with the pixel styling — the emoji is
   redrawn onto a small canvas by pixelateEmoji() and upscaled with hard pixels. */
.ab-emoji { display: inline-flex; line-height: 1; }
.ab-emoji canvas { display: block; image-rendering: pixelated; }
.ab-btn.active { background: var(--accent-2); border-color: var(--accent-2); color: #06251d; }
.ab-btn.active .ab-label {color: #06251d; }
.ab-btn.danger { background: var(--danger); border-color: var(--danger); color: #2a0000; }
.ab-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ab-sep { width: 2px; background: var(--border); margin: 2px 3px; }

/* Interaction prompt */
.interact-prompt {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: var(--accent); color: #1a1400;
  font-family: var(--pixel); font-size: 16px;
  padding: 8px 12px; border: 2px solid #1a1400;
  pointer-events: none; white-space: nowrap;
}

/* Toast */
.toast {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  background: var(--panel); border: 2px solid var(--accent);
  color: var(--ink); font-family: var(--pixel); font-size: 18px;
  padding: 10px 14px; pointer-events: none; max-width: 90vw; text-align: center;
}

/* Stage video dock */
.stage-dock {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px #0a0d15;
  padding: 6px; pointer-events: auto; max-width: 92vw;
}
.stage-dock-label { font-size: 13px; color: var(--accent); margin-bottom: 4px; letter-spacing: 1px; }
.stage-tiles { display: flex; gap: 4px; }
.stage-tiles .tile {
  position: relative; width: 160px; height: 90px;
  background: #05070c; border: 2px solid var(--border); overflow: hidden;
}
.stage-tiles .tile.screen { width: 240px; }
.stage-tiles video { width: 100%; height: 100%; object-fit: cover; background: #05070c; }
.stage-tiles .cap {
  position: absolute; left: 0; bottom: 0; right: 0;
  font-family: var(--pixel); font-size: 12px; background: rgba(0,0,0,0.7);
  padding: 2px 4px; color: var(--ink);
}
.stage-tiles .muted-dot { position: absolute; top: 3px; right: 3px; font-size: 12px; }
/* Double the SPEAKERS dock while in a huddle. */
.stage-dock.huddle .stage-tiles .tile { width: 320px; height: 180px; }
.stage-dock.huddle .stage-tiles .tile.screen { width: 460px; }

/* Sidebars */
.sidebar {
  position: absolute; top: 10px; right: 10px; bottom: 92px; width: 390px; max-width: calc(100vw - 20px);
  background: var(--panel); border: 3px solid var(--border);
  box-shadow: 0 0 0 3px #0a0d15;
  display: flex; flex-direction: column; pointer-events: auto;
  overflow: hidden;
}
.sidebar header {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--pixel); font-size: 20px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 10px 12px;
}
/* Give the first control breathing room below the header. */
.sidebar .admin-block { padding: 16px 12px 12px; }
.sidebar .x, .object-header .x {
  background: transparent; border: none; color: var(--muted);
  font-size: 18px; line-height: 1; font-family: var(--term);
}
.sidebar h4:first-of-type { margin-top: 6px; }
.sidebar > *:not(header) { padding: 0 10px; }
.sidebar ol, .sidebar ul { overflow-y: auto; }

/* ---------- Room chat ----------------------------------------------- */
.chat-log { list-style: none; margin: 8px 0; padding: 0 10px; flex: 1; }
.chat-log li { margin: 6px 0; font-size: 16px; line-height: 1.3; word-break: break-word; }
.chat-log .c-name { color: var(--accent-2); font-family: var(--pixel); font-size: 16px; margin-right: 6px; }
.chat-log li.me .c-name { color: var(--accent); }
.chat-log a { color: var(--accent); word-break: break-all; }
.sidebar .chat-form { display: flex; gap: 6px; align-items: stretch; padding: 8px 10px 12px; border-top: 2px solid var(--border); }
.sidebar .chat-form input { flex: 1; margin: 0; min-width: 0; }
.sidebar .chat-form .btn-primary { flex: 0 0 auto; padding: 9px 16px; }
.ab-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: #2a0000;
  font-family: var(--pixel); font-size: 11px;
  padding: 2px 3px; border: 1px solid #2a0000; border-radius: 2px;
}
.ab-btn { position: relative; }

/* ---------- Auditorium-only controls + status pills ---------------- */
#hud .aud-only { display: none; }
#hud.in-auditorium .aud-only { display: flex; }
.mode-pill {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  background: var(--panel); border: 2px solid var(--accent-2); color: var(--ink);
  font-family: var(--pixel); font-size: 14px; padding: 7px 12px; pointer-events: none;
  white-space: nowrap; z-index: 24;
}
.mode-pill.live { border-color: var(--danger); color: var(--danger); }
.mode-pill.huddle { top: 44px; border-color: var(--accent); }

/* ---------- Screen-share window (draggable + resizable) ------------ */
.screen-window {
  position: fixed; top: 60px; right: 16px; width: 480px; height: 300px;
  z-index: 40; background: #05070c;
  border: 3px solid var(--accent); box-shadow: 0 0 0 3px #0a0d15, 6px 6px 0 rgba(0,0,0,0.5);
  display: flex; flex-direction: column; pointer-events: auto;
}
.sw-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--panel); border-bottom: 2px solid var(--border);
  font-family: var(--pixel); font-size: 14px; color: var(--accent);
  padding: 6px 8px; cursor: move; touch-action: none; user-select: none;
}
.sw-close { background: transparent; border: none; color: var(--muted); font-size: 16px; font-family: var(--term); cursor: pointer; }
.screen-window video { flex: 1; width: 100%; min-height: 0; object-fit: contain; background: #05070c; }
.sw-resize {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px;
  cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 45%, var(--accent) 45%, var(--accent) 60%, transparent 60%);
}

/* ---------- Screen-share takeover ---------------------------------- */
/* While someone shares, the window fills most of the viewport and the
   sharer's camera is pinned to the left. */
body.screen-sharing .screen-window {
  top: 14px; bottom: 96px; left: 250px; right: 14px;
  width: auto; height: auto;
}
body.screen-sharing .stage-dock { display: none; }         /* focus on the presenter */
body.screen-sharing.im-presenting .self-cam { display: none; } /* your own is redundant */

.presenter-cam {
  position: fixed; left: 14px; top: 88px; z-index: 41;
  width: 224px; height: 168px;
  background: #05070c; border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px #0a0d15;
  pointer-events: none; overflow: hidden;
}
.presenter-cam video { width: 100%; height: 100%; object-fit: cover; }
.presenter-cam-label {
  position: absolute; left: 0; bottom: 0;
  font-family: var(--pixel); font-size: 13px;
  background: rgba(0,0,0,0.7); color: var(--ink); padding: 3px 6px;
}

/* ---------- Self camera (bottom-left) ------------------------------- */
.self-cam {
  position: fixed; left: 12px; bottom: 84px; z-index: 22;
  width: 168px; height: 126px;
  background: #05070c; border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px #0a0d15;
  pointer-events: none; overflow: hidden;
}
.self-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.self-cam-label {
  position: absolute; left: 0; bottom: 0;
  font-family: var(--pixel); font-size: 12px;
  background: rgba(0,0,0,0.7); color: var(--ink); padding: 2px 4px;
}

.admin-block { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.switch-row { display: flex; gap: 8px; align-items: center; font-family: var(--term); font-size: 15px; color: var(--ink); }

.user-list, .object-list { list-style: none; margin: 0 0 10px; padding: 0 10px 10px; }
.user-list li {
  display: flex; align-items: center; gap: 6px; justify-content: space-between;
  padding: 6px 0; font-size: 16px;
}
.user-list .u-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-list .u-name .badge { color: var(--accent); font-size: 14px; }
/* Admin participant rows: name on its own line, action buttons wrap 2-up below. */
#admin-user-list li { flex-wrap: wrap; gap: 6px; }
#admin-user-list .u-name { flex: 1 0 100%; }
#admin-user-list li .btn-secondary,
#admin-user-list li .btn-tertiary { flex: 1 1 calc(50% - 3px); }

.object-list li { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.object-list .o-type { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.object-list .o-name { width: 100%; margin-bottom: 6px; }
.object-list .o-row { display: flex; gap: 6px; margin-top: 6px; }
.object-list .o-row input { flex: 1; min-width: 0; }
.object-list .o-row .btn-secondary { flex: 0 0 auto; }

/* ---------- Landing page --------------------------------------------- */
/* Plain black for now — this page is getting a full SaaS-style redesign later. */
.landing-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100%; padding: 24px 16px;
  background: #000;
}
.landing-panel { max-width: 460px; display: flex; flex-direction: column; gap: 10px; }
.landing-panel > * { margin: 0; }
.landing-panel h4 { margin: 6px 0 0; }
.landing-panel h4:first-of-type { margin-top: 6px; }
.landing-panel .created .btn-primary { margin-top: 4px; }
.landing-panel .user-list { max-height: 42vh; overflow-y: auto; padding: 0; }
.landing-panel .user-list li .btn-secondary { flex: 0 0 auto; }

.created { border: 2px solid var(--accent-2); padding: 16px 12px; margin: 6px 0 4px; }
.created-row { display: flex; gap: 6px; align-items: stretch; margin: 6px 0 10px; }
.created-row code {
  flex: 1; min-width: 0; font-family: var(--term); font-size: 15px;
  background: #0d1019; border: 2px solid var(--border);
  padding: 9px 12px; overflow-x: auto; white-space: nowrap;
}
.created-row .btn-secondary { flex: 0 0 auto; }

/* Context menu */
.context-menu {
  position: absolute; z-index: 40; min-width: 150px;
  background: var(--panel); border: 3px solid var(--border);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.6);
  pointer-events: auto;
}
.context-menu button {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; font-size: 9px;
  background: transparent; border: none; color: var(--ink);
}
.context-menu button:hover { background: var(--accent); color: #1a1400; }
.context-menu .cm-title {
  padding: 8px 12px; font-family: var(--pixel); font-size: 9px;
  color: var(--accent); border-bottom: 2px solid var(--border);
}

/* Object iframe modal */
.object-panel { max-width: 960px; width: 92vw; height: 82vh; display: flex; flex-direction: column; padding: 0; }
.object-header {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--pixel); font-size: 20px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 10px 12px;
}

.object-header.no-padding { padding: 0; }

.object-frame-wrap { flex: 1; background: #fff; }
#object-frame { width: 100%; height: 100%; border: 0; }


@media (max-width: 640px) {
  .sidebar { width: 78vw; }
  .ab-btn .ab-label { display: none; }
  .stage-tiles .tile { width: 108px; height: 62px; }
  .stage-tiles .tile.screen { width: 150px; }
  .stage-dock.huddle .stage-tiles .tile { width: 180px; height: 104px; }
  .stage-dock.huddle .stage-tiles .tile.screen { width: 240px; }
  /* stack the presenter cam above the screen on narrow screens */
  .presenter-cam { top: 10px; left: 10px; width: 132px; height: 99px; }
  body.screen-sharing .screen-window { top: 118px; left: 8px; right: 8px; bottom: 88px; }
  body.screen-sharing.im-presenting .self-cam { display: none; }
}
@media (max-width: 760px) {
  .avatar-layout { flex-direction: column; }
  .avatar-layout .avatar-preview-wrap { align-self: center; position: static; }
  .avatar-layout .avatar-preview-col { align-self: center; position: static; align-items: center; }
  .avatar-layout .avatar-controls { grid-template-columns: repeat(2, 1fr); }
}
