/**
 * LiveScoreJSON public UI
 *
 * Visual contract carried from the approved homepage prototype:
 * Inter-first typography, #059669 accent, white/#f7f8fa surfaces, 1px borders,
 * compact information density and no decorative gradients. Layout remains usable
 * without JavaScript and has no horizontal page overflow at a 390px viewport.
 *
 * Primary structural hooks expected by the ES modules:
 * [data-sidebar], [data-sidebar-toggle], [data-sidebar-backdrop],
 * [data-search-form], [data-search-input], [data-search-results], [data-toast],
 * [data-scores-root], [data-match-root], [data-entity-root].
 */

:root {
  color-scheme: light;
  --bg: #fff;
  --bg-alt: #f7f8fa;
  --bg-hover: #eef1f5;
  --text: #1a1a1a;
  --text-soft: #555;
  --muted: #858b94;
  --border: #e0e0e0;
  --border-strong: #cdd1d6;
  --accent: #059669;
  --accent-dark: #047857;
  --accent-soft: #d1fae5;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --info: #2563eb;
  --info-soft: #e0e7ff;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;
  --header-h: 56px;
  --sidebar-w: 248px;
  --rail-w: 292px;
  --content-max: 1440px;
  --radius: 6px;
  --shadow-soft: 0 12px 34px rgba(22, 27, 34, .1);
}

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

html {
  min-width: 0;
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

body.is-locked,
body.sidebar-open,
body.drawer-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  margin: 0;
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: .58;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

table {
  border-collapse: collapse;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

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

.icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.icon--sm { width: 14px; height: 14px; }
.icon--lg { width: 20px; height: 20px; }
/* Skor satırı altındaki gol şeridi 8.5px metinle hizalanır; mevcut en küçük
   ölçü (--sm) bu satırda metnin iki katı kalıyordu. */
.icon--xs { width: 10px; height: 10px; stroke-width: 2.1; }

.mono,
.match-time,
.match-score,
.score-value,
.numeric,
.rank-number {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(250px, 520px) minmax(0, 1fr) auto;
  align-items: center;
  height: var(--header-h);
  padding: 0 18px 0 0;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .97);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 100%;
  padding: 0 18px;
  gap: 9px;
  border-right: 1px solid var(--border);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.25px;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--accent);
}

.brand-accent { color: var(--accent); }
.brand-text > span { color: var(--accent); }

.version {
  padding: 1px 4px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.mobile-menu,
.icon-button,
.plain-button {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-soft);
}

.mobile-menu { display: none; }

.mobile-menu:hover,
.icon-button:hover,
.plain-button:hover {
  border-color: var(--border);
  background: var(--bg-alt);
  color: var(--text);
}

.search {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0 14px;
}

/* Production layout renders the field directly as .global-search. */
.global-search {
  position: relative;
  display: flex;
  align-items: center;
  width: calc(100% - 28px);
  min-width: 0;
  height: 34px;
  margin: 0 14px;
  padding: 0 9px;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--muted);
}

.global-search:focus-within {
  border-color: #99cdbb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, .08);
}

.global-search > input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.global-search > input::placeholder { color: #969ca4; }
.global-search > .search-results { inset: calc(100% + 8px) 0 auto; }

.search-field {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 34px;
  gap: 8px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--muted);
}

.search-field:focus-within {
  border-color: #99cdbb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, .08);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.search-field input::placeholder { color: #969ca4; }

.search-kbd {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-bottom-color: var(--border-strong);
  border-radius: 3px;
  background: #fff;
  color: var(--muted);
  font: 500 9px/1.5 "JetBrains Mono", Consolas, monospace;
}

.search-results {
  position: absolute;
  inset: calc(100% + 8px) 14px auto;
  z-index: 130;
  max-height: min(420px, calc(100vh - var(--header-h) - 30px));
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.search-label {
  padding: 6px 8px 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .65px;
  text-transform: uppercase;
}

.search-status {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
}

.search-result {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 8px;
  gap: 9px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  text-align: left;
}

.search-result:hover,
.search-result.is-active { background: var(--bg-alt); }

.search-result strong,
.search-result span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result strong { display: block; font-size: 11px; }
.search-result small { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; }

.header-nav {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 2px;
}

.header-link {
  padding: 8px 9px;
  border-radius: 4px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.header-nav > a {
  padding: 8px 9px;
  border-radius: 4px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.header-nav > a:hover { background: var(--bg-alt); color: var(--text); }

.language-link {
  display: grid;
  min-width: 32px;
  min-height: 30px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-alt);
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 700;
}

.header-link:hover { background: var(--bg-alt); color: var(--text); }
.header-link.active,
.header-link[aria-current="page"] { color: var(--accent-dark); }

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.lang-switch {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-alt);
}

.lang-switch button {
  min-width: 28px;
  padding: 5px 6px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 700;
}

.lang-switch button.active,
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* Sidebar */
.app-sidebar {
  position: fixed;
  inset: var(--header-h) auto 0 0;
  z-index: 90;
  display: flex;
  width: var(--sidebar-w);
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--bg-alt);
}

.side-group { padding: 14px 10px 0; }

.side-title {
  padding: 0 8px 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.side-link {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px 7px 9px;
  gap: 8px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text-soft);
  font-size: 11px;
  text-align: left;
}

.side-link:hover { background: var(--bg-hover); color: var(--text); }

.side-link.active,
.side-link[aria-current="page"] {
  border-left-color: var(--accent);
  background: var(--bg-hover);
  color: var(--accent-dark);
  font-weight: 600;
}

.side-link .label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.count,
.filter-count {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 8px;
  background: #e7e9ec;
  color: #68707a;
  font-size: 8.5px;
  font-weight: 700;
  text-align: center;
}

.side-link.active .count { background: var(--accent-soft); color: var(--accent-dark); }

.league-dot {
  display: grid;
  position: relative;
  width: 20px;
  height: 20px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--text-soft);
  font-size: 7px;
  font-weight: 800;
}

.sidebar-status {
  margin: auto 10px 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 10px;
}

.status-line { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.status-dot.is-offline { background: var(--muted); box-shadow: 0 0 0 3px var(--bg-hover); }
.status-dot.is-error { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.status-dot.offline { background: var(--muted); box-shadow: 0 0 0 3px var(--bg-hover); }
.status-meta { margin-top: 4px; color: var(--muted); font-size: 9px; }

.sidebar-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  visibility: hidden;
  background: rgba(17, 24, 39, .28);
  opacity: 0;
  transition: opacity .18s ease, visibility .18s ease;
}

/* Main shell */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
  width: auto;
  max-width: calc(var(--content-max) + var(--sidebar-w));
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  padding: calc(var(--header-h) + 18px) 24px 56px;
  gap: 20px;
}

.workspace--single { grid-template-columns: minmax(0, 1fr); }
.workspace.single-column { grid-template-columns: minmax(0, 1fr); }
.feed,
.page-content,
.right-rail { min-width: 0; }
.right-rail-inner { position: sticky; top: calc(var(--header-h) + 18px); display: grid; gap: 12px; }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-width: 0;
  margin-bottom: 13px;
  padding-bottom: 12px;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

.page-heading > * { min-width: 0; }
.eyebrow { margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.page-heading h1 { margin: 0; font-size: clamp(19px, 2.2vw, 25px); line-height: 1.2; letter-spacing: -.45px; }
.page-heading p { max-width: 720px; margin: 5px 0 0; color: var(--text-soft); font-size: 11.5px; }
.sync { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.sync [data-refresh] { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--accent); }
.sync [data-refresh]:hover { border-color: var(--border); background: var(--bg-alt); }

.card,
.league-panel,
.rail-card,
.data-section,
.entity-card,
.match-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.card + .card,
.data-section + .data-section { margin-top: 12px; }

.card-header,
.section-heading,
.rail-heading,
.league-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 40px;
  padding: 9px 11px;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.card-header h2,
.section-heading h2,
.section-heading h3,
.rail-heading h2,
.rail-heading strong {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-body,
.section-body { padding: 12px; }

.toolbar,
.filter-row,
.tab-list,
.chip-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.toolbar { justify-content: space-between; margin-bottom: 10px; }
.toolbar-group { display: flex; min-width: 0; align-items: center; gap: 6px; }

.date-strip {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  margin-bottom: 9px;
  padding: 7px 0;
  background: rgba(255, 255, 255, .97);
}

.scores-workspace .date-strip {
  display: grid;
  grid-template-columns: 32px repeat(5, minmax(72px, 1fr)) 32px;
  gap: 5px;
}

.date-row {
  display: grid;
  grid-template-columns: 32px repeat(5, minmax(72px, 1fr)) 32px;
  gap: 5px;
}

.date-arrow,
.date-button,
.filter-button,
.select-control,
.button {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 500;
}

.date-arrow { display: grid; place-items: center; padding: 0; }
.date-button { min-width: 0; padding: 4px 7px; text-align: center; }
.date-day { display: block; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase; }
.date-value { display: block; margin-top: 1px; white-space: nowrap; }
.date-number { display: block; margin-top: 1px; white-space: nowrap; }
.date-arrow:hover,
.date-button:hover,
.filter-button:hover,
.button:hover { border-color: var(--border-strong); background: var(--bg-alt); color: var(--text); }
.date-button.active,
.date-button[aria-current="date"] { border-color: var(--accent); background: var(--accent); color: #fff; }
.date-button.active .date-day,
.date-button[aria-current="date"] .date-day { color: rgba(255, 255, 255, .75); }

.filter-row {
  margin-bottom: 10px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: thin;
}

.filter-row,
.date-strip,
.entity-tabs,
.tab-list,
.match-tab-list {
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar,
.date-strip::-webkit-scrollbar,
.entity-tabs::-webkit-scrollbar,
.tab-list::-webkit-scrollbar,
.match-tab-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.filter-button,
.button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; padding: 6px 9px; gap: 5px; }
.filter-button.active,
.filter-button[aria-pressed="true"],
.button--accent { border-color: #a9d6c7; background: var(--accent-soft); color: var(--accent-dark); }
.button--primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button--primary:hover { border-color: var(--accent-dark); background: var(--accent-dark); color: #fff; }
.button--danger { border-color: #efb0b0; background: var(--danger-soft); color: var(--danger); }
.select-control { min-width: 120px; max-width: 100%; padding: 5px 28px 5px 8px; }

.notice {
  position: relative;
  margin-bottom: 10px;
  padding: 9px 34px 9px 11px;
  border: 1px solid #cce2da;
  border-radius: var(--radius);
  background: #f4fbf8;
  color: #39665a;
  font-size: 10px;
}

.notice--warning { border-color: #edd9aa; background: #fffaf0; color: #775817; }
.notice--danger { border-color: #efc1c1; background: #fff7f7; color: #8b2d2d; }

/* Score feed */
.league-list { display: grid; min-width: 0; gap: 10px; }
.league-panel { contain: layout paint; }

.league-header {
  width: 100%;
  border-width: 0 0 1px;
  border-radius: 0;
  color: var(--text);
  text-align: left;
}

.league-header:hover { background: var(--bg-hover); }
.league-title { display: flex; min-width: 0; align-items: center; gap: 8px; }
.league-title-copy { min-width: 0; }
.league-title strong { display: block; overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.league-title small { display: block; margin-top: 1px; overflow: hidden; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.league-actions { display: flex; align-items: center; gap: 7px; }
.league-panel.collapsed .matches { display: none; }
.league-panel.collapsed .league-header { border-bottom: 0; }
.league-panel.collapsed .league-chevron { transform: rotate(-90deg); }
.league-chevron { transition: transform .15s ease; }

.tiny-badge,
.pill,
.tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 6px;
  gap: 4px;
  border-radius: 8px;
  background: var(--bg-hover);
  color: var(--text-soft);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.tiny-badge.live,
.pill--live { background: var(--danger-soft); color: var(--danger); }
.tiny-badge.upcoming,
.pill--info { background: var(--info-soft); color: var(--info); }
.pill--success { background: var(--accent-soft); color: var(--accent-dark); }
.pill--warning { background: var(--warning-soft); color: var(--warning); }

.match-row {
  position: relative;
  display: grid;
  grid-template-columns: 26px 45px minmax(120px, 1fr) 54px minmax(120px, 1fr) minmax(150px, .85fr) 24px;
  grid-template-areas: "favorite time home score away odds open";
  align-items: center;
  min-width: 0;
  min-height: 61px;
  padding: 9px 8px;
  gap: 7px;
  background: #fff;
  transition: background .12s ease;
}

.match-row--no-odds {
  grid-template-columns: 26px 45px minmax(120px, 1fr) 54px minmax(120px, 1fr) 24px;
  grid-template-areas: "favorite time home score away open";
}

.match-row + .match-row { border-top: 1px solid var(--border); }
.match-row:hover { background: #fcfcfd; }
.match-row.is-updated { animation: row-flash 1.1s ease; }
.match-row.live-match::before,
.match-row[data-status="live"]::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--danger); }
.match-row.hidden-match { display: none; }

.star,
.favorite-button {
  grid-area: favorite;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b5bac0;
}

.star:hover,
.star.active,
.favorite-button:hover,
.favorite-button.active,
.favorite-button[aria-pressed="true"] { color: var(--warning); }

.match-time { grid-area: time; color: var(--text-soft); font-size: 10px; text-align: center; }
.match-time > * { display: block; }
.live-label { color: var(--danger); font-family: Inter, sans-serif; font-size: 8px; font-weight: 800; letter-spacing: .35px; text-transform: uppercase; }
.live-pulse { display: inline-block; width: 5px; height: 5px; margin-right: 3px; border-radius: 50%; background: var(--danger); vertical-align: 1px; animation: pulse 1.8s ease-out infinite; }

/* Maç satırı skorun iki yanında aynalanır: ev sahibi sağa, deplasman sola
   yaslanır. Böylece iki takım logosu da skor merkezine en yakın öğe olur. */
.match-team { grid-area: home; display: flex; min-width: 0; align-items: center; gap: 8px; }
.match-team:not(.away) { flex-direction: row-reverse; justify-content: flex-start; text-align: right; }
.match-team.away { grid-area: away; flex-direction: row; justify-content: flex-start; text-align: left; }
.team-name { min-width: 0; overflow: hidden; font-size: 10.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.team-card { display: block; margin-top: 2px; color: var(--danger); font-size: 8px; font-weight: 700; }

.crest,
.avatar,
.entity-logo {
  display: grid;
  position: relative;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 5px;
  background: var(--crest-bg, #eef1f4);
  color: var(--crest-fg, #40454c);
  font-size: 8px;
  font-weight: 800;
}

.crest.round,
.avatar { border-radius: 50%; }
.crest img,
.avatar img,
.entity-logo img { width: 100%; height: 100%; object-fit: contain; }
[data-team-crest] > img[data-team-logo],
[data-competition-crest] > img[data-competition-logo] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--crest-bg, #eef1f4);
}

.match-score {
  grid-area: score;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.match-score.scheduled { color: var(--muted); font-weight: 500; }
.score-main { display: flex; align-items: center; gap: 5px; }
.score-penalties { color: var(--muted); font: 700 7.5px/1.15 Inter, sans-serif; }
.score-penalties > span { margin-inline: 1px; }
.score-winner { color: var(--accent-dark); }

.odds { grid-area: odds; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.odd { min-width: 0; padding: 5px 3px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg-alt); color: var(--text-soft); font-size: 8.5px; text-align: center; }
.odd b { margin-right: 3px; color: var(--muted); font-size: 7px; }
.odd:hover { border-color: #afd7c9; background: #f4fbf8; color: var(--accent-dark); }
.open-match { grid-area: open; display: grid; width: 24px; height: 28px; place-items: center; padding: 0; border: 0; background: transparent; color: var(--muted); }
.open-match:hover { color: var(--accent); }
/* Gol / kırmızı kart / İY şeridi. Satırın grid-template-areas'ı bozulmadan
   altına örtük ikinci satır olarak yerleşir; ev sahibi sola, deplasman sağa
   yaslanarak üstteki takım sütunlarıyla aynı aynalamayı sürdürür. */
.match-event-line {
  grid-column: 1 / -1;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

/* Blok kalır: flex yapılırsa metin düğümleri ayrı flex öğesi olur ve uzun gol
   listesini kısaltan text-overflow devre dışı kalırdı. */
.match-event-side {
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-event-side.away { text-align: right; }
.match-event-side .icon { margin-right: 3px; vertical-align: -1px; }
.match-event-half { flex: 0 0 auto; color: var(--text-soft); font-weight: 700; }

/* Kırmızı kart rozeti. Sayfada başka ikon yok; canlı nabız noktası gibi küçük
   renkli bir öğe olarak çizilir. İkinci sarıdan kırmızı, sarı-kırmızı bölünmüş
   kartla ayrışır. */
.match-event-card {
  display: inline-block;
  width: 5px;
  height: 7px;
  margin-right: 3px;
  border-radius: 1px;
  background: var(--danger);
  vertical-align: -1px;
}

.match-event-card--second { background: linear-gradient(135deg, var(--warning) 50%, var(--danger) 50%); }
.entity-match-groups { padding: 10px; }

.feed-footer { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }

.data-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: 14px;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.configuration-banner {
  position: fixed;
  inset: var(--header-h) 0 auto var(--sidebar-w);
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 16px;
  gap: 8px;
  border-bottom: 1px solid #ead49e;
  background: #fffaf0;
  color: #765817;
  font-size: 9.5px;
}

body:has(.configuration-banner) .workspace { padding-top: calc(var(--header-h) + 51px); }

.rail-placeholder { padding: 18px 12px; color: var(--muted); font-size: 9.5px; text-align: center; }
.rail-placeholder.is-loading { display: flex; align-items: center; justify-content: center; gap: 7px; }
.rail-placeholder .spinner { width: 13px; height: 13px; }
.rail-retry { display: block; margin: 8px auto 0; padding: 4px 7px; border: 1px solid var(--border); border-radius: 3px; background: #fff; color: var(--accent-dark); font-size: 8.5px; }
.match-row.context-active { background: #f7fbf9; }
.rail-standing-table td:nth-child(2) { max-width: 150px; overflow: hidden; text-align: left; text-overflow: ellipsis; }
.rail-team-identity { display: flex; min-width: 0; align-items: center; gap: 5px; text-align: left; }
.rail-team-identity > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crest--rail { width: 18px; height: 18px; border-radius: 4px; font-size: 6px; }
.rail-standing-table .context-team td { background: var(--accent-soft); }
.rail-leader-groups { display: grid; gap: 0; }
.rail-leader-group + .rail-leader-group { border-top: 1px solid var(--border); }
.rail-leader-group h3 { margin: 0; padding: 7px 10px; background: #fbfbfc; color: var(--muted); font-size: 8px; letter-spacing: .3px; text-transform: uppercase; }
.rail-leader-group ol { margin: 0; padding: 0; list-style: none; }
.rail-leader-group li { display: grid; grid-template-columns: 20px minmax(0, 1fr) 28px; align-items: center; padding: 7px 10px; gap: 6px; border-top: 1px solid #ededee; }
.rail-leader-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-leader-name small { display: block; overflow: hidden; margin-top: 1px; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.rail-leader-group li > strong { text-align: right; }
.data-status-list { margin: 0; padding: 4px 10px; }
.data-status-list > div { display: flex; align-items: center; justify-content: space-between; padding: 7px 1px; gap: 8px; border-top: 1px solid var(--border); }
.data-status-list > div:first-child { border-top: 0; }
.data-status-list dt { color: var(--muted); }
.data-status-list dd { margin: 0; overflow: hidden; font-family: "JetBrains Mono", Consolas, monospace; font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }

/* Rail and tables */
.rail-card { font-size: 10px; }
.rail-tabs,
.tab-list { overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.rail-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
.rail-tab,
.tab-button,
.match-tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  background: #fff;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}
.rail-tab:hover,
.tab-button:hover,
.match-tab:hover { background: var(--bg-alt); color: var(--text); }
.rail-tab.active,
.tab-button.active,
.match-tab.active,
[role="tab"][aria-selected="true"] { color: var(--accent-dark); }
.rail-tab.active::after,
.tab-button.active::after,
.match-tab.active::after,
[role="tab"][aria-selected="true"]::after { content: ""; position: absolute; inset: auto 8px -1px; height: 2px; background: var(--accent); }

.table-scroll { width: 100%; min-width: 0; overflow-x: auto; }
.data-table,
.standing-table { width: 100%; font-size: 9.5px; }
.data-table th,
.standing-table th { padding: 6px 8px; background: #fbfbfc; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .3px; text-align: right; text-transform: uppercase; white-space: nowrap; }
.data-table td,
.standing-table td { padding: 7px 8px; border-top: 1px solid #ededee; text-align: right; vertical-align: middle; white-space: nowrap; }
.data-table th:first-child,
.data-table td:first-child,
.standing-table th:first-child,
.standing-table td:first-child { text-align: left; }
.data-table tr:hover td,
.standing-table tr:hover td { background: #fcfcfd; }
/* Puan durumu sıra hücresi: sol kenarda bölge şeridi, sıra, değişim oku.
   Kullanıcının "zone boyaması + last_rank oku" isteği üzerine eklendi. Şerit
   ::before ile çiziliyor; böylece satır işaretlemek için renderTable'ın satır
   üretimine dokunmak gerekmiyor. Bilinmeyen bölge kodunda modifier sınıfı hiç
   basılmadığı için hücre boyasız kalır. */
.rank-cell { position: relative; display: inline-flex; align-items: center; gap: 4px; padding-left: 7px; }
.rank-cell::before { position: absolute; top: 50%; left: 0; width: 3px; height: 12px; border-radius: 2px; content: ''; transform: translateY(-50%); }
.rank-cell--ucl::before { background: var(--info); }
.rank-cell--uel::before { background: var(--purple); }
.rank-cell--uecl::before { background: var(--accent); }
.rank-cell--risk::before { background: var(--warning); }
.rank-cell--drop::before { background: var(--danger); }
/* Renk açıklaması: dokunmatik cihazda title okunamadığı için tablonun altına
   yalnızca o tabloda görünen bölgeler yazılıyor. */
.standings-legend { display: flex; flex-wrap: wrap; margin: 8px 0 0; padding: 0 2px; gap: 5px 14px; color: var(--muted); font-size: 8.5px; list-style: none; }
.standings-legend li { display: flex; align-items: center; gap: 5px; }
.zone-swatch { width: 3px; height: 10px; border-radius: 2px; background: var(--border-strong); }
.zone-swatch--ucl { background: var(--info); }
.zone-swatch--uel { background: var(--purple); }
.zone-swatch--uecl { background: var(--accent); }
.zone-swatch--risk { background: var(--warning); }
.zone-swatch--drop { background: var(--danger); }
/* Ok, ikon dosyasına bağımlı olmasın diye saf CSS üçgeni. */
.rank-move { width: 0; height: 0; border-right: 3px solid transparent; border-left: 3px solid transparent; }
.rank-move--up { border-bottom: 4px solid var(--accent); }
.rank-move--down { border-top: 4px solid var(--danger); }
.table-entity { display: flex; min-width: 130px; align-items: center; gap: 7px; text-align: left; }
.table-entity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crest--table { width: 20px; height: 20px; border-radius: 4px; font-size: 6px; }
.data-table td.record-details-cell { min-width: 110px; text-align: left; white-space: normal; }
.record-details { display: inline-block; text-align: left; }
.record-details summary { color: var(--accent-dark); cursor: pointer; font-weight: 700; white-space: nowrap; }
.record-details-list { display: grid; margin: 6px 0 0; padding: 0; gap: 4px; list-style: none; }
.record-details-list a { white-space: nowrap; }

/* Loading, empty, error */
.state-card,
.empty-state,
.error-state {
  width: 100%;
  padding: 28px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-soft);
  font-size: 11px;
  text-align: center;
}

.state-card strong,
.empty-state strong,
.error-state strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 12px; }
.state-card p,
.empty-state p,
.error-state p { max-width: 470px; margin: 4px auto 0; }
.state-card .button,
.error-state .button { margin-top: 12px; }
.state-icon { display: grid; width: 34px; height: 34px; margin: 0 auto 9px; place-items: center; border-radius: 50%; background: var(--bg-alt); color: var(--muted); }
.error-state { border-color: #e8bcbc; background: #fffafa; }

.loading-state { display: grid; gap: 8px; }
.skeleton { position: relative; overflow: hidden; min-height: 15px; border-radius: 3px; background: #eceef0; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); transform: translateX(-100%); animation: shimmer 1.25s infinite; }
.skeleton-row { display: grid; grid-template-columns: 40px minmax(90px, 1fr) 50px minmax(90px, 1fr); padding: 13px 10px; gap: 10px; border-bottom: 1px solid var(--border); }

/* Entity and directory pages */
.entity-hero,
.match-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  margin-bottom: 12px;
  padding: 16px;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  min-width: 0;
  margin-bottom: 10px;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
}

.breadcrumbs a:hover { color: var(--accent-dark); }

.context-switchers,
.directory-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  align-items: end;
  margin-bottom: 10px;
  padding: 10px;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.context-switchers label,
.directory-filters label {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .35px;
  text-transform: uppercase;
}

.context-switchers select,
.directory-filters select {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

/* Takım ve oyuncu sayfasındaki tek seçim, üç sütunluk organizasyon formu gibi
   dar görünmemelidir. */
.context-switchers--team,
.context-switchers--player { grid-template-columns: minmax(220px, 560px); }

.entity-tabs {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  /* Yatay kaydırma diğer ekseni `auto`ya çeviriyordu; aktif alt çizginin
     1 px taşması sağda gereksiz bir dikey scrollbar oluşturmasın. */
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  background: #fff;
  scrollbar-width: none;
}

.entity-tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 11px;
  border: 0;
  background: #fff;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}

.entity-tab:hover { background: var(--bg-alt); color: var(--text); }
.entity-tab.active,
.entity-tab[aria-selected="true"] { color: var(--accent-dark); }
.entity-tab.active::after,
.entity-tab[aria-selected="true"]::after { content: ""; position: absolute; inset: auto 8px 0; height: 2px; background: var(--accent); }

.entity-panel {
  min-width: 0;
  min-height: 170px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: #fff;
}

.related-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.primary-button { display: inline-flex; min-height: 32px; align-items: center; justify-content: center; padding: 6px 11px; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 600; }
.primary-button:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.directory-filters { grid-template-columns: repeat(3, minmax(150px, 1fr)) auto; }
.directory-results { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.directory-meta { min-height: 23px; color: var(--muted); font-size: 9px; text-align: right; }
.disclaimer { margin: 10px; color: var(--muted); font-size: 9px; line-height: 1.5; }

.coverage-total { color: var(--accent-dark); font: 700 19px "JetBrains Mono", Consolas, monospace; }
.coverage-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 12px; gap: 8px; }
.coverage-summary > div { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-alt); }
.coverage-summary strong { display: block; color: var(--accent-dark); font: 700 18px "JetBrains Mono", Consolas, monospace; }
.coverage-summary span { color: var(--muted); font-size: 8.5px; }
.coverage-table { width: 100%; font-size: 9px; }
.coverage-table th, .coverage-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.coverage-table th { background: var(--bg-alt); color: var(--muted); font-size: 8px; text-transform: uppercase; }
.coverage-table code { font: 500 8.5px "JetBrains Mono", Consolas, monospace; }

.error-card { width: min(540px, 100%); margin: 8vh auto 0; padding: 34px 24px; border: 1px solid var(--border); border-radius: var(--radius); text-align: center; }
.error-code { display: block; color: var(--accent); font: 700 34px "JetBrains Mono", Consolas, monospace; }
.error-card h1 { margin: 8px 0; }
.error-card p { color: var(--muted); }

.entity-logo { width: 54px; height: 54px; border-radius: 9px; font-size: 15px; }
.entity-identity { min-width: 0; }
.entity-identity h1,
.match-identity h1 { margin: 0; overflow-wrap: anywhere; font-size: clamp(18px, 2.4vw, 26px); line-height: 1.18; letter-spacing: -.4px; }
.entity-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.entity-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

.entity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 330px);
  min-width: 0;
  gap: 12px;
}

.entity-main,
.entity-aside { min-width: 0; }
.entity-aside { display: grid; align-content: start; gap: 12px; }

.directory-grid,
.entity-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  min-width: 0;
  gap: 8px;
}

.directory-grid { padding: 10px; }
.entity-list { padding: 10px; }

.entity-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  min-height: 54px;
  padding: 8px;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}
.entity-item:hover { border-color: var(--border-strong); background: var(--bg-alt); }
.entity-item-copy { min-width: 0; }
.entity-item-copy strong { display: block; overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.entity-item-copy small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }

.key-value-list { margin: 0; padding: 0; }
.key-value-row { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(0, 1.2fr); padding: 8px 11px; gap: 10px; border-top: 1px solid var(--border); font-size: 9.5px; }
.key-value-row:first-child { border-top: 0; }
.key-value-row dt { color: var(--muted); }
.key-value-row dd { min-width: 0; margin: 0; overflow-wrap: anywhere; text-align: right; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); padding: 10px; gap: 7px; }
.stat-tile { min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-alt); }
.stat-tile strong { display: block; overflow: hidden; color: var(--accent-dark); font: 700 16px "JetBrains Mono", Consolas, monospace; text-overflow: ellipsis; }
.stat-tile span { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.stat-tile small { display: block; margin-top: 4px; overflow: hidden; color: var(--text-soft); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.player-statistics { padding: 10px; }
.player-statistics .section-heading > span { min-width: 0; max-width: 70%; overflow: hidden; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.statistics-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; padding: 10px; gap: 10px; }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }

/* Match detail */
.match-hero { grid-template-columns: minmax(0, 1fr); padding: 0; }
.match-context { display: flex; min-width: 0; align-items: center; justify-content: space-between; padding: 10px 12px; gap: 10px; border-bottom: 1px solid var(--border); background: var(--bg-alt); color: var(--muted); font-size: 9px; }
.match-scoreboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, auto) minmax(0, 1fr); align-items: center; padding: 18px; gap: 16px; }
.scoreboard-team { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 9px; text-align: right; }
.scoreboard-team.away { flex-direction: row-reverse; text-align: left; }
.scoreboard-team .crest { width: 42px; height: 42px; }
.scoreboard-team-copy { display: block; min-width: 0; }
.scoreboard-team strong { display: block; min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.scoreboard-team small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: .35px; }
.scoreboard-team.is-winner strong { color: var(--accent-dark); }
.scoreboard-center { text-align: center; }
.scoreboard-score { color: var(--text); font: 700 clamp(21px, 4vw, 32px)/1.1 "JetBrains Mono", Consolas, monospace; letter-spacing: -1px; white-space: nowrap; }
.scoreboard-penalties { display: flex; align-items: baseline; justify-content: center; margin-top: 4px; gap: 4px; color: var(--muted); font-size: 8px; }
.scoreboard-penalties strong { color: var(--text-soft); font: 700 11px "JetBrains Mono", Consolas, monospace; }
.scoreboard-status { margin-top: 5px; color: var(--danger); font-size: 9px; font-weight: 700; }
.match-meta { padding: 0 12px 12px; color: var(--muted); font-size: 9px; text-align: center; }

.match-tab-list { position: sticky; top: var(--header-h); z-index: 25; display: flex; min-width: 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; background: #fff; scrollbar-width: none; }
.match-tab { flex: 1 0 auto; min-width: 78px; }
.match-panel { min-width: 0; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: #fff; }
.match-panel-body { min-width: 0; padding: 12px; }
.panel-section { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); }
.panel-section + .panel-section { margin-top: 12px; }
.panel-section > .timeline { padding: 8px 11px; }

.formation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.formation-team { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); }
.formation-team .formation-pitch { width: 100%; max-width: 430px; margin-block: 12px; }
.formation-team .table-scroll { border-top: 1px solid var(--border); }
.formation-roster + .formation-roster { border-top: 1px solid var(--border); }
.formation-roster .section-heading { min-height: 34px; padding-block: 6px; }
.formation-roster .section-heading h3 { font-size: 9.5px; }
.formation-roster .data-table th:nth-child(2),
.formation-roster .data-table td:nth-child(2) { text-align: left; }

.odds-market-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 10px; gap: 8px; }
.odds-market { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.odds-market-title { display: flex; align-items: center; justify-content: space-between; min-height: 36px; padding: 7px 9px; gap: 8px; border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.odds-market-title strong { min-width: 0; overflow: hidden; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.odds-market-title span { flex: 0 0 auto; color: var(--muted); font-size: 8px; }
.odds-outcomes { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); }
.odds-outcome { display: flex; min-width: 0; align-items: center; justify-content: space-between; padding: 8px; gap: 6px; border-right: 1px solid var(--border); border-top: 1px solid var(--border); font-size: 9px; }
.odds-outcome strong { color: var(--accent-dark); font: 700 10px "JetBrains Mono", Consolas, monospace; }
.disclaimer { margin: 12px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.5; }

.timeline { position: relative; display: grid; gap: 2px; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 49px; width: 1px; background: var(--border); }
.event { display: grid; grid-template-columns: 36px 22px minmax(0, 1fr); align-items: center; min-width: 0; padding: 5px 0; gap: 7px; }
.event-time { color: var(--muted); font: 500 9px "JetBrains Mono", Consolas, monospace; text-align: right; }
.event-icon { z-index: 1; display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: #fff; color: var(--text-soft); font-size: 8px; }
.event-icon.goal { border-color: #a9d8c8; color: var(--accent-dark); }
.event-icon.penalty--missed { border-color: #e7a3a7; background: var(--danger-soft); color: var(--danger); font-weight: 800; }
.event-icon.penalty--saved { border-color: #a9d8c8; background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; }
.event-icon.card { position: relative; font-family: Arial, sans-serif; }
.event-icon.card--yellow { border-color: #c48a22; background: #fff2bd; color: #8a5a00; }
.event-icon.card--red { border-color: #e7a3a7; background: var(--danger-soft); color: var(--danger); }
/* İkinci sarı olayını tek sarı kareye indirmiyoruz: üst üste iki minik kart,
   ihraç kararının hem sarı kart zincirini hem kırmızı sonucunu anlatır. */
.event-icon.card--second-yellow { border-color: #dfb77d; background: #fff8ee; color: transparent; }
.event-icon.card--second-yellow::before,
.event-icon.card--second-yellow::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 27%;
  height: 45%;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}
.event-icon.card--second-yellow::before { left: 39%; z-index: 1; background: #d39a12; box-shadow: 0 0 0 1px #805500; transform: translate(-50%, -50%) rotate(-7deg); }
.event-icon.card--second-yellow::after { left: 61%; z-index: 2; background: var(--danger); transform: translate(-50%, -50%) rotate(7deg); }
.event-copy { min-width: 0; font-size: 10px; }
.event-copy small { display: block; overflow: hidden; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }

/* Maç özeti ev olaylarını merkezin solunda, deplasman olaylarını sağında
   gösterir. Eşit zaman kolonları ikon eksenini her genişlikte tam ortada tutar. */
.timeline--split::before { left: 50%; transform: translateX(-50%); }
/* Kullanıcının maç olaylarını daha rahat tarayabilmesi için top ikonunu tek başına
   büyütmüyoruz; satır ritmi, zaman, metin ve merkez kolonunu birlikte ölçekliyoruz. */
.panel-section > .timeline--split { padding: 12px 14px; gap: 4px; }
.timeline--split::before { top: 12px; bottom: 12px; }
.timeline--split .event {
  grid-template-columns: minmax(0, 1fr) 42px 28px 42px minmax(0, 1fr);
  padding: 7px 0;
  gap: 9px;
}
.timeline--split .event-time,
.timeline--split .event-icon,
.timeline--split .event-copy { grid-row: 1; }
.timeline--split .event-time { font-size: 11px; line-height: 1.2; }
.timeline--split .event-icon { grid-column: 3; justify-self: center; }
.timeline--split .event-icon { width: 26px; height: 26px; font-size: 12px; line-height: 1; }
.timeline--split .event-icon.goal { font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.timeline--split .event-copy { font-size: 12px; line-height: 1.35; }
.timeline--split .event-copy small { margin-top: 2px; font-size: 10px; line-height: 1.35; }
.timeline--split .event--home .event-time { grid-column: 2; text-align: right; }
.timeline--split .event--home .event-copy { grid-column: 1; text-align: right; }
.timeline--split .event--away .event-time { grid-column: 4; text-align: left; }
.timeline--split .event--away .event-copy { grid-column: 5; text-align: left; }
.timeline--split .event--neutral .event-time { grid-column: 2; }
.timeline--split .event--neutral .event-copy { grid-column: 4 / 6; }
.timeline--split .event-copy strong { overflow-wrap: anywhere; }
.timeline--split .event-player { color: inherit; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 2px; }
.timeline--split .event-player:hover,
.timeline--split .event-player:focus-visible { text-decoration-color: currentColor; }
.timeline--split .event-shirt { display: inline-block; margin-inline-end: 4px; color: var(--muted); font: 600 .82em "JetBrains Mono", Consolas, monospace; }
/* Kullanıcının isteğiyle tek değişiklik işlemi aynı event satırında kalır.
 * Renk ve oklar çıkan/giren oyuncuyu ayırır; sarma yalnız dar ekranda olur. */
.timeline--split .event-substitution {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1px 6px;
}
.timeline--split .event--home .event-substitution { justify-content: flex-end; }
.timeline--split .event--away .event-substitution { justify-content: flex-start; }
.timeline--split .substitution-player { min-width: 0; overflow-wrap: anywhere; }
.timeline--split .substitution-player--out { color: var(--danger); }
.timeline--split .substitution-player--in { color: var(--accent-dark); }
.timeline--split .substitution-link { color: var(--muted); font-weight: 500; }
/* Gol ve asist, ham olay kayıtlarını değiştirmeden tek özet satırında kalır.
 * Uzun oyuncu adları dar ekranda aynı event içinde güvenle sarılabilir. */
.timeline--split .event-goal-assist {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1px 6px;
}
.timeline--split .event--home .event-goal-assist { justify-content: flex-end; }
.timeline--split .event--away .event-goal-assist { justify-content: flex-start; }
.timeline--split .goal-player { min-width: 0; overflow-wrap: anywhere; }
.timeline--split .assist-player { color: var(--text-soft); font-weight: 500; overflow-wrap: anywhere; }

.stat-row { margin-bottom: 13px; }
.stat-row:last-child { margin-bottom: 0; }
.stat-labels { display: grid; grid-template-columns: 45px minmax(0, 1fr) 45px; margin-bottom: 5px; font-size: 9px; }
.stat-labels span:nth-child(2) { color: var(--muted); text-align: center; }
.stat-labels span:last-child { text-align: right; }
.stat-bar {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  appearance: none;
  background: #aeb4bc;
}
.stat-bar::-webkit-progress-bar { background: #aeb4bc; }
.stat-bar::-webkit-progress-value { background: var(--accent); }
.stat-bar::-moz-progress-bar { background: var(--accent); }

.formation-pitch {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 68 / 105;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #6da687;
  border-radius: 4px;
  background-color: #2e8b62;
  background-image: linear-gradient(to bottom, rgba(255,255,255,.035) 50%, rgba(0,0,0,.025) 50%);
  background-size: 100% 16.666%;
}
.formation-pitch::before { content: ""; position: absolute; z-index: 1; inset: 50% 0 auto; border-top: 1px solid rgba(255,255,255,.55); pointer-events: none; }
.formation-pitch::after { content: ""; position: absolute; z-index: 1; left: 50%; top: 50%; width: 26.9118%; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%); }
/* FIFA'nın önerdiği 105 × 68 m saha ve IFAB Law 1 ölçüleri esas alınır.
   Yüzdeler metre karşılıklarından türetildiği için mobilde de gerçek oran kalır. */
.pitch-markings { position: absolute; z-index: 1; inset: 0; color: rgba(255,255,255,.55); pointer-events: none; box-shadow: inset 0 0 0 1px currentColor; }
.pitch-markings > span { position: absolute; display: block; box-sizing: border-box; }
.pitch-goal { left: 50%; width: 10.7647%; height: 2.5%; border: 1px solid currentColor; background-image: repeating-linear-gradient(90deg, transparent 0 4px, rgba(255,255,255,.12) 4px 5px); transform: translateX(-50%); }
/* IFAB kale ağının derinliğini sabitlemez; görünür ağ yalnız şematik tutulur. */
.pitch-goal--top { top: 0; border-top: 0; }
.pitch-goal--bottom { bottom: 0; border-bottom: 0; }
.pitch-penalty-area { left: 50%; width: 59.2941%; height: 15.7143%; border: 1px solid currentColor; transform: translateX(-50%); }
.pitch-penalty-area--top { top: 0; border-top: 0; }
.pitch-penalty-area--bottom { bottom: 0; border-bottom: 0; }
.pitch-goal-area { left: 50%; width: 26.9412%; height: 5.2381%; border: 1px solid currentColor; transform: translateX(-50%); }
.pitch-goal-area--top { top: 0; border-top: 0; }
.pitch-goal-area--bottom { bottom: 0; border-bottom: 0; }
/* Ceza yayı bağımsız bir elips değildir. Penaltı noktasını merkez alan 9,15 m
   yarıçaplı tam daire, ceza alanının dışında kalan %19,9454'lük kapağa kırpılır. */
.pitch-penalty-arc { left: 50%; width: 26.9118%; aspect-ratio: 1; border: 1px solid currentColor; border-radius: 50%; transform: translateX(-50%); }
.pitch-penalty-arc--top { top: 1.7619%; -webkit-clip-path: inset(80.0546% 0 0); clip-path: inset(80.0546% 0 0); }
.pitch-penalty-arc--bottom { bottom: 1.7619%; -webkit-clip-path: inset(0 0 80.0546%); clip-path: inset(0 0 80.0546%); }
.pitch-penalty-spot,
.pitch-centre-spot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; transform: translate(-50%, -50%); }
.pitch-penalty-spot { left: 50%; }
.pitch-penalty-spot--top { top: 10.4762%; }
.pitch-penalty-spot--bottom { bottom: 10.4762%; transform: translate(-50%, 50%); }
.pitch-centre-spot { left: 50%; top: 50%; }
.pitch-corner-arc { width: 2.9412%; aspect-ratio: 1; border: 1px solid currentColor; border-radius: 50%; }
.pitch-corner-arc--top-left { left: 0; top: 0; transform: translate(-50%, -50%); }
.pitch-corner-arc--top-right { right: 0; top: 0; transform: translate(50%, -50%); }
.pitch-corner-arc--bottom-left { bottom: 0; left: 0; transform: translate(-50%, 50%); }
.pitch-corner-arc--bottom-right { right: 0; bottom: 0; transform: translate(50%, 50%); }
.pitch-player {
  position: absolute;
  z-index: 2;
  display: flex;
  width: clamp(44px, 17%, 64px);
  min-width: 0;
  align-items: center;
  flex-direction: column;
  gap: 2px;
  color: #fff;
  transform: translate(-50%, -14px);
}
/* Oyuncu adı eklenirken kullanıcının beğendiği yuvarlak numara görünümü
   korunur; etiket ayrı katmanda olduğu için dairenin ölçüsü değişmez. */
.pitch-player-number { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border: 2px solid #fff; border-radius: 50%; background: var(--accent-dark); box-shadow: 0 1px 3px rgba(0,0,0,.2); font-size: 8px; font-weight: 800; }
.pitch-player.away .pitch-player-number { background: #3f4650; }
.pitch-player-name { display: block; width: 100%; min-width: 0; overflow: hidden; padding: 2px 3px; border-radius: 3px; background: rgba(18,42,31,.78); font-size: 8px; font-weight: 700; line-height: 1.15; text-align: center; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.8); white-space: nowrap; }
.pitch-line-gk { top: 91%; }
.pitch-line-defence { top: 74%; }
.pitch-line-dm { top: 60%; }
.pitch-line-midfield { top: 46%; }
.pitch-line-am { top: 31%; }
.pitch-line-attack { top: 13%; }
.pitch-line-centre { top: 50%; }
.pitch-lane-l { left: 12%; }
.pitch-lane-cl { left: 32%; }
.pitch-lane-c { left: 50%; }
.pitch-lane-cr { left: 68%; }
.pitch-lane-r { left: 88%; }

.editorial { color: var(--text-soft); font-size: 11px; line-height: 1.65; }
.editorial h2,
.editorial h3 { color: var(--text); line-height: 1.3; }
.editorial img { margin: 12px auto; border-radius: var(--radius); }

/* Drawer is supported for homepage match preview. */
.match-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 160;
  width: min(460px, 100vw);
  max-width: 100%;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: #fff;
  box-shadow: -10px 0 30px rgba(17,24,39,.1);
  transform: translateX(102%);
  transition: transform .22s ease;
}
.drawer-open .match-drawer { transform: translateX(0); }
.drawer-open .drawer-backdrop { z-index: 150; visibility: visible; opacity: 1; }
.drawer-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 8px 11px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.97); }
.drawer-body { padding: 12px; }

/* Feedback */
.toast {
  position: fixed;
  z-index: 300;
  right: 18px;
  bottom: 18px;
  max-width: min(340px, calc(100vw - 24px));
  padding: 9px 11px;
  border: 1px solid #b9d7cc;
  border-radius: var(--radius);
  background: #f5fbf9;
  color: #285e50;
  box-shadow: var(--shadow-soft);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease;
}
.toast.visible,
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { border-color: #ecc1c1; background: #fff8f8; color: #8a2c2c; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .38); }
  70%, 100% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); }
}

@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes row-flash { 0%, 100% { background: #fff; } 30% { background: #f0fbf7; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 1240px) {
  .site-header { grid-template-columns: var(--sidebar-w) minmax(240px, 1fr) auto; }
  .header-nav { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .right-rail { display: none; }
}

@media (max-width: 1040px) {
  .match-row { grid-template-columns: 26px 44px minmax(100px, 1fr) 52px minmax(100px, 1fr) 24px; grid-template-areas: "favorite time home score away open"; }
  .odds { display: none; }
  /* Şerit temel kuralda zaten 1 / -1 ile tüm satırı kaplıyor; oran sütunu
     kalkınca ayrıca daraltılmasına gerek yok. */
}

@media (max-width: 860px) {
  .site-header { grid-template-columns: 42px 190px minmax(180px, 1fr) auto; padding-left: 8px; }
  .mobile-menu { display: inline-grid; }
  .brand { padding: 0 10px; border-right: 0; }
  .app-sidebar { visibility: hidden; box-shadow: 10px 0 30px rgba(17,24,39,.1); transform: translateX(-102%); transition: transform .2s ease, visibility .2s ease; }
  .sidebar-open .app-sidebar { visibility: visible; transform: translateX(0); }
  .sidebar-open .sidebar-backdrop { inset: var(--header-h) 0 0; visibility: visible; opacity: 1; }
  .workspace { margin-left: 0; padding: calc(var(--header-h) + 15px) 16px 44px; }
  .configuration-banner { left: 0; }
  .entity-grid { grid-template-columns: minmax(0, 1fr); }
  .entity-aside { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

@media (max-width: 640px) {
  :root { --header-h: 101px; }
  .site-header {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    grid-template-rows: 54px 46px;
    height: var(--header-h);
    padding: 0 8px;
  }
  .brand { grid-column: 2; min-width: 0; overflow: hidden; }
  .brand-text { overflow: hidden; text-overflow: ellipsis; }
  .header-actions { grid-column: 3; }
  .header-actions .icon-button { display: none; }
  .search { grid-column: 1 / -1; grid-row: 2; padding: 5px 0 7px; }
  .global-search { grid-column: 1 / -1; grid-row: 2; width: 100%; height: 34px; margin: 5px 0 7px; }
  .language-link { grid-column: 3; grid-row: 1; }
  .search-results { inset: calc(100% + 3px) 0 auto; }
  .workspace { padding: calc(var(--header-h) + 11px) 10px 36px; }
  .page-heading { align-items: flex-start; margin-bottom: 9px; padding-bottom: 9px; }
  .page-heading .sync { margin-top: 4px; }
  .page-heading p { font-size: 10.5px; }
  .date-strip { margin-inline: -10px; padding: 6px 10px; }
  .scores-workspace .date-strip { display: flex; overflow-x: auto; scrollbar-width: none; }
  .scores-workspace .date-strip::-webkit-scrollbar { width: 0; height: 0; display: none; }
  .date-row { display: flex; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .date-arrow { position: sticky; z-index: 2; width: 32px; min-width: 32px; background: #fff; }
  .date-arrow:first-child { left: 0; }
  .date-arrow:last-child { right: 0; }
  .date-button { width: 72px; min-width: 72px; }
  .filter-row { margin-inline: -10px; padding: 0 10px 3px; }
  .match-row {
    grid-template-columns: 24px 42px minmax(0, 1fr) 48px 22px;
    grid-template-rows: minmax(27px, auto) minmax(27px, auto);
    grid-template-areas:
      "favorite time home score open"
      "favorite time away score open";
    min-height: 72px;
    padding: 7px 6px;
    gap: 1px 6px;
  }
  .entity-match-groups { padding: 8px; }
  /* Dar ekranda takımlar skorun iki yanında değil, aynı sütunda alt alta yer
     aldığı için iki satır da okunabilir logo + takım sırasına geri döner. */
  .match-team { gap: 6px; }
  .match-team:not(.away) { flex-direction: row; justify-content: flex-start; text-align: left; }
  .match-team .crest { width: 23px; height: 23px; }
  .team-name { font-size: 9.5px; }
  .match-event-line { display: none; }
  .league-header { padding: 8px; }
  .entity-hero { grid-template-columns: auto minmax(0, 1fr); padding: 12px; }
  .entity-logo { width: 44px; height: 44px; }
  .entity-actions { grid-column: 1 / -1; justify-content: stretch; }
  .entity-actions .button { flex: 1; }
  .context-switchers,
  .directory-filters { grid-template-columns: minmax(0, 1fr); }
  .directory-filters .primary-button { width: 100%; }
  .directory-grid,
  .entity-list { grid-template-columns: minmax(0, 1fr); padding: 8px; }
  .match-scoreboard { grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr); padding: 14px 8px; gap: 7px; }
  .scoreboard-team { flex-direction: column-reverse; gap: 5px; text-align: center; }
  .scoreboard-team.away { flex-direction: column-reverse; text-align: center; }
  .scoreboard-team .crest { width: 34px; height: 34px; }
  .scoreboard-team strong { font-size: 10px; }
  .match-tab-list { top: var(--header-h); }
  .match-tab { min-width: 72px; padding-inline: 8px; }
  .formation-grid { grid-template-columns: minmax(0, 1fr); }
  .odds-market-grid { grid-template-columns: minmax(0, 1fr); }
  .statistics-groups { grid-template-columns: minmax(0, 1fr); padding: 8px; }
  .key-value-row { grid-template-columns: minmax(80px, .8fr) minmax(0, 1.2fr); padding-inline: 9px; }
  .toast { right: 12px; bottom: 12px; }
  .configuration-banner { padding-inline: 10px; font-size: 8.5px; }
  .coverage-summary { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 420px) {
  .lang-switch button { min-width: 26px; padding-inline: 5px; }
  .version { display: none; }
  .page-heading h1 { font-size: 19px; }
  .page-heading { gap: 8px; }
  .sync span { display: none; }
  .match-row { grid-template-columns: 22px 36px minmax(0, 1fr) 43px 20px; gap: 1px 4px; }
  .match-team .crest { width: 22px; height: 22px; }
  .match-score { font-size: 12px; }
  /* Dar ekranda aynı okunabilirlik artışını korurken iki takım metnine yeterli
     alan bırakmak için büyütülmüş olay ölçülerini bir kademe dengeliyoruz. */
  .panel-section > .timeline--split { padding: 10px 8px; gap: 3px; }
  .timeline--split::before { top: 10px; bottom: 10px; }
  .timeline--split .event {
    grid-template-columns: minmax(0, 1fr) 38px 26px 38px minmax(0, 1fr);
    padding: 6px 0;
    gap: 6px;
  }
  .timeline--split .event-time { font-size: 10px; }
  .timeline--split .event-icon { width: 24px; height: 24px; font-size: 11px; }
  .timeline--split .event-copy { font-size: 11px; }
  .timeline--split .event-copy small { font-size: 9.5px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
