/* GoalFox brand applied to the original compact table and calendar layout. */
:root { --orange:#ff7714; --orange-wash:#fff0e5; }
:root[data-theme="dark"] { --bg:#181a18; --surface:#20231f; --hover:#28271f; --line:#34382f; --text:#f0f1ea; --muted:#acb0a5; --subtle:#929889; --orange-wash:#382518; }
.site-header { background:var(--bg); }
.brand { gap:9px; }
.brand h1 { font-size:28px; letter-spacing:-1px; font-weight:750; }
.brand h1 span { color:var(--orange); font-weight:750; }
.fox-mark { display:block; flex-shrink:0; width:44px; height:48px; background:url('goalfox_img.png') center / contain no-repeat; border-radius:9px; }
.help-button { font-weight:500; color:#181b16; }
.league-tabs>button.active { color:var(--orange); }
.league-tabs>button.active>span { color:var(--orange); }
@media(max-width:560px) { .brand h1 { font-size:24px; } .fox-mark { width:36px; height:40px; background-size:contain; background-position:center; } }

.language-switch { display:flex; align-items:center; flex-shrink:0; gap:2px; font:11px var(--mono); }
.language-switch button { border:0; background:transparent; color:var(--subtle); border-radius:3px; min-height:32px; padding:4px 5px; font:inherit; }
.language-switch button[aria-pressed="true"] { color:var(--orange); background:var(--orange-wash); font-weight:600; }
.language-switch>span { color:var(--subtle); }
.language-switch button:hover { color:var(--text); }
@media(max-width:560px) { .header-actions { gap:4px; } .language-switch { font-size:10px; } .language-switch button { padding-inline:4px; } }
@media(max-width:560px) { .header-actions { flex:1; min-width:0; } .header-actions .search { flex:1; min-width:0; width:auto; } .icon-button,.help-button { flex-shrink:0; } }

.team-dialog { width:740px; }
.squad-section { margin:22px 0; border-block:1px solid var(--line); padding-block:20px; }
.squad-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px; }
.squad-heading h3 { font-size:15px; }.squad-heading>span,.squad-source { color:var(--muted); font:10px var(--mono); }
.squad-table-wrap { overflow:auto; max-height:460px; }
.squad-table { min-width:560px; table-layout:auto; width:100%; }
.squad-table th,.squad-table td { position:static; left:auto; text-align:left; padding:10px 8px; height:auto; font-size:11px; width:auto; }
.squad-table th { position:sticky; top:0; z-index:1; background:var(--surface); }
.squad-table th:first-child,.squad-table td:first-child { width:64px; text-align:center; }
.squad-table .kit-numbered { width:42px; height:46px; flex-basis:42px; }
.squad-table td:nth-child(2) { font-weight:500; }.squad-table td:nth-child(4) { white-space:nowrap; font:10px var(--mono); }
.squad-source { margin-top:13px; line-height:1.7; }.squad-loading { color:var(--muted); }
.squad-retry { margin-top:10px; background:var(--surface); border:1px solid var(--line); padding:6px 10px; border-radius:4px; }
@media(max-width:560px) { .team-dialog { width:100vw; } }

.club-button .club-name { font-size:15px; font-weight:700; line-height:1.4; }
@media(max-width:560px) { .club-button .club-name { font-size:14px; } }

.player-country { display:inline-flex; align-items:center; gap:7px; white-space:nowrap; }
.country-flag { font-family:'Apple Color Emoji','Segoe UI Emoji',sans-serif; font-size:19px; width:24px; height:18px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; line-height:1; }
.flag-gb-eng { background:linear-gradient(90deg,transparent 42%,#ce1124 42% 58%,transparent 58%),linear-gradient(transparent 38%,#ce1124 38% 62%,transparent 62%),white; border:1px solid #9994; }
.flag-gb-sct { background:linear-gradient(35deg,transparent 42%,white 42% 58%,transparent 58%),linear-gradient(-35deg,transparent 42%,white 42% 58%,transparent 58%),#005eb8; }
.flag-gb-wls::before { content:'🏴󠁧󠁢󠁷󠁬󠁳󠁿'; }.flag-gb-nir::before { content:'🇬🇧'; }
/* Full-size result badges retain W/D/L (승/무/패) alongside distinct colors. */
.recent-form { display:flex; align-items:center; gap:5px; }
.form-result { display:grid; place-items:center; flex:0 0 30px; width:30px; height:30px; font:700 14px/1 var(--sans); border:1px solid transparent; border-radius:5px; }
.form-w { background:#187044; color:#fff; border-color:#218757; }
.form-d { background:#526173; color:#fff; border-color:#6b7c90; }
.form-l { background:#b93838; color:#fff; border-color:#d85454; }
.form-result:focus-visible { outline:2px solid var(--text); outline-offset:2px; }
/* More legible primary navigation. */
.league-tabs > button { font-size:14px; font-weight:700; }
.league-tabs > button.active { font-weight:700; }
@media(max-width:800px) { .league-tabs > button { font-size:13px; } }
@media(max-width:560px) { .league-tabs > button { font-size:12px; font-weight:700; } }

.detail-club { position:relative; padding-right:150px; min-height:112px; }
.coach-profile { position:absolute; right:0; top:0; width:130px; display:flex; align-items:center; flex-direction:column; gap:6px; }
.coach-avatar { width:68px; height:68px; border-radius:50%; border:1px solid var(--line); background-image:url('coach-portraits.png'); background-size:300% 100%; }
.coach-avatar-0 { background-position:0 0; }.coach-avatar-1 { background-position:50% 0; }.coach-avatar-2 { background-position:100% 0; }
.coach-avatar-pending { background-image:none; display:grid; place-items:center; overflow:hidden; }
.coach-avatar-pending .player-portrait-pending { width:100%; height:100%; border:0; }
.coach-avatar-pending svg { width:100%; height:100%; }
.coach-avatar-image { display:block; flex-shrink:0; overflow:hidden; background-image:none; }
.coach-avatar-image img { display:block; width:100%; height:100%; object-fit:cover; }
.coach-caption { display:flex; flex-direction:column; text-align:center; font-size:11px; font-weight:500; }.coach-caption small { color:var(--muted); font-size:9px; }
.staff-section { margin-top:22px; }.staff-section h3 { font-size:15px; margin-bottom:12px; }.staff-list { display:grid; grid-template-columns:1fr 1fr; gap:7px 22px; }
.staff-list>div { display:flex; flex-direction:column; padding:8px 0; border-bottom:1px solid var(--line); gap:3px; }.staff-list dt { color:var(--muted); font-size:10px; }.staff-list dd { font-size:12px; font-weight:500; }
.staff-source { font:9px/1.8 var(--mono); color:var(--muted); margin-top:10px; }
@media(max-width:560px){.detail-club { padding-right:105px; }.coach-profile { width:95px; }.coach-avatar { width:56px; height:56px; }.coach-caption { font-size:10px; }}

.highlight-star { color:var(--orange); font-size:13px; line-height:1; }
.day-top .highlight-star { margin-left:auto; cursor:help; }
.match-highlight { color:var(--orange); font-size:10px; font-weight:700; margin-bottom:8px; display:flex; align-items:center; gap:5px; }
.highlighted-match { box-shadow:inset 3px 0 0 var(--orange); }

/* High-contrast rank markers share the legend palette in both themes. */
:root { --zone-champions:#087c58; --zone-europa:#7941bb; --zone-conference:#8a6900; --zone-relegation:#ca3048; }
:root[data-theme="dark"] { --zone-champions:#4edaa0; --zone-europa:#c399ff; --zone-conference:#e9cc52; --zone-relegation:#ff7387; }
.rank-number { display:inline-flex; align-items:center; justify-content:center; min-width:28px; height:32px; color:var(--text); font-size:17px; font-weight:700; font-variant-numeric:tabular-nums; }
.rank-number::before { width:5px; height:28px; left:-8px; border-radius:3px; }
.zone-dot { width:9px; height:9px; }
.champions { background:var(--zone-champions); }.europa { background:var(--zone-europa); }.conference { background:var(--zone-conference); }.relegation { background:var(--zone-relegation); }
.legend>span { font-size:11px; font-weight:500; color:var(--text); }
.coach-contract { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 12px; padding:12px; margin-bottom:12px; background:var(--surface); border:1px solid var(--line); border-radius:5px; font-size:12px; }
.coach-contract>span { color:var(--muted); }.coach-contract strong { flex:1 1 220px; font-weight:600; }.coach-contract a { text-decoration:underline; font-size:11px; }.coach-contract small { color:var(--muted); }
@media(max-width:560px){.rank-number { min-width:23px; font-size:16px; }.rank-number::before { left:-5px; width:4px; }.legend>span { font-size:10px; }}

/* Calendar typography stays readable at desktop and mobile widths. */
.calendar-heading h2 { font-size:28px; font-weight:700; }
.calendar-weekdays span { font-size:12px; font-weight:700; color:var(--text); }
.day-number { font-size:17px; font-weight:700; }
.day-match-count { font-size:16px; font-weight:700; }.day-match-count small { font-size:11px; font-weight:500; color:var(--text); }
.calendar-day.selected { box-shadow:inset 0 0 0 2px var(--orange); }
.calendar-day.today .day-number { padding:2px 6px; }
.today-label { color:var(--text); font-size:9px; font-weight:700; }
.calendar-day.outside { opacity:1; }.calendar-day.outside .day-number { color:var(--muted); font-weight:400; }
.calendar-controls button,.calendar-controls select { font-size:12px; font-weight:600; }
.month-navigation button { font-size:21px; }
.calendar-months button { font-size:13px; font-weight:700; color:var(--text); }
.calendar-key>span { color:var(--text); font-size:11px; font-weight:600; }
.calendar-summary,.calendar-explainer { color:var(--muted); font-size:11px; }
.match-panel-heading h3 { font-size:18px; font-weight:700; }
#match-count { color:var(--text); font-size:11px; font-weight:600; }
.match-meta { color:var(--text); font-size:12px; font-weight:600; flex-wrap:wrap; }
.match-state { font-size:11px; font-weight:600; color:var(--muted); }
.match-body time { font-size:16px; font-weight:700; }
.match-teams>div>span { font-size:14px; font-weight:700; }.match-teams strong { font-size:17px; }
.match-bottom { font-size:11px; color:var(--muted); }
.day-leagues .league-dot,.calendar-key .league-dot { width:7px; height:7px; }
.match-round { display:inline-block; padding:2px 7px; background:var(--surface); border:1px solid var(--line); border-radius:4px; color:var(--text); font-size:11px; font-weight:700; }
@media(max-width:560px){.calendar-heading h2 { font-size:24px; }.calendar-weekdays span { font-size:10px; padding-inline:5px; }.day-number { font-size:15px; }.day-match-count { font-size:14px; }.day-match-count small { font-size:10px; }.calendar-months button { font-size:12px; }.day-leagues { gap:3px; }.day-leagues .league-dot { width:5px; height:5px; }.today-label { font-size:8px; }}

.player-identity { display:flex; align-items:center; gap:9px; }.player-portrait,.player-portrait-pending { width:40px; height:40px; flex:0 0 40px; border-radius:50%; overflow:hidden; display:inline-grid; place-items:center; background:var(--surface); border:1px solid var(--line); }.player-portrait img { width:100%; height:100%; object-fit:cover; }.player-portrait-pending { color:var(--muted); }.squad-table td .player-identity { font-size:12px; font-weight:500; }

/* Readable standings headings in both languages and themes. */
#standings > table { min-width:1384px; }
#standings .col-league { width:194px; }
#standings .col-stat { width:80px; }
#standings .col-ppg { width:124px; }
#standings thead th {
  height:48px;
  padding-inline:8px;
  color:var(--text);
  font-family:var(--sans);
  font-size:14px;
  font-weight:700;
  line-height:1.4;
  border-bottom:2px solid var(--line);
}
#standings thead th:first-child { padding:0; }
#standings thead th button {
  min-height:46px;
  font-family:inherit;
  font-size:inherit;
  font-weight:inherit;
  line-height:inherit;
}
#standings thead .sort-arrow { font-size:12px; font-weight:700; }
#standings thead th[aria-sort="ascending"],
#standings thead th[aria-sort="descending"] { background:var(--orange-wash); }
@media(max-width:560px) {
  #standings > table { min-width:1344px; }
  #standings thead th:nth-child(2) { padding-inline:5px; }
}


/* Calendar league flags reuse the same country artwork as the league tabs. */
.calendar-flag { width:24px; height:17px; border-radius:2px; box-shadow:0 0 0 1px var(--line); }
.day-leagues { flex-wrap:wrap; gap:6px; width:100%; }
.day-leagues .calendar-flag { width:20px; height:14px; }
@media(max-width:560px) {
  .day-leagues { gap:5px; }
  .day-leagues .calendar-flag { width:18px; height:13px; }
}


/* Main match statistics: strong labels, aligned digits and clear point totals. */
#standings thead th:nth-child(n+5):nth-child(-n+12) {
  font-size:15px;
  text-align:center;
}
#standings tbody td:nth-child(n+5):nth-child(-n+12) {
  padding-inline:8px;
  color:var(--text);
  font-size:16px;
  font-weight:600;
  font-variant-numeric:tabular-nums;
  line-height:1.5;
  text-align:center;
}
#standings tbody td:nth-child(11).positive { color:#187044; }
#standings tbody td:nth-child(11).negative { color:#b93838; }
:root[data-theme="dark"] #standings tbody td:nth-child(11).positive { color:#9de2b6; }
:root[data-theme="dark"] #standings tbody td:nth-child(11).negative { color:#ffaaaa; }
#standings tbody td.points > span {
  min-width:38px;
  padding:4px 7px;
  border-radius:5px;
  background:var(--orange-wash);
  color:#7a3900;
  font-size:17px;
  font-weight:700;
}
:root[data-theme="dark"] #standings tbody td.points > span { color:#ffbf86; }

.staff-list dd { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 8px; font-weight:600; }
.staff-person-source { font-size:10px; font-weight:400; color:var(--muted); text-decoration:underline; text-underline-offset:2px; }
.staff-person-source:hover, .staff-person-source:focus-visible { color:var(--text); }
.staff-coverage { margin-top:12px; font-size:11px; line-height:1.6; color:var(--muted); }

/* Keep calendar controls and the selected date visible while fixtures scroll. */
.calendar-view{display:flex;flex-direction:column;overflow:hidden}
.calendar-toolbar,.calendar-months{flex-shrink:0}
.calendar-layout{flex:1;min-height:0;overflow:hidden;grid-template-rows:minmax(0,1fr)}
.month-panel{min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.match-panel{display:flex;flex-direction:column;min-height:0;overflow:hidden}
.match-panel-heading{flex-shrink:0}
.match-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--line) transparent;scrollbar-gutter:stable}
@media(max-width:850px){
 .calendar-view{display:block;overflow-y:auto}
 .calendar-layout{overflow:visible;grid-template-rows:auto auto}
 .month-panel{overflow:visible}
 .match-panel{max-height:60dvh}
 .match-list{display:block}
 .match-card:nth-child(odd){border-right:0}
}

/* Points first and recent form last; sticky identifiers remain aligned on mobile. */
#standings{--points-width:72px;--favorite-width:34px;--rank-width:47px}
#standings > table{min-width:1147px}
#standings .col-points{width:var(--points-width)}
#standings thead th{left:auto;z-index:3;text-align:right;padding-inline:8px}
#standings tbody td{position:static;left:auto;text-align:right}
#standings thead th[data-column],#standings tbody td[data-column]{text-align:center}
#standings thead th[data-column="club"],#standings tbody td[data-column="club"],#standings thead th[data-column="form"],#standings tbody td[data-column="form"]{text-align:left}
#standings thead th[data-column]:not([data-column="form"]){position:sticky;z-index:6}
#standings tbody td[data-column]:not([data-column="form"]){position:sticky;z-index:2}
#standings [data-column="points"]{left:0;font-size:16px;font-weight:700}
#standings [data-column="favorite"]{left:var(--points-width);padding-inline:0}
#standings [data-column="rank"]{left:calc(var(--points-width) + var(--favorite-width));padding-inline:5px}
#standings [data-column="club"]{left:calc(var(--points-width) + var(--favorite-width) + var(--rank-width));padding-inline:8px}
#standings tbody td:nth-child(n+5):nth-child(-n+11){text-align:center}
#standings thead th:nth-child(n+5):nth-child(-n+11){text-align:center}
@media(max-width:560px){#standings{--points-width:60px;--favorite-width:28px;--rank-width:35px}#standings > table{min-width:1075px}}
@media(max-width:560px){#standings .col-club{width:160px}#standings > table{min-width:1037px}#standings .club-name{white-space:normal;overflow-wrap:anywhere}}
@media(max-width:380px){#standings .col-club{width:130px}#standings > table{min-width:1007px}}

/* Points immediately precede matches played; only club identifiers stay pinned. */
#standings [data-column="favorite"]{left:0}
#standings [data-column="rank"]{left:var(--favorite-width)}
#standings [data-column="club"]{left:calc(var(--favorite-width) + var(--rank-width))}
#standings thead th[data-column="points"]:not([data-column="form"]){left:auto;z-index:3;text-align:center}
#standings tbody td[data-column="points"]:not([data-column="form"]){position:static;left:auto;text-align:center}
