body {
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: #f5f3ee;
  color: #222;
  margin: 0;
  padding: 24px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

/* ── Header ──────────────────────────────────────── */
.header {
  position: relative;
  text-align: center;
  margin-bottom: 4px;
}

h1 {
  color: #8a1c1c;
  margin: 0;
  display: inline-block;
}

.brand-le { color: #2b2b2b; }

.header-icons {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-icons-left {
  right: auto;
  left: 0;
}

.icon-btn {
  background: none;
  border: 2px solid #8a1c1c;
  color: #8a1c1c;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: #8a1c1c;
  color: white;
}

.subtitle {
  text-align: center;
  color: #666;
  margin-top: 6px;
  margin-bottom: 20px;
}

/* ── Sport tabs ──────────────────────────────────── */
.sport-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 10px;
}

.sport-tab {
  padding: 7px 22px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid #8a1c1c;
  border-radius: 4px;
  background: none;
  color: #8a1c1c;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sport-tab:hover {
  background: #f0dede;
}

.sport-tab.active {
  background: #8a1c1c;
  color: white;
}

/* ── Mode tabs ───────────────────────────────────── */
.mode-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 14px;
}

.mode-tab {
  padding: 6px 22px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid #8a1c1c;
  border-radius: 4px;
  background: none;
  color: #8a1c1c;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mode-tab:hover {
  background: #f0dede;
}

.mode-tab.active {
  background: #8a1c1c;
  color: white;
}

/* ── Decade filter row ───────────────────────────── */
.decade-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 14px;
  color: #555;
}

.decade-row label {
  font-weight: 600;
  color: #8a1c1c;
}

.decade-row select {
  padding: 5px 10px;
  font-size: 14px;
  border: 2px solid #8a1c1c;
  border-radius: 4px;
  background: white;
  color: #8a1c1c;
  font-weight: 600;
  cursor: pointer;
}

/* ── Streak display ──────────────────────────────── */
.streak-display {
  font-size: 16px;
  color: #444;
  margin: 0 auto 16px;
  padding: 10px 20px;
  background: #fff;
  border: 2px solid #8a1c1c;
  border-radius: 999px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

.streak-display > * {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.streak-display-wrap {
  text-align: center;
  margin-bottom: 4px;
}

.streak-display strong {
  color: #8a1c1c;
  font-size: 22px;
  font-weight: 800;
}

.streak-best {
  color: #888;
  font-size: 13px;
  font-weight: 500;
}

.hint {
  text-align: center;
  font-size: 12px;
  color: #aaa;
  margin: -8px 0 14px;
  letter-spacing: 0.02em;
}

/* ── Guess area ──────────────────────────────────── */
.guess-area {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.input-wrap {
  position: relative;
}

#guess-input {
  font-size: 16px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 260px;
}

.suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  max-height: 220px;
  overflow-y: auto;
  z-index: 10;
  text-align: left;
}

.suggestions.open { display: block; }

.suggestion-item {
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: #f0e9dc;
}

button {
  font-size: 15px;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: #8a1c1c;
  color: white;
}

button:hover { background: #6e1616; }

#new-player-btn { background: #444; }
#new-player-btn:hover { background: #222; }

/* ── Wrong guesses ───────────────────────────────── */
.wrong-guesses {
  text-align: center;
  font-size: 13px;
  color: #888;
  min-height: 20px;
  margin-bottom: 8px;
}

.wrong-guesses span {
  display: inline-block;
  background: #f0dede;
  color: #8a1c1c;
  border-radius: 12px;
  padding: 2px 10px;
  margin: 2px 3px;
  font-weight: 500;
}

/* ── Status / result banner ──────────────────────── */
@keyframes resultPop {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}

.status {
  text-align: center;
  font-weight: bold;
  font-size: 15px;
  min-height: 28px;
  margin-bottom: 10px;
  padding: 0 12px;
  border-radius: 6px;
}

.status.result-pop {
  animation: resultPop 0.3s ease-out forwards;
}

.status.wrong {
  color: #7a0010;
  background: #fde8e8;
  padding: 10px 16px;
}

.status.correct {
  color: #145214;
  background: #d4edda;
  padding: 10px 16px;
  font-size: 17px;
}

.status.lost {
  color: #7a0010;
  background: #fde8e8;
  padding: 10px 16px;
  font-size: 17px;
}

.tries {
  text-align: center;
  color: #555;
  margin-bottom: 8px;
}

/* ── Table ───────────────────────────────────────── */
.table-scroll {
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #8a1c1c #f0e9dc;
  }
  .table-scroll::-webkit-scrollbar { height: 6px; }
  .table-scroll::-webkit-scrollbar-track { background: #f0e9dc; border-radius: 3px; }
  .table-scroll::-webkit-scrollbar-thumb { background: #8a1c1c; border-radius: 3px; }

  table { min-width: 500px; }
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  background: white;
}

th, td {
  border: 1px solid #ddd;
  padding: 2px 6px;
  text-align: center;
  height: 32px;
  vertical-align: middle;
  box-sizing: border-box;
  white-space: nowrap;
}

thead {
  background: #f0e9dc;
  color: #8a1c1c;
}

tbody tr:nth-child(even) { background: #fafafa; }

.team-hidden { color: #bbb; font-style: italic; }
.team-revealed { color: #145214; font-weight: 600; }
.team-late { color: #888; }

.team-cell { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.team-cell-logo { width: 26px; height: 26px; object-fit: contain; vertical-align: middle; display: block; }
.team-cell-abbr { font-weight: 600; }

/* ── Logo bank ───────────────────────────────────── */
.logo-bank-section {
  margin-top: 20px;
  border-top: 1px solid #e0dcd2;
  padding-top: 10px;
}

.logo-bank-section > summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #8a1c1c;
  text-align: center;
  list-style: none;
  padding: 6px 0;
  user-select: none;
}

.logo-bank-section > summary::-webkit-details-marker { display: none; }

.logo-bank-section > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s;
}

.logo-bank-section[open] > summary::before {
  transform: rotate(90deg);
}

.logo-bank {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 6px 4px;
}

.logo-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.logo-division {
  display: flex;
  gap: 6px;
}

.team-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #555;
  text-align: center;
  line-height: 1.15;
}

.team-logo img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.team-logo .team-abbr-fallback {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  background: #8a1c1c;
  color: white;
  font-weight: 700;
  font-size: 11px;
  border-radius: 50%;
  letter-spacing: 0.02em;
}

.team-logo .team-abbr-label {
  font-weight: 600;
  color: #333;
}

/* ── Report area ─────────────────────────────────── */
.report-area {
  text-align: center;
  margin-top: 24px;
  margin-bottom: 8px;
}

.report-area button {
  background: none;
  border: none;
  color: #888;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.report-area button:hover {
  color: #444;
  background: none;
}

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 8px;
  padding: 28px 32px;
  max-width: 440px;
  width: 90%;
  position: relative;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.modal h2 {
  margin: 0 0 12px;
  color: #8a1c1c;
  font-size: 20px;
}

.info-subhead {
  margin: 16px 0 6px;
  color: #8a1c1c;
  font-size: 15px;
  font-weight: 700;
}

.link-btn {
  background: none;
  border: none;
  color: #8a1c1c;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-weight: 600;
}

.link-btn:hover { color: #6e1616; background: none; }

.modal p, .modal li {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

.modal ul { padding-left: 18px; margin: 8px 0; }

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #888;
  padding: 0;
  line-height: 1;
}

.modal-close:hover { color: #222; background: none; }

/* ── Stats modal ─────────────────────────────────── */
.stats-sport-tabs {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin: 4px 0 8px;
  flex-wrap: wrap;
}

.stats-sport-tab {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid #8a1c1c;
  border-radius: 4px;
  background: none;
  color: #8a1c1c;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.stats-sport-tab:hover { background: #f0dede; }
.stats-sport-tab.active { background: #8a1c1c; color: white; }

.stats-section { margin-top: 14px; }
.stats-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #8a1c1c;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.stat-cell {
  background: #f5f3ee;
  border: 1px solid #e0dcd2;
  border-radius: 6px;
  padding: 8px 4px;
  text-align: center;
}

.stat-cell .stat-value {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #8a1c1c;
  line-height: 1.1;
}

.stat-cell .stat-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #777;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Feedback form ───────────────────────────────── */
.feedback-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 4px;
  color: #444;
}

.feedback-form input,
.feedback-form textarea,
.feedback-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.feedback-form textarea { resize: vertical; min-height: 80px; }
.feedback-form button[type="submit"] { margin-top: 16px; width: 100%; font-size: 15px; }

.feedback-success {
  text-align: center;
  color: #1a7a1a;
  font-weight: bold;
  margin-top: 12px;
  display: none;
}
