@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Mono:wght@300;400;500&family=Instrument+Serif:ital@0;1&display=swap');

/* ─── Tokens ─────────────────────────────────────────── */
:root {
  --bg:          #0a0a0b;
  --bg2:         #111114;
  --bg3:         #18181c;
  --border:      #2a2a30;
  --border2:     #3a3a42;
  --text:        #e8e8ed;
  --text2:       #9090a0;
  --text3:       #606070;
  --accent:      #c8f564;   /* electric lime */
  --accent2:     #7c6af0;   /* violet */
  --accent3:     #f06464;   /* coral */
  --accent4:     #64c8f0;   /* sky */
  --white:       #ffffff;
  --radius:      6px;
  --radius-lg:   12px;
  --font-head:   'Syne', sans-serif;
  --font-body:   'DM Mono', monospace;
  --font-serif:  'Instrument Serif', serif;
  --transition:  0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 16px 64px rgba(0,0,0,0.6);
}

/* ─── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.75; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select {
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  width: 100%;
  outline: none;
  transition: border-color var(--transition);
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239090a0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ─── Typography ─────────────────────────────────────── */
h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }
h1 { font-size: clamp(2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p { color: var(--text2); }

/* ─── Layout ─────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 720px; }
.container--wide { max-width: 1440px; }

/* ─── Navigation ─────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,10,11,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex; align-items: center;
}
.nav__inner {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.nav__logo {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.05em;
}
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 8px; align-items: center; }

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  transition: all var(--transition); white-space: nowrap; cursor: pointer;
  border: 1px solid transparent;
}
.btn--primary {
  background: var(--accent); color: #0a0a0b; border-color: var(--accent);
}
.btn--primary:hover { background: #d9ff7a; border-color: #d9ff7a; }
.btn--ghost {
  background: transparent; color: var(--text2); border-color: var(--border);
}
.btn--ghost:hover { background: var(--bg3); color: var(--text); border-color: var(--border2); }
.btn--danger {
  background: transparent; color: var(--accent3); border-color: var(--accent3);
}
.btn--danger:hover { background: var(--accent3); color: white; }
.btn--sm { padding: 5px 12px; font-size: 12px; }
.btn--lg { padding: 13px 28px; font-size: 15px; }
.btn--icon { padding: 8px; border-radius: var(--radius); }
.btn:disabled { opacity: 0.4; pointer-events: none; }

/* ─── Cards ──────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card--hover:hover { border-color: var(--border2); }

/* ─── Form ───────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; color: var(--text2); letter-spacing: 0.05em; text-transform: uppercase; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11px; color: var(--text3); }
.form-error { font-size: 12px; color: var(--accent3); }

/* ─── Badge ──────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.04em;
}
.badge--lime   { background: rgba(200,245,100,0.12); color: var(--accent); }
.badge--violet { background: rgba(124,106,240,0.15); color: var(--accent2); }
.badge--coral  { background: rgba(240,100,100,0.15); color: var(--accent3); }
.badge--sky    { background: rgba(100,200,240,0.15); color: var(--accent4); }
.badge--muted  { background: var(--bg3); color: var(--text3); }
.badge--live   { background: rgba(240,100,100,0.2); color: var(--accent3); animation: pulse 2s infinite; }

/* ─── Alert ──────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13px; border: 1px solid;
}
.alert--success { background: rgba(200,245,100,0.08); border-color: rgba(200,245,100,0.3); color: var(--accent); }
.alert--error   { background: rgba(240,100,100,0.08); border-color: rgba(240,100,100,0.3); color: var(--accent3); }
.alert--info    { background: rgba(100,200,240,0.08); border-color: rgba(100,200,240,0.3); color: var(--accent4); }

/* ─── Tabs ───────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab {
  padding: 10px 18px; font-size: 13px; color: var(--text3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all var(--transition); cursor: pointer; font-family: var(--font-body);
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab:hover:not(.active) { color: var(--text2); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Toggle ─────────────────────────────────────────── */
.toggle {
  position: relative; width: 36px; height: 20px; display: inline-block; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle__slider {
  position: absolute; inset: 0; background: var(--border2);
  border-radius: 99px; cursor: pointer; transition: var(--transition);
}
.toggle__slider::before {
  content: ''; position: absolute; width: 14px; height: 14px;
  background: white; border-radius: 50%; bottom: 3px; left: 3px;
  transition: var(--transition);
}
.toggle input:checked + .toggle__slider { background: var(--accent); }
.toggle input:checked + .toggle__slider::before { transform: translateX(16px); }

/* ─── Table ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 10px 16px; text-align: left; font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); font-weight: 500; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }

/* ─── Grid utilities ─────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* ─── Flex utilities ─────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.wrap { flex-wrap: wrap; }

/* ─── Spacing utilities ──────────────────────────────── */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* ─── Text utilities ─────────────────────────────────── */
.text-muted  { color: var(--text2); }
.text-dim    { color: var(--text3); }
.text-accent { color: var(--accent); }
.text-coral  { color: var(--accent3); }
.text-sky    { color: var(--accent4); }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }
.text-lg     { font-size: 16px; }
.text-xl     { font-size: 18px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serif       { font-family: var(--font-serif); }

/* ─── Modal ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(16px); transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal__header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.modal__title { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; }
.modal__close { color: var(--text3); font-size: 20px; padding: 4px; cursor: pointer; transition: color var(--transition); }
.modal__close:hover { color: var(--text); }
.modal__footer { margin-top: 24px; display: flex; justify-content: flex-end; gap: 8px; }

/* ─── Stat card ──────────────────────────────────────── */
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 24px;
}
.stat-card__value { font-family: var(--font-head); font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-card__label { font-size: 12px; color: var(--text3); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ─── Section list (programme) ───────────────────────── */
.section-item {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; gap: 16px; align-items: center;
  transition: border-color var(--transition), background var(--transition);
}
.section-item:hover { border-color: var(--border2); }
.section-item--live { border-color: var(--accent3); background: rgba(240,100,100,0.05); }
.section-item--done { opacity: 0.5; }
.section-item__drag { color: var(--text3); cursor: grab; padding: 4px; flex-shrink: 0; }
.section-item__icon { width: 36px; height: 36px; border-radius: var(--radius); background: var(--bg3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.section-item__info { flex: 1; min-width: 0; }
.section-item__title { font-weight: 600; font-family: var(--font-head); font-size: 15px; }
.section-item__meta { display: flex; gap: 8px; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.section-item__actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ─── Photo grid ─────────────────────────────────────── */
.photo-grid { columns: 3; gap: 12px; }
.photo-item { break-inside: avoid; margin-bottom: 12px; position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.photo-item img { width: 100%; display: block; transition: transform 0.3s ease; }
.photo-item:hover img { transform: scale(1.03); }
.photo-item__overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0; transition: opacity var(--transition); display: flex; align-items: flex-end; padding: 12px;
}
.photo-item:hover .photo-item__overlay { opacity: 1; }

/* ─── Chat ───────────────────────────────────────────── */
.chat-wrap {
  display: flex; flex-direction: column; height: 100%;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px;
  scroll-behavior: smooth;
}
.chat-msg { display: flex; flex-direction: column; gap: 2px; }
.chat-msg__header { display: flex; gap: 8px; align-items: baseline; }
.chat-msg__name { font-weight: 600; font-size: 12px; color: var(--accent); }
.chat-msg__name--admin { color: var(--accent2); }
.chat-msg__time { font-size: 10px; color: var(--text3); }
.chat-msg__text { font-size: 13px; line-height: 1.5; word-break: break-word; }
.chat-msg--pinned { background: rgba(124,106,240,0.08); border: 1px solid rgba(124,106,240,0.2); border-radius: var(--radius); padding: 8px 12px; }
.chat-input-wrap { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.chat-input-wrap input { margin: 0; }

/* ─── Q&A ────────────────────────────────────────────── */
.question-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; gap: 16px; align-items: flex-start;
}
.question-card__votes {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex-shrink: 0; min-width: 40px;
}
.question-card__upvote {
  width: 32px; height: 32px; border-radius: var(--radius); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  transition: all var(--transition); cursor: pointer; background: transparent; color: var(--text3);
}
.question-card__upvote:hover,
.question-card__upvote.voted { border-color: var(--accent); color: var(--accent); background: rgba(200,245,100,0.1); }
.question-card__count { font-size: 13px; font-weight: 600; color: var(--text2); }
.question-card__body { font-size: 14px; line-height: 1.6; color: var(--text); flex: 1; }
.question-card__meta { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ─── Reactions bar ──────────────────────────────────── */
.reactions-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.reaction-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg2);
  font-size: 16px; color: var(--text2); font-family: var(--font-body);
  cursor: pointer; transition: all var(--transition);
}
.reaction-btn:hover { border-color: var(--border2); background: var(--bg3); transform: scale(1.1); }
.reaction-btn.sent { border-color: var(--accent); background: rgba(200,245,100,0.08); }
.reaction-btn .count { font-size: 12px; }

/* ─── Timer ──────────────────────────────────────────── */
.timer-display {
  font-family: var(--font-head); font-size: 3rem; font-weight: 800;
  letter-spacing: -0.04em; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.timer-display.overtime { color: var(--accent3); }
.progress-bar { height: 3px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-bar__fill { height: 100%; background: var(--accent); transition: width 1s linear; border-radius: 99px; }
.progress-bar__fill.danger { background: var(--accent3); }

/* ─── Live indicator ─────────────────────────────────── */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent3); display: inline-block; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ─── Empty state ────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 64px 24px; color: var(--text3);
}
.empty-state__icon { font-size: 40px; margin-bottom: 16px; opacity: 0.4; }
.empty-state__title { font-family: var(--font-head); font-size: 1.1rem; color: var(--text2); margin-bottom: 8px; }

/* ─── Toast ──────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 13px; min-width: 240px; max-width: 360px;
  background: var(--bg3); border: 1px solid var(--border);
  box-shadow: var(--shadow); animation: slideIn 0.2s ease;
}
.toast--success { border-color: rgba(200,245,100,0.4); color: var(--accent); }
.toast--error   { border-color: rgba(240,100,100,0.4); color: var(--accent3); }
.toast--info    { border-color: rgba(100,200,240,0.4); color: var(--accent4); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Dropdown ───────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 50;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  min-width: 160px; box-shadow: var(--shadow); padding: 4px;
  opacity: 0; pointer-events: none; transform: translateY(4px); transition: all var(--transition);
}
.dropdown.open .dropdown__menu { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown__item {
  display: block; padding: 8px 12px; font-size: 13px; color: var(--text2);
  border-radius: var(--radius); cursor: pointer; transition: all var(--transition); width: 100%; text-align: left;
}
.dropdown__item:hover { background: var(--bg3); color: var(--text); }
.dropdown__item--danger { color: var(--accent3); }
.dropdown__divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ─── Drag-and-drop ──────────────────────────────────── */
.dragging { opacity: 0.5; }
.drag-over { border-color: var(--accent) !important; }

/* ─── Announcement banner ────────────────────────────── */
.announcement-bar {
  padding: 10px 16px; text-align: center; font-size: 13px; font-weight: 500;
  animation: slideDown 0.3s ease;
}
.announcement-bar--info    { background: rgba(100,200,240,0.12); color: var(--accent4); border-bottom: 1px solid rgba(100,200,240,0.2); }
.announcement-bar--alert   { background: rgba(240,100,100,0.12); color: var(--accent3); border-bottom: 1px solid rgba(240,100,100,0.2); }
.announcement-bar--success { background: rgba(200,245,100,0.10); color: var(--accent); border-bottom: 1px solid rgba(200,245,100,0.2); }
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ─── Poll widget ────────────────────────────────────── */
.poll-option {
  position: relative; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all var(--transition);
  overflow: hidden; display: flex; justify-content: space-between; align-items: center;
}
.poll-option:hover { border-color: var(--accent); }
.poll-option.selected { border-color: var(--accent); background: rgba(200,245,100,0.06); }
.poll-bar {
  position: absolute; left: 0; top: 0; bottom: 0; background: rgba(200,245,100,0.08); z-index: 0;
  transition: width 0.5s ease;
}
.poll-option__text { position: relative; z-index: 1; }
.poll-option__pct  { position: relative; z-index: 1; font-size: 12px; color: var(--accent); font-weight: 600; }

/* ─── Admin sidebar layout ───────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg2); border-right: 1px solid var(--border);
  padding: 24px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.sidebar__brand { padding: 0 20px 24px; border-bottom: 1px solid var(--border); }
.sidebar__nav { padding: 16px 0; flex: 1; }
.sidebar__link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; font-size: 13px; color: var(--text2);
  transition: all var(--transition); cursor: pointer;
  border-left: 2px solid transparent;
}
.sidebar__link:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.sidebar__link.active { color: var(--accent); border-left-color: var(--accent); background: rgba(200,245,100,0.05); }
.sidebar__icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar__section { padding: 8px 20px 4px; font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 8px; }
.admin-main { padding: 32px; overflow-x: hidden; }
.admin-header { margin-bottom: 28px; }
.admin-header h2 { font-size: 1.6rem; }

/* ─── Scroll ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -240px; z-index: 80; transition: left var(--transition); width: 240px; height: 100vh; top: 0; }
  .sidebar.open { left: 0; }
  .admin-main { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .photo-grid { columns: 2; }
}
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .photo-grid { columns: 1; }
}
