:root {
  color-scheme: dark;
  --bg: #08090b;
  --surface: #12161a;
  --surface-2: #1a2026;
  --surface-3: #222932;
  --line: #31343a;
  --line-gold: rgba(212, 175, 55, 0.42);
  --text: #f4efe3;
  --muted: #9ca7b1;
  --gold: #d4af37;
  --gold-light: #e6c86e;
  --accent: #34d399;
  --warn: #d4af37;
  --error: #f05f5f;
  --info: #69a8ff;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0%, rgba(212, 175, 55, 0.08), transparent 28%),
    linear-gradient(145deg, #08090b 0%, #101317 48%, #090a0c 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: 300px;
  border-right: 1px solid var(--line-gold);
  background:
    linear-gradient(180deg, rgba(212, 175, 55, 0.06), transparent 22%),
    #0d1013;
  padding: 24px 18px 18px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
  padding: 10px 8px 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  position: relative;
  width: 84px;
  height: 84px;
  padding: 0;
  border: 1px solid rgba(230, 200, 110, 0.36);
  border-radius: 50%;
  background: #08090b;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.brand-mark img {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 420%;
  height: 420%;
  max-width: none;
  object-fit: contain;
  transform: translate(-36.7%, -48.1%);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: var(--gold-light);
  font-size: 16px;
  line-height: 1.18;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
}

nav {
  display: grid;
  gap: 4px;
  flex: 1;
}

nav a {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 6px;
  border: 1px solid transparent;
  color: #e3e8ed;
  text-decoration: none;
  font-size: 14px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

nav a:hover,
nav a.active {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.12), rgba(255, 255, 255, 0.03));
  border-color: rgba(212, 175, 55, 0.28);
  color: var(--text);
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-submenu {
  display: grid;
  gap: 2px;
  margin: 0 0 4px 34px;
}

.nav-submenu a {
  min-height: 30px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
}

.nav-submenu a.active {
  color: var(--gold-light);
}

.nav-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 50%;
  color: var(--gold-light);
  font-size: 12px;
}

.coming {
  color: var(--warn);
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}

.season-card {
  margin-top: 20px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.14), rgba(255, 255, 255, 0.03));
  padding: 14px;
}

.season-card span,
.season-card strong {
  display: block;
}

.season-card span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.season-card strong {
  margin-top: 6px;
  color: var(--gold-light);
  font-size: 18px;
}

main {
  margin-left: 300px;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold-light);
  font-size: 13px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
}

h2 {
  font-size: 19px;
}

.api-state,
button {
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  white-space: nowrap;
}

button {
  cursor: pointer;
}

button:hover {
  border-color: var(--gold);
}

.api-state.ok {
  border-color: rgba(51, 214, 166, 0.55);
  color: var(--accent);
}

.api-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.state-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.7);
}

.api-state.ok .state-dot {
  background: var(--accent);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.75);
}

.api-state.error .state-dot {
  background: var(--error);
  box-shadow: 0 0 18px rgba(240, 95, 95, 0.65);
}

.api-state.error {
  border-color: rgba(240, 95, 95, 0.55);
  color: var(--error);
}

.panel {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 24px 0 32px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

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

.status-grid,
.competition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.data-status-block {
  margin-top: 18px;
}

.data-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.data-status-item {
  min-height: 78px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 13px;
}

.data-status-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.data-status-item strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.match-list {
  display: grid;
  gap: 10px;
}

.match-card {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(260px, 2fr) minmax(140px, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(212, 175, 55, 0.07), rgba(255, 255, 255, 0.025)),
    var(--surface);
  padding: 14px 16px;
}

.match-meta,
.match-time {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.match-teams {
  display: grid;
  gap: 8px;
}

.team-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.team-crest {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.team-crest img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.status-card,
.competition-card {
  position: relative;
  min-height: 128px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(212, 175, 55, 0.07), rgba(255, 255, 255, 0.025)),
    var(--surface);
  padding: 16px;
  overflow: hidden;
}

.status-card::before,
.competition-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), transparent);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-icon,
.competition-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(230, 200, 110, 0.42);
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(8, 9, 11, 0.58);
}

.card-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.competition-mark {
  font-size: 13px;
  font-weight: 800;
}

.status-card strong,
.competition-card strong {
  display: block;
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}

.badge.ok {
  border-color: rgba(51, 214, 166, 0.55);
  color: var(--accent);
}

.badge.not_configured {
  border-color: rgba(212, 175, 55, 0.62);
  color: var(--warn);
}

.badge.error {
  border-color: rgba(240, 95, 95, 0.55);
  color: var(--error);
}

.competition-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.competition-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.competition-code {
  color: var(--gold-light);
  font-size: 12px;
  text-transform: uppercase;
}

.competition-details {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.competition-detail {
  margin-top: 22px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(212, 175, 55, 0.18);
  padding-top: 20px;
  margin-bottom: 16px;
}

.detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-button {
  width: auto;
  border-color: rgba(212, 175, 55, 0.22);
}

.tab-button.active {
  border-color: var(--gold);
  color: var(--gold-light);
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 8px;
  background: var(--surface);
}

.standings-table th,
.standings-table td {
  padding: 10px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: right;
  font-size: 13px;
}

.standings-table th {
  color: var(--gold-light);
  font-weight: 700;
}

.standings-table td:first-child,
.standings-table th:first-child,
.standings-table td:nth-child(2),
.standings-table th:nth-child(2) {
  text-align: left;
}

.standings-team {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.points-cell {
  color: var(--gold-light);
  font-weight: 800;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.team-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(212, 175, 55, 0.07), rgba(255, 255, 255, 0.025)),
    var(--surface);
  color: var(--text);
  padding: 14px;
  text-decoration: none;
}

.team-card:hover {
  border-color: rgba(230, 200, 110, 0.55);
}

.team-card-head,
.team-profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-profile {
  display: grid;
  gap: 18px;
}

.team-profile-head .team-crest {
  width: 72px;
  height: 72px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.info-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 12px;
}

.info-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.info-item strong {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
}

.info-item a {
  color: var(--gold-light);
  overflow-wrap: break-word;
  word-break: normal;
}

.info-item--quarter {
  grid-column: span 3;
}

.info-item--third {
  grid-column: span 4;
}

.info-item--half {
  grid-column: span 6;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.form-badge {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--gold-light);
  font-weight: 800;
}

.form-badge.win {
  border-color: rgba(52, 211, 153, 0.55);
  color: var(--accent);
}

.form-badge.loss {
  border-color: rgba(240, 95, 95, 0.55);
  color: var(--error);
}

.value-title {
  align-items: flex-start;
}

.value-toolbar {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}

.value-toolbar label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.value-toolbar select {
  min-height: 40px;
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 10px;
}

.value-toolbar input {
  min-height: 40px;
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 10px;
}

.value-state,
.value-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.value-tabs {
  margin-bottom: 16px;
}

.value-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.value-card-grid,
.future-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.value-metric,
.future-module-grid > div {
  min-height: 86px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 13px;
}

.value-metric span,
.future-module-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.value-metric strong,
.future-module-grid strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.value-status-banner {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
}

.value-status-banner strong,
.value-status-banner span {
  display: block;
}

.value-status-banner span,
.value-status-banner li {
  color: var(--muted);
  font-size: 13px;
}

.value-status-banner ul {
  margin: 0;
  padding-left: 18px;
}

.value-status-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.value-badge.ready,
.value-badge.value {
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--accent);
}

.value-badge.strong_value {
  border-color: rgba(230, 200, 110, 0.45);
  color: var(--gold-light);
}

.value-badge.watch,
.value-badge.model_uncertain {
  border-color: rgba(212, 175, 55, 0.38);
  color: var(--warn);
}

.value-badge.no_bet,
.value-badge.no_market_data,
.value-badge.muted-badge {
  border-color: rgba(156, 167, 177, 0.28);
  color: var(--muted);
}

.value-market-card {
  margin-bottom: 14px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.value-market-head,
.value-section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
}

.value-market-head {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.16);
}

.value-market-head span {
  color: var(--muted);
  font-size: 12px;
}

.daily-selection-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.daily-selection-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
}

.daily-selection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.daily-selection-head strong,
.daily-selection-head span {
  display: block;
}

.daily-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.daily-selection-reason {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.daily-selection-reason strong {
  color: var(--text);
}

.decision-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.decision-badge.a_jouer {
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--accent);
}

.decision-badge.a_surveiller {
  border-color: rgba(212, 175, 55, 0.42);
  color: var(--warn);
}

.decision-badge.ne_pas_jouer,
.decision-badge.donnees_insuffisantes {
  border-color: rgba(156, 167, 177, 0.28);
  color: var(--muted);
}

.empty-state {
  border: 1px dashed rgba(212, 175, 55, 0.25);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line-gold);
  }

  main {
    margin-left: 0;
    padding: 22px 16px;
  }

  .topbar,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .match-card {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-item,
  .info-item--quarter,
  .info-item--third,
  .info-item--half {
    grid-column: 1;
  }

  .api-state,
  button {
    width: 100%;
    justify-content: center;
  }

  .value-toolbar,
  .value-card-grid,
  .future-module-grid,
  .daily-card-grid,
  .data-status-grid {
    grid-template-columns: 1fr;
  }

  .daily-selection-head {
    flex-direction: column;
  }
}

@media (min-width: 821px) and (max-width: 1120px) {
  .sidebar {
    width: 260px;
  }

  main {
    margin-left: 260px;
    padding: 24px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 76px;
    height: 76px;
  }

  .info-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .info-item,
  .info-item--quarter,
  .info-item--third {
    grid-column: span 3;
  }

  .info-item--half {
    grid-column: span 6;
  }

  .value-card-grid,
  .future-module-grid,
  .daily-card-grid,
  .data-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
