/* ═══════════════════════════════════════════════════════════
   Meeting Focus Meter — Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── Self-hosted fonts ──────────────────────────────────────
   Files live in assets/fonts/ — run download_assets.sh to
   fetch them, or place them manually as shown below.        */

/* DM Sans */
@font-face {
  font-family: 'DM Sans';
  font-style:  normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/dm-sans-v17-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style:  italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/dm-sans-v17-latin-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style:  normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/dm-sans-v17-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style:  italic;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/dm-sans-v17-latin-500italic.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style:  normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/dm-sans-v17-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style:  italic;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/dm-sans-v17-latin-600italic.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style:  normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/dm-sans-v17-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style:  italic;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/dm-sans-v17-latin-700italic.woff2') format('woff2');
}

/* DM Mono */
@font-face {
  font-family: 'DM Mono';
  font-style:  normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/dm-mono-v16-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Mono';
  font-style:  italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/dm-mono-v16-latin-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Mono';
  font-style:  normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/dm-mono-v16-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Mono';
  font-style:  italic;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/dm-mono-v16-latin-500italic.woff2') format('woff2');
}

/* Syne */
@font-face {
  font-family: 'Syne';
  font-style:  normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/syne-v24-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Syne';
  font-style:  normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/syne-v24-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Syne';
  font-style:  normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/syne-v24-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Syne';
  font-style:  normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/syne-v24-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Syne';
  font-style:  normal;
  font-weight: 800;
  font-display: swap;
  src: url('assets/fonts/syne-v24-latin-800.woff2') format('woff2');
}

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --red:        #ff3b3b;
  --yellow:     #f5c518;
  --green:      #1fc16b;
  --red-dim:    rgba(255, 59,  59,  0.11);
  --yellow-dim: rgba(245, 197, 24,  0.11);
  --green-dim:  rgba(31,  193, 107, 0.11);
  --bg:         #0c0e14;
  --surface:    #13161f;
  --surface2:   #181b26;
  --border:     #252838;
  --border2:    #313549;
  --text:       #e8ecf8;
  --muted:      #7a86a8;
  --mono:       'DM Mono', monospace;
  --head:       'Syne', sans-serif;
  --body:       'DM Sans', sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-tap-highlight-color: transparent;
}

/* ── Screens ────────────────────────────────────────────────── */
.screen { display: none; flex-direction: column; min-height: 100dvh; }
.screen.active { display: flex; }

/* ── Shared components ──────────────────────────────────────── */
button {
  cursor: pointer; border: none; border-radius: 12px;
  font-family: var(--body); font-weight: 600;
  transition: all 0.18s ease;
}
button:active { transform: scale(0.96); }

.btn-primary { background: var(--yellow); color: #0c0e14; padding: 11px 22px; font-size: 0.9rem; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-full { width: 100%; padding: 14px; font-size: 0.95rem; }
.btn-outline { background: none; border: 1.5px solid var(--border2); color: var(--muted); padding: 8px 16px; font-size: 0.82rem; }
.btn-outline:hover { border-color: var(--muted); color: var(--text); }
.btn-ghost { background: none; border: none; color: var(--muted); padding: 6px 12px; font-size: 0.78rem; }
.btn-ghost:hover { color: var(--text); }

input[type="text"] {
  flex: 1; background: var(--bg);
  border: 1.5px solid var(--border2); border-radius: 12px;
  padding: 11px 16px; color: var(--text);
  font-family: var(--mono); font-size: 1.1rem; letter-spacing: 0.2em;
  text-transform: uppercase; outline: none; transition: border-color 0.2s;
}
input[type="text"]:focus { border-color: var(--yellow); }
input[type="text"]::placeholder { color: var(--muted); letter-spacing: 0.08em; font-size: 0.88rem; }

.card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 22px; padding: 26px 22px;
  overflow: hidden; min-width: 0;
}
.card h2 { font-family: var(--head); font-size: 0.95rem; font-weight: 700; margin-bottom: 16px; letter-spacing: 0.03em; }

/* ── HOME ───────────────────────────────────────────────────── */
#home { align-items: center; justify-content: center; padding: 40px 22px; gap: 32px; }

.logo { font-family: var(--head); font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; text-align: center; }
.logo em { color: var(--yellow); font-style: normal; }

.home-stack { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 400px; }

.room-code-display {
  font-family: var(--mono); font-size: 2.4rem; font-weight: 500;
  letter-spacing: 0.24em; color: var(--yellow); text-align: center;
  background: rgba(245, 197, 24, 0.07); border: 1.5px dashed rgba(245, 197, 24, 0.22);
  border-radius: 12px; padding: 14px; margin-bottom: 14px;
  cursor: pointer; user-select: all; transition: background 0.2s;
}
.room-code-display:hover { background: rgba(245, 197, 24, 0.13); }
.room-hint { font-size: 0.72rem; color: var(--muted); text-align: center; margin-bottom: 16px; }

.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 0.7rem; letter-spacing: 0.09em;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.role-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.role-tab { flex: 1; padding: 9px; background: none; border: 1.5px solid var(--border); color: var(--muted); border-radius: 10px; font-size: 0.78rem; }
.role-tab.active { background: var(--yellow-dim); border-color: rgba(245, 197, 24, 0.38); color: var(--yellow); }

.input-row { display: flex; gap: 8px; width: 100%; min-width: 0; overflow: hidden; }
.input-row input[type="text"] { flex: 1; min-width: 0; width: 0; }
.join-error { font-size: 0.72rem; color: var(--red); margin-top: 7px; min-height: 16px; }

/* ── FACILITATOR ────────────────────────────────────────────── */
#facilitator { align-items: center; padding: 20px 20px 28px; gap: 16px; }

.f-topbar {
  width: 100%; max-width: 720px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.f-topbar-left { display: flex; flex-direction: column; gap: 2px; }
.f-room-title { font-family: var(--head); font-size: 1rem; font-weight: 700; }
.f-room-code { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.1em; }
.f-topbar-right { display: flex; gap: 7px; flex-wrap: wrap; }

/* Traffic light box */
.f-light-box {
  position: relative; width: 100%; max-width: 720px;
  background: var(--surface); border: 2px solid var(--border); border-radius: 32px;
  padding: 30px 26px 24px; display: flex; flex-direction: column;
  align-items: center; gap: 22px; overflow: hidden; transition: border-color 0.9s;
}
.f-glow {
  position: absolute; inset: 0; border-radius: 32px;
  opacity: 0; transition: opacity 1.4s; pointer-events: none;
}

/* Bulbs */
.bulbs-row { display: flex; gap: 26px; align-items: center; position: relative; z-index: 1; }
.bulb {
  border-radius: 50%; flex-shrink: 0; position: relative;
  transition: box-shadow 0.7s ease, filter 0.7s ease;
}
.bulb::after {
  content: ''; position: absolute; top: 15%; left: 18%;
  width: 28%; height: 24%; background: rgba(255, 255, 255, 0.22);
  border-radius: 50%; filter: blur(3px);
}
.bulb-lg   { width: 88px; height: 88px; }
.bulb-red    { background: radial-gradient(circle at 38% 32%, #ff9090, #ff3b3b 55%, #7f0000); }
.bulb-yellow { background: radial-gradient(circle at 38% 32%, #fff080, #f5c518 55%, #6b4d00); }
.bulb-green  { background: radial-gradient(circle at 38% 32%, #7fffc4, #1fc16b 55%, #054428); }
.bulb.off { filter: brightness(0.13) saturate(0.25) !important; box-shadow: none !important; }
.bulb.lit-red    { filter: brightness(1); box-shadow: 0 0 44px rgba(255,59,59,0.85),  0 0 90px rgba(255,59,59,0.28); }
.bulb.lit-yellow { filter: brightness(1); box-shadow: 0 0 44px rgba(245,197,24,0.85), 0 0 90px rgba(245,197,24,0.28); }
.bulb.lit-green  { filter: brightness(1); box-shadow: 0 0 44px rgba(31,193,107,0.85), 0 0 90px rgba(31,193,107,0.28); }

@keyframes bulbPop { 0%{transform:scale(1)} 38%{transform:scale(1.17)} 100%{transform:scale(1)} }
.bulb.pop { animation: bulbPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Gauge */
.gauge-wrap { width: 100%; position: relative; z-index: 1; }
.gauge-track {
  height: 14px; border-radius: 8px;
  background: linear-gradient(to right, var(--red), var(--yellow) 50%, var(--green));
  filter: brightness(0.55); position: relative;
}
.gauge-needle {
  position: absolute; top: -11px; width: 5px; height: 36px;
  background: #fff; border-radius: 4px; transform: translateX(-50%);
  transition: left 1s cubic-bezier(0.34, 1.4, 0.64, 1); left: 50%;
  box-shadow: 0 0 10px rgba(255,255,255,0.55), 0 2px 5px rgba(0,0,0,0.5);
}
.gauge-labels {
  display: flex; justify-content: space-between; margin-top: 7px;
  font-size: 0.68rem; color: var(--muted); font-family: var(--mono); letter-spacing: 0.04em;
}

.f-status {
  font-family: var(--head); font-size: 1.15rem; font-weight: 700;
  letter-spacing: 0.01em; min-height: 28px; text-align: center;
  transition: color 0.6s; position: relative; z-index: 1;
}

/* Breakdown toggle */
.breakdown-wrap { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.breakdown {
  display: flex; gap: 9px; flex-wrap: wrap; justify-content: center;
  overflow: hidden; max-height: 0; transition: max-height 0.4s ease, opacity 0.35s ease;
  opacity: 0; pointer-events: none;
}
.breakdown.visible { max-height: 60px; opacity: 1; pointer-events: auto; }
.bp { display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,0.04); border: 1px solid var(--border2); border-radius: 24px; padding: 6px 15px; font-size: 0.8rem; font-weight: 600; }
.bp-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.bp-num { font-family: var(--mono); font-size: 0.92rem; min-width: 16px; text-align: center; }
.bp-lbl { color: var(--muted); font-weight: 400; }
.bd-toggle { font-size: 0.7rem; font-family: var(--mono); letter-spacing: 0.07em; color: var(--muted); background: none; border: 1px solid var(--border); border-radius: 20px; padding: 4px 14px; transition: all 0.2s; }
.bd-toggle:hover { color: var(--text); border-color: var(--muted); }

.f-total { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.06em; }

/* Trend bars */
.trend-section { width: 100%; max-width: 720px; }
.trend-label { font-size: 0.67rem; font-family: var(--mono); color: var(--muted); letter-spacing: 0.07em; margin-bottom: 6px; }
.trend-bars { display: flex; gap: 4px; height: 34px; align-items: flex-end; }
.trend-bar { flex: 1; border-radius: 3px 3px 0 0; transition: height 0.55s ease, background 0.55s ease; min-height: 3px; background: var(--border); }

/* Facilitator tabs (Live / Retro) */
.f-tabs { display: flex; background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; padding: 4px; gap: 3px; width: 100%; max-width: 720px; }
.f-tab { flex: 1; padding: 9px; background: none; color: var(--muted); border-radius: 10px; font-size: 0.82rem; font-weight: 600; border: none; letter-spacing: 0.03em; }
.f-tab.active { background: var(--yellow-dim); color: var(--yellow); }

/* Retro panel */
.retro-panel { display: none; flex-direction: column; gap: 16px; width: 100%; max-width: 720px; }
.retro-panel.active { display: flex; }

/* Retro chart */
.retro-chart-wrap {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 22px; padding: 22px 20px 16px;
}
.retro-chart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.retro-chart-title { font-family: var(--head); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.03em; }
.retro-chart-canvas-wrap { position: relative; height: 180px; }
canvas#retroChart { width: 100% !important; height: 100% !important; }

/* Retro log */
.retro-log-wrap {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 22px; padding: 22px 20px;
}
.retro-log-title { font-family: var(--head); font-size: 0.85rem; font-weight: 700; margin-bottom: 14px; letter-spacing: 0.03em; }
.retro-log { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.retro-log::-webkit-scrollbar { width: 4px; }
.retro-log::-webkit-scrollbar-track { background: transparent; }
.retro-log::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.log-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,0.03);
  font-size: 0.78rem;
}
.log-entry-icon { font-size: 1.2rem; flex-shrink: 0; }
.log-entry-label { flex: 1; font-weight: 600; }
.log-entry-time { font-family: var(--mono); font-size: 0.65rem; color: var(--muted); }
.log-entry.vote-red    { border-left: 3px solid rgba(255,59,59,0.4); }
.log-entry.vote-yellow { border-left: 3px solid rgba(245,197,24,0.4); }
.log-entry.vote-green  { border-left: 3px solid rgba(31,193,107,0.4); }

.retro-empty { font-size: 0.8rem; color: var(--muted); text-align: center; padding: 24px 0; }

/* Facilitator bottom actions */
.f-bottom { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: 100%; max-width: 720px; }
.f-btn { background: var(--surface); border: 1.5px solid var(--border); color: var(--muted); border-radius: 11px; padding: 8px 17px; font-size: 0.78rem; letter-spacing: 0.03em; }
.f-btn:hover { border-color: var(--border2); color: var(--text); }
.f-btn.danger:hover { border-color: var(--red); color: var(--red); }

/* Live panel */
.live-panel { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.live-panel.hidden { display: none; }

/* ── PARTICIPANT ─────────────────────────────────────────────── */
#participant { align-items: center; padding: 24px 18px 32px; gap: 18px; }

.p-topbar { width: 100%; max-width: 380px; display: flex; align-items: center; justify-content: space-between; }
.p-title { font-family: var(--head); font-size: 1rem; font-weight: 700; }

/* Mini light */
.p-light-box {
  position: relative; width: 100%; max-width: 380px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 22px; padding: 18px 18px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; overflow: hidden;
}
.p-glow { position: absolute; inset: 0; border-radius: 22px; opacity: 0; transition: opacity 1.2s; pointer-events: none; }
.mini-bulbs { display: flex; gap: 14px; align-items: center; }
.bulb-sm { width: 50px; height: 50px; }
.bulb-sm.lit-red    { box-shadow: 0 0 22px rgba(255,59,59,0.7); }
.bulb-sm.lit-yellow { box-shadow: 0 0 22px rgba(245,197,24,0.7); }
.bulb-sm.lit-green  { box-shadow: 0 0 22px rgba(31,193,107,0.7); }
.p-status { font-size: 0.8rem; font-weight: 600; color: var(--muted); transition: color 0.5s; text-align: center; }

.p-bd { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 22px; }
.p-bp { display: flex; align-items: center; gap: 5px; font-size: 0.7rem; font-weight: 600; color: var(--muted); background: rgba(255,255,255,0.04); border-radius: 20px; padding: 3px 10px; transition: opacity 0.3s; }
.p-bp.hidden { opacity: 0; pointer-events: none; }

/* Vote section */
.vote-section { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.vote-section-label { font-size: 0.68rem; font-family: var(--mono); color: var(--muted); letter-spacing: 0.09em; text-transform: uppercase; text-align: center; }

/* Input mode tabs */
.mode-tabs { display: flex; background: var(--surface); border: 1.5px solid var(--border); border-radius: 13px; padding: 4px; gap: 3px; }
.mode-tab { flex: 1; padding: 7px 4px; font-size: 0.7rem; letter-spacing: 0.03em; border-radius: 9px; background: none; color: var(--muted); border: none; }
.mode-tab.active { background: rgba(245,197,24,0.12); color: var(--yellow); }

/* Vote buttons */
.vote-btns { display: flex; gap: 9px; }
.vote-btn {
  flex: 1; padding: 18px 7px; border-radius: 17px; border: 2px solid transparent;
  background: var(--surface2); color: var(--muted);
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; font-size: 0.72rem; font-weight: 600; line-height: 1.4;
  text-align: center; transition: all 0.2s;
}
.vote-btn .vb-icon { font-size: 1.75rem; line-height: 1; }
.vote-btn:hover { transform: translateY(-2px); }
.vb-red    { border-color: rgba(255,59,59,0.25); }
.vb-yellow { border-color: rgba(245,197,24,0.25); }
.vb-green  { border-color: rgba(31,193,107,0.25); }
.vb-red.selected    { background: var(--red-dim);    border-color: var(--red);    color: var(--red);    transform: translateY(-4px) scale(1.04); }
.vb-yellow.selected { background: var(--yellow-dim); border-color: var(--yellow); color: var(--yellow); transform: translateY(-4px) scale(1.04); }
.vb-green.selected  { background: var(--green-dim);  border-color: var(--green);  color: var(--green);  transform: translateY(-4px) scale(1.04); }

/* Slider */
.slider-wrap { padding: 8px 2px; display: flex; flex-direction: column; gap: 10px; }
.focus-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 10px;
  border-radius: 6px; outline: none; cursor: pointer;
  background: linear-gradient(to right, var(--red), var(--yellow) 50%, var(--green));
  filter: brightness(0.65);
}
.focus-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%;
  background: white; border: 3px solid var(--yellow);
  box-shadow: 0 2px 8px rgba(0,0,0,0.45); cursor: grab; transition: transform 0.15s, border-color 0.3s;
}
.focus-slider::-webkit-slider-thumb:active { transform: scale(1.2); cursor: grabbing; }
.slider-labels { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--muted); }
.slider-val-label { text-align: center; font-family: var(--mono); font-size: 0.76rem; color: var(--muted); min-height: 18px; }

/* Emoji grid */
.emoji-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.emoji-btn {
  padding: 13px 6px; border-radius: 13px; background: var(--surface2);
  border: 1.5px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 0.67rem; color: var(--muted); transition: all 0.18s;
}
.emoji-btn .e-icon { font-size: 1.55rem; }
/* Pale coloured border — mirrors the vote buttons, hints at traffic light group */
.emoji-btn.hint-r { border-color: rgba(255,  59,  59, 0.3); }
.emoji-btn.hint-y { border-color: rgba(245, 197,  24, 0.3); }
.emoji-btn.hint-g { border-color: rgba( 31, 193, 107, 0.3); }
.emoji-btn:hover { border-color: var(--border2); color: var(--text); }
.emoji-btn.sel-r { background: var(--red-dim);    border-color: var(--red);    color: var(--red); }
.emoji-btn.sel-y { background: var(--yellow-dim); border-color: var(--yellow); color: var(--yellow); }
.emoji-btn.sel-g { background: var(--green-dim);  border-color: var(--green);  color: var(--green); }

/* Submit */
.my-vote-chip { text-align: center; font-size: 0.7rem; color: var(--muted); font-family: var(--mono); letter-spacing: 0.04em; min-height: 17px; }
.my-vote-chip strong { font-weight: 700; }

/* ── Connection status pill ────────────────────────────────── */
.conn-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.06em;
  color: var(--muted); background: var(--surface2);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 3px 10px; transition: color 0.3s, border-color 0.3s, background 0.3s;
  white-space: nowrap;
}
.conn-pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted); transition: background 0.3s;
  flex-shrink: 0;
}

/* LIVE — green, pulsing dot */
.conn-pill.live { color: var(--green); border-color: rgba(31,193,107,0.3); }
.conn-pill.live .conn-pill-dot {
  background: var(--green);
  animation: connPulse 2s infinite;
}

/* SYNC — yellow */
.conn-pill.polling { color: var(--yellow); border-color: rgba(245,197,24,0.3); }
.conn-pill.polling .conn-pill-dot { background: var(--yellow); }

/* OFFLINE — red, attention-grabbing */
.conn-pill.offline {
  color: var(--red);
  border-color: rgba(255,59,59,0.4);
  background: rgba(255,59,59,0.08);
  animation: offlinePulse 1.5s ease infinite;
}
.conn-pill.offline .conn-pill-dot { background: var(--red); animation: none; }

@keyframes connPulse    { 0%,100%{opacity:1} 50%{opacity:0.35} }
@keyframes offlinePulse { 0%,100%{opacity:1} 50%{opacity:0.65} }

/* Retry button inside the pill */
.conn-pill-retry {
  background: none;
  border: 1px solid currentColor;
  color: inherit;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.62rem;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  cursor: pointer;
  margin-left: 2px;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.conn-pill-retry:hover { opacity: 1; }

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(72px);
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 11px; padding: 9px 20px; font-size: 0.8rem; font-weight: 500;
  pointer-events: none; transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  opacity: 0; z-index: 200; white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── QR Code Modal ──────────────────────────────────────────── */
.qr-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
  backdrop-filter: blur(4px);
}
.qr-overlay.active { opacity: 1; pointer-events: auto; }

.qr-modal {
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 26px;
  padding: 28px 26px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 300px; width: 90%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  animation: modalPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalPop {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.qr-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}
.qr-title { font-family: var(--head); font-size: 1rem; font-weight: 700; }
.qr-close-btn {
  background: none; border: none; color: var(--muted);
  font-size: 1rem; padding: 2px 6px; border-radius: 6px;
  line-height: 1;
}
.qr-close-btn:hover { color: var(--text); background: var(--border); }

.qr-code-box {
  background: #13161f;
  border: 2px solid var(--border2);
  border-radius: 16px;
  padding: 12px;
  line-height: 0; /* remove gap below canvas/img */
}
/* QRCode.js renders either a canvas or an img — round both */
.qr-code-box canvas,
.qr-code-box img { border-radius: 8px; display: block; }

.qr-room-badge {
  font-family: var(--mono); font-size: 1.5rem; font-weight: 500;
  letter-spacing: 0.18em; color: var(--yellow);
}

.qr-link-text {
  font-family: var(--mono); font-size: 0.6rem; color: var(--muted);
  word-break: break-all; text-align: center; line-height: 1.5;
  max-width: 240px;
}

.qr-actions { display: flex; gap: 8px; }

/* ── Meeting status badge ───────────────────────────────────── */
.meeting-status-bar {
  width: 100%; max-width: 720px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.07em;
  border-radius: 20px; padding: 5px 14px;
  border: 1.5px solid var(--border); color: var(--muted);
  transition: all 0.3s;
}
.status-badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); transition: background 0.3s; }
.status-badge.open   { border-color: rgba(31,193,107,0.4); color: var(--green); }
.status-badge.open   .status-badge-dot { background: var(--green); box-shadow: 0 0 6px var(--green); animation: statusPulse 2s infinite; }
.status-badge.paused { border-color: rgba(245,197,24,0.4); color: var(--yellow); }
.status-badge.paused .status-badge-dot { background: var(--yellow); }
.status-badge.closed { border-color: rgba(255,59,59,0.4); color: var(--red); }
.status-badge.closed .status-badge-dot { background: var(--red); }
@keyframes statusPulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.status-controls { display: flex; gap: 7px; flex-wrap: wrap; }
.status-btn {
  padding: 6px 16px; font-size: 0.78rem; border-radius: 10px;
  background: none; border: 1.5px solid var(--border); color: var(--muted);
}
.status-btn:hover { border-color: var(--muted); color: var(--text); }
.status-btn.btn-open   { border-color: rgba(31,193,107,0.5); color: var(--green); }
.status-btn.btn-open:hover   { background: var(--green-dim); }
.status-btn.btn-pause  { border-color: rgba(245,197,24,0.5); color: var(--yellow); }
.status-btn.btn-pause:hover  { background: var(--yellow-dim); }
.status-btn.btn-close  { border-color: rgba(255,59,59,0.5); color: var(--red); }
.status-btn.btn-close:hover  { background: var(--red-dim); }

/* Participant: show locked message when meeting not open */
.voting-locked-msg {
  text-align: center; font-size: 0.82rem; font-weight: 600;
  color: var(--muted); padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border); border-radius: 14px;
  display: none;
}
.voting-locked-msg.visible { display: block; }

/* ── Average focus number (retro tab) ───────────────────────── */
.avg-focus-wrap {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 22px; padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.avg-focus-left { display: flex; flex-direction: column; gap: 3px; }
.avg-focus-label { font-family: var(--head); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.03em; }
.avg-focus-sub   { font-size: 0.7rem; color: var(--muted); font-family: var(--mono); }
.avg-focus-right { text-align: right; }
.avg-focus-number {
  font-family: var(--head); font-size: 2.8rem; font-weight: 800;
  letter-spacing: -0.02em; transition: color 0.5s; line-height: 1;
}
.avg-focus-duration { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); letter-spacing: 0.06em; margin-top: 4px; }

/* ── Inline QR side-by-side layout ─────────────────────────── */
.f-live-row {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 720px;
  align-items: stretch;
}

/* Traffic light box shrinks when QR is visible */
.f-live-row .f-light-box {
  flex: 1;
  min-width: 0;
  max-width: 720px; /* full width when QR hidden */
  transition: max-width 0.4s ease;
}

/* Inline QR panel */
.f-qr-panel {
  display: none; /* hidden by default */
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid rgba(245,197,24,0.25);
  border-radius: 28px;
  padding: 22px 18px 18px;
  width: 220px;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.95) translateX(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.f-qr-panel.visible {
  display: flex;
  opacity: 1;
  transform: scale(1) translateX(0);
}

/* Animate in after display:flex kicks in */
.f-qr-panel.animating {
  display: flex;
}

.f-qr-panel.hiding {
  opacity: 0;
  transform: scale(0.95) translateX(12px);
}

.f-qr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.f-qr-title {
  font-family: var(--head);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.f-qr-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
}
.f-qr-close:hover { color: var(--text); background: var(--border); }

.f-qr-code {
  background: #13161f;
  border: 2px solid var(--border2);
  border-radius: 14px;
  padding: 10px;
  line-height: 0;
}
.f-qr-code canvas,
.f-qr-code img { border-radius: 6px; display: block; width: 160px !important; height: 160px !important; }

.f-qr-room {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--yellow);
}

.f-qr-zoom-hint {
  font-size: 0.6rem;
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-top: -6px;
}

@media (max-width: 600px) {
  /* On narrow screens, stack instead of side-by-side */
  .f-live-row { flex-direction: column; }
  .f-qr-panel { width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .f-qr-code canvas, .f-qr-code img { width: 120px !important; height: 120px !important; }
}

@media (max-width: 480px) {
  .bulb-lg { width: 70px; height: 70px; }
  .bulbs-row { gap: 18px; }
  .f-light-box { padding: 22px 16px 18px; }
}

/* ── Rising emoji animation ─────────────────────────────────── */
/* Two independent animations run in parallel:
   Movement: fast entry (0.16s) → smooth constant rise (2.3s)
   Opacity:  quick fade-in (0.08s) → visible (1.2s) → fade-out (0.8s) */

.rising-emoji {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
  will-change: transform, opacity;
}

.rising-emoji-icon {
  font-size: 1.5rem;
  line-height: 1;
  position: relative;
  z-index: 1;
}