@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400&display=swap');

:root {
  /* ─── Slate palette (Figma/Vercel style) ─── */
  --bg:       #0f172a;
  --bg-2:     #131e32;
  --bg-3:     #1a2540;
  --surface:  #1e293b;
  --surface-2:#253347;
  --border:   rgba(51,65,85,.8);
  --border-2: rgba(71,85,105,.9);

  /* ─── Text ─── */
  --text:     #e2e8f0;
  --text-2:   #94a3b8;
  --text-3:   #64748b;

  /* ─── Brand / accents ─── */
  --accent:   #2563eb;   /* Königsblau */
  --accent-h: #1d4ed8;   /* hover */
  --accent-2: #3b82f6;   /* heller Blauton */
  --teal:     #0d9488;
  --ok:       #22c55e;
  --warn:     #f59e0b;
  --danger:   #ef4444;

  /* ─── Answer colors ─── */
  --a-1: #ef4444;
  --a-2: #3b82f6;
  --a-3: #22c55e;
  --a-4: #f59e0b;
  --a-5: #a855f7;
  --a-6: #14b8a6;

  /* ─── Radii & shadows ─── */
  --r-xs:  6px;
  --r-sm:  10px;
  --r:     14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --shadow:    0 24px 64px rgba(0,0,0,.5);
  --shadow-sm: 0 4px 16px rgba(0,0,0,.3);
  --shadow-xs: 0 2px 8px rgba(0,0,0,.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  min-height: 100vh;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: .01em;
  line-height: 1.6;
}

/* Subtle warm noise texture */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(168,162,158,.2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(168,162,158,.35); }

/* ─── Nav ─── */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: .35rem; flex-wrap: wrap;
  padding: .75rem clamp(.75rem, 2.5vw, 1.5rem);
  background: rgba(15,23,42,.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(140%);
}

.nav-brand {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 800; font-size: 1rem; letter-spacing: -.03em;
  color: var(--text); text-decoration: none;
  margin-right: .4rem; white-space: nowrap;
}
.nav-brand .brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}

.nav a:not(.nav-brand) {
  color: var(--text-2); font-weight: 500; font-size: .88rem;
  padding: .38rem .7rem; border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: all .15s ease;
  text-decoration: none; white-space: nowrap;
}
.nav a:not(.nav-brand):hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-2);
}

.nav-spacer { flex: 1; }

.nav-user {
  display: flex; align-items: center; gap: .4rem;
  color: var(--text-2); font-weight: 500; font-size: .84rem;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r-sm); padding: .38rem .72rem;
  white-space: nowrap;
}
.nav-user .role-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}

/* ─── Layout ─── */
.wrap {
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto; padding: 2rem 0 4rem;
  position: relative; z-index: 1;
}

.page-header { margin-bottom: 1.8rem; }
.page-header h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; letter-spacing: -.05em; line-height: 1.1; margin-bottom: .35rem; }
.page-header p { color: var(--text-2); font-size: .97rem; }

/* ─── Typography ─── */
h1 { font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -.05em; line-height: 1.1; }
h2 { font-size: clamp(1rem, 1.8vw, 1.3rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.2; margin-bottom: .55rem; }
h3 { font-size: .95rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .35rem; }
p { color: var(--text-2); line-height: 1.65; }
a { color: var(--accent); text-decoration: none; font-weight: 500; transition: color .15s; }
a:hover { color: #60a5fa; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: .15rem .4rem; font-size: .85em; color: var(--text-2); font-family: 'SF Mono', 'Fira Code', monospace; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 1rem; overflow: auto; color: var(--text-2); font-size: .85rem; }

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1rem, 2.2vw, 1.5rem);
  margin: .9rem 0;
  box-shadow: var(--shadow-xs);
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--border);
}
.card-header h2 { margin: 0; }

/* ─── Grid ─── */
.grid   { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .9rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: start; }
.cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.1rem; align-items: start; }

/* ─── Buttons ─── */
.btn, button {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.4rem; padding: .55rem 1rem; margin: .12rem;
  color: white; font-size: .88rem; font-weight: 600; font-family: inherit;
  border-radius: var(--r); text-decoration: none; white-space: nowrap;
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.12);
  transition: background .15s, transform .12s, box-shadow .12s, opacity .15s;
}
.btn:hover, button:hover {
  background: var(--accent-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.3), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn:active, button:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
button:disabled, .btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-sm { min-height: 1.9rem; padding: .38rem .75rem; font-size: .82rem; border-radius: var(--r-sm); }
.btn-lg { min-height: 2.9rem; padding: .85rem 1.6rem; font-size: .97rem; border-radius: var(--r-lg); }
.btn-xl { min-height: 3.4rem; padding: 1rem 2rem; font-size: 1.05rem; border-radius: var(--r-xl); }

.btn-ok, button.ok   { background: #16a34a !important; box-shadow: 0 1px 2px rgba(0,0,0,.3) !important; }
.btn-ok:hover, button.ok:hover { background: #15803d !important; box-shadow: 0 4px 12px rgba(22,163,74,.3) !important; }
.btn-danger, button.danger { background: #dc2626 !important; box-shadow: 0 1px 2px rgba(0,0,0,.3) !important; }
.btn-danger:hover, button.danger:hover { background: #b91c1c !important; box-shadow: 0 4px 12px rgba(220,38,38,.3) !important; }
.btn-warn, button.warn { background: #d97706 !important; }
.btn-ghost {
  background: var(--surface-2) !important;
  border: 1px solid var(--border-2) !important;
  color: var(--text-2) !important;
  box-shadow: none !important;
}
.btn-ghost:hover { background: var(--bg-3) !important; color: var(--text) !important; }
.btn-icon { padding: .45rem; min-height: 2rem; width: 2rem; border-radius: var(--r-sm); }

.inline { display: inline-flex; align-items: center; }

/* ─── Forms ─── */
.form-group { margin-bottom: .85rem; }
.form-group label, label {
  display: block; color: var(--text); font-weight: 500;
  font-size: .85rem; margin-bottom: .35rem;
}
.form-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.form-row > * { flex: 1; min-width: 0; }

input, select, textarea {
  width: 100%; min-height: 2.5rem;
  padding: .6rem .8rem; margin: .12rem 0;
  color: var(--text); background: var(--bg-3);
  border: 1px solid var(--border-2); border-radius: var(--r);
  outline: none; font-family: inherit; font-size: .88rem;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 5.5rem; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
select { cursor: pointer; }
input[type=checkbox], input[type=radio] {
  width: 1rem; min-height: auto; accent-color: var(--accent);
  margin: 0; flex-shrink: 0;
}
input[type=file]::file-selector-button {
  appearance: none; border: 0; cursor: pointer;
  min-height: 2rem; padding: .4rem .8rem;
  color: white; font-weight: 600; font-family: inherit; font-size: .85rem;
  background: var(--accent); border-radius: var(--r-sm); margin-right: .65rem;
  transition: background .15s;
}
input[type=file]::file-selector-button:hover { background: var(--accent-h); }

.check-label {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 500; color: var(--text); font-size: .88rem; cursor: pointer;
  padding: .5rem 0;
}

/* ─── Feedback ─── */
.error-msg, p.danger, .alert-danger {
  display: flex; align-items: center; gap: .55rem;
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25);
  color: #fca5a5; border-radius: var(--r); padding: .75rem .9rem;
  font-weight: 500; font-size: .88rem; margin: .55rem 0;
}
.alert-ok {
  display: flex; align-items: center; gap: .55rem;
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.25);
  color: #86efac; border-radius: var(--r); padding: .75rem .9rem;
  font-weight: 500; font-size: .88rem; margin: .55rem 0;
}

/* ─── Badges / Pills ─── */
.badge {
  display: inline-flex; align-items: center; gap: .28rem;
  padding: .22rem .55rem; border-radius: var(--r-sm);
  font-size: .74rem; font-weight: 600; letter-spacing: .02em;
  border: 1px solid transparent;
}
.badge-blue   { background: rgba(59,130,246,.12);  border-color: rgba(59,130,246,.28);  color: #93c5fd; }
.badge-green  { background: rgba(34,197,94,.1);    border-color: rgba(34,197,94,.25);   color: #86efac; }
.badge-yellow { background: rgba(234,179,8,.1);    border-color: rgba(234,179,8,.25);   color: #fde68a; }
.badge-red    { background: rgba(239,68,68,.1);    border-color: rgba(239,68,68,.25);   color: #fca5a5; }
.badge-purple { background: rgba(168,85,247,.1);   border-color: rgba(168,85,247,.25);  color: #d8b4fe; }
.badge-gray   { background: rgba(120,113,108,.12); border-color: rgba(120,113,108,.25); color: #a8a29e; }
.badge-orange { background: rgba(37,99,235,.12);   border-color: rgba(37,99,235,.3);    color: #fb923c; }

.pill {
  display: inline-flex; align-items: center; gap: .28rem;
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: 99px; padding: .28rem .6rem;
  color: var(--text-2); font-weight: 500; font-size: .82rem;
}

/* ─── Live badge ─── */
.live-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5; border-radius: var(--r-sm); padding: .26rem .65rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .06em;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #ef4444; flex-shrink: 0;
  animation: pulse-red 1.6s ease-in-out infinite;
}
@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(1.3); }
}

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th {
  color: var(--text-3); background: var(--bg-3);
  font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600;
  padding: .65rem .9rem; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td { padding: .65rem .9rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; font-size: .88rem; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--bg-3); }
td a { color: var(--accent); font-weight: 600; }
td a:hover { color: #60a5fa; }

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: clamp(3rem, 8vw, 5.5rem) 1rem clamp(2rem, 4vw, 3.5rem);
}
.hero-title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 900; letter-spacing: -.07em; line-height: .95;
  color: var(--text); margin-bottom: 1.1rem;
}
.hero-title span { color: var(--accent); }
.hero-sub { font-size: clamp(.95rem, 1.8vw, 1.1rem); color: var(--text-2); max-width: 500px; margin: 0 auto 2.2rem; line-height: 1.6; }
.hero-actions { display: flex; gap: .65rem; justify-content: center; flex-wrap: wrap; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; margin-top: 2.5rem; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.25rem; text-align: left;
}
.feature-icon { font-size: 1.5rem; margin-bottom: .6rem; }
.feature-card h3 { color: var(--text); font-size: .93rem; margin-bottom: .28rem; }
.feature-card p { color: var(--text-2); font-size: .84rem; line-height: 1.55; margin: 0; }

/* ─── Auth ─── */
.auth-wrap {
  min-height: calc(100vh - 56px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 2rem 1.8rem;
  box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo .logo-icon { font-size: 2rem; display: block; margin-bottom: .4rem; }
.auth-logo h1 { font-size: 1.4rem; letter-spacing: -.04em; }
.auth-card button[type=submit] { width: 100%; margin-top: .4rem; }
.auth-footer { text-align: center; margin-top: 1.1rem; color: var(--text-3); font-size: .84rem; }
.auth-footer a { color: var(--accent); font-weight: 600; }

/* ─── Quiz list ─── */
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .85rem; }
.quiz-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.25rem;
  transition: border-color .2s, box-shadow .2s;
  cursor: default;
}
.quiz-card:hover { border-color: var(--border-2); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.quiz-card h2 { font-size: 1.05rem; margin-bottom: .3rem; color: var(--text); }
.quiz-card p { font-size: .84rem; color: var(--text-2); margin-bottom: .9rem; }
.quiz-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: .9rem; padding-top: .75rem; border-top: 1px solid var(--border); }

.quiz-join-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.25rem; margin-bottom: 1.2rem; }
.quiz-join-form h2 { margin-bottom: .7rem; }
.quiz-join-row { display: flex; gap: .5rem; }
.quiz-join-row input { flex: 1; }
.quiz-join-row button { flex-shrink: 0; }

/* ─── Participant ─── */
.participant-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: .9rem 1.2rem; margin-bottom: 1rem;
}
.participant-header h2 { margin: 0; font-size: 1rem; }

.join-card {
  max-width: 420px; margin: 2rem auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 2rem; text-align: center;
  box-shadow: var(--shadow-sm);
}
.join-card h2 { font-size: 1.4rem; margin-bottom: .4rem; }
.join-card p { color: var(--text-2); margin-bottom: 1.4rem; }
.join-card input { text-align: center; font-size: 1rem; max-width: 260px; margin: 0 auto .7rem; display: block; }
.join-card button { width: 100%; max-width: 260px; }

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(1.1rem, 2.5vw, 1.8rem);
  margin: 1rem 0;
}
.question-card.active-q {
  border-color: rgba(37,99,235,.4);
  box-shadow: 0 0 0 1px rgba(37,99,235,.12);
}
.question-number {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  color: var(--accent); text-transform: uppercase;
}
.question-text { font-size: clamp(1.05rem, 2vw, 1.4rem); font-weight: 700; letter-spacing: -.025em; color: var(--text); margin-bottom: 1.1rem; line-height: 1.35; }

/* ─── Answer Options ─── */
.options-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; }
.option-label {
  position: relative; cursor: pointer;
  display: flex; align-items: center; gap: .7rem;
  background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--r-lg); padding: .85rem .95rem;
  transition: all .15s; font-weight: 500; font-size: .9rem;
  user-select: none; color: var(--text);
}
.option-label:hover { border-color: var(--accent); background: rgba(37,99,235,.07); }
.option-label input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.option-label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(37,99,235,.1);
  box-shadow: 0 0 0 1px rgba(37,99,235,.2);
}
.option-label:has(input:checked) .opt-letter { background: var(--accent); color: #fff; border-color: var(--accent); }

.opt-letter {
  width: 1.85rem; height: 1.85rem; border-radius: var(--r-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .76rem; font-weight: 800; letter-spacing: .02em;
  border: 1.5px solid currentColor; transition: all .15s;
}
.opt-a { color: var(--a-1); }
.opt-b { color: var(--a-2); }
.opt-c { color: var(--a-3); }
.opt-d { color: var(--a-4); }
.opt-e { color: var(--a-5); }
.opt-f { color: var(--a-6); }
.opt-text { flex: 1; line-height: 1.3; }

/* ─── Buzz Button ─── */
.buzz-wrap { text-align: center; padding: 1.2rem 0; }
.buzz-btn {
  width: clamp(150px, 38vw, 190px); height: clamp(150px, 38vw, 190px);
  border-radius: 50%; margin: 0 auto; display: flex;
  align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 900; letter-spacing: .04em;
  background: #dc2626;
  box-shadow: 0 0 0 6px rgba(220,38,38,.12), 0 0 0 14px rgba(220,38,38,.06), 0 16px 40px rgba(220,38,38,.3);
  animation: buzz-idle 2.8s ease-in-out infinite;
  border: 3px solid rgba(255,255,255,.15) !important;
  transition: transform .1s, box-shadow .1s;
}
.buzz-btn:hover {
  animation: none; transform: scale(1.05);
  box-shadow: 0 0 0 8px rgba(220,38,38,.18), 0 0 0 18px rgba(220,38,38,.08), 0 20px 50px rgba(220,38,38,.4);
  background: #b91c1c;
}
.buzz-btn:active { transform: scale(.96); }
@keyframes buzz-idle {
  0%, 100% { box-shadow: 0 0 0 6px rgba(220,38,38,.12), 0 16px 40px rgba(220,38,38,.28); }
  50%       { box-shadow: 0 0 0 10px rgba(220,38,38,.18), 0 16px 40px rgba(220,38,38,.36); }
}

.submit-answer-btn { width: 100%; margin-top: .9rem; min-height: 2.8rem; font-size: .95rem; border-radius: var(--r-lg); }

/* ─── Waiting ─── */
.waiting-card { text-align: center; padding: 3rem 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); }
.waiting-spinner {
  width: 36px; height: 36px; border-radius: 50%; margin: 0 auto 1rem;
  border: 2.5px solid rgba(37,99,235,.2); border-top-color: var(--accent);
  animation: spin .85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.waiting-card h2 { font-size: 1.2rem; margin-bottom: .4rem; }
.waiting-card p { color: var(--text-2); font-size: .9rem; }

/* ─── Media ─── */
.media-frame { margin: .9rem 0; }
.media-frame img { max-width: 100%; max-height: 50vh; border-radius: var(--r-lg); border: 1px solid var(--border); display: block; }
.media-frame iframe { width: 100%; aspect-ratio: 16/9; max-height: 50vh; border: 0; border-radius: var(--r-lg); display: block; }
.media-frame video { max-width: 100%; border-radius: var(--r-lg); border: 1px solid var(--border); }

/* ─── Moderator ─── */
.mod-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1rem; align-items: start; }
.mod-controls { position: sticky; top: 72px; }
.mod-controls .card { padding: .9rem; }
.mod-section-title {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-3); margin: .9rem 0 .4rem; padding-top: .75rem; border-top: 1px solid var(--border);
}
.mod-section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.mod-btn-row { display: flex; flex-wrap: wrap; gap: .25rem; }
.mod-btn-row button { flex: 1; min-width: 0; font-size: .8rem; padding: .5rem .45rem; }

.mod-question {
  background: rgba(37,99,235,.07); border: 1px solid rgba(37,99,235,.2);
  border-radius: var(--r-lg); padding: 1.1rem; margin-bottom: .9rem;
}
.mod-question .q-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: .4rem; }
.mod-question .q-text { font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.35; }

.correct-mark { color: var(--ok); font-weight: 700; }
.wrong-mark   { color: var(--danger); font-weight: 700; }

.lb-list { list-style: none; }
.lb-list li { display: flex; align-items: center; gap: .65rem; padding: .55rem .4rem; border-radius: var(--r); transition: background .12s; }
.lb-list li:hover { background: var(--bg-3); }
.lb-rank {
  width: 1.8rem; height: 1.8rem; border-radius: var(--r-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 800;
  background: var(--bg-3); color: var(--text-2);
  border: 1px solid var(--border);
}
.lb-rank.rank-1 { background: rgba(234,179,8,.15); border-color: rgba(234,179,8,.35); color: #fde68a; }
.lb-rank.rank-2 { background: rgba(148,163,184,.1); border-color: rgba(148,163,184,.25); color: #e2e8f0; }
.lb-rank.rank-3 { background: rgba(180,83,9,.15); border-color: rgba(180,83,9,.3); color: #fdba74; }
.lb-name { flex: 1; font-weight: 600; font-size: .88rem; }
.lb-pts { font-weight: 700; font-size: .95rem; color: var(--accent); white-space: nowrap; }

.participant-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: 99px; padding: .35rem .75rem; margin: .18rem;
  font-weight: 500; font-size: .84rem; color: var(--text);
}
.participant-pill .remove-btn {
  background: transparent !important; box-shadow: none !important;
  color: var(--text-3) !important; padding: .15rem !important;
  min-height: auto !important; margin: 0 !important;
  border-radius: 4px !important; font-size: .9rem !important; line-height: 1;
}
.participant-pill .remove-btn:hover { color: var(--danger) !important; background: rgba(239,68,68,.1) !important; }

/* ─── Admin ─── */
.quiz-list-table .status-live   { color: #86efac; font-weight: 600; }
.quiz-list-table .status-draft  { color: var(--text-3); }
.quiz-list-table .status-done   { color: var(--text-3); }
.quiz-list-table .status-open   { color: #93c5fd; }

.question-editor {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: .9rem 1.1rem; margin-bottom: .5rem;
}
.question-editor summary {
  cursor: pointer; font-weight: 600; font-size: .9rem;
  display: flex; align-items: center; gap: .65rem; list-style: none;
  user-select: none; color: var(--text); transition: color .12s;
}
.question-editor summary:hover { color: var(--accent); }
.question-editor summary::-webkit-details-marker { display: none; }
.question-editor summary::before {
  content: '';
  flex-shrink: 0;
  width: 1.5rem; height: 1.5rem;
  border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
  transition: transform .15s, background-color .12s;
}
.question-editor[open] summary::before {
  transform: rotate(90deg);
  background-color: rgba(37,99,235,.12);
  border-color: rgba(37,99,235,.3);
}
.question-editor-body { padding-top: .9rem; border-top: 1px solid var(--border); margin-top: .75rem; }
.options-input-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }

/* ─── Links bar ─── */
.links-bar { display: flex; flex-wrap: wrap; gap: .35rem; margin: .7rem 0; }
.links-bar a {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .35rem .7rem; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border-2);
  color: var(--accent); font-size: .82rem; font-weight: 600;
  transition: all .12s;
}
.links-bar a:hover {
  background: rgba(37,99,235,.1); color: #60a5fa;
  border-color: rgba(37,99,235,.35);
}

/* ─── Messages ─── */
.message-item { display: flex; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.message-item:last-child { border-bottom: 0; }
.message-sender { font-weight: 600; color: var(--accent); font-size: .84rem; white-space: nowrap; }
.message-text { flex: 1; font-size: .86rem; color: var(--text-2); line-height: 1.45; }

/* ─── Vote bars ─── */
.vote-bar-wrap { display: flex; flex-direction: column; gap: .45rem; }
.vote-bar-row { display: flex; align-items: center; gap: .55rem; font-size: .84rem; }
.vote-bar-label { width: 1.2rem; font-weight: 700; flex-shrink: 0; color: var(--text-2); }
.vote-bar-track { flex: 1; height: 6px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.vote-bar-fill  { height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s ease; }
.vote-bar-count { width: 2.8rem; text-align: right; color: var(--text-3); font-weight: 600; font-size: .8rem; }

/* ─── Overlay ─── */
.overlay { position: relative; min-height: 100vh; overflow: hidden; text-align: center; }
.overlay .nav { display: none; }
.overlay-q   { position: absolute; transform: translate(-50%,-50%); width: min(90vw,1000px); }
.overlay-lb  { position: absolute; transform: translate(-50%,0); min-width: 200px; }
.overlay-votes { position: absolute; transform: translate(-50%,-50%); }
.overlay-msgs  { position: absolute; transform: translate(-50%,-50%); max-width: 360px; text-align: left; }
.overlay-aud   { position: absolute; transform: translate(-50%,-50%); max-width: 280px; text-align: left; }
.overlay-classic { background: #0f0e0d; color: #faf9f7; }
.overlay-clean   { background: #000; color: #fff; }
.overlay-game    { background: radial-gradient(circle at top, #1e1a0e, #0f0e0d 65%); color: #fef3c7; }
.overlay-card { background: rgba(15,14,13,.85); border: 1px solid rgba(168,162,158,.2); border-radius: var(--r-lg); padding: .9rem 1.1rem; backdrop-filter: blur(10px); }
.big-q-text { font-size: clamp(1.3rem, 2.8vw, 2.2rem); font-weight: 800; line-height: 1.25; }

/* ─── Status dots ─── */
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.status-dot.live   { background: var(--ok); }
.status-dot.draft  { background: var(--text-3); }
.status-dot.done   { background: var(--text-3); }
.status-dot.open   { background: #60a5fa; }

/* ─── Misc ─── */
hr { border: 0; border-top: 1px solid var(--border); margin: .9rem 0; }
.muted { color: var(--text-2) !important; }
.text-sm { font-size: .82rem; }
.mt-sm { margin-top: .35rem; }
.mt { margin-top: .9rem; }
.mt-lg { margin-top: 1.6rem; }
.mb-sm { margin-bottom: .35rem; }
.mb { margin-bottom: .9rem; }
.flex { display: flex; align-items: center; gap: .55rem; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.gap-sm { gap: .28rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .mod-layout { grid-template-columns: 1fr; }
  .mod-controls { position: static; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 1.2rem); padding: 1rem 0 2.5rem; }
  .nav { gap: .2rem; }
  .options-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .options-input-grid { grid-template-columns: repeat(2, 1fr); }
  .quiz-join-row { flex-direction: column; }
  h1 { font-size: 1.4rem; }
  .hero-title { font-size: 2.2rem; }
  .table-wrap table { font-size: .8rem; }
  th, td { padding: .55rem .65rem; }
}
