/* ── Reset & Base ────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --card: #25253d;
  --accent: #5b9bf5;
  --accent-glow: #5b9bf580;
  --accent-hover: #93c5fd;
  --text: #eaeaea;
  --text-muted: #999;
  --border: #333;
  --today: #1e3a5f;
  --event-dot: #5b9bf5;
  --danger: #e94560;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f0f2f5;
    --surface: #ffffff;
    --card: #f8f9fb;
    --accent: #2563eb;
    --accent-glow: #2563eb40;
    --accent-hover: #1d4ed8;
    --text: #1a1a2e;
    --text-muted: #64748b;
    --border: #d4d4d8;
    --today: #dbeafe;
    --event-dot: #2563eb;
    --danger: #dc2626;
  }
}

html {
  font-size: 16px;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.owner-only-hidden {
  display: none !important;
}

/* ── Header ──────────────────────────────────────────── */
header {
  text-align: center;
  padding: 2rem 1rem 1rem;
  position: relative;
}

header h1 {
  font-size: 2rem;
  letter-spacing: 0.02em;
}

.subtitle {
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-size: 0.9rem;
}

.stream-line {
  margin-top: 0.6rem;
  text-align: center;
}

.stream-link {
  color: #fff;
  background: #9146ff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.stream-link:hover {
  background: #7c3aed;
  text-decoration: none;
}

.owner-auth-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  margin-top: 0;
  display: none;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(90vw, 520px);
}

.owner-auth-controls.with-admin {
  right: 4.5rem;
}

.owner-auth-status {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.owner-auth-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}

.owner-auth-btn:hover {
  border-color: var(--accent);
}

/* ── Admin Button ────────────────────────────────────── */
.admin-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color 0.2s, background 0.2s;
  line-height: 1;
}

.admin-btn:hover {
  border-color: var(--accent);
  background: var(--card);
}

/* Hide commentator features unless admin */
body:not(.admin-mode) .commentator-btn,
body:not(.admin-mode) #commentator-modal,
body:not(.admin-mode) .export-btn {
  display: none !important;
}

/* ── Main ────────────────────────────────────────────── */
main {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  flex: 1;
}

main.runs-page {
  max-width: 800px;
}

main.calendar-page {
  max-width: 860px;
}

/* ── Month Navigation ────────────────────────────────── */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 1rem;
}

.month-nav h2 {
  min-width: 220px;
  text-align: center;
  font-size: 1.4rem;
}

.month-nav button {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.3rem;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.month-nav button:hover {
  background: var(--accent);
}

/* ── Calendar Grid ───────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-header {
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
  text-transform: uppercase;
}

.day-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-height: 80px;
  padding: 0.4rem;
  position: relative;
  cursor: default;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.day-cell.empty {
  background: transparent;
  border-color: transparent;
}

.day-cell.today {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.day-cell .day-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.day-cell.today .day-number {
  color: var(--accent);
}

.day-cell.has-event {
  cursor: pointer;
}

.day-cell.has-event:hover {
  border-color: var(--accent);
}

.event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--event-dot);
  display: inline-block;
  margin-right: 3px;
}

.event-label {
  font-size: 0.7rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

/* ── Event Details Panel ─────────────────────────────── */
.event-details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  margin-top: 1.2rem;
  animation: fadeIn 0.25s ease;
}

.event-details.hidden {
  display: none;
}

.event-details h3 {
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
}

.event-details ul {
  list-style: none;
  padding: 0;
}

.event-details li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.event-details li:last-child {
  border-bottom: none;
}

.event-details .event-name {
  font-weight: 600;
  font-size: 1rem;
}

.event-details .event-time {
  color: var(--accent);
  font-size: 0.9rem;
}

.event-details .event-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Twitch Link ──────────────────────────────────────── */
.twitch-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #9146ff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.twitch-link:hover {
  color: #b47aff;
  text-decoration: underline;
}

.twitch-icon {
  font-size: 0.9rem;
}

/* ── Schedule Link ───────────────────────────────────── */
.schedule-link {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.schedule-link:hover {
  color: var(--accent-hover, #7dd3fc);
  text-decoration: underline;
}
/* ── Next Up Banner ───────────────────────────────────── */
.next-up {
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.next-up.hidden {
  display: none;
}

.next-up-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.next-up-game {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.next-up-marathon {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.next-up-time {
  display: block;
  font-size: 0.9rem;
  color: var(--accent);
  margin-top: 0.4rem;
}

.next-up-countdown {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.next-up-actions {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.next-up-watch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.9rem;
  background: #9146ff;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.next-up-watch:hover {
  background: #7c3aed;
}

.next-up-cal {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

/* ── Calendar Actions ────────────────────────────────── */
.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* ── Subscribe Button ────────────────────────────────── */
.subscribe-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.subscribe-btn:hover {
  opacity: 0.85;
}

/* ── Subscribe Modal ─────────────────────────────────── */
.subscribe-modal {
  max-width: 560px;
}

.subscribe-intro {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.subscribe-option {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.7rem;
}

.subscribe-option h4 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.subscribe-option p,
.subscribe-option ol {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.subscribe-option ol {
  padding-left: 1.2rem;
}

.subscribe-option a {
  color: var(--accent);
}

.subscribe-url-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.subscribe-url-input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--card);
  color: var(--text);
  font-size: 0.8rem;
  font-family: monospace;
  outline: none;
  min-width: 0;
}

.copy-url-btn {
  padding: 0.4rem 0.7rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}

.copy-url-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.subscribe-action-btn {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.2s;
}

.subscribe-action-btn:hover {
  opacity: 0.85;
}

.subscribe-tip {
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
  font-style: italic;
  margin-top: 0.4rem;
}

/* ── Upcoming List ───────────────────────────────────── */
.upcoming {
  margin-top: 2rem;
  margin-bottom: 1.4rem;
}

.upcoming h2 {
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.export-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.submit-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.submit-link-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

#upcoming-list,
#other-runners-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#upcoming-list li,
#other-runners-list li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 0.3rem;
}

#upcoming-list .event-name,
#other-runners-list .event-name {
  font-weight: 600;
}

#upcoming-list .event-date,
#upcoming-list .event-time,
#other-runners-list .event-date,
#other-runners-list .event-time {
  color: var(--accent);
  font-size: 0.9rem;
}

#upcoming-list .event-desc,
#other-runners-list .event-desc {
  width: 100%;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Footer ──────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.footer-socials {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.7rem 0.95rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.footer-social-link:visited {
  color: inherit;
}

.footer-social-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.footer-social-link:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--card);
}

.footer-social-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Commentator Button (in detail panel) ────────────── */
.commentator-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.commentator-btn:hover {
  background: var(--card);
  border-color: var(--accent);
}

/* ── Run Cards ───────────────────────────────────────── */
.runs-section {
  width: 100%;
  margin-top: 0.6rem;
}

.run-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.4rem;
  position: relative;
}

.run-card.has-edit {
  padding-right: 4.3rem;
}

.run-card:last-child {
  margin-bottom: 0;
}

.run-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.run-game {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.run-category {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.run-time {
  font-size: 0.8rem;
  color: var(--accent);
}

.tz-note {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-style: italic;
}

/* ── Run Actions ──────────────────────────────────── */
.run-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* ── Calendar Dropdown ───────────────────────────────── */
.cal-dropdown-wrap {
  position: relative;
  display: inline-flex;
}

.submission-cal-wrap {
  position: relative;
  display: inline-flex;
}

.add-to-cal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.submission-add-to-cal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.add-to-cal-btn:hover {
  background: var(--card);
  border-color: var(--accent);
}

.submission-add-to-cal-btn:hover {
  background: var(--card);
  border-color: var(--accent);
}

.submission-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
}

.submission-edit-btn:hover {
  background: var(--card);
  border-color: var(--accent);
}

.submission-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.submission-edit-form label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.submission-edit-form input {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
}

.submission-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.cal-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 100;
  min-width: 180px;
  overflow: hidden;
  animation: fadeIn 0.15s ease;
}

.submission-cal-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 100;
  min-width: 180px;
  overflow: hidden;
  animation: fadeIn 0.15s ease;
}

.cal-dropdown-wrap.open .cal-dropdown {
  display: block;
}

.submission-cal-wrap.open .submission-cal-dropdown {
  display: block;
}

.cal-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.submission-cal-item {
  display: block;
  width: 100%;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.cal-dropdown-item:last-child {
  border-bottom: none;
}

.submission-cal-item:last-child {
  border-bottom: none;
}

.cal-dropdown-item:hover {
  background: var(--surface);
  color: var(--accent);
}

.submission-cal-item:hover {
  background: var(--surface);
  color: var(--accent);
}

.comm-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.badge-empty .comm-badge {
  background: #444;
  color: var(--text-muted);
}

.badge-partial .comm-badge {
  background: #7a5c1a;
  color: #f5c842;
}

.badge-complete .comm-badge {
  background: #1a5c2a;
  color: #4cdf6b;
}

/* ── Modal Overlay ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 0.5rem;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  transition: color 0.2s;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  color: var(--accent);
}

.modal-body {
  padding: 1rem 1.2rem;
  overflow-y: auto;
}

/* ── Commentator Add Row ─────────────────────────────── */
.commentator-add-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.commentator-add-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.commentator-add-row input:focus {
  border-color: var(--accent);
}

.commentator-add-row input.input-error {
  border-color: var(--danger);
  animation: shake 0.3s ease;
}

.commentator-add-row button {
  padding: 0.5rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.commentator-add-row button:hover {
  opacity: 0.85;
}

/* ── Commentator List ────────────────────────────────── */
.commentator-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.commentator-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.commentator-item.status-confirmed {
  border-left: 3px solid #4cdf6b;
}

.commentator-item.status-asked {
  border-left: 3px solid #f5c842;
}

.commentator-item.status-declined {
  border-left: 3px solid var(--danger);
  opacity: 0.7;
}

.commentator-item.status-not-asked {
  border-left: 3px solid #666;
}

.comm-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.comm-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
}

.comm-status-select {
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

.comm-status-select:focus {
  border-color: var(--accent);
}

.comm-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.comm-remove-btn:hover {
  background: rgba(233, 69, 96, 0.2);
  color: var(--danger);
}

.commentator-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem 0;
}

.commentator-empty.hidden {
  display: none;
}

/* ── Utilities ───────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ── Back Link ────────────────────────────────────────── */
.back-link {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:visited {
  color: var(--accent);
}

.back-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ── Nav Link ────────────────────────────────────────── */
.nav-link {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.45rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s;
}

.nav-link:visited {
  color: var(--text);
}

.nav-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* ── Site Tabs ───────────────────────────────────────── */
.site-tabs {
  margin-top: 0.75rem;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.site-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 0.42rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.site-tab:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--surface);
}

.site-tab.active,
.site-tab.active:visited {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ── Landing Page ───────────────────────────────────── */
.landing-page {
  max-width: 860px;
  display: grid;
  gap: 1.1rem;
}

.landing-hero,
.stream-panel {
  background: linear-gradient(145deg, var(--card), var(--surface));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem;
}

.landing-hero {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top right, rgba(91, 155, 245, 0.22), transparent 30%),
    radial-gradient(circle at bottom left, rgba(145, 70, 255, 0.18), transparent 35%),
    linear-gradient(145deg, var(--card), var(--surface));
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: auto -48px -48px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 62%);
  pointer-events: none;
}

.landing-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-hero h2,
.stream-panel h2 {
  font-size: 1.35rem;
}

.landing-hero h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.02;
  max-width: 12ch;
  margin-top: 0.5rem;
}

.landing-hero p,
.stream-panel-note {
  margin-top: 0.5rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.landing-hero > p:not(.landing-kicker) {
  max-width: 62ch;
  font-size: 1rem;
  line-height: 1.65;
}

.landing-highlight-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.landing-highlight-card {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(10, 14, 27, 0.34);
  backdrop-filter: blur(10px);
}

.landing-highlight-card strong {
  color: var(--text);
  font-size: 0.95rem;
}

.landing-highlight-card span {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.stream-offline {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.stream-offline-image {
  width: 100%;
  max-width: 720px;
  min-height: 180px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  letter-spacing: 0.08em;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  background:
    radial-gradient(circle at 18% 18%, rgba(91, 155, 245, 0.28), transparent 42%),
    radial-gradient(circle at 80% 22%, rgba(147, 197, 253, 0.18), transparent 38%),
    linear-gradient(135deg, #1d2438, #101422);
}

.follow-btn {
  min-width: 210px;
}

.landing-cta-row {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.landing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.8rem 1.15rem;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.landing-cta:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--card);
}

.landing-cta-primary,
.landing-cta-primary:visited {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.landing-cta-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.stream-embed-wrap {
  margin-top: 0.8rem;
}

/* ── Social Links ────────────────────────────────────── */
.social-links-row {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.social-link:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--card);
}

.social-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.social-link-twitch {
  color: #bf94ff;
}

.social-link-youtube {
  color: #ff6b6b;
}

.social-link-instagram {
  color: #ff9ac6;
}

.social-link-tiktok {
  color: #7ae7f2;
}

.social-link-discord {
  color: #a7b6ff;
}

/* ── About Section ───────────────────────────────────── */
.about-section {
  background: linear-gradient(145deg, var(--card), var(--surface));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem;
}

.about-section h2 {
  font-size: 1.35rem;
  margin-bottom: 0.8rem;
}

.about-section p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.about-subsection {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.about-subsection h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.about-subsection p {
  margin-bottom: 0;
}

.games-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.game-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.game-tag:visited {
  color: var(--text);
}

.game-tag:hover {
  border-color: var(--accent);
  background: var(--card);
}

.game-tag:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Quick Links Section ─────────────────────────────── */
.quick-links-section {
  background: linear-gradient(145deg, var(--card), var(--surface));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem;
}

.quick-links-section h2 {
  font-size: 1.35rem;
  margin-bottom: 0.8rem;
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
}

.quick-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.quick-link-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--card);
}

.link-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.link-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.link-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stream-embed-wrap {
  margin-top: 0.8rem;
}

/* ── Runs Page ───────────────────────────────────────── */
.runs-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.run-entry {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
}

.run-event-title {
  font-size: 1.3rem;
  margin-bottom: 0.2rem;
}

.run-event-game {
  font-size: 1rem;
  color: var(--text);
  font-weight: 500;
}

.runs-filter {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.runs-filter label {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.runs-filter select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.runs-filter select:focus {
  border-color: var(--accent);
}

.run-event-date {
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}

.embed-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.embed-wrap iframe,
.stream-player-host {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.embed-fallback {
  margin-top: 0.55rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.embed-fallback a,
.embed-fallback a:visited {
  color: var(--accent);
}

.embed-fallback a:hover {
  color: var(--accent-hover);
}

.vod-actions {
  margin-top: 0.8rem;
  display: flex;
  justify-content: flex-end;
}

.vod-edit-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 7px;
  padding: 0.45rem 0.75rem;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.vod-edit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Submit Page ───────────────────────────────────── */
.submit-page {
  max-width: 920px;
  display: grid;
  gap: 1rem;
}

.submit-intro-card,
.submit-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}

.submit-intro-card h2,
.submit-card h2 {
  font-size: 1.2rem;
  margin-bottom: 0.65rem;
}

.submit-intro-card ol {
  padding-left: 1.2rem;
  color: var(--text-muted);
  display: grid;
  gap: 0.35rem;
}

.submit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.submit-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.submit-card label {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.submit-card input,
.submit-card select,
.submit-card textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  font-size: 0.92rem;
}

.submit-card textarea {
  resize: vertical;
}

.submit-help {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.submit-feedback {
  min-height: 1.1rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.submit-feedback.is-success {
  color: #57d28c;
}

.submit-feedback.is-error {
  color: #ff7c7c;
}

.import-tools {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.2rem;
}

.import-tools h3 {
  font-size: 0.98rem;
  margin-bottom: 0.35rem;
}

.import-row {
  display: flex;
  gap: 0.5rem;
  margin: 0.55rem 0 0.4rem;
}

.import-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.import-btn:hover {
  border-color: var(--accent);
}

.imported-runs {
  margin-top: 0.45rem;
}

.imported-runs-list {
  display: grid;
  gap: 0.35rem;
  max-height: 180px;
  overflow: auto;
  margin: 0.45rem 0;
  padding-right: 0.25rem;
}

.import-run-item {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.submit-issue-btn {
  margin-top: 0.6rem;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.58rem 0.9rem;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.submit-issue-btn:hover {
  opacity: 0.9;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .owner-auth-controls {
    position: static;
    margin-top: 0.8rem;
    justify-content: center;
    max-width: 100%;
  }

  .owner-auth-controls.with-admin {
    right: auto;
  }

  .day-cell {
    min-height: 54px;
    padding: 0.25rem;
  }

  .site-tabs {
    width: 100%;
  }

  .site-tab {
    flex: 1;
    min-width: 0;
  }

  .landing-cta {
    width: 100%;
  }

  .landing-hero {
    padding: 1.2rem;
  }

  .landing-hero h2 {
    max-width: none;
    font-size: 2rem;
  }

  .landing-highlight-row {
    grid-template-columns: 1fr;
  }

  .social-links-row {
    justify-content: stretch;
  }

  .social-link {
    width: 100%;
    justify-content: flex-start;
  }

  .quick-links-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-socials {
    gap: 0.6rem;
  }

  .footer-social-link {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }

  .submit-grid {
    grid-template-columns: 1fr;
  }

  .import-row {
    flex-direction: column;
  }

  .submit-issue-btn {
    width: 100%;
    justify-content: center;
  }

  .submit-link-btn {
    width: 100%;
    justify-content: center;
  }

  .event-label {
    display: none;
  }

  .month-nav h2 {
    min-width: 0;
    font-size: 1.1rem;
  }

  header h1 {
    font-size: 1.4rem;
  }
}
