/* FF2026 Chubba League — modern minimal utility skin */

:root {
  --bg: #e8eef4;
  --bg-accent: #d5e0ea;
  --surface: #f7f9fb;
  --surface-2: #eef3f7;
  --text: #1a2430;
  --muted: #5a6a7a;
  --accent: #1f5f8b;
  --accent-soft: #d6e6f2;
  --border: #c5d0db;
  --pts: #1a5f9e;
  --sos: #1f7a4d;
  --rank-bg: #1f5f8b;
  --rank-fg: #fff;
  --row-hover: #e4eef6;
  --danger: #9b2c2c;
  --shadow: 0 1px 2px rgba(26, 36, 48, 0.06);
  --radius: 10px;
  --page-max: 1100px;
  --toolbar-gap: 0.55rem;
  --row-h: 2.15rem;
  --visible-rows: 12;
  --font-sans: "DM Sans", "Segoe UI", sans-serif;
  --font-display: "Source Serif 4", Georgia, serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, #c9d9e8 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #d2e0ec 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%);
}

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1rem 0.85rem 2.5rem;
}

.page-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.site-main {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 0.22rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.site-main:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.page-header__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
}

.page-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page-header__sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-header__labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.draft-label,
.scoring-label {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-head {
  margin-bottom: 0.65rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.section-head__sub,
.bento-cell__sub {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.rankings {
  margin-bottom: 1.75rem;
}

.rankings-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--toolbar-gap);
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.45rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow-x: hidden;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.field__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.field--select select,
.search-wrap input {
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
}

.field--select select {
  min-width: 7.5rem;
  cursor: pointer;
}

.field--search {
  flex: 1 1 10rem;
  min-width: 8rem;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.45rem 0 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.search-wrap__icon {
  flex-shrink: 0;
  color: var(--muted);
}

.search-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0.4rem 0.35rem;
  background: transparent;
  outline: none;
}

.mode-toggle {
  display: inline-flex;
  padding: 0.15rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}

.mode-toggle__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.mode-toggle__btn.is-active {
  background: var(--accent);
  color: #fff;
}

.mode-toggle__btn:focus-visible,
.field--select select:focus-visible,
.search-wrap:focus-within,
.video-carousel__controls button:focus-visible,
.site-main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rankings-status {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.rankings-status.is-error {
  color: var(--danger);
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  max-height: calc(var(--row-h) * var(--visible-rows) + 2.4rem);
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

.rankings-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.rankings-table th,
.rankings-table td {
  padding: 0.35rem 0.55rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: left;
  height: var(--row-h);
}

.rankings-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.rankings-table tbody tr {
  transition: background 0.15s ease;
}

.rankings-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.55);
}

.rankings-table tbody tr:hover {
  background: var(--row-hover);
}

.rank-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.25rem;
  border-radius: 5px;
  background: var(--rank-bg);
  color: var(--rank-fg);
  font-weight: 700;
  font-size: 0.72rem;
}

.player-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  padding: 0.05rem 0.28rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.status-badge--q {
  background: #fde8e8;
  color: #9b2c2c;
}

.status-badge--ir {
  background: #1a2430;
  color: #fff;
}

.pos-badge {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
}

.team-logo {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  vertical-align: middle;
}

.team-abbr {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.pts-cell {
  color: var(--pts);
  font-weight: 700;
}

.sos-cell {
  color: var(--sos);
  font-weight: 600;
}

.num-empty {
  color: var(--muted);
}

/* Bento */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "external video"
    "docs chat";
  gap: 0.85rem;
  align-items: start;
}

.bento-cell {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.bento-cell--external { grid-area: external; }
.bento-cell--video { grid-area: video; }
.bento-cell--chat { grid-area: chat; }
.bento-cell--docs { grid-area: docs; }

.bento-cell h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.resource-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.resource-list a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.resource-list a:hover,
.resource-list a:focus-visible {
  text-decoration: underline;
}

.resource-list a.is-disabled {
  color: var(--muted);
  pointer-events: none;
  cursor: default;
  text-decoration: none;
}

.resource-list__meta,
.resource-list__note {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.resource-list__note {
  font-size: 0.78rem;
  font-style: italic;
}

.resource-list--compact {
  margin-top: 0.35rem;
  gap: 0.3rem;
}

.resource-list--compact li {
  font-size: 0.85rem;
}

.favorites {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.favorites-group__name {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.helpful-links {
  margin: 0.85rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.helpful-links a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.helpful-links a:hover,
.helpful-links a:focus-visible {
  text-decoration: underline;
}

.video-carousel__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #0f1720;
  margin-top: 0.65rem;
}

.video-carousel__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-carousel__frame .video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #9db0c2;
  font-size: 0.85rem;
  padding: 1rem;
  text-align: center;
}

.video-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.video-carousel__controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.video-carousel__controls button:hover {
  background: var(--accent-soft);
}

.video-carousel__counter {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 3.5rem;
  text-align: center;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.55rem;
  height: 5.5rem;
  overflow: hidden;
}

.chat-bubble {
  max-width: 85%;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.chat-bubble--other {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text);
}

.chat-bubble--self {
  align-self: flex-end;
  background: var(--accent-soft);
  color: var(--text);
}

.chat-composer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.chat-composer__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-composer input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
}

.chat-composer button {
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: not-allowed;
}

@media (max-width: 700px) {
  .page {
    padding: 0.85rem 0.65rem 2rem;
  }

  .site-main {
    min-height: 2.75rem;
    padding: 0.45rem 0.75rem;
  }

  .bento-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "external"
      "video"
      "chat"
      "docs";
  }

  .rankings-toolbar {
    padding: 0.5rem;
  }

  .field--select,
  .mode-toggle,
  .field--search {
    flex: 1 1 100%;
  }

  .field--select select {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mode-toggle__btn,
  .rankings-table tbody tr,
  .video-carousel__controls button,
  .site-main {
    transition: none;
  }
}
