/* Created by Juergen Geider */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

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

/* ── Design tokens ── */
:root {
  --bg:            #050510;
  --surface:       rgba(255, 255, 255, 0.05);
  --surface-raised: rgba(255, 255, 255, 0.08);
  --border:        rgba(255, 255, 255, 0.10);
  --border-active: rgba(139, 92, 246, 0.55);

  --c1: #6366f1;
  --c2: #8b5cf6;
  --c3: #ec4899;
  --gradient: linear-gradient(135deg, var(--c1), var(--c2), var(--c3));

  --text:       #f0f0ff;
  --text-muted: rgba(240, 240, 255, 0.52);
  --text-dim:   rgba(240, 240, 255, 0.30);
  --success:    #34d399;
  --danger:     #f87171;

  --radius-card:  20px;
  --radius-btn:   100px;
  --radius-input: 12px;
  --blur:         blur(20px);
}

/* ── Light theme overrides ── */
[data-theme="light"] {
  --bg:             #f0eeff;
  --surface:        rgba(255, 255, 255, 0.72);
  --surface-raised: rgba(255, 255, 255, 0.92);
  --border:         rgba(99, 102, 241, 0.13);
  --border-active:  rgba(139, 92, 246, 0.60);
  --text:           #1e1b4b;
  --text-muted:     rgba(30, 27, 75, 0.52);
  --text-dim:       rgba(30, 27, 75, 0.33);
  --success:        #059669;
  --danger:         #dc2626;
}

/* Light: softer aurora */
[data-theme="light"] .bg-orb { opacity: 0.13; }
[data-theme="light"] body::before { opacity: 0.07; }

/* Light: cards — lighter shadow, no inner-glow line */
[data-theme="light"] .card,
[data-theme="light"] .directory-section,
[data-theme="light"] .links-section {
  box-shadow: 0 2px 24px rgba(99, 102, 241, 0.10), 0 1px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .qr-card {
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.15) inset,
    0 0 32px rgba(99, 102, 241, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.08);
}

/* Light: sticky header */
[data-theme="light"] .room-header {
  background: rgba(240, 238, 255, 0.88);
}

/* Light: expiry pill */
[data-theme="light"] .room-expiry {
  background: rgba(0, 0, 0, 0.04);
}

/* Light: member grid cells */
[data-theme="light"] .member-row {
  background: rgba(255,255,255,.65);
  border-color: rgba(99,102,241,.15);
}
[data-theme="light"] .member-row:hover {
  background: rgba(255,255,255,.82);
  box-shadow: 0 8px 32px rgba(99,102,241,.15), 0 0 0 1px rgba(99,102,241,.22);
}
[data-theme="light"] .member-status-dot {
  border-color: #fff;
}

/* Light: glass inputs */
[data-theme="light"] form input[type="text"],
[data-theme="light"] form input[type="search"],
[data-theme="light"] form input[type="url"],
[data-theme="light"] form input[type="password"],
[data-theme="light"] #search-input,
[data-theme="light"] .links-add input[type="text"],
[data-theme="light"] .links-add input[type="url"] {
  background: rgba(255, 255, 255, 0.80);
  border-color: rgba(99, 102, 241, 0.18);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

[data-theme="light"] form input:focus,
[data-theme="light"] #search-input:focus,
[data-theme="light"] .links-add input:focus {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

/* Light: paste / ghost buttons */
[data-theme="light"] .paste-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .paste-btn:hover {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(99, 102, 241, 0.28);
}

[data-theme="light"] .btn-ghost {
  border-color: rgba(99, 102, 241, 0.20);
}

[data-theme="light"] .btn-ghost:hover {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.35);
}

/* Light: link open button */
[data-theme="light"] .link-open-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .link-open-btn:hover {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(99, 102, 241, 0.28);
}

/* Light: export button */
[data-theme="light"] .export-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .export-btn:hover {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(99, 102, 241, 0.28);
}

/* Light: confirm profile preview */
[data-theme="light"] .confirm-profile {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.12);
}

/* Light: joined banner */
[data-theme="light"] .joined-card {
  background: rgba(5, 150, 105, 0.06);
  border-color: rgba(5, 150, 105, 0.22);
}

/* Light: leave button */
[data-theme="light"] .leave-btn {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.20);
}

[data-theme="light"] .leave-btn:hover {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.40);
}

/* Light: error status */
[data-theme="light"] .lookup-status.error {
  background: rgba(220, 38, 38, 0.07);
  border-color: rgba(220, 38, 38, 0.22);
}

/* ── Base ── */
html { font-size: 16px; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Aurora background orbs ── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.38;
  pointer-events: none;
  will-change: transform;
  z-index: 0;
}

.bg-orb--1 {
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -180px;
  right: -120px;
  animation: orb-drift-1 20s ease-in-out infinite alternate;
}

.bg-orb--2 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #ec4899 0%, transparent 70%);
  bottom: -120px;
  left: -80px;
  animation: orb-drift-2 24s ease-in-out infinite alternate;
}

/* Third orb — center, no extra HTML needed */
body::before {
  content: '';
  position: fixed;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
  animation: orb-drift-3 30s ease-in-out infinite alternate;
}

@keyframes orb-drift-1 {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(-50px, 70px) scale(1.08); }
  66%  { transform: translate(30px, 30px) scale(0.94); }
  100% { transform: translate(-15px, 110px) scale(1.04); }
}

@keyframes orb-drift-2 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(70px, -50px) scale(1.12); }
  100% { transform: translate(15px, -20px) scale(0.92); }
}

@keyframes orb-drift-3 {
  0%   { transform: translate(-50%, -50%) scale(1); }
  100% { transform: translate(-50%, -50%) scale(1.25); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-orb, body::before { animation: none; }
}

/* ── Glassmorphic card ── */
.card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 2rem 1.75rem;
  width: 100%;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 32px 64px rgba(0, 0, 0, 0.45);
}

/* ── Layout ── */
.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

/* ── Typography ── */
h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: .5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Logo ── */
.logo {
  margin-bottom: 1.5rem;
  display: inline-block;
}
.logo img { width: 80px; height: 80px; display: block; }

/* Override the hardcoded blue fill on the SVG rect */
.logo svg rect {
  fill: var(--c1) !important;
}

.logo svg {
  filter: drop-shadow(0 0 14px rgba(99, 102, 241, 0.65));
  border-radius: 12px;
}

/* ── Subtitle / note ── */
.subtitle {
  color: var(--text-muted);
  font-size: .9375rem;
  margin-bottom: 2rem;
  line-height: 1.65;
}

.note {
  margin-top: .875rem;
  font-size: .8125rem;
  color: var(--text-dim);
  text-align: center;
}

.bmc-wrap {
  text-align: center;
  margin-top: 1.25rem;
}

/* ── Form labels ── */
form label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  margin-bottom: .375rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-family: inherit;
}

/* ── Inputs ── */
form input[type="text"],
form input[type="search"],
form input[type="url"],
form input[type="password"],
#search-input {
  width: 100%;
  padding: .8125rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-size: .9375rem;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none;
  -webkit-text-fill-color: var(--text);
}

form input:focus,
#search-input:focus {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

form input::placeholder,
#search-input::placeholder {
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
}

/* ── Input row with paste button ── */
.input-row {
  display: flex;
  gap: .5rem;
  align-items: stretch;
}

.input-row input {
  flex: 1;
  min-width: 0;
}

.paste-btn {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-size: .8125rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}

.paste-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

/* ── Gradient CTA button ── */
button[type="submit"],
.btn-primary,
.connect-btn {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  padding: .875rem 1.5rem;
  background: var(--gradient);
  background-size: 200% 200%;
  color: #fff;
  -webkit-text-fill-color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: .9375rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  letter-spacing: .01em;
  text-decoration: none;
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.38);
  transition: opacity .15s, transform .1s, box-shadow .2s;
  animation: gradient-shift 5s ease infinite;
}

button[type="submit"]:hover,
.btn-primary:hover,
.connect-btn:hover {
  opacity: .88;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.55);
}

button[type="submit"]:active,
.btn-primary:active,
.connect-btn:active {
  transform: translateY(0);
}

button[type="submit"]:disabled,
.btn-primary:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Ghost button ── */
.btn-ghost {
  display: block;
  width: 100%;
  padding: .875rem 1.25rem;
  background: transparent;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: .9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* ── Theme toggle ── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  -webkit-text-fill-color: initial; /* don't inherit gradient clip */
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s, transform .2s;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
  transform: rotate(20deg);
}

/* Fixed float for pages without a header */
.theme-toggle--float {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
}

/* Show sun icon in dark mode (to suggest switching to light) */
[data-theme="dark"] .icon-moon  { display: none; }
/* Show moon icon in light mode (to suggest switching to dark) */
[data-theme="light"] .icon-sun  { display: none; }

/* Light mode overrides for the toggle */
[data-theme="light"] .theme-toggle {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(99, 102, 241, 0.16);
}

[data-theme="light"] .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.09);
  border-color: rgba(99, 102, 241, 0.28);
}

/* ── Room header actions group ── */
.room-header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.export-btn {
  padding: .3rem .75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .6875rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  cursor: pointer;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}

.export-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

.card-desc {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: .35rem 0 .9rem;
}

.btn-card-action {
  padding: .4rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn-card-action:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.22);
}
.btn-card-action--primary {
  background: var(--c1);
  border-color: transparent;
  color: #fff;
}
.btn-card-action--primary:hover { opacity: .88; }
.btn-card-action--danger {
  color: #f87171;
  border-color: rgba(248,113,113,0.3);
  background: rgba(248,113,113,0.07);
}
.btn-card-action--danger:hover {
  background: rgba(248,113,113,0.15);
  border-color: rgba(248,113,113,0.5);
}
[data-theme="light"] .btn-card-action {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.12);
}
[data-theme="light"] .btn-card-action:hover {
  background: rgba(0,0,0,0.1);
}
[data-theme="light"] .btn-card-action--primary {
  background: var(--c1);
}

.close-room-header-btn {
  color: #f87171;
  -webkit-text-fill-color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.07);
}
.close-room-header-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
  -webkit-text-fill-color: #fca5a5;
}

.projector-launch-btn {
  display: inline-block;
  padding: .65rem 1.4rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  text-decoration: none;
  transition: background .15s, border-color .15s;
  cursor: pointer;
}
.projector-launch-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.22);
}
[data-theme="light"] .projector-launch-btn {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.12);
}
[data-theme="light"] .projector-launch-btn:hover {
  background: rgba(0,0,0,0.1);
}

.export-btn.copied {
  border-color: rgba(52, 211, 153, 0.5);
  color: var(--success);
  -webkit-text-fill-color: var(--success);
  background: rgba(52, 211, 153, 0.08);
}

/* ── Room header ── */
.room-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .875rem 1.25rem;
  background: rgba(5, 5, 16, 0.80);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}

.room-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.room-expiry {
  font-size: .6875rem;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem .75rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
}

/* ── Room main ── */
/* ── Tab bar ── */
.room-tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  gap: .35rem;
  padding: .5rem .75rem calc(env(safe-area-inset-bottom, 0px) + .5rem);
  background: rgba(5, 5, 16, 0.92);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.room-tab-bar::-webkit-scrollbar { display: none; }
[data-theme="light"] .room-tab-bar {
  background: rgba(248, 248, 255, 0.92);
}
.room-tab {
  flex: none;
  padding: .45rem 1.1rem .4rem;
  background: none;
  border: none;
  border-radius: 100px;
  color: rgba(240, 240, 255, 0.4);
  font-size: .76rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: color .2s, background .2s;
  white-space: nowrap;
  letter-spacing: .01em;
}
[data-theme="light"] .room-tab {
  color: rgba(13, 13, 26, 0.4);
}
.room-tab.room-tab--active {
  background: var(--gradient);
  color: #fff;
}
[data-theme="light"] .room-tab.room-tab--active {
  color: #fff;
}

/* ── Tab panes (columns) — mobile: hidden by default, one shown at a time ── */
.room-col {
  display: none;
  flex-direction: column;
  gap: 1rem;
}
.room-col.tab-active {
  display: flex;
}

.room-main {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 1rem 7rem;  /* bottom clears fixed tab bar + safe area */
  position: relative;
  z-index: 1;
}

/* ── Badge pulse animation ── */
@keyframes badge-ping {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.45); box-shadow: 0 0 0 5px rgba(99,102,241,0.2); }
  100% { transform: scale(1); box-shadow: none; }
}
.badge-ping {
  animation: badge-ping .5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ── SSE reconnect indicator ── */
.connection-status {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .72rem;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 100px;
  padding: .2rem .65rem;
  white-space: nowrap;
}
.connection-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  animation: pulse-dot 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

/* ── QR card — hero with neon glow ── */
.qr-card {
  text-align: center;
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.12) inset,
    0 0 48px rgba(99, 102, 241, 0.12),
    0 32px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

/* Gradient shimmer line at top of QR card */
.qr-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0.9;
}

.qr-card .room-expiry {
  display: inline-block;
  margin-bottom: 1rem;
}

.qr-label {
  font-size: .6875rem;
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.qr-img {
  display: block;
  margin: 0 auto 1.25rem;
  width: 200px;
  height: 200px;
  border-radius: 14px;
  border: 2px solid rgba(99, 102, 241, 0.55);
  box-shadow:
    0 0 20px rgba(99, 102, 241, 0.3),
    0 0 60px rgba(99, 102, 241, 0.12);
  cursor: zoom-in;
  transition: transform .15s, box-shadow .15s;
}

.qr-img:hover {
  transform: scale(1.03);
  box-shadow:
    0 0 28px rgba(99, 102, 241, 0.45),
    0 0 80px rgba(99, 102, 241, 0.18);
}

/* ── QR URL row (link + copy button) ── */
.qr-url-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.qr-url {
  display: inline-block;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--c2);
  -webkit-text-fill-color: var(--c2);
  word-break: break-all;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity .15s;
}

.qr-url:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.copy-url-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .625rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .6875rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}

.copy-url-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
}

.copy-url-btn.copied {
  border-color: rgba(52, 211, 153, 0.45);
  color: var(--success);
  -webkit-text-fill-color: var(--success);
  background: rgba(52, 211, 153, 0.08);
}

[data-theme="light"] .copy-url-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(99, 102, 241, 0.15);
}
[data-theme="light"] .copy-url-btn:hover {
  background: rgba(0, 0, 0, 0.07);
}

/* ── QR mode toggle (host-only pill switcher below QR card) ── */
.qr-mode-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.qr-mode-pills {
  display: flex;
  gap: .25rem;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .25rem;
}

[data-theme="light"] .qr-mode-pills {
  background: rgba(0, 0, 0, .04);
}

.qr-mode-btn {
  padding: .4rem 1.1rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  font-size: .8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.qr-mode-btn--active {
  background: var(--c1);
  color: #fff;
  -webkit-text-fill-color: #fff;
}

.qr-mode-btn:not(.qr-mode-btn--active):hover {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

.qr-mode-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.qr-secure-expiry {
  font-size: .7rem;
  font-weight: 600;
  color: var(--success);
  -webkit-text-fill-color: var(--success);
  letter-spacing: .04em;
}

/* ── QR overlay ── */
.qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.qr-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: zoom-out;
}

.qr-overlay-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem 1.75rem;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
  max-width: min(600px, 96vw);
  width: 100%;
  text-align: center;
  overflow: hidden;
}

/* Gradient top line on overlay card */
.qr-overlay-content::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient);
  border-radius: 24px 24px 0 0;
  opacity: 0.8;
}

.qr-overlay-img {
  width: min(520px, calc(96vw - 3.5rem));
  height: min(520px, calc(96vw - 3.5rem));
  border-radius: 14px;
  border: 2px solid rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 32px rgba(99, 102, 241, 0.25);
  background: white; /* ensure white bg if QR is transparent */
}

[data-theme="light"] .qr-overlay-backdrop {
  background: rgba(0, 0, 0, 0.60);
}

/* ── Extra check-in fields ── */
.extra-fields {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .625rem;
  padding-top: .625rem;
  border-top: 1px solid var(--border);
}

/* ── Check-in mode selector ── */
.mode-selector {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.125rem;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .25rem;
}

.mode-btn {
  flex: 1;
  padding: .5rem 1rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.mode-btn.active {
  background: var(--c1, #6366f1);
  color: #fff;
}

.mode-btn:not(.active):hover {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

[data-theme="light"] .mode-selector {
  background: rgba(0, 0, 0, .04);
}

[data-theme="light"] .mode-btn:not(.active):hover {
  background: rgba(0, 0, 0, .07);
  color: var(--text);
}

/* ── Name mode section fields ── */
.mode-section {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* ── Check-in card ── */
.checkin-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.015em;
  margin-bottom: .375rem;
}

.hint {
  font-size: .875rem;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.65;
}

.hint strong {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  font-weight: 700;
}

.lookup-status {
  font-size: .875rem;
  margin-top: .625rem;
  padding: .625rem .875rem;
  border-radius: 10px;
}

.lookup-status.error {
  background: rgba(248, 113, 113, 0.10);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.28);
}

/* ── Confirmation card ── */
.confirm-card { text-align: center; }

.confirm-label {
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.confirm-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  text-align: left;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.confirm-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 1.375rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.45);
}

.confirm-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.confirm-info {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.confirm-name {
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text);
}

.confirm-handle {
  font-size: .875rem;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
}

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* ── Joined banner ── */
.joined-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.05);
}

.joined-inner {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.joined-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.joined-sub {
  font-size: .8125rem;
  color: var(--success);
  -webkit-text-fill-color: var(--success);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .375rem;
}

/* Pulsing presence dot */
.joined-sub::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse-dot 2.2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(0.75); }
}

.joined-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-shrink: 0;
}

.not-you-btn {
  background: none;
  border: none;
  padding: .4rem .5rem;
  font-size: .8125rem;
  font-family: inherit;
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s;
}

.not-you-btn:hover {
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
}

.leave-btn {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 100px;
  padding: .375rem 1rem;
  font-size: .8125rem;
  font-family: inherit;
  font-weight: 600;
  color: rgba(252, 165, 165, 0.8);
  -webkit-text-fill-color: rgba(252, 165, 165, 0.8);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}

.leave-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
  -webkit-text-fill-color: #fca5a5;
}

/* ── Directory section ── */
.directory-section {
  position: relative;
  z-index: 1;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 32px 64px rgba(0, 0, 0, 0.4);
}

.directory-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.directory-header h2 {
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
}

/* ── Count badge ── */
.count-badge {
  background: var(--gradient);
  color: #fff;
  -webkit-text-fill-color: #fff;
  font-size: .625rem;
  font-weight: 800;
  padding: .15rem .5rem;
  border-radius: 100px;
  min-width: 20px;
  text-align: center;
  letter-spacing: 0;
}

/* ── Search input ── */
#search-input {
  width: 100%;
  padding: .6875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

#search-input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

#search-input::placeholder {
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
}

/* ── Member grid (2-column) ── */
.member-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: transparent;
  padding: 4px;
}

/* Empty state spans both columns */
#member-list > .empty-state {
  grid-column: 1 / -1;
  background: transparent;
}

/* ── Member card ── */
.member-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  overflow: hidden;
  transform: perspective(800px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
  will-change: transform;
  cursor: default;
  padding: 0 .875rem .875rem;
}

.member-row:hover {
  background: rgba(255,255,255,.09);
  box-shadow: 0 8px 32px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.18);
}

/* Shine sweep on hover */
.member-row::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.07) 50%, transparent 60%);
  background-size: 200% 100%;
  background-position: 200% 0;
  transition: background-position .6s ease;
  pointer-events: none;
}
.member-row:hover::after { background-position: -200% 0; }

/* Colored accent strip at the top */
.member-strip {
  width: calc(100% + 1.75rem);
  height: 40px;
  background: var(--strip-color, var(--c1));
  opacity: .28;
  margin: 0 -.875rem;
  flex-shrink: 0;
}
[data-theme="light"] .member-strip { opacity: .18; }

/* Avatar gradient ring wrapper */
.member-avatar-wrap {
  position: relative;
  padding: 2.5px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--strip-color, var(--c1)), var(--c2));
  margin-top: -22px;
  margin-bottom: .5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  flex-shrink: 0;
}

/* Avatar */
.member-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #888;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--bg);
}

.member-avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}

/* Attending status dot */
.member-status-dot {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--bg);
}
/* ── Host settings card ── */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .625rem 0;
  cursor: pointer;
}
.setting-label {
  font-size: .875rem;
  color: var(--text);
}
.setting-hint {
  margin-top: .25rem;
  margin-bottom: 0;
}

/* Toggle pill switch */
.toggle-pill {
  position: relative;
  flex-shrink: 0;
}
.toggle-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-pill__track {
  display: block;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.12);
  transition: background .2s, border-color .2s;
  position: relative;
}
.toggle-pill__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  transition: transform .2s, background .2s;
}
.toggle-pill input:checked + .toggle-pill__track {
  background: var(--c1);
  border-color: var(--c1);
}
.toggle-pill input:checked + .toggle-pill__track::after {
  transform: translateX(18px);
  background: #fff;
}
[data-theme="light"] .toggle-pill__track {
  background: rgba(0,0,0,.12);
  border-color: rgba(0,0,0,.1);
}
[data-theme="light"] .toggle-pill__track::after {
  background: rgba(0,0,0,.4);
}

/* Name row */
.member-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  max-width: 100%;
  padding: 0 1rem;
  margin-bottom: .2rem;
}

.member-name {
  font-weight: 700;
  font-size: .9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  max-width: 16ch;
}

.badge-host {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-size: .5rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  -webkit-text-fill-color: #fff;
  line-height: 1.4;
}

/* Bio */
.member-bio {
  font-size: .6875rem;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  margin-bottom: .3rem;
}

/* Chips row */
.member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  justify-content: center;
  margin-bottom: .3rem;
}

.member-chip {
  font-size: .625rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

.member-chip--location {
  color: var(--c1);
  -webkit-text-fill-color: var(--c1);
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.09);
  text-transform: capitalize;
}

.member-chip--hobby {
  color: var(--c3);
  -webkit-text-fill-color: var(--c3);
  border-color: rgba(236, 72, 153, 0.35);
  background: rgba(236, 72, 153, 0.09);
}

/* Contact */
.member-contact {
  font-size: .625rem;
  color: var(--c2);
  -webkit-text-fill-color: var(--c2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  opacity: .85;
  margin-bottom: .1rem;
}

.checkin-extras { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }

/* Connect button — ghost, revealed on hover */
.member-row .connect-btn {
  display: block;
  width: 100%;
  margin-top: .625rem;
  padding: .4rem 1rem;
  font-size: .6875rem;
  font-weight: 700;
  border-radius: 100px;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow: 0 2px 8px rgba(139,92,246,.3);
  animation: gradient-shift 5s ease infinite;
  text-align: center;
  background-size: 200% 200%;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
}

.member-row:hover .connect-btn {
  opacity: 1;
  transform: translateY(0);
}

.member-row .connect-btn:hover {
  opacity: .88;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(139,92,246,.5);
}

/* ── Empty state ── */
.empty-state {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
  font-size: .9375rem;
}

/* ── Links section ── */
.links-section {
  position: relative;
  z-index: 1;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 32px 64px rgba(0, 0, 0, 0.4);
}

.links-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.links-header h2 {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
}

.links-list {
  padding: .25rem 0;
}

.link-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.5rem;
  gap: 1rem;
  transition: background .1s;
  border-bottom: 1px solid var(--border);
}

.link-row:last-child { border-bottom: none; }
.link-row:hover { background: rgba(255, 255, 255, 0.03); }

.link-info {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
}

.link-title {
  font-weight: 600;
  font-size: .9375rem;
  color: var(--c2);
  -webkit-text-fill-color: var(--c2);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s;
}

.link-title:hover {
  color: var(--c3);
  -webkit-text-fill-color: var(--c3);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-meta {
  font-size: .75rem;
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
}

.link-open-btn {
  display: inline-block;
  padding: .375rem .875rem;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .8125rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}

.link-open-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

/* ── Links add form ── */
.links-add {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

.links-add input[type="text"],
.links-add input[type="url"] {
  width: 100%;
  padding: .6875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.links-add input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.links-add input::placeholder {
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
}

/* ── Links sign-in hint ── */
.links-signin-hint {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: .875rem;
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
  text-align: center;
}

.links-signin-hint p { margin: 0; }

/* ── Optional password toggle (home page) ── */
.room-password-option {
  margin-top: 1.125rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.room-password-option summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  transition: opacity .15s;
}

.room-password-option summary::-webkit-details-marker { display: none; }
.room-password-option summary::marker { display: none; }

.room-password-option summary::before {
  content: '›';
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  flex-shrink: 0;
  margin-top: .1rem;
  transition: transform .2s, color .15s;
}

.room-password-option[open] summary::before {
  transform: rotate(90deg);
  color: var(--c2);
  -webkit-text-fill-color: var(--c2);
}

.room-password-option summary:hover {
  opacity: .85;
}

.room-option-main {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.room-option-label {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.room-option-hint {
  font-size: .8125rem;
  font-weight: 400;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  line-height: 1.4;
}

.room-password-option .password-field {
  margin-top: .875rem;
}

.pin-min-hint {
  display: block;
  font-size: .75rem;
  color: var(--text-dim);
  margin-top: .3rem;
}

.room-duration-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .75rem;
}
.room-duration-row label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
}
.room-duration-row select {
  flex: 1;
  padding: .45rem .65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg, var(--surface));
  color: var(--text);
  font-size: .875rem;
  cursor: pointer;
}

.optional-label {
  font-weight: 500;
  font-size: .75rem;
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0;
}

/* ── Agenda ── */
.agenda-card { margin-bottom: 1rem; }
.agenda-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.agenda-header-right {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.agenda-progress {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .03em;
  white-space: nowrap;
}

.agenda-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  counter-reset: agenda-counter;
}
.agenda-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem .6rem 2.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: background .2s, opacity .2s;
  counter-increment: agenda-counter;
}
.agenda-item::before {
  content: counter(agenda-counter);
  position: absolute;
  left: .75rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 1rem;
  text-align: center;
}
.agenda-item.active {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.08);
  padding-top: .85rem;
  padding-bottom: .85rem;
}
.agenda-item.active::before {
  color: var(--c1);
  font-weight: 800;
}
.agenda-item.past { opacity: .4; }
.agenda-duration {
  font-size: .7rem;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--surface-raised, var(--surface));
  padding: .15rem .5rem;
  border-radius: 100px;
}
.agenda-title {
  font-size: .9rem;
  color: var(--text);
  flex: 1;
}
.agenda-item.active .agenda-title {
  font-weight: 600;
  color: var(--c1);
}
.agenda-speaker {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .15rem;
  font-weight: 400;
}

/* ── Notes ── */
.notes-list { display: flex; flex-direction: column; gap: .75rem; margin-top: 1rem; }
.note-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem 1rem;
  position: relative;
}
.note-meta {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .35rem;
  padding-right: 1.5rem;
}
.note-text {
  font-size: .9rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.note-delete {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: .85rem;
  padding: .15rem .35rem;
  border-radius: 6px;
  line-height: 1;
}
.note-delete:hover { color: var(--danger); background: rgba(248,113,113,.1); }
.notes-card textarea { resize: vertical; min-height: 80px; margin-bottom: .5rem; width: 100%; }
.agenda-item-controls {
  display: flex;
  gap: .3rem;
  margin-left: auto;
  opacity: 0;
  transition: opacity .15s;
}
.agenda-item:hover .agenda-item-controls {
  opacity: 1;
}
.agenda-ctrl-btn {
  font-size: .7rem;
  padding: .2rem .45rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  transition: opacity .15s, border-color .15s, color .15s;
  line-height: 1;
}
.agenda-ctrl-btn.edit {
  color: var(--text-muted);
  border-color: var(--border);
}
.agenda-ctrl-btn.activate {
  color: var(--c1);
  border-color: rgba(99, 102, 241, 0.35);
}
.agenda-ctrl-btn.activate:disabled {
  opacity: .35;
  cursor: default;
}
.agenda-ctrl-btn.delete {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.3);
}

/* ── Feedback ── */
.feedback-trigger {
  font-size: .8rem;
  padding: .3rem .8rem;
  margin-left: .5rem;
}
.feedback-modal-content { max-width: 420px; }
.feedback-modal-content textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input, 10px);
  color: var(--text);
  padding: .75rem;
  resize: vertical;
  font-family: inherit;
  font-size: .9rem;
  margin-top: .5rem;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--text-muted);
  cursor: pointer;
  margin: .75rem 0;
}
.modal-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.success-msg {
  color: var(--success);
  text-align: center;
  padding: 1rem 0;
}
.form-actions {
  display: flex;
  gap: .5rem;
}
.form-actions .btn-primary,
.form-actions .btn-ghost {
  flex: 1;
  margin-top: 0;
}
.feedback-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.feedback-item {
  padding: .75rem;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.feedback-item.actioned { opacity: .45; }
.feedback-meta {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .4rem;
  display: flex;
  justify-content: space-between;
}
.feedback-text {
  font-size: .88rem;
  color: var(--text);
  line-height: 1.5;
}
.feedback-action-btn {
  font-size: .72rem;
  color: var(--c2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.empty-hint {
  font-size: .85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Leaderboard ── */
.leaderboard-card { margin-top: 1rem; }
.leaderboard-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: background .3s;
  position: relative;
}
.leaderboard-row.rank-up {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.3);
}
.leaderboard-row.rank-down { background: rgba(248, 113, 113, 0.06); }
.rank-badge {
  font-size: .75rem;
  font-weight: 700;
  width: 1.5rem;
  text-align: center;
  color: var(--text-muted);
}
.leaderboard-row:nth-child(1) .rank-badge { color: #fbbf24; }
.leaderboard-row:nth-child(2) .rank-badge { color: #9ca3af; }
.leaderboard-row:nth-child(3) .rank-badge { color: #d97706; }
.leaderboard-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.leaderboard-name {
  flex: 1;
  font-size: .88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.points-badge {
  font-size: .9rem;
  font-weight: 700;
  color: var(--c1);
  min-width: 2rem;
  text-align: right;
}
.points-control-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.points-control-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.points-control-name {
  flex: 1;
  font-size: .85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.award-btn {
  font-size: .75rem;
  padding: .2rem .5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.award-btn:hover { background: var(--surface-raised, var(--surface)); color: var(--text); }
.award-btn.plus { color: var(--success); border-color: rgba(52, 211, 153, 0.3); }
.award-btn.minus { color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }

/* ── Host Controls ── */
.host-panel {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.06);
}
.host-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: .75rem;
}
.host-panel-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c1);
  white-space: nowrap;
}
.host-panel-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-shrink: 0;
}
.host-action-btn {
  font-size: .8rem;
  padding: .35rem .85rem;
  white-space: nowrap;
}
.host-panel-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.host-panel-section h4 {
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.host-panel-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.host-section-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
  gap: .5rem;
}

.host-section-btns {
  display: flex;
  gap: .35rem;
  flex-shrink: 0;
}

.host-section-btn {
  font-size: .72rem;
  font-weight: 600;
  padding: .28rem .65rem;
  white-space: nowrap;
  width: auto;
  border-radius: 8px;
}
.danger-btn {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.3);
}
.danger-btn:hover { background: rgba(248, 113, 113, 0.1); }
.host-login-trigger {
  font-size: .75rem;
  padding: .25rem .75rem;
}
.member-row__remove,
.link-row__delete {
  position: absolute;
  top: .5rem;
  right: .5rem;
  font-size: .7rem;
  padding: .15rem .4rem;
  border-radius: 4px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  background: none;
  color: var(--danger);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.member-row:hover .member-row__remove,
.link-row:hover .link-row__delete {
  opacity: 1;
}
.duration-row {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.duration-row input {
  flex: 1;
  min-width: 0;
}
.duration-unit {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding-right: .25rem;
}

/* ── Agenda template chips ── */
#agenda-templates {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.agenda-templates-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.agenda-template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.agenda-template-chip {
  padding: 0.3rem 0.7rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.agenda-template-chip:hover {
  border-color: var(--c2);
  color: var(--text);
  background: rgba(139, 92, 246, 0.08);
}
.agenda-template-chip:active {
  transform: scale(0.97);
}
.agenda-template-chip.selected {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.18);
  color: var(--text);
}
[data-theme="light"] .agenda-template-chip:hover {
  background: rgba(139, 92, 246, 0.06);
}
[data-theme="light"] .agenda-template-chip.selected {
  background: rgba(139, 92, 246, 0.14);
}
.field-hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .375rem;
}
.password-option-body {
  margin-top: .875rem;
}

/* ══════════════════���═════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════ */

/* ── Small mobile (≤ 480px) ── */
@media (max-width: 480px) {
  .card { padding: 1.5rem 1.25rem; }
  .room-main { padding: 1rem .75rem 5.5rem; }
  .qr-img { width: 175px; height: 175px; }
  h1 { font-size: 1.625rem; }
}

/* ── Very small (≤ 400px): single-column members ── */
@media (max-width: 400px) {
  .member-list { grid-template-columns: 1fr; }
}

/* ── Tablet (≥ 640px): wider single column ── */
@media (min-width: 640px) {
  .room-main {
    max-width: 660px;
    padding: 2rem 1.5rem 4rem;
    gap: 1.5rem;
  }

  .room-header {
    padding: .875rem 2rem;
  }

  .qr-img {
    width: 220px;
    height: 220px;
  }

  .page-center {
    padding: 2rem;
  }

  .page-center .card {
    max-width: 520px;
    padding: 2.5rem 2.25rem;
  }
}

/* ── Desktop (≥ 1024px): top sticky tab bar, wider single column ── */
@media (min-width: 1024px) {
  .room-header {
    padding: .875rem 2.5rem;
  }
  .room-title {
    font-size: 1.0625rem;
  }

  /* Tab bar: move from fixed bottom to sticky top */
  .room-tab-bar {
    position: sticky;
    top: 54px;  /* sits just below the sticky header */
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid var(--border);
    padding: .5rem 2rem;
    justify-content: center;
    gap: .5rem;
    z-index: 99;  /* header is 100 */
  }

  .room-tab {
    font-size: .84rem;
    padding: .5rem 1.8rem;
    flex: none;
  }

  /* Single wider content area */
  .room-main {
    max-width: 780px;
    padding: 2rem 2rem 3rem;
  }

  /* All tab panes display as flex on desktop (active handled by JS) */
  .room-col {
    gap: 1.5rem;
  }

  /* QR: bigger on desktop */
  .qr-img {
    width: 240px;
    height: 240px;
  }

  /* Orbs scale with viewport */
  .bg-orb--1 { width: 700px; height: 700px; }
  .bg-orb--2 { width: 600px; height: 600px; }

  /* Home page: wider card */
  .page-center .card {
    max-width: 540px;
    padding: 2.75rem 2.5rem;
  }
}

/* ── Large Desktop (≥ 1280px) ── */
@media (min-width: 1280px) {
  .room-main {
    max-width: 900px;
    padding: 2rem 2.5rem 3rem;
  }

  .room-header {
    padding: 1rem 3rem;
  }

  .room-title {
    font-size: 1.125rem;
  }

  /* Three-column attendee grid */
  .member-list {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .qr-img {
    width: 260px;
    height: 260px;
  }

  /* Home page */
  .page-center .card {
    max-width: 560px;
    padding: 3rem 2.75rem;
  }

  .page-center h1 {
    font-size: 2.5rem;
  }

  .bg-orb--1 { width: 900px; height: 900px; }
  .bg-orb--2 { width: 760px; height: 760px; }
}

/* ══════════════════════════════════════════════════════════
   QUIZ BANNER
   ════════════════════════════════════════════════════════ */

.quiz-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 400;
  padding: 1rem 1rem 1.25rem;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-top: 1px solid var(--border-active);
  box-shadow: 0 -8px 32px rgba(99, 102, 241, 0.18);
  animation: quiz-slide-up .3s ease;
}

@keyframes quiz-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.quiz-banner-inner {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.quiz-dismiss-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: .2rem .4rem;
  line-height: 1;
  border-radius: 6px;
  transition: color .15s;
}
.quiz-dismiss-btn:hover { color: var(--text-muted); }

.quiz-banner-label {
  font-size: .6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--c1);
  margin-bottom: .4rem;
}

.quiz-question-text {
  font-weight: 700;
  font-size: .9375rem;
  color: var(--text);
  margin-bottom: .75rem;
  padding-right: 1.5rem;
  line-height: 1.4;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.quiz-opt-btn {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.quiz-opt-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--border-active);
}
.quiz-opt-btn.selected {
  border-color: var(--c2);
  background: rgba(139, 92, 246, 0.12);
}
.quiz-opt-btn.correct {
  border-color: var(--success);
  background: rgba(52, 211, 153, 0.10);
  color: var(--success);
}
.quiz-opt-btn.wrong {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.06);
  opacity: .7;
}
.quiz-opt-btn.neutral { opacity: .45; }
.quiz-opt-btn:disabled { cursor: default; }

.quiz-opt-letter {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 1rem;
  flex-shrink: 0;
}
.quiz-opt-btn.correct .quiz-opt-letter { color: var(--success); }

.quiz-opt-text {
  flex: 1;
  text-align: left;
}

.quiz-opt-count {
  margin-left: auto;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.quiz-result {
  margin-top: .6rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: .4rem .75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}
.quiz-result.correct {
  color: var(--success);
  background: rgba(52, 211, 153, 0.08);
}

/* ── Host quiz panel ── */
.quiz-question-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.quiz-q-row {
  padding: .7rem .875rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised);
}
.quiz-q-row.status-active  { border-color: rgba(99, 102, 241, 0.45); }
.quiz-q-row.status-revealed { border-color: rgba(52, 211, 153, 0.35); }
.quiz-q-row.status-closed  { opacity: .4; }

.quiz-q-row-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .5rem;
}

.quiz-q-text-preview {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.quiz-status-badge {
  font-size: .6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .15rem .5rem;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.quiz-q-row.status-active .quiz-status-badge  { background: rgba(99, 102, 241, 0.2); color: var(--c1); }
.quiz-q-row.status-revealed .quiz-status-badge { background: rgba(52, 211, 153, 0.15); color: var(--success); }

.quiz-q-actions {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: .625rem;
  padding-top: .625rem;
  border-top: 1px solid var(--border);
}

.quiz-q-actions-top {
  display: flex;
  gap: .35rem;
  align-items: center;
}

.quiz-q-edit-btn {
  flex: 1;
  padding: .3rem .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}
.quiz-q-edit-btn:hover {
  background: var(--surface-raised);
  color: var(--text);
  border-color: var(--border-active);
}

.quiz-q-delete-btn {
  width: 1.875rem;
  height: 1.875rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 8px;
  background: none;
  color: rgba(248, 113, 113, 0.55);
  cursor: pointer;
  font-size: .8rem;
  font-family: inherit;
  transition: all .15s;
}
.quiz-q-delete-btn:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.45);
  color: rgba(248, 113, 113, 0.9);
}

.quiz-q-launch-btn,
.quiz-q-reveal-btn {
  display: block;
  width: 100%;
  padding: .45rem .75rem;
  background: var(--gradient);
  background-size: 200% 200%;
  color: #fff;
  -webkit-text-fill-color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  letter-spacing: .01em;
  box-shadow: 0 3px 12px rgba(139, 92, 246, 0.3);
  transition: opacity .15s, transform .1s;
  animation: gradient-shift 5s ease infinite;
}
.quiz-q-launch-btn:hover,
.quiz-q-reveal-btn:hover {
  opacity: .88;
  transform: translateY(-1px);
}

.quiz-q-close-btn {
  display: block;
  width: 100%;
  padding: .4rem .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}
.quiz-q-close-btn:hover {
  background: var(--surface-raised);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.quiz-host-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-top: .25rem;
}

/* ── Quiz modal ── */
.quiz-option-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .4rem;
}
.quiz-opt-label {
  font-size: .75rem;
  font-weight: 800;
  color: var(--text-muted);
  width: .875rem;
  flex-shrink: 0;
}
.quiz-correct-label {
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .4rem;
}
.quiz-correct-selector {
  display: flex;
  gap: .35rem;
}
.quiz-correct-btn {
  padding: .35rem .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
.quiz-correct-btn.active-answer {
  background: var(--c1);
  color: #fff;
  border-color: var(--c1);
}

[data-theme="light"] .quiz-banner {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -8px 32px rgba(99, 102, 241, 0.12);
}
[data-theme="light"] .quiz-opt-btn {
  background: rgba(255, 255, 255, 0.7);
}
[data-theme="light"] .quiz-opt-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.06);
}

/* ── Question Library Modal ── */
.quiz-library-content {
  max-width: min(820px, 96vw);
  max-height: 82vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}

.quiz-lib-categories {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .5rem 0 .75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .75rem;
  flex-shrink: 0;
}

.quiz-lib-cat-btn {
  padding: .3rem .75rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text);
  font-size: .78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}

.quiz-lib-cat-btn:hover {
  background: rgba(99, 102, 241, 0.08);
}

.quiz-lib-cat-btn.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

.quiz-lib-questions {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
  max-height: 55vh;
}

.quiz-lib-desc {
  font-size: .78rem;
  color: var(--text-muted);
  margin: .1rem 0 .6rem;
}

.quiz-lib-q-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.quiz-lib-q-row:hover {
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.25);
}
.quiz-lib-q-row.loading {
  opacity: .5;
  pointer-events: none;
}
.quiz-lib-q-row.added {
  border-color: rgba(52,211,153,0.4);
  background: rgba(52,211,153,0.07);
  pointer-events: none;
  opacity: .65;
}

.quiz-lib-q-text {
  flex: 1;
  min-width: 0;
  font-size: .875rem;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.quiz-lib-q-answer {
  font-size: .7rem;
  font-weight: 700;
  color: var(--success);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 6px;
  padding: .1rem .4rem;
  white-space: nowrap;
}

.quiz-lib-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  flex-shrink: 0;
}

.quiz-lib-footer .btn-ghost {
  width: auto;
  padding: .5rem 1.5rem;
}

/* ── Language toggle ──────────────────────────────────────────────────────── */
.lang-toggle {
  height: 32px;
  padding: 0 .7rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: .04em;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}
.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}
[data-theme="light"] .lang-toggle {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(99, 102, 241, 0.16);
}
[data-theme="light"] .lang-toggle:hover {
  background: rgba(0, 0, 0, 0.09);
  border-color: rgba(99, 102, 241, 0.28);
}

/* Fixed float variant for pages without a header */
.lang-toggle--float {
  position: fixed;
  top: 1rem;
  right: calc(1rem + 32px + .5rem);
  z-index: 100;
}

/* ── Utility classes (replaces HTML inline styles — required for CSP style-src) ── */
.is-hidden { display: none; }
.logo-img { border-radius: 18px; display: block; }
.btn-ghost--small { font-size: 0.8rem; padding: .3rem .8rem; }
.card-hint { margin: .5rem 0 1.25rem; }
.mt-sm { margin-top: .5rem; }
.mt-md { margin-top: .75rem; }
.mb-sm { margin-bottom: .5rem; }
.text-center { text-align: center; }
.qr-overlay-done { width: auto; padding: .5rem 1.5rem; margin-top: 0; }
.quiz-award-row { margin-top: .75rem; display: flex; align-items: center; gap: .6rem; }
.checkbox-auto { width: auto; margin: 0; }
.toggle-label--plain { margin: 0; cursor: pointer; }
