/* Botola simulator — table + fixture editor side-by-side. */

.botola-sim { padding-bottom: 40px; }
.botola-head h1 { margin: 20px 0 6px; font-size: 2rem; }
.botola-head .tagline { opacity: .85; margin: 0 0 8px; }
.botola-head .meta { font-size: .85rem; opacity: .8; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ar-inline { font-weight: 400; opacity: .7; margin-left: 10px; font-size: 0.7em; direction: rtl; unicode-bidi: isolate; }

.botola-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.2fr);
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 900px) {
  .botola-layout { grid-template-columns: 1fr; }
}

.botola-table h2, .botola-fixtures h2 {
  font-size: 1rem; text-transform: uppercase; letter-spacing: 1px;
  margin: 0 0 10px; opacity: .85;
}

#standings-table {
  width: 100%; border-collapse: collapse;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; overflow: hidden;
  font-size: .9rem;
}
#standings-table th, #standings-table td {
  padding: 8px 6px; text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
#standings-table th { background: rgba(0,0,0,0.25); font-weight: 600; font-size: .8rem; }
#standings-table td.team { text-align: left; padding-left: 10px; }
#standings-table td.team span { display: inline-block; vertical-align: middle; }

/* Real crest PNG from football-logos.cc — displayed at 28×28 with
   white drop-shadow so dark logos still pop on the dark page. */
.crest-img {
  width: 28px; height: 28px;
  object-fit: contain;
  vertical-align: middle; margin-right: 8px;
  filter: drop-shadow(0 0 1px rgba(255,255,255,0.4));
}
.fixture .crest-img { margin: 0; }

/* Letter-badge fallback — used via <img onerror="..."> if the PNG
   URL 404s. Same footprint as .crest-img so layout doesn't shift. */
.crest {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700; font-size: 10px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15) inset, 0 1px 3px rgba(0,0,0,0.3);
  margin-right: 8px; vertical-align: middle;
}
.fixture .crest { margin: 0; }

/* Coloured rank pill in the # column — replaces the CAF / Botola-2
   logos. One pill per zone; colour keyed to the qualification band
   for that row. */
.pos-pill {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 28px; height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 800; font-size: 12px;
  background: rgba(255,255,255,0.06);       /* mid-table default */
  color: #fff;
}
#standings-table tr.zone-champ  .pos-pill { background: #16a34a; box-shadow: 0 0 10px rgba(22,163,74,0.4); }
#standings-table tr.zone-confed .pos-pill { background: #2563eb; box-shadow: 0 0 10px rgba(37,99,235,0.4); }
#standings-table tr.zone-playoff .pos-pill{ background: #f59e0b; color: #1a1200; box-shadow: 0 0 10px rgba(245,158,11,0.4); }
#standings-table tr.zone-bottom .pos-pill { background: #dc2626; box-shadow: 0 0 10px rgba(220,38,38,0.4); }

/* Legend under the standings table — dot + label per zone. */
.botola-legend {
  margin-top: 14px;
  display: flex; flex-wrap: wrap; gap: 14px 22px;
  font-size: .78rem;
  opacity: .9;
}
.botola-legend span { display: inline-flex; align-items: center; gap: 8px; }
.botola-legend .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
}
.botola-legend .dot.green  { background: #16a34a; box-shadow: 0 0 6px rgba(22,163,74,0.5); }
.botola-legend .dot.blue   { background: #2563eb; box-shadow: 0 0 6px rgba(37,99,235,0.5); }
.botola-legend .dot.orange { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.botola-legend .dot.red    { background: #dc2626; box-shadow: 0 0 6px rgba(220,38,38,0.5); }
/* Zone colour is carried by .pos-pill (above); keep the td plain. */

/* Crest sizing in fixtures */
.fixture .side { display: flex; align-items: center; gap: 10px; }
/* DOM order per side:
     home: [crest][name]  → packed left
     away: [name][crest]  → packed right
   No row-reverse — that pushed the away crest to the left of the name.
   The JS render must emit crest BEFORE name on home, AFTER name on away. */
.fixture .side.home { justify-content: flex-start; }
.fixture .side.away { justify-content: flex-end; }
#standings-table td { font-variant-numeric: tabular-nums; }
#standings-table .crest { width: 22px; height: 22px; object-fit: contain; }

.botola-filters { margin-bottom: 10px; font-size: .85rem; opacity: .85; }

/* Journée pager: prev/next + chip strip over the current round's
   fixtures. Chips are colour-coded so the user sees which rounds are
   done / partial / empty at a glance. */
.botola-pager {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px 10px; margin-bottom: 12px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: .85rem;
}
.botola-pager strong { font-size: .95rem; }
.botola-pager .pg-progress { opacity: .7; font-size: .78rem; }
.botola-pager .pg-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.botola-pager .pg-chip {
  width: 28px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700; font-size: .75rem;
  color: #fff;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform .12s ease;
}
.botola-pager .pg-chip:hover    { transform: translateY(-1px); }
.botola-pager .pg-chip.done     { background: #16a34a; border-color: #16a34a; }
.botola-pager .pg-chip.partial  { background: #f59e0b; border-color: #f59e0b; color: #1a1200; }
.botola-pager .pg-chip.current  { outline: 2px solid #fff; outline-offset: 1px; }
.botola-pager button[disabled]  { opacity: .35; cursor: not-allowed; }

.matchday { margin-bottom: 18px; }
.matchday h3 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: 1.5px;
  margin: 0 0 10px; opacity: .9;
  padding: 6px 12px; background: rgba(255,255,255,0.05); border-radius: 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.matchday h3 .round-autofill {
  text-transform: none; letter-spacing: 0; font-size: .7rem;
  padding: 3px 10px;
}

.fixture {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  margin-bottom: 5px;
  font-size: .9rem;
}
.fixture.predicted  { border-color: rgba(120, 180, 255, 0.4); background: rgba(80, 140, 255, 0.08); }

/* Strip number-input spinners on score cells. */
.fixture input[type=number]::-webkit-inner-spin-button,
.fixture input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.fixture input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.fixture .scores { display: flex; gap: 4px; align-items: center; justify-content: center; }
.fixture .score {
  width: 38px; padding: 4px; text-align: center;
  background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px; color: #fff; font-weight: 600;
}
.fixture .score:disabled { background: rgba(255,255,255,0.05); color: #fff; font-weight: 700; opacity: 1; }
@media (max-width: 640px) {
  .fixture { font-size: .8rem; padding: 8px 10px; gap: 8px; }
  .fixture .score { width: 32px; }
}
