/* McMeet client — McKodev look: cinnabar red accent, clean utility UI.
   Audio-first; tiles are avatars, not video. No third-party marks. */
:root {
  --accent: #ED4236; --accent-dark: #c5362b;
  --bg: #14161a; --panel: #1d2128; --panel-2: #262b34;
  --text: #f3f5f7; --muted: #9aa3af; --ok: #3ecf8e; --line: #2c323c;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { display: flex; flex-direction: column; min-height: 100vh; }

.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 18px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(237,66,54,0.18); }
.room-label { color: var(--muted); font-size: 14px; font-family: ui-monospace, monospace; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.rec-indicator { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .3px;
  animation: recblink 1.4s ease-in-out infinite; }
@keyframes recblink { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.conn-state { font-size: 13px; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; }
.conn-state.ok { color: var(--ok); border-color: rgba(62,207,142,0.4); }
.conn-state.warn { color: #f3c969; border-color: rgba(243,201,105,0.4); }
.conn-state.bad { color: var(--accent); border-color: rgba(237,66,54,0.5); }

.stage { flex: 1; display: flex; }
.screen { flex: 1; display: flex; }
.hidden { display: none !important; }

.card { margin: auto; background: var(--panel); padding: 36px 40px; border-radius: 14px;
  text-align: center; max-width: 460px; border: 1px solid var(--line); }
.card h1 { margin: 0 0 10px; font-size: 22px; }
.muted { color: var(--muted); font-size: 14px; }
.spinner { width: 38px; height: 38px; margin: 0 auto 18px; border: 4px solid var(--panel-2);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== in-meeting layout ===== */
.meeting-wrap { flex: 1; display: flex; min-height: 0; }
.meeting-main { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 14px; gap: 14px; }

.spotlight { position: relative; flex: 1; min-height: 0; background: #0c0e11; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.screen-video { max-width: 100%; max-height: 100%; border-radius: 10px; background: #000; }
.spotlight-label { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,0.6);
  padding: 4px 10px; border-radius: 8px; font-size: 13px; }

/* tiles grid; when spotlight is on, tiles become a horizontal strip */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-content: start; }
.meeting-main.has-spotlight .tiles { display: flex; overflow-x: auto; flex: none; }
.meeting-main.has-spotlight .spotlight { display: flex; }
.meeting-main:not(.has-spotlight) .spotlight { display: none; }
.meeting-main.has-spotlight .tile { min-width: 130px; }

.tile { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tile.speaking { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 24px;
  object-fit: cover; overflow: hidden; }
.tile.speaking .avatar { animation: talkpulse 1.1s ease-in-out infinite; }
@keyframes talkpulse { 0%,100% { box-shadow: 0 0 0 3px rgba(237,66,54,0.30); }
  50% { box-shadow: 0 0 0 6px rgba(237,66,54,0.55); } }
.tile-name { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-name .you { color: var(--muted); font-size: 12px; }
.tile-badges { display: flex; gap: 8px; align-items: center; min-height: 18px; }
.tile-badges svg { width: 16px; height: 16px; }
.badge-muted { color: var(--accent); }
.badge-hand { color: #f3c969; }
.badge-host { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.tile-admin { position: absolute; top: 8px; right: 8px; }
.tile-menu-btn { background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; width: 26px; height: 26px; cursor: pointer; line-height: 1; }
.tile-menu { position: absolute; top: 36px; right: 8px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 5; min-width: 150px; }
.tile-menu button { background: none; border: none; color: var(--text); text-align: left; padding: 8px 10px;
  border-radius: 7px; cursor: pointer; font-size: 13px; }
.tile-menu button:hover { background: #333a45; }
.tile-menu button.danger { color: var(--accent); }

/* ===== chat ===== */
.chat-panel { width: 320px; background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  border-bottom: 1px solid var(--line); font-weight: 600; }
.chat-note { padding: 8px 16px 0; margin: 0; font-size: 12px; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { font-size: 14px; }
.chat-msg .who { color: var(--accent); font-weight: 600; margin-right: 6px; }
.chat-msg .when { color: var(--muted); font-size: 11px; margin-left: 6px; }
.chat-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 9px 11px; font-size: 14px; }
.notes-area { flex: 1; margin: 8px 16px 6px; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 9px; padding: 12px; font-size: 14px; line-height: 1.55; resize: none;
  font-family: inherit; }
.notes-area:focus { outline: none; border-color: var(--accent); }

/* ===== reactions ===== */
.ctl-wrap { position: relative; }
.react-picker { position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  display: flex; gap: 6px; }
.react-picker button { background: none; border: none; font-size: 24px; cursor: pointer; padding: 4px;
  border-radius: 8px; }
.react-picker button:hover { background: #333a45; }
.reaction-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.float-react { position: absolute; bottom: 90px; font-size: 34px; animation: floatup 2.6s ease-out forwards; }
@keyframes floatup {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  12% { opacity: 1; transform: translateY(-12px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-260px) scale(1); }
}

/* ===== controls ===== */
.controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 14px;
  background: var(--panel); border-top: 1px solid var(--line); }
.ctl { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 78px;
  padding: 10px 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 11px; cursor: pointer; font-size: 12px; transition: background .15s; }
.ctl:hover { background: #303743; }
.ctl:disabled, .ctl.disabled { opacity: 0.38; cursor: not-allowed; }
.ctl-ico { line-height: 0; }
.ctl-ico svg { width: 22px; height: 22px; display: block; }
.ctl[aria-pressed="true"], .ctl.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ctl-leave { background: #3a2020; border-color: #5a2a26; }
.ctl-leave:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn { padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--text); cursor: pointer; font-size: 14px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); cursor: pointer; line-height: 0; display: inline-flex;
  align-items: center; justify-content: center; }
.icon-btn svg { width: 18px; height: 18px; }

/* ===== modal + profile ===== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; z-index: 100; }
.modal-card { margin: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; width: 360px; max-width: 92vw; }
.modal-card h2 { margin: 0 0 18px; font-size: 18px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 28px; overflow: hidden; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input { background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 10px 12px; font-size: 15px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ===== home / create ===== */
.home-card { max-width: 420px; text-align: left; }
.home-card h1, .home-card > .muted { text-align: center; }
.home-block { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.home-block input[type=text] { background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 11px 12px; font-size: 14px; }
.home-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.home-or { text-align: center; color: var(--muted); font-size: 12px; margin: 4px 0; }

/* ===== prompts (knock / add-review) ===== */
.prompt-layer { position: fixed; right: 16px; bottom: 88px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.prompt { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  width: 300px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.prompt p { margin: 0 0 12px; font-size: 14px; }
.prompt .row { display: flex; gap: 8px; justify-content: flex-end; }
.prompt .btn { padding: 7px 12px; font-size: 13px; }

@media (max-width: 760px) {
  .chat-panel { position: fixed; inset: 0; width: auto; z-index: 90; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
