/* ==========================================================================
   zPOLLS STYLESHEET
   Warren's zSuite — Aesthetic Ink-Paper Monospace Design System
   ========================================================================== */

:root {
  color-scheme: light;
  --desk: #e6e4de;
  --paper: #f4f3ef;
  --ink: #121211;
  --mid: #4a4945;
  --muted: #75746f;
  --soft: #a3a29d;
  --rule: #d2d1cb;
  --stamp: #a8321f;
  --field: rgba(18, 18, 17, 0.055);
  --font: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ink-blue: #325b99;
  --ink-green: #376b42;
  --ink-gold: #9e7314;
  --ink-purple: #6d478f;
  --ink-cyan: #197a8c;

  --bg-blue: rgba(50, 91, 153, 0.08);
  --bg-green: rgba(55, 107, 66, 0.08);
  --bg-gold: rgba(158, 115, 20, 0.08);
  --bg-purple: rgba(109, 71, 143, 0.08);

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --ease-gentle: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  color-scheme: dark;
  --desk: #0c0c0b;
  --paper: #1a1a18;
  --ink: #efeee9;
  --mid: #c5c4be;
  --muted: #8d8c86;
  --soft: #62615c;
  --rule: #34342f;
  --stamp: #ff8f70;
  --field: rgba(255, 255, 255, 0.06);

  --ink-blue: #86b2ff;
  --ink-green: #81cf93;
  --ink-gold: #f2c14e;
  --ink-purple: #c79ff5;
  --ink-cyan: #64d2e8;

  --bg-blue: rgba(134, 178, 255, 0.12);
  --bg-green: rgba(129, 207, 147, 0.12);
  --bg-gold: rgba(242, 193, 78, 0.12);
  --bg-purple: rgba(199, 159, 245, 0.12);

  --shadow-subtle: 0 4px 16px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Scrollbar System */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 99px;
  transition: background 0.15s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--soft);
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--desk);
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

body {
  background-color: var(--desk);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-dim { color: var(--soft); font-size: 11px; }

/* Confetti Overlay */
.confetti-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}

/* Toast Banner */
.toast-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--solid);
  color: var(--on-solid);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s var(--ease-gentle), opacity 0.25s ease;
}
.toast-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Global Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.nav-back-link:hover {
  color: var(--ink);
  background: var(--field);
}
.nav-back-link :is(i, svg) {
  width: 14px;
  height: 14px;
}

.divider-vertical {
  width: 1px;
  height: 18px;
  background: var(--rule);
}

.brand-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand-subtext {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}

.header-room-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--field);
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}
.room-code-tag {
  font-weight: 800;
  font-size: 12px;
  color: var(--ink-blue);
  letter-spacing: 1px;
  cursor: pointer;
}

.sync-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-green);
  box-shadow: 0 0 6px var(--ink-green);
}
.sync-status-pill.offline .sync-dot {
  background: var(--stamp);
  box-shadow: 0 0 6px var(--stamp);
}

.btn-icon-subtle {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.btn-icon-subtle:hover {
  color: var(--ink);
  background: var(--field);
}
.btn-icon-subtle :is(i, svg) {
  width: 16px;
  height: 16px;
}

.btn-theme-toggle {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 13px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-theme-toggle:hover {
  background: var(--field);
}

/* Button & Input System */
.btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s var(--ease-gentle);
  user-select: none;
  text-decoration: none;
}
.btn :is(i, svg) {
  width: 14px;
  height: 14px;
}
.btn-primary {
  background: var(--solid);
  color: var(--on-solid);
  border-color: var(--border-strong);
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-outline {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--rule);
}
.btn-outline:hover {
  background: var(--field);
  border-color: var(--mid);
}
.btn-danger {
  background: var(--stamp);
  color: #fff;
  border-color: var(--stamp);
}
.btn-danger:hover {
  opacity: 0.9;
}
.btn-sm {
  padding: 4px 9px;
  font-size: 11px;
}
.btn-xs {
  padding: 2px 6px;
  font-size: 10px;
}
.btn-lg {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
}
.btn-block {
  width: 100%;
}

.form-group {
  margin-bottom: 8px;
}
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.form-input, .form-textarea, select.form-input {
  width: 100%;
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.15s ease;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--border-strong);
}
.form-input-lg {
  font-size: 16px;
  padding: 10px 14px;
  font-weight: 700;
  letter-spacing: 1px;
}
.uppercase-input {
  text-transform: uppercase;
}
.input-with-action {
  display: flex;
  gap: 6px;
}

.pill-selector {
  display: flex;
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
  flex-wrap: wrap;
}
.pill-opt {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.pill-opt:hover {
  color: var(--ink);
}
.pill-opt.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: var(--radius-sm);
}
.badge-pill :is(i, svg) {
  width: 13px;
  height: 13px;
}
.badge-count {
  background: var(--ink-blue);
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 99px;
  font-weight: 800;
}

/* App Main Container: Screen-Fit Viewport */
.app-main-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 16px;
  height: calc(100vh - 54px);
  height: calc(100dvh - 54px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================================================
   VIEW 1: LOBBY — same frame and layout as zARCADE (hero + tiles from
   /shared/zui.css). body.in-hub swaps the full-bleed app header for it.
   ========================================================================== */
body.in-hub > .app-header,
body.in-hub > .app-main-container,
body:not(.in-hub) > .polls-lobby { display: none !important; }
body.in-hub { flex-direction: row; justify-content: center; align-items: stretch; }

.polls-lobby {
  width: 100%;
  max-width: 560px;
  min-width: 0;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-left: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
}
.polls-lobby > .card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  view-transition-name: zui-page;
  timeline-scope: --zui-hero;
}
.polls-lobby .nav-breadcrumbs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding: 14px 20px;
  margin: -18px -20px 14px;
  border-bottom: 1px solid transparent !important;
}
.polls-lobby .nav-breadcrumbs > span:first-child { display: inline-flex; align-items: center; }
.polls-compact { margin-left: 6px; font-weight: 600; color: var(--text); }
.polls-lobby .zui-sticky-head { top: -18px; }

.hub-quick-join-card {
  margin-bottom: 22px;
  padding: 10px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--fill);
  box-shadow: var(--glass-hi);
}
.quick-join-inputs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quick-join-inputs .form-input { flex: 1 1 140px; width: auto; min-width: 0; padding: 8px 12px; font-size: 13px; }

.polls-modes { --tile-min: 220px; }
.polls-lobby .footer-note {
  margin-top: auto;
  padding-top: 20px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-4);
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .polls-lobby > .card { padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .polls-lobby .nav-breadcrumbs { margin: -18px -16px 14px; padding: 14px 16px; }
}
/* Desktop: same frame as the zSuite hub, so the shell holds still across page transitions */
@media (min-width: 768px) {
  body.in-hub { padding: 28px; align-items: center; }
  .polls-lobby {
    max-width: 1120px;
    height: min(94vh, 860px);
    border: 1px solid var(--glass-border);
  }
  .polls-lobby > .card { padding: 18px 24px 16px; }
  .polls-lobby .nav-breadcrumbs { margin: -18px -24px 14px; padding: 14px 24px; }
}

/* Mode icon chip (setup modal header) */
.mode-icon-box {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mode-icon-box :is(i, svg) { width: 19px; height: 19px; }
.mode-icon-box.bg-blue   { background: var(--bg-blue); color: var(--ink-blue); }
.mode-icon-box.bg-purple { background: var(--bg-purple); color: var(--ink-purple); }
.mode-icon-box.bg-green  { background: var(--bg-green); color: var(--ink-green); }
.mode-icon-box.bg-gold   { background: var(--bg-gold); color: var(--ink-gold); }
.mode-icon-box.bg-cyan   { background: rgba(25, 122, 140, 0.1); color: var(--ink-cyan); }
.mode-icon-box.bg-stamp  { background: rgba(168, 50, 31, 0.1); color: var(--stamp); }

.recent-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--field);
  transition: background 0.12s ease;
}
.recent-item-row:last-child { border-bottom: none; }
.recent-item-row:hover { background: var(--field); }
.recent-code {
  font-weight: 800;
  color: var(--ink-blue);
  font-size: 13px;
}
.recent-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

/* ==========================================================================
   VIEW 2: PRESENTER / STAGE MODE
   ========================================================================== */
#view-presenter {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.presenter-top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.hud-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.hud-join-banner {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--field);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
}
.hud-join-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.hud-join-url {
  font-size: 12px;
  font-weight: 700;
}
.hud-code-badge {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-blue);
  letter-spacing: 1px;
  cursor: pointer;
  padding: 0 4px;
  border-bottom: 1px solid var(--ink-blue);
}
.hud-slide-counter {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.hud-slide-counter:hover {
  background: var(--field);
}

.presenter-stage {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-subtle);
}
:fullscreen .presenter-stage {
  min-height: 85vh;
  padding: 30px 40px;
  border: none;
}

.stage-slide-header {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 30px auto;
}
.stage-type-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: 99px;
  color: var(--muted);
  margin-bottom: 10px;
}
.stage-slide-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin-bottom: 6px;
}
.stage-slide-subtitle {
  font-size: 14px;
  color: var(--muted);
}

.stage-canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  min-height: 340px;
}

/* Blind Curtain Overlay */
.blind-curtain {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(var(--paper), 0.96);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: var(--radius-md);
  z-index: 50;
  padding: 20px;
}

/* Deck Strip Carousel */
.presenter-bottom-deck {
  /* overflow-x:auto also clips vertically, so pad the strip to leave room for
     the hover lift and the active ring, and pull the margin back in. */
  margin-top: 0;
  overflow-x: auto;
  padding: 8px 4px 10px;
  flex-shrink: 0;
}
.deck-strip-track {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.deck-thumb {
  min-width: 160px;
  max-width: 180px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.deck-thumb:hover {
  border-color: var(--mid);
  transform: translateY(-2px);
}
.deck-thumb.active {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 2px var(--ink);
}
.deck-thumb-num {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}
.deck-thumb-title {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}

/* ==========================================================================
   PRESENTATION VISUALIZERS (Bars, WordCloud, Masonry, Ladder, Matrix, Quiz)
   ========================================================================== */

/* 1. Multiple Choice Bar Chart */
.chart-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
}
.chart-bar-item {
  position: relative;
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}
.chart-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--bg-blue);
  border-right: 2px solid var(--ink-blue);
  transition: width 0.6s var(--ease-gentle);
  z-index: 1;
}
.chart-bar-item.is-correct .chart-bar-fill {
  background: var(--bg-green);
  border-right-color: var(--ink-green);
}
.chart-bar-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}
.chart-bar-key {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
}
.chart-bar-label {
  font-size: 16px;
  font-weight: 700;
}
.chart-bar-stats {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.chart-bar-pct {
  font-size: 18px;
  font-weight: 800;
}
.chart-bar-count {
  font-size: 12px;
  color: var(--muted);
}

/* 2. Word Cloud Stage */
.wordcloud-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 30px 20px;
  min-height: 360px;
  max-width: 1000px;
  margin: 0 auto;
}
.cloud-word {
  display: inline-block;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s var(--ease-gentle), color 0.2s ease;
  line-height: 1;
}
.cloud-word:hover {
  transform: scale(1.15) !important;
  background: var(--field);
}

/* 3. Ideas Wall & Brainstorming Masonry */
.ideas-wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  padding: 10px 0;
  width: 100%;
}
.idea-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink-blue);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.idea-card:hover {
  transform: translateY(-2px);
  border-color: var(--mid);
}
.idea-text {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 12px;
  word-break: break-word;
}
.idea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
.btn-upvote {
  background: var(--field);
  border: 1px solid var(--rule);
  padding: 3px 8px;
  border-radius: 99px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 11px;
}
.btn-upvote:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn-upvote.voted {
  background: var(--bg-blue);
  border-color: var(--ink-blue);
  color: var(--ink-blue);
}

/* 4. Ranking Ladder */
.ranking-ladder-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}
.ranking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.3s ease;
}
.ranking-rank {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-gold);
  width: 32px;
}
.ranking-label {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}
.ranking-score-pill {
  font-size: 12px;
  font-weight: 700;
  background: var(--field);
  padding: 3px 8px;
  border-radius: 99px;
}

/* 5. 2D Matrix / 2x2 Grid Canvas */
.matrix-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 1;
  margin: 0 auto;
  border: 2px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
}
.matrix-cross-x {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--rule);
}
.matrix-cross-y {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--rule);
}
.matrix-label {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px;
}
.matrix-label-top { top: 0; left: 50%; transform: translateX(-50%); }
.matrix-label-bottom { bottom: 0; left: 50%; transform: translateX(-50%); }
.matrix-label-left { left: 0; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.matrix-label-right { right: 0; top: 50%; transform: translateY(-50%) rotate(90deg); }
.matrix-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink-blue);
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
  transition: all 0.3s var(--ease-gentle);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  cursor: pointer;
}
.matrix-centroid {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(168, 50, 31, 0.2);
  border: 2px solid var(--stamp);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: var(--stamp);
}

/* 6. Rating & Likert Distribution */
.rating-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 650px;
  width: 100%;
  margin: 0 auto;
}
.rating-big-score {
  font-size: 56px;
  font-weight: 800;
  color: var(--ink-gold);
  line-height: 1;
}
.rating-stars-row {
  display: flex;
  gap: 6px;
}
.rating-stars-row :is(i, svg) {
  width: 28px;
  height: 28px;
  fill: var(--ink-gold);
  color: var(--ink-gold);
}
.likert-dist-bars {
  display: flex;
  gap: 12px;
  width: 100%;
  height: 180px;
  align-items: flex-end;
  border-bottom: 2px solid var(--rule);
  padding-bottom: 8px;
}
.likert-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}
.likert-bar {
  width: 100%;
  background: var(--bg-blue);
  border-top: 2px solid var(--ink-blue);
  border-radius: var(--r-sm) 2px 0 0;
  transition: height 0.5s ease;
  min-height: 4px;
}
.likert-col-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

/* 7. Timed Quiz & Podium Leaderboard */
.quiz-podium-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  min-height: 260px;
  margin-top: 20px;
}
.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
}
.podium-avatar {
  font-size: 32px;
  margin-bottom: 4px;
}
.podium-nick {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  text-align: center;
}
.podium-score {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.podium-pillar {
  width: 100%;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--on-solid);
}
.podium-pillar.gold {
  height: 140px;
  background: #d4af37;
}
.podium-pillar.silver {
  height: 105px;
  background: #a9a9a9;
}
.podium-pillar.bronze {
  height: 75px;
  background: #cd7f32;
}

/* 8. Spinner Wheel */
.wheel-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 0 auto;
}
.wheel-canvas-container {
  position: relative;
  width: 320px;
  height: 320px;
}
.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid var(--stamp);
  z-index: 10;
}

/* ==========================================================================
   VIEW 3: AUDIENCE / PARTICIPANT VIEW
   ========================================================================== */
#view-audience {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.audience-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.audience-room-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.audience-code-tag {
  font-weight: 800;
  font-size: 12px;
  color: var(--ink-blue);
  background: var(--bg-blue);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.audience-title-text {
  font-size: 13px;
  font-weight: 700;
}
.audience-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--field);
  border: 1px solid var(--rule);
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}
.audience-user-pill:hover {
  background: var(--paper);
  border-color: var(--mid);
}

.audience-voter-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-subtle);
  margin-bottom: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.audience-slide-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.audience-status-pill {
  font-size: 11px;
  font-weight: 700;
}

.audience-question-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 6px;
}
.audience-question-hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Audience Input Controls */
.audience-choices-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.audience-choice-btn {
  background: var(--paper);
  border: 2px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  transition: all 0.15s ease;
  user-select: none;
}
.audience-choice-btn:hover {
  border-color: var(--mid);
  background: var(--field);
}
.audience-choice-btn.selected {
  border-color: var(--ink-blue);
  background: var(--bg-blue);
  color: var(--ink-blue);
}
.choice-letter {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--field);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
}
.audience-choice-btn.selected .choice-letter {
  background: var(--ink-blue);
  color: #fff;
}

.audience-feedback-box {
  background: var(--bg-green);
  border: 1px solid var(--ink-green);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  margin-top: 16px;
}
.audience-feedback-box.locked-box {
  background: var(--field);
  border-color: var(--rule);
}
.feedback-icon {
  font-size: 32px;
  color: var(--ink-green);
  margin-bottom: 6px;
}
.locked-box .feedback-icon {
  color: var(--muted);
}
.feedback-title {
  font-size: 16px;
  font-weight: 800;
}
.feedback-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.audience-bottom-dock {
  position: sticky;
  bottom: 14px;
  z-index: 100;
}

/* ==========================================================================
   MODALS & DRAWERS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  overflow: hidden;
}
.modal-lg {
  max-width: 760px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
}
.modal-body {
  padding: 18px;
  overflow-y: auto;
}
.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--rule);
  background: var(--field);
}

/* QR Code Modal */
.qr-modal-card {
  max-width: 380px;
}
.qr-code-frame {
  background: #fff;
  padding: 16px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin: 12px auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.qr-code-frame canvas, .qr-code-frame img {
  display: block;
}
.qr-join-url {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-blue);
  word-break: break-all;
  margin-top: 6px;
}
.qr-code-display {
  font-size: 18px;
  margin-top: 4px;
}

/* Drawer Component */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 20000;
  display: flex;
  justify-content: flex-end;
}
.drawer-panel {
  background: var(--paper);
  border-left: 1px solid var(--rule);
  width: 100%;
  max-width: 440px;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
}
.drawer-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--field);
  background: var(--field);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Q&A Item Card */
.qa-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: all 0.15s ease;
}
.qa-card.answered {
  opacity: 0.65;
  border-left: 3px solid var(--ink-green);
}
.qa-card.pinned {
  border-left: 3px solid var(--ink-gold);
}
.qa-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}
.qa-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
.qa-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* Spotlight Card */
.spotlight-card {
  background: var(--paper);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 40px;
  max-width: 800px;
  width: 90%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}
.spotlight-tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-gold);
  margin-bottom: 14px;
}
.spotlight-text {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 16px;
}
.spotlight-author {
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
}

/* Activity Picker in Editor */
.activity-type-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
}
.type-opt-btn {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  transition: all 0.15s ease;
}
.type-opt-btn :is(i, svg) { width: 16px; height: 16px; }
.type-opt-btn:hover {
  border-color: var(--mid);
  color: var(--ink);
}
.type-opt-btn.active {
  border-color: var(--border-strong);
  background: var(--field);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.options-builder-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.option-builder-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Avatar Picker */
.avatar-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.avatar-opt {
  font-size: 22px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: all 0.15s ease;
}
.avatar-opt:hover {
  background: var(--field);
}
.avatar-opt.selected {
  border-color: var(--border-strong);
  background: var(--field);
  transform: scale(1.1);
}

/* Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 680px) {
  .settings-grid { grid-template-columns: 1fr; }
}
.settings-sec-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.settings-sec-title :is(i, svg) { width: 14px; height: 14px; }
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--field);
}
.setting-name {
  font-size: 13px;
  font-weight: 700;
}
.setting-desc {
  font-size: 11px;
  color: var(--muted);
}

/* Report Content Box */
.report-content-box {
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--field);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
}


/* ==========================================================================
   zUI polish layer — soft glass + depth
   ========================================================================== */
body { font-size: 14px; }

.app-header {
  background: var(--glass) !important;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-hi);
  padding: 10px 18px;
}
.brand-title { font-size: 16px; font-weight: 680; letter-spacing: -0.02em; }
.brand-subtext { font-size: 10px; letter-spacing: .1em; color: var(--text-4); }
.divider-vertical { background: var(--border); }
.nav-back-link { margin-left: 0; }
.btn-icon-subtle { border-radius: var(--r-md); padding: 7px; }
.btn-icon-subtle:hover { background: var(--fill-2); }
.sync-status-pill { background: var(--fill); border-color: var(--border); font-size: 10.5px; letter-spacing: .06em; padding: 4px 10px; }
.sync-dot { box-shadow: 0 0 0 3px var(--positive-bg); }

.header-room-badge { border-radius: var(--r-pill); background: var(--fill); border-color: var(--border); padding: 3px 10px; }
.room-code-tag, .hud-code-badge, .audience-code-tag, .recent-code, .qr-code-display {
  font-family: var(--font-num);
  letter-spacing: .08em;
  color: var(--accent-text);
}
.room-code-tag { transition: transform var(--t-slow) var(--ease-spring); }
.room-code-tag:active { transform: scale(.92); }
.hud-code-badge { border-bottom: 0; padding: 2px 10px; border-radius: var(--r-pill); background: var(--accent-soft); }

/* Shared controls */
.btn { padding: 8px 14px; }
.btn-lg { padding: 12px 20px; font-size: 14px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }
.btn-outline { background: var(--fill); border-color: var(--border-strong); }
.btn-danger { background: var(--negative-bg); color: var(--negative); border: 1px solid color-mix(in oklab, var(--negative) 35%, transparent); }
.btn-danger:hover { background: var(--negative); color: #fff; }
.btn :is(i, svg), .btn > svg { width: 15px; height: 15px; flex-shrink: 0; }

.form-label { font-size: 12px; font-weight: 500; letter-spacing: .01em; text-transform: none; color: var(--text-3); }
.form-input, .form-textarea, select.form-input { border-radius: var(--r-md); padding: 10px 12px; font-size: 14px; }

.pill-selector { gap: 4px; padding: 4px; border-radius: 12px; background: var(--fill); border: 1px solid var(--border); }
.pill-opt { border: 0 !important; border-radius: var(--r-md); color: var(--text-3); background: transparent; transition: all var(--t-med) var(--ease-out); }
.pill-opt:hover { color: var(--text); background: var(--fill); }
.pill-opt.active { background: var(--accent-grad) !important; color: #fff !important; box-shadow: var(--glow); }

.badge-pill { border-radius: var(--r-pill); }
.badge-count { font-family: var(--font-num); border-radius: var(--r-pill); }

.recent-item-row { border-radius: var(--r-md); border-bottom-color: var(--border); padding: 10px 12px; transition: background var(--t-fast); }
.recent-item-row:hover { background: var(--fill-2); }

/* Presenter */
.presenter-top-hud, .audience-header {
  border-radius: 14px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-hi), var(--shadow-1);
  padding: 8px 12px;
}
.hud-join-banner { border-radius: var(--r-pill); background: var(--fill); border-color: var(--border); padding: 5px 12px; }
.hud-join-label { font-size: 9.5px; font-weight: 600; letter-spacing: .1em; color: var(--text-3); }
.hud-slide-counter { font-family: var(--font-num); border-radius: var(--r-md); background: var(--fill); border-color: var(--border); }

.presenter-stage {
  border-radius: var(--r-xl);
  border: 1px solid var(--glass-border);
  background:
    radial-gradient(60% 50% at 15% 0%, var(--aurora-1), transparent 70%),
    radial-gradient(50% 50% at 100% 100%, var(--aurora-2), transparent 70%),
    var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--glass-hi), var(--shadow-3);
  padding: 26px 32px;
}
.stage-type-chip { border: 0; background: var(--accent-soft); color: var(--accent-text); font-weight: 650; letter-spacing: .1em; padding: 4px 12px; }
.stage-slide-title { font-size: clamp(26px, 3.4vw, 44px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.12; }
.stage-slide-subtitle { font-size: 15px; color: var(--text-3); }
.blind-curtain { background: var(--glass-strong); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-radius: var(--r-xl); }

.deck-strip-track { gap: 8px; }
.deck-thumb { border-radius: 12px; background: var(--fill); border-color: var(--border); transition: transform var(--t-slow) var(--ease-spring), border-color var(--t-med), box-shadow var(--t-med); }
.deck-thumb:hover { border-color: var(--border-strong); }
.deck-thumb.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--accent-soft); }
.deck-thumb-num { font-family: var(--font-num); font-weight: 600; color: var(--text-3); }

/* Live charts */
.chart-bars-wrap { gap: 10px; }
.chart-bar-item {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--fill);
  padding: 14px 18px;
  animation: zuiRise .45s var(--ease-out) both;
}
.chart-bar-item:nth-child(2) { animation-delay: .05s; }
.chart-bar-item:nth-child(3) { animation-delay: .1s; }
.chart-bar-item:nth-child(4) { animation-delay: .15s; }
.chart-bar-item:nth-child(5) { animation-delay: .2s; }
.chart-bar-item:nth-child(6) { animation-delay: .25s; }
.chart-bar-fill {
  border-right: 0;
  background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 30%, transparent), color-mix(in oklab, var(--accent-2) 34%, transparent));
  box-shadow: inset -2px 0 0 var(--accent-2);
  transition: width .9s var(--ease-spring);
}
.chart-bar-item.is-correct .chart-bar-fill {
  background: linear-gradient(90deg, color-mix(in oklab, var(--positive) 22%, transparent), color-mix(in oklab, var(--positive) 38%, transparent));
  box-shadow: inset -2px 0 0 var(--positive);
}
.chart-bar-key { font-family: var(--font-num); border-radius: 8px; background: var(--surface); border-color: var(--border); }
.chart-bar-label { font-weight: 600; }
.chart-bar-pct { font-family: var(--font-num); font-weight: 650; letter-spacing: -0.03em; }
.chart-bar-count { font-family: var(--font-num); color: var(--text-3); }

.cloud-word { font-weight: 680; letter-spacing: -0.02em; border-radius: var(--r-md); animation: zuiPop .5s var(--ease-spring) both; }

.idea-card {
  border-radius: 14px;
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  background: var(--fill);
  box-shadow: var(--glass-hi), inset 0 3px 0 var(--ink-blue);
  animation: zuiPop .4s var(--ease-spring) both;
  transition: transform var(--t-slow) var(--ease-spring), border-color var(--t-med), box-shadow var(--t-med);
}
.idea-card:hover { transform: translateY(-3px) rotate(-.4deg); border-color: var(--border-strong); box-shadow: var(--shadow-2), inset 0 3px 0 var(--ink-blue); }
.btn-upvote { border-radius: var(--r-pill); font-family: var(--font-num); transition: all var(--t-med) var(--ease-spring); }
.btn-upvote.voted { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }

.ranking-item { border-radius: 12px; background: var(--fill); border-color: var(--border); transition: transform var(--t-slow) var(--ease-spring); }
.ranking-rank, .ranking-score-pill, .rating-big-score, .podium-score { font-family: var(--font-num); }
.ranking-score-pill { border-radius: var(--r-pill); }
.matrix-container { border-radius: var(--r-lg); border-color: var(--border); background: var(--fill); }
.matrix-dot { box-shadow: 0 0 0 3px var(--accent-soft); transition: left .8s var(--ease-spring), top .8s var(--ease-spring); }
.likert-bar { border-radius: 8px 8px 3px 3px; background: var(--accent-grad); transition: height .9s var(--ease-spring); }
.podium-pillar { border-radius: 14px 14px 4px 4px; box-shadow: var(--glass-hi); }
.podium-pillar.gold { background: linear-gradient(180deg, #ffd66b, #e9a72a); }
.podium-pillar.silver { background: linear-gradient(180deg, #e6e9f2, #a9b0c2); }
.podium-pillar.bronze { background: linear-gradient(180deg, #f2b07c, #c4733c); }

/* Timer ring */
#btn-timer-trigger.is-running { position: relative; padding-left: 32px; }
#btn-timer-trigger.is-running > svg { display: none; }
#btn-timer-trigger.is-running::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  width: 16px; height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: conic-gradient(var(--accent-2) calc(var(--p, 1) * 360deg), var(--fill-2) 0);
  -webkit-mask: radial-gradient(circle, transparent 4.5px, #000 5px);
  mask: radial-gradient(circle, transparent 4.5px, #000 5px);
  transition: background .9s linear;
}
#btn-timer-trigger.is-urgent { color: var(--negative); border-color: color-mix(in oklab, var(--negative) 40%, transparent); animation: timerPulse 1s ease-in-out infinite; }
#btn-timer-trigger.is-urgent::before { background: conic-gradient(var(--negative) calc(var(--p, 1) * 360deg), var(--fill-2) 0); }
#hud-timer-display { font-family: var(--font-num); }
@keyframes timerPulse { 50% { box-shadow: 0 0 0 4px var(--negative-bg); } }

/* Audience */
.audience-code-tag { border-radius: var(--r-pill); background: var(--accent-soft); padding: 2px 10px; }
.audience-user-pill { border-radius: var(--r-pill); background: var(--fill); border-color: var(--border); }
.audience-voter-card {
  border-radius: var(--r-xl);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-hi), var(--shadow-2);
  padding: 22px;
}
.audience-question-title { font-size: 22px; font-weight: 680; letter-spacing: -0.025em; }
.audience-choice-btn {
  font-family: var(--font-ui);
  font-weight: 560;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--fill);
  padding: 14px 16px;
  transition: transform var(--t-slow) var(--ease-spring), border-color var(--t-med), background var(--t-med), box-shadow var(--t-med);
}
.audience-choice-btn:hover { border-color: var(--border-strong); background: var(--fill-2); transform: translateY(-1px); }
.audience-choice-btn:active { transform: scale(.98); }
.audience-choice-btn.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.choice-letter { font-family: var(--font-num); border-radius: 9px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); transition: all var(--t-med) var(--ease-spring); }
.audience-choice-btn.selected .choice-letter { background: var(--accent-grad); color: #fff; box-shadow: var(--glow); transform: scale(1.08); }
.audience-feedback-box { border-radius: var(--r-lg); border-color: color-mix(in oklab, var(--positive) 35%, transparent); animation: zuiPop .4s var(--ease-spring) both; }
.audience-bottom-dock {
  border-radius: 18px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-hi), var(--shadow-3);
}

/* Modals + drawer */
.modal-backdrop, .drawer-backdrop {
  background: rgba(6, 8, 14, .5);
  -webkit-backdrop-filter: blur(10px) saturate(120%); backdrop-filter: blur(10px) saturate(120%);
  animation: zuiFade var(--t-med) var(--ease-out) both;
}
.modal-card {
  border-radius: var(--r-xl);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-hi), var(--shadow-3);
  animation: zuiPop var(--t-slow) var(--ease-spring) both;
}
.modal-header { border-bottom-color: var(--border); padding: 16px 20px; }
.modal-body { padding: 20px; }
.modal-footer { border-top-color: var(--border); background: transparent; padding: 14px 20px; }
.qr-code-frame { border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.qr-join-url { color: var(--accent-text); font-family: var(--font-num); font-weight: 500; }
.drawer-panel {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-left: 1px solid var(--glass-border);
  box-shadow: var(--shadow-3);
}
.drawer-header, .drawer-filter-bar { border-bottom-color: var(--border); }
.qa-card { border-radius: 14px; background: var(--fill); border-color: var(--border); animation: zuiRise .4s var(--ease-out) both; }
.qa-card.pinned { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.spotlight-card { border-radius: var(--r-xl); background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--fill); border-color: color-mix(in oklab, var(--accent) 30%, transparent); }
.spotlight-tag { border-radius: var(--r-pill); }

.type-opt-btn { border-radius: 12px; border-color: var(--border); background: var(--fill); transition: all var(--t-med) var(--ease-out); }
.type-opt-btn:hover { border-color: var(--border-strong); }
.type-opt-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.option-builder-row { gap: 8px; }
.avatar-opt { border-radius: 12px; transition: transform var(--t-slow) var(--ease-spring); }
.avatar-opt:hover { transform: scale(1.1); }
.avatar-opt.selected { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-soft); }
.settings-sec-title { letter-spacing: .08em; color: var(--text-3); }
.setting-item { border-color: var(--border); }
.report-content-box { border-radius: var(--r-lg); background: var(--fill); border-color: var(--border); }

/* ==========================================================================
   Scroll layer hooks (see /shared/zui.css)
   ========================================================================== */
/* Slide strip: snaps thumbnails to centre; works without timeline support too */
.presenter-bottom-deck {
  scroll-snap-type: x proximity;
  scroll-padding-inline: 24px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.presenter-bottom-deck::-webkit-scrollbar { display: none; }
.deck-thumb { scroll-snap-align: center; }

@supports (animation-timeline: view()) {
@media (prefers-reduced-motion: no-preference) {
  @property --fade-left { syntax: '<length>'; inherits: false; initial-value: 0px; }
  @property --fade-right { syntax: '<length>'; inherits: false; initial-value: 0px; }
  @keyframes deckFadeLeft { from { --fade-left: 0px; } to { --fade-left: 40px; } }
  @keyframes deckFadeRight { from { --fade-right: 40px; } to { --fade-right: 0px; } }
  @keyframes deckFocus { 0%, 100% { scale: .93; opacity: .6; } 35%, 65% { scale: 1; opacity: 1; } }
  .presenter-bottom-deck {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-left), #000 calc(100% - var(--fade-right)), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-left), #000 calc(100% - var(--fade-right)), transparent 100%);
    animation: deckFadeLeft linear both, deckFadeRight linear both;
    animation-timeline: scroll(self inline), scroll(self inline);
    animation-range: 0px 48px, calc(100% - 48px) 100%;
  }
  /* Focus effect only when the strip actually overflows (a short deck stays flat) */
  .presenter-bottom-deck { container-type: scroll-state; }
  @container scroll-state(scrollable: inline) {
    .deck-thumb {
      animation: deckFocus linear both;
      animation-timeline: view(inline);
      animation-range: cover 0% cover 100%;
    }
    .deck-thumb.active { opacity: 1 !important; }
  }
}
}
