/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ── Dark theme base ─────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #000;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

a {
  color: #8ab4f8;
}

/* ── Header ──────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-logo {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.15em;
}

.site-logo:hover {
  color: #8ab4f8;
}

.logo-vowel {
  font-size: 0.55em;
  opacity: 0.18;
  vertical-align: baseline;
  margin: 0 -0.09em;
}

/* ── User menu ───────────────────────────────────────── */

.user-menu {
  position: relative;
}

.user-menu-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
  padding: 0;
}

.user-menu-button:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
}

.user-menu-button svg {
  width: 20px;
  height: 20px;
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.5rem 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.user-menu-dropdown.open {
  display: block;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  color: #e0e0e0;
  text-decoration: none;
  font-size: 0.9rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
  background: #2a2a2a;
  color: #fff;
}

.user-menu-dropdown .menu-divider {
  height: 1px;
  background: #333;
  margin: 0.25rem 0;
}

/* ── Flash messages ──────────────────────────────────── */

.flash-notice,
.flash-alert {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  max-width: 500px;
  text-align: center;
  animation: flash-fade-in 0.3s ease;
}

.flash-notice {
  background: rgba(39, 174, 96, 0.15);
  border: 1px solid rgba(39, 174, 96, 0.3);
  color: #6ddb9a;
}

.flash-alert {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #f09080;
}

@keyframes flash-fade-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Network graph ───────────────────────────────────── */

#network-graph {
  width: 100%;
  height: calc(100vh - 56px);
  background: #000;
  margin: 0;
  border: none;
  border-radius: 0;
}

/* ── Main content area (home) ────────────────────────── */

.home-container {
  padding-top: 56px; /* header height */
}

/* ── Topic detail panel ──────────────────────────────── */

#topic-detail {
  display: none;
}

#topic-detail.active {
  display: block;
  min-height: calc(100vh - 56px);
  overflow-y: auto;
}

.topic-detail-panel {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.topic-close-button {
  position: absolute;
  top: 1.5rem;
  right: 0.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.topic-close-button:hover {
  color: #fff;
  border-color: #555;
  background: #2a2a2a;
}

.topic-close-button svg {
  width: 18px;
  height: 18px;
}

.topic-detail-panel h2 {
  font-size: 1.75rem;
  color: #fff;
  margin: 0 0 0.5rem;
}

.topic-detail-panel .topic-category {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.topic-detail-panel .topic-description {
  line-height: 1.7;
  color: #ccc;
  margin-bottom: 2rem;
}

.topic-detail-panel h3 {
  font-size: 1.1rem;
  color: #fff;
  margin: 2rem 0 1rem;
}

/* ── Quiz question cards (dark theme) ────────────────── */

.quiz-card {
  position: relative;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: #111;
}

.quiz-card .question-label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.quiz-card .question-type-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
}
.quiz-card .question-type-badge--single   { color: #6ddb9a; border: 1px solid rgba(109, 219, 154, 0.35); }
.quiz-card .question-type-badge--multiple { color: #f8a84b; border: 1px solid rgba(248, 168, 75,  0.35); }
.quiz-card .question-type-badge--ranking  { color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.35); }

.quiz-card .question-body {
  line-height: 1.6;
  color: #e0e0e0;
  margin-bottom: 1rem;
}

.quiz-card .answers-grid {
  display: grid;
  gap: 0.5rem;
}

.quiz-card .answer-option {
  padding: 0.75rem 1rem;
  border: 2px solid #2a2a2a;
  border-radius: 6px;
  cursor: pointer;
  background: #0a0a0a;
  color: #e0e0e0;
  transition: border-color 0.2s, background 0.2s;
}

.quiz-card .answer-option:hover {
  border-color: #444;
  background: #1a1a1a;
}

.quiz-card .answer-option.selected {
  border-color: #8ab4f8;
  background: rgba(138, 180, 248, 0.1);
}

.quiz-card .quiz-submit-btn {
  margin-top: 1rem;
  padding: 0.6rem 1.5rem;
  background: #2c3e50;
  color: #e0e0e0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: bold;
  transition: background 0.2s;
}

.quiz-card .quiz-submit-btn:hover {
  background: #3d5166;
}

.quiz-card .quiz-feedback {
  display: none;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-weight: bold;
}

.quiz-card .quiz-explanation {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background: #1a1a2e;
  border-radius: 6px;
  border-left: 4px solid #3498db;
  line-height: 1.6;
}

/* ── Ranking question ────────────────────────────────── */

.quiz-card .ranking-list { display: flex; flex-direction: column; gap: 0.5rem; }
.quiz-card .ranking-item { cursor: grab; padding: 0.75rem 1rem; border: 2px solid #2a2a2a; border-radius: 6px; background: #0a0a0a; color: #e0e0e0; user-select: none; display: flex; align-items: center; gap: 0.75rem; }
.quiz-card .ranking-item:hover { border-color: #444; background: #1a1a1a; }
.quiz-card .ranking-item.dragging { opacity: 0.4; cursor: grabbing; }
.quiz-card .ranking-item.over { border-color: #8ab4f8; background: rgba(138,180,248,0.08); }
.quiz-card .ranking-item-number { flex-shrink: 0; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #1e1e1e; border: 1px solid #3a3a3a; color: #888; font-size: 0.75rem; font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* ── Matching question ──────────────────────────────── */

.quiz-card .question-type-badge--matching { color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.35); }
.matching-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.matching-prompt { padding: 0.75rem 1rem; border: 2px solid #2a2a2a; border-radius: 6px; background: #0a0a0a; color: #e0e0e0; display: flex; align-items: center; }
.matching-dropzone { min-height: 2.75rem; padding: 0.5rem 1rem; border: 2px dashed #333; border-radius: 6px; background: #0d0d0d; color: #666; display: flex; align-items: center; transition: border-color 0.2s, background 0.2s; }
.matching-dropzone.has-answer { border-style: solid; border-color: #2a2a2a; color: #e0e0e0; background: #0a0a0a; cursor: grab; }
.matching-dropzone.over { border-color: #8ab4f8; background: rgba(138, 180, 248, 0.08); }
.matching-pool { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.matching-pool-item { cursor: grab; padding: 0.6rem 1rem; border: 2px solid #2a2a2a; border-radius: 6px; background: #0a0a0a; color: #e0e0e0; user-select: none; transition: border-color 0.2s, background 0.2s; }
.matching-pool-item:hover { border-color: #444; background: #1a1a1a; }
.matching-pool-item.dragging { opacity: 0.4; cursor: grabbing; }

/* ── Bucket question ─────────────────────────────────── */
.quiz-card .question-type-badge--bucket { color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.35); }
.bucket-container { display: flex; gap: 1rem; margin-top: 0.5rem; }
.bucket-column { flex: 1; min-width: 0; }
.bucket-header { padding: 0.6rem 1rem; border: 2px solid #2a2a2a; border-radius: 6px 6px 0 0; background: #0a0a0a; color: #e0e0e0; font-weight: 600; text-align: center; }
.bucket-dropzone { min-height: 4rem; padding: 0.5rem; border: 2px dashed #333; border-top: none; border-radius: 0 0 6px 6px; background: #0d0d0d; display: flex; flex-direction: column; gap: 0.5rem; transition: border-color 0.2s, background 0.2s; }
.bucket-dropzone.over { border-color: #8ab4f8; background: rgba(138, 180, 248, 0.08); }
.bucket-placeholder { color: #555; text-align: center; padding: 0.75rem; font-size: 0.9rem; }
.bucket-item { cursor: grab; padding: 0.5rem 0.75rem; border: 2px solid #2a2a2a; border-radius: 6px; background: #0a0a0a; color: #e0e0e0; user-select: none; transition: border-color 0.2s, background 0.2s; }
.bucket-item:hover { border-color: #444; background: #1a1a1a; }
.bucket-item.dragging { opacity: 0.4; cursor: grabbing; }
.bucket-pool { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.bucket-pool-item { cursor: grab; padding: 0.6rem 1rem; border: 2px solid #2a2a2a; border-radius: 6px; background: #0a0a0a; color: #e0e0e0; user-select: none; transition: border-color 0.2s, background 0.2s; }
.bucket-pool-item:hover { border-color: #444; background: #1a1a1a; }
.bucket-pool-item.dragging { opacity: 0.4; cursor: grabbing; }

/* ── About page ──────────────────────────────────────── */

.about-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 6rem 1.5rem 3rem;
}

.about-page h1 {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 2rem;
  color: #fff;
  letter-spacing: 0.15em;
  margin-bottom: 2rem;
}

.about-page p {
  line-height: 1.8;
  color: #ccc;
  margin-bottom: 1rem;
}

/* ── Stats page ──────────────────────────────────────── */

.stats-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 6rem 1.5rem 3rem;
}

.stats-page h1 {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 2rem;
  color: #fff;
  letter-spacing: 0.15em;
  margin-bottom: 2rem;
}

.stats-empty {
  color: #666;
  font-size: 0.95rem;
}

.stats-hero {
  display: grid;
  grid-template-columns: minmax(260px, 300px) 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

@media (max-width: 600px) {
  .stats-hero {
    grid-template-columns: 1fr;
  }
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stats-card {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}

.stats-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.stats-card-label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.4rem;
}

.stats-section {
  margin-bottom: 2.5rem;
}

.stats-section-title {
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 1rem;
  font-weight: 600;
}

.stats-bar-chart {
  width: 100%;
  height: 72px;
  display: block;
}

.stats-radar-section {
  min-width: 0;
}

.stats-radar-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.stats-chart-label {
  font-size: 9px;
  fill: #555;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.stats-table th {
  text-align: left;
  color: #555;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #2a2a2a;
}

.stats-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #141414;
  color: #e0e0e0;
}

.stats-table tr:last-child td {
  border-bottom: none;
}

.stats-table tr:hover td {
  background: #0d0d0d;
}

.stats-category-label {
  color: #666;
  font-size: 0.82rem;
}

.stats-progress-bar {
  height: 5px;
  width: 80px;
  background: #1e1e1e;
  border-radius: 3px;
  overflow: hidden;
}

.stats-progress-fill {
  height: 100%;
  background: #8ab4f8;
  border-radius: 3px;
  min-width: 2px;
}

/* ── Histogram ───────────────────────────────────────── */

.stats-histogram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stats-histogram-header .stats-section-title {
  margin: 0;
}

.stats-histogram-select {
  background: #111;
  color: #e0e0e0;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  appearance: auto;
}

.stats-histogram-select:focus {
  outline: none;
  border-color: #8ab4f8;
}

.stats-histogram-chart {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
}

.stats-histogram-bar {
  fill: #2a2a2a;
}

.stats-histogram-bar--you {
  fill: #8ab4f8;
}

.stats-histogram-bin-label {
  font-size: 10px;
  fill: #555;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.stats-histogram-you-label {
  font-size: 10px;
  fill: #8ab4f8;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.stats-histogram-percentile {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #888;
}

/* ── Friends page ───────────────────────────────────── */

.friends-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 6rem 1.5rem 3rem;
}

.friends-page h1 {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 2rem;
  color: #fff;
  letter-spacing: 0.15em;
  margin-bottom: 2rem;
}

.friends-section-title {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.75rem;
}

.friends-invite-desc {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.friends-invite-section {
  margin-bottom: 2.5rem;
}

.friends-qr-code {
  display: inline-block;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  overflow: hidden;
}

.friends-qr-code svg {
  display: block;
  max-width: 220px;
  height: auto;
}

.friends-invite-row {
  display: flex;
  gap: 0.5rem;
  max-width: 480px;
  width: 100%;
}

.friends-invite-input {
  flex: 1;
  min-width: 0;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  background: #111;
  color: #e0e0e0;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friends-invite-input:focus {
  border-color: #8ab4f8;
  box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.25);
}

.friends-copy-btn {
  flex-shrink: 0;
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: #8ab4f8;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.friends-copy-btn:hover {
  background: #6ea1f7;
}

.friends-copy-btn.copied {
  background: #4caf50;
}

.friends-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.friends-card {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.friends-card-email {
  color: #e0e0e0;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.friends-card-menu {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.friends-card-menu-btn {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.friends-card-menu-btn:hover {
  color: #aaa;
  background: #1a1a1a;
}

.friends-card-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  min-width: 120px;
  z-index: 50;
  overflow: hidden;
}

.friends-card-dropdown[hidden] {
  display: none;
}

.friends-card-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: #ccc;
  transition: background 0.1s ease;
}

.friends-card-dropdown-item:hover {
  background: #222;
}

.friends-card-dropdown-danger {
  color: #ef5350;
}

.friends-card-dropdown-danger:hover {
  background: rgba(239, 83, 80, 0.1);
}

.friends-empty {
  color: #666;
  font-size: 0.95rem;
}

.friends-chart-section {
  margin-bottom: 2.5rem;
}

.friends-chart {
  width: 100%;
  max-height: 300px;
}

.friends-chart-label {
  fill: #666;
  font-size: 11px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.friends-chart-axis-title {
  fill: #888;
  font-size: 11px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.friends-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}

.friends-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #999;
  font-size: 0.8rem;
}

.friends-chart-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.friends-card-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.friends-card-stat {
  color: #888;
  font-size: 0.9rem;
}

.friends-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #8ab4f8;
  color: #000;
  font-size: 1.75rem;
  font-weight: 300;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 100;
}

.friends-fab:hover {
  background: #6ea1f7;
  transform: scale(1.08);
}

.friends-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.friends-modal-overlay[hidden] {
  display: none;
}

.friends-modal {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  position: relative;
}

.friends-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  color: #666;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.friends-modal-close:hover {
  color: #fff;
}

/* ── Leagues ─────────────────────────────────────────── */

.league-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 6rem 1.5rem 3rem;
}

.league-page h1 {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 2rem;
  color: #fff;
  letter-spacing: 0.15em;
  margin-bottom: 2rem;
}

.league-section-title {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.75rem;
}

.league-create-section {
  margin-bottom: 2.5rem;
}

.league-create-row {
  display: flex;
  gap: 0.5rem;
  max-width: 480px;
}

.league-name-input {
  flex: 1;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  background: #111;
  color: #e0e0e0;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  outline: none;
}

.league-name-input:focus {
  border-color: #8ab4f8;
  box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.25);
}

.league-create-btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: #8ab4f8;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.league-create-btn:hover {
  background: #6ea1f7;
}

.league-form-error {
  color: #ef5350;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.league-list-section {
  margin-bottom: 2.5rem;
}

.league-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.league-card {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.league-card:hover {
  border-color: #8ab4f8;
}

.league-card-name {
  color: #e0e0e0;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.league-card-meta {
  color: #888;
  font-size: 0.85rem;
  margin-left: auto;
}

.league-card-badge {
  background: #8ab4f8;
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.league-member-card {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.league-card-email {
  color: #e0e0e0;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.league-card-menu {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.league-card-menu-btn {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.league-card-menu-btn:hover {
  color: #aaa;
  background: #1a1a1a;
}

.league-card-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  min-width: 120px;
  z-index: 50;
  overflow: hidden;
}

.league-card-dropdown[hidden] {
  display: none;
}

.league-card-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: #ccc;
  transition: background 0.1s ease;
}

.league-card-dropdown-item:hover {
  background: #222;
}

.league-card-dropdown-danger {
  color: #ef5350;
}

.league-card-dropdown-danger:hover {
  background: rgba(239, 83, 80, 0.1);
}

.league-card-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.league-card-stat {
  color: #888;
  font-size: 0.9rem;
}

.league-empty {
  color: #666;
  font-size: 0.95rem;
}

.league-chart-section {
  margin-bottom: 2.5rem;
}

.league-chart {
  width: 100%;
  max-height: 300px;
}

.league-chart-label {
  fill: #666;
  font-size: 11px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.league-chart-axis-title {
  fill: #888;
  font-size: 11px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.league-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}

.league-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #999;
  font-size: 0.8rem;
}

.league-chart-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.league-leave-section {
  margin-bottom: 2rem;
}

.league-leave-btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ef5350;
  background: none;
  border: 1px solid #ef5350;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.league-leave-btn:hover {
  background: rgba(239, 83, 80, 0.1);
}

.league-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #8ab4f8;
  color: #000;
  font-size: 1.75rem;
  font-weight: 300;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 100;
}

.league-fab:hover {
  background: #6ea1f7;
  transform: scale(1.08);
}

.league-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.league-modal-overlay[hidden] {
  display: none;
}

.league-modal {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  position: relative;
}

.league-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  color: #666;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.league-modal-close:hover {
  color: #fff;
}

.league-invite-desc {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.league-qr-code {
  display: inline-block;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  overflow: hidden;
}

.league-qr-code svg {
  display: block;
  max-width: 220px;
  height: auto;
}

.league-invite-row {
  display: flex;
  gap: 0.5rem;
  max-width: 480px;
}

.league-invite-input {
  flex: 1;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  background: #111;
  color: #e0e0e0;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  outline: none;
}

.league-invite-input:focus {
  border-color: #8ab4f8;
  box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.25);
}

.league-copy-btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: #8ab4f8;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.league-copy-btn:hover {
  background: #6ea1f7;
}

.league-copy-btn.copied {
  background: #4caf50;
}

/* ── Admin tooltip (preserved) ───────────────────────── */

.topic-questions-tooltip {
  position: relative;
  cursor: pointer;
  text-decoration: underline dotted;
}

.topic-questions-tooltip-content {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  background: #2c3e50;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  white-space: nowrap;
  z-index: 10;
}

.topic-questions-tooltip-content span {
  display: block;
  padding: 2px 0;
}

.topic-questions-tooltip:hover .topic-questions-tooltip-content {
  display: block;
}
