:root {
  --bg0: #0f1c17;
  --bg1: #163028;
  --bg2: #1d3d32;
  --ink: #e8f2ec;
  --muted: #9bb5a8;
  --accent: #d6ff4b;
  --accent-ink: #132017;
  --line: rgba(232, 242, 236, 0.12);
  --danger: #ff7a6e;
  --ok: #6dffb0;
  --card: rgba(14, 28, 23, 0.72);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --font-display: "Archivo", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(214, 255, 75, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(109, 255, 176, 0.12), transparent 50%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 45%, #0b1511);
}

/* Post-auth boot: football rolls left → right (≥1.5s) while line data preloads */
.boot-loader {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 28px;
  padding: 48px 0;
}
.boot-loader-track {
  position: relative;
  height: 120px;
  width: 100%;
  overflow: hidden;
}
.boot-chase {
  position: absolute;
  left: 0;
  bottom: 24px;
  will-change: transform;
  animation: boot-chase-run 1.5s linear infinite;
}
.boot-football {
  width: 72px;
  height: 72px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.28));
  animation: boot-ball-spin 0.48s linear infinite;
  pointer-events: none;
  user-select: none;
}
.boot-loader-caption {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
}
@keyframes boot-chase-run {
  0% { transform: translateX(-12vw); }
  100% { transform: translateX(100vw); }
}
@keyframes boot-ball-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .boot-chase {
    left: 50%;
    animation: none;
    transform: translateX(-50%);
  }
  .boot-football {
    animation: boot-ball-pulse 1.2s ease-in-out infinite;
  }
  @keyframes boot-ball-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
  }
}

.app { max-width: 1100px; margin: 0 auto; padding: 24px 20px 64px; }

.topbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
}

.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 50%;
  display: block;
  object-fit: contain;
  border: none;
  background: #000;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}
.muted, .hint, .meta, .votes { color: var(--muted); }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.userbox {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: 32px;
  padding-left: 8px;
}
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.user-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  border: none;
  background: #000;
}
.avatar-empty {
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
}

button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  font: 600 0.95rem var(--font-body);
  cursor: pointer;
  box-shadow: none;
  filter: none;
  /* Default = fade-out after .is-pressed is removed */
  transition:
    transform 0.28s ease,
    background 0.32s ease,
    border-color 0.32s ease,
    color 0.32s ease,
    box-shadow 0.32s ease,
    filter 0.32s ease;
}
button:hover { transform: translateY(-1px); border-color: rgba(214,255,75,.45); }
button:disabled { cursor: wait; opacity: 0.55; transform: none; box-shadow: none; filter: none; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button.ghost { background: rgba(255,255,255,0.03); }
button.logout {
  background: var(--danger);
  color: #1a0b09;
  border-color: transparent;
  font-weight: 700;
}
button.logout:hover { border-color: transparent; filter: brightness(1.05); }
button.nav.active { background: rgba(214,255,75,0.16); border-color: rgba(214,255,75,0.4); }

/* Fast ignition on press; release uses base ~0.32s for smooth fade-out.
   League tabs skip green press flash — selection uses .active crossfade (0.5s). */
button.is-pressed:not(:disabled):not(.is-cancel):not(.logout):not(.league-tab) {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 0 22px rgba(214, 255, 75, 0.4);
  transform: scale(0.97);
  filter: brightness(1.05);
  transition-duration: 0.12s;
}
button.primary.is-pressed:not(:disabled) {
  box-shadow: 0 0 26px rgba(214, 255, 75, 0.55);
  filter: brightness(1.1);
  transform: scale(0.97);
  transition-duration: 0.12s;
}
button.logout.is-pressed:not(:disabled) {
  box-shadow: 0 0 22px rgba(255, 92, 92, 0.45);
  filter: brightness(1.12);
  transform: scale(0.97);
  transition-duration: 0.12s;
}
button.is-cancel.is-pressed:not(:disabled) {
  background: rgba(255, 92, 92, 0.42);
  color: #ffe0e0;
  border-color: rgba(255, 130, 130, 0.95);
  box-shadow: 0 0 22px rgba(255, 92, 92, 0.48);
  transform: scale(0.97);
  filter: brightness(1.1);
  transition-duration: 0.12s;
}

@media (prefers-reduced-motion: reduce) {
  button.is-pressed:not(:disabled) {
    transform: none;
  }
}

.content h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
  margin: 0 0 8px;
}
.lede { margin: 0 0 24px; color: var(--muted); max-width: 42rem; }

.league-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
button.league-tab {
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  transition:
    background 0.5s ease,
    color 0.5s ease,
    border-color 0.5s ease,
    box-shadow 0.5s ease,
    filter 0.5s ease,
    transform 0.2s ease;
}
button.league-tab.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
button.league-tab.is-pressed:not(:disabled) {
  transform: scale(0.97);
  transition-duration: 0.12s;
}
.league-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}
.poll-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  margin-bottom: 8px;
  scrollbar-width: thin;
}
.poll-filters > * { flex: 0 0 auto; }
.round-filter-select {
  width: min(160px, 42vw);
  max-width: 160px;
  min-width: 112px;
  padding: 10px 34px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--bg2);
  font: 600 0.95rem var(--font-body);
  cursor: pointer;
}
button.filter-chip {
  background: rgba(255,255,255,0.03);
  white-space: nowrap;
}
button.filter-chip.active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
}
.admin-block {
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(14, 28, 23, 0.55);
}
.admin-block h2, .page > h2 {
  font-family: var(--font-display);
  margin: 0 0 12px;
  font-size: 1.2rem;
}
.admin-user-select {
  display: block;
  width: min(100%, 420px);
  margin: 14px 0 12px;
  padding: 12px 36px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--bg2);
  font: 600 0.95rem var(--font-body);
}
.temporary-password-result { margin-top: 14px; }
.temporary-password {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  background: rgba(0,0,0,0.25);
  font: 800 1.1rem monospace;
  letter-spacing: 0.08em;
  user-select: all;
}

.banner {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.banner.error { background: rgba(255,122,110,0.12); color: #ffd2cd; }
.banner.ok { background: rgba(109,255,176,0.12); color: #d8ffe9; }

.auth-card, .poll, .ach, .table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.auth-card { padding: 28px; max-width: 460px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 18px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,0.2);
}
button.auth-tab {
  padding: 9px 12px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
button.auth-tab.active {
  border-color: rgba(214,255,75,.28);
  background: rgba(214,255,75,.12);
  color: var(--accent);
}
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.field span { font-size: 0.85rem; color: var(--muted); }
.field-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
}
.field-title label { font-size: 0.85rem; color: var(--muted); }
.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--ink);
  font: 500 1rem var(--font-body);
}
.password-input { position: relative; }
.password-input .input { padding-right: 50px; }
button.password-reveal {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 36px;
  height: 34px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  filter: grayscale(1);
  opacity: 0.72;
  transform: translateY(-50%);
  user-select: none;
  touch-action: none;
}
button.password-reveal:hover,
button.password-reveal.active {
  border-color: rgba(214,255,75,.38);
  opacity: 1;
  transform: translateY(-50%);
}
button.password-info {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  color: var(--accent);
  background: rgba(214,255,75,.08);
  font: 700 0.72rem var(--font-body);
}
.password-requirements {
  margin: 0;
  padding: 9px 11px;
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(214,255,75,.06);
  font-size: 0.8rem;
  line-height: 1.4;
}
.password-requirements[hidden] { display: none; }
@keyframes auth-input-shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}
.input.auth-input-shake {
  animation: auth-input-shake 1.1s ease-in-out;
  border-color: rgba(255,122,110,.75);
}
label.remember {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
}
label.remember input { margin-top: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.hint { margin-top: 18px; font-size: 0.85rem; }
.form-error { min-height: 1.25rem; margin: 14px 0 0; color: #ffd2cd; }

.poll-list { display: grid; gap: 16px; }
.round-heading {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.poll {
  position: relative;
  overflow: hidden;
  padding: 22px;
}
.poll-win-ribbon {
  position: absolute;
  top: 18px;
  left: -34px;
  z-index: 1;
  width: 120px;
  padding: 5px 0;
  transform: rotate(-35deg);
  background: rgba(255, 80, 70, 0.92);
  color: #fff5f4;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  pointer-events: none;
  box-shadow: none;
}
.poll-title { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.matchup {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}
.matchup-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 3.2rem;
}
.matchup-score-main {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.matchup-score-pen {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.team-side {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.team-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 12px;
  background: #f3f7f4;
  border: 1px solid rgba(232, 242, 236, 0.25);
  padding: 3px;
  flex-shrink: 0;
  display: block;
}
.team-logo-fallback {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--accent-ink);
  background: var(--accent);
}
.team-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.matchup-vs {
  color: var(--muted);
  font-weight: 700;
}
.badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.badge.open { background: rgba(214,255,75,0.15); color: var(--accent); }
.badge.closed { background: rgba(255,255,255,0.06); }
.badge.settled { background: rgba(109,255,176,0.12); color: var(--ok); }
.mine, .result { font-weight: 600; }
.votes-locked { color: var(--muted); margin: 14px 0 4px; font-size: 0.95rem; }
.settle { margin-top: 8px; align-items: center; }
.prediction-timer { color: var(--muted); margin: 10px 0 0; font-size: 0.9rem; }

.prediction-actions button.prediction-choice {
  min-width: 8.5rem;
  min-height: 2.6rem;
  transform-style: preserve-3d;
  perspective: 700px;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease,
    filter 0.3s ease;
}

.prediction-actions button.prediction-choice.is-cancel {
  background: rgba(255, 92, 92, 0.18);
  color: #ffb4b4;
  border-color: rgba(255, 92, 92, 0.6);
  box-shadow: 0 0 16px rgba(255, 92, 92, 0.18);
}

.prediction-actions button.prediction-choice.is-cancel:hover {
  border-color: rgba(255, 92, 92, 0.9);
  filter: brightness(1.06);
}

.prediction-actions button.prediction-choice.is-flipping {
  animation: prediction-flip 0.52s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

@keyframes prediction-flip {
  0% {
    transform: rotateX(0deg) scale(1);
  }
  45% {
    transform: rotateX(90deg) scale(0.97);
  }
  55% {
    transform: rotateX(90deg) scale(0.97);
  }
  100% {
    transform: rotateX(0deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .prediction-actions button.prediction-choice.is-flipping {
    animation: none;
  }
}

.votes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.vote-item {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
}
.vote-item.mine-choice {
  border-color: rgba(214,255,75,0.7);
  background: rgba(214,255,75,0.08);
}
.vote-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.vote-label-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.vote-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.my-vote-badge {
  flex-shrink: 0;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}
.vote-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}
.vote-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.vote-fill.mine { box-shadow: 0 0 8px rgba(214,255,75,0.65); }

.table-wrap { overflow: auto; }
.rating-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.rating-print-area { overflow: auto; }
.rating-board-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.rating-section-title {
  margin: 18px 0 10px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--accent);
}
.rating-around {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.rating-around-hint { margin: 0 0 10px; font-size: 0.9rem; }
.rating-print-header { display: none; }
table.rating { width: 100%; border-collapse: collapse; }
table.rating th, table.rating td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
table.rating th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
table.rating tr.rating-me {
  background: rgba(214, 255, 75, 0.12);
}
table.rating tr.rating-me td {
  border-bottom-color: rgba(214, 255, 75, 0.35);
}

@media print {
  body {
    background: #fff !important;
    color: #111 !important;
  }
  .topbar,
  .banner,
  .no-print,
  .lede {
    display: none !important;
  }
  .app {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .rating-page h1 {
    margin: 0 0 12px;
    color: #111;
  }
  .rating-print-header {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
  }
  .rating-print-header strong {
    font-size: 1.2rem;
  }
  .rating-section-title {
    color: #111;
  }
  .rating-around {
    border-top-color: #ccc;
  }
  table.rating th,
  table.rating td {
    color: #111;
    border-bottom-color: #ddd;
  }
  table.rating tr.rating-me {
    background: #f3f3f3 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .avatar,
  .ach-image,
  .team-logo,
  .brand-mark {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.ach { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.ach-image {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: contain;
  border: none;
  background: #000;
  align-self: flex-start;
}
.ach h3 { margin: 0; font-family: var(--font-display); }
.ach.locked { opacity: 0.55; }
.ach.unlocked { border-color: rgba(214,255,75,0.35); }
.ach-status { font-size: 0.85rem; color: var(--muted); }
.ach-avatar-current {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.chat-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.chat-status { margin-left: auto; color: var(--muted); font-size: 0.85rem; }
.chat-status.connected { color: var(--ok); }
.chat-messages {
  height: min(62vh, 620px);
  min-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 6px 14px 0;
}
.chat-empty { margin: auto; text-align: center; }
.chat-message {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}
.chat-message-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
  border: none;
  background: #000;
  flex: 0 0 auto;
}
.chat-avatar-empty {
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
}
.chat-author { font-size: 0.92rem; }
.chat-time { margin-left: auto; color: var(--muted); font-size: 0.76rem; }
.chat-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.chat-quote {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 0 9px;
  padding: 7px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(0,0,0,0.18);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}
button.chat-reply {
  margin-top: 8px;
  padding: 5px 9px;
  font-size: 0.78rem;
}
.chat-reply-preview {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: rgba(214,255,75,0.07);
}
.chat-reply-preview > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chat-reply-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.chat-input {
  min-height: 52px;
  max-height: 140px;
  resize: vertical;
}
.chat-composer-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.chat-counter { color: var(--muted); font-size: 0.72rem; }
.chat-error { margin-bottom: 0; }

.notif-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.notif-settings-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  padding: 0;
  line-height: 0;
  /* Keep base button ignition/fade (background, glow, color). */
  transition:
    transform 0.28s ease,
    background 0.32s ease,
    border-color 0.32s ease,
    color 0.32s ease,
    box-shadow 0.32s ease,
    filter 0.32s ease;
}
.notif-settings-btn svg {
  pointer-events: none;
  display: block;
}
.notif-settings-btn.is-active:not(.is-pressed) {
  border-color: rgba(214, 255, 75, 0.45);
  color: var(--accent, #d6ff4b);
}
.notif-prefs {
  margin-bottom: 8px;
}
.notif-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.notif-item {
  border: 1px solid rgba(155, 181, 168, 0.22);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(10, 28, 22, 0.55);
}
.notif-item.unread {
  border-color: rgba(214, 255, 75, 0.35);
  background: rgba(214, 255, 75, 0.06);
}
.notif-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.notif-pref {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  color: var(--text);
}
.notif-campaign-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(155, 181, 168, 0.15);
}

@media (max-width: 800px) {
  .topbar { grid-template-columns: 1fr; }
  .poll-title { flex-direction: column; }
  .votes-grid { grid-template-columns: 1fr; }
  .chat-panel { padding: 12px; }
  .chat-messages { height: 58vh; min-height: 300px; }
  .chat-composer { align-items: stretch; flex-direction: column; }
  .chat-composer-side { flex-direction: row; justify-content: space-between; align-items: center; }
  .chat-composer-side button { flex: 1; }
}
