/* ==========================================================================
   Flat design system — shared by public pages and the PHP admin.
   Ported from the visual language of project/ (Touchline Admin).
   Rules: solid colours, 1px borders, no gradients, no shadows.
   ========================================================================== */

/* Light theme is the default. The header script can switch to dark before paint. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #dfe3e8;
  --border-strong: #c3cad4;
  --text: #171a1f;
  --muted: #626b7a;
  --accent: #128a45;
  --accent-ink: #ffffff;
  --danger: #c53030;
  --warn: #946200;
  --info: #2563eb;
  --radius: 4px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0d10;
  --surface: #12151a;
  --surface-2: #171b21;
  --border: #272c34;
  --border-strong: #363d47;
  --text: #e9ecef;
  --muted: #939baa;
  --accent: #55cd7b;
  --accent-ink: #07170d;
  --danger: #ff6b6b;
  --warn: #e7b84b;
  --info: #67a9ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
/* Every flag (league or team) is capped by HEIGHT only — its width scales
   naturally so wide flags are never cropped. */
.flag-img,
.prediction-league img,
.team img,
.pt-league img,
.pt-team img,
.cp-team img,
.group-league-inner img { max-height: 32px; width: auto; height: auto; object-fit: contain; flex: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.container { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }

/* ---------- Public header / footer ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header .header-inner {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius); font-size: 13px; font-weight: 800;
}
.brand img, .brand-logo { max-height: 32px; height: auto; width: auto; object-fit: contain; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  padding: 7px 12px; color: var(--muted); font-size: 13px;
  border-radius: var(--radius);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--accent); }
.header-spacer { flex: 1; }
.header-cta {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid var(--accent); border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
}
.header-cta:hover { opacity: .9; color: var(--accent-ink); }
/* Mobile hamburger — an icon button, not a text label. */
.mobile-nav-toggle {
  display: none; width: 38px; height: 34px; padding: 0;
  place-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
}
.mobile-nav-toggle .hamburger { display: grid; gap: 4px; width: 18px; }
.mobile-nav-toggle .hamburger span {
  display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px;
  transition: transform .15s ease, opacity .15s ease;
}
.mobile-nav-toggle[aria-expanded="true"] .hamburger span:first-child { transform: translateY(6px) rotate(45deg); }
.mobile-nav-toggle[aria-expanded="true"] .hamburger span:nth-child(2) { opacity: 0; }
.mobile-nav-toggle[aria-expanded="true"] .hamburger span:last-child { transform: translateY(-6px) rotate(-45deg); }

.site-footer { margin-top: 64px; border-top: 1px solid var(--border); background: var(--surface); }
.site-footer .footer-inner { width: min(1120px, calc(100% - 32px)); margin-inline: auto; padding: 32px 0; }
/* Footer: centred flex funnel — brand across the top, menus centred below. */
.footer-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 24px 48px; }
.footer-grid > div { flex: 0 1 auto; min-width: 0; }
.footer-grid > div:first-child { flex-basis: 100%; text-align: center; }
.footer-grid > div:first-child .brand { justify-content: center; }
.footer-grid p, .footer-grid li { color: var(--muted); font-size: 13px; }
.footer-grid > div:first-child p { max-width: 480px; margin-inline: auto; }
.footer-grid ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.footer-grid li + li { margin-top: 0; }
.footer-logo { height: 34px; width: auto; margin-bottom: 12px; }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 0 24px; color: var(--muted); font-size: 12px; text-align: center; }

/* ---------- Public page furniture ---------- */
.page-head { padding: 42px 0 26px; border-bottom: 1px solid var(--border); }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 700; }
.page-head h1 { font-size: clamp(26px, 4vw, 38px); margin-top: 8px; }
.page-head p { color: var(--muted); margin-top: 8px; max-width: 620px; }
.section { padding: 32px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font-size: 18px; }
.section-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.text-link { color: var(--accent); font-size: 13px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); font-size: 11px; font-weight: 600;
  color: var(--muted); background: var(--surface-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-win { color: var(--accent); border-color: var(--border-strong); }
.badge-loss { color: var(--danger); border-color: var(--border-strong); }
.badge-wait { color: var(--warn); border-color: var(--border-strong); }
.badge-live { color: var(--danger); }
.badge-draft { color: var(--muted); }

/* ---------- Predictions ---------- */
.prediction-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.prediction-card { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.prediction-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.prediction-league { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: var(--muted); }
.prediction-league img { max-height: 32px; object-fit: contain; flex: none; }
.prediction-league span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prediction-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.prediction-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 20px 16px; }
.team { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.team img { max-height: 32px; object-fit: contain; }
.team-fallback { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); font-size: 12px; font-weight: 700; }
.team span { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.vs { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.prediction-tip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.prediction-tip strong { color: var(--accent); font-size: 14px; }
.prediction-tip small { color: var(--muted); font-size: 11px; }
.empty-state { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 48px 20px; text-align: center; color: var(--muted); }

/* ---------- News ---------- */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.filter-chip { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); background: var(--surface); font-size: 12px; }
.filter-chip:hover { color: var(--text); border-color: var(--border-strong); }
.filter-chip[aria-current="page"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.news-card { display: flex; flex-direction: column; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.news-card:hover { border-color: var(--border-strong); }
.news-card img { width: 100%; height: 170px; object-fit: cover; background: var(--surface-2); }
.news-card-body { display: flex; flex-direction: column; flex: 1; padding: 16px; gap: 8px; }
.news-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.news-card h2 { font-size: 15px; line-height: 1.4; }
.news-card p { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-card .read-more { margin-top: auto; color: var(--accent); font-size: 12px; font-weight: 600; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 32px; }
.pagination a, .pagination span { min-width: 32px; height: 32px; display: grid; place-items: center; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); font-size: 12px; }
.pagination a:hover { color: var(--text); border-color: var(--border-strong); }
.pagination .current { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 700; }

.article { max-width: 820px; margin-inline: auto; }
.article-back { display: inline-block; margin-bottom: 20px; color: var(--muted); font-size: 13px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 14px 0 20px; }
.article h1 { font-size: clamp(26px, 4vw, 36px); }
.article > img { width: 100%; max-height: 420px; object-fit: cover; border: 1px solid var(--border); border-radius: var(--radius); }
.article-content { margin-top: 28px; color: var(--text); font-size: 15px; }
.article-content h2 { font-size: 22px; margin: 28px 0 12px; }
.article-content h3 { font-size: 18px; margin: 24px 0 10px; }
.article-content p { margin: 0 0 16px; }
.article-content a { color: var(--accent); text-decoration: underline; }
.article-content img { height: auto; border: 1px solid var(--border); border-radius: var(--radius); margin: 16px 0; }
.related { margin-top: 48px; border-top: 1px solid var(--border); padding-top: 28px; }

/* ---------- Admin shell ---------- */
.admin { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 236px; flex: none; border-right: 1px solid var(--border);
  background: var(--surface); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.admin-brand { height: 62px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.admin-brand .brand-name { font-size: 14px; font-weight: 700; }
.admin-brand .brand-sub { color: var(--muted); font-size: 11px; }
.admin-nav { flex: 1; overflow-y: auto; padding: 18px 12px; }
.admin-nav-label { padding: 0 10px 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 700; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px;
  border-radius: var(--radius); color: var(--muted); font-size: 13px;
}
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.active { background: var(--surface-2); color: var(--accent); font-weight: 600; }
.admin-nav .nav-icon { width: 16px; text-align: center; opacity: .9; }
.admin-sidebar-foot { border-top: 1px solid var(--border); padding: 12px; }
.admin-sidebar-foot a { display: block; padding: 8px 10px; color: var(--muted); font-size: 13px; border-radius: var(--radius); }
.admin-sidebar-foot a:hover { background: var(--surface-2); color: var(--text); }
.admin-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--border); margin-top: 6px; }
.avatar { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius); color: var(--accent); font-size: 12px; font-weight: 700; }

.admin-body { flex: 1; min-width: 0; }
.admin-topbar {
  position: sticky; top: 0; z-index: 10; height: 62px;
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.admin-topbar .crumb { color: var(--muted); font-size: 13px; }
.admin-topbar .crumb strong { color: var(--text); font-weight: 600; }
.admin-topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.admin-topbar .pill { border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 8px; color: var(--muted); font-size: 11px; }
.admin-main { width: min(1240px, 100%); margin-inline: auto; padding: 28px; }

.page-header { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-header h1 { font-size: 24px; }
.page-header p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-header .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 13px; }
.btn:hover { border-color: var(--border-strong); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { opacity: .9; color: var(--accent-ink); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn-link { background: none; border: none; padding: 0; color: var(--accent); font-size: 12px; }
.btn-link:hover { text-decoration: underline; }
.btn-danger-link { background: none; border: none; padding: 0; color: var(--danger); font-size: 12px; }

.card { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 14px; }
.card-head p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card-body { padding: 16px; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--border); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 16px; }
.stat-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 14px; font-variant-numeric: tabular-nums; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.quick { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 16px; }
.quick:hover { border-color: var(--border-strong); }
.quick-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius); color: var(--accent); font-size: 15px; }
.quick strong { display: block; font-size: 13px; }
.quick small { color: var(--muted); font-size: 11px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, label.field-label { font-size: 12px; font-weight: 600; }
.field small { color: var(--muted); font-size: 11px; }
input, select, textarea {
  width: 100%; min-height: 36px; padding: 8px 10px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); outline: none;
  font-size: 13px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type="checkbox"] { width: 16px; min-height: 16px; accent-color: var(--accent); }
textarea { min-height: 110px; resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.max-form { max-width: 780px; }

/* Admin: site-content repeaters (logo, promo buttons, promo cards, ads) */
.content-section { margin-bottom: 28px; }
.content-row {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 14px; margin-bottom: 10px;
}
.content-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.content-row-head strong { font-size: 13px; }
.content-row-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.content-row-grid .full { grid-column: 1 / -1; }
.icon-upload { display: flex; align-items: end; gap: 8px; }
.icon-upload input[type="file"] { padding: 6px; font-size: 11px; }
.icon-preview {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); overflow: hidden;
}
.icon-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.row-remove { color: var(--danger); }
.tip-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tip-chip { padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); font-size: 11px; }

.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, .015); }
td .muted, .muted { color: var(--muted); }
td .team-cell { display: flex; align-items: center; gap: 8px; font-weight: 600; }
td .team-cell img { max-height: 32px; object-fit: contain; }
.row-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.inline-form { display: inline; }
.nowrap { white-space: nowrap; }
.thumb { width: 56px; height: 38px; object-fit: cover; border: 1px solid var(--border); border-radius: var(--radius); }
.thumb-empty { width: 56px; height: 38px; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); font-size: 10px; }

.flash { margin-bottom: 18px; border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--surface); padding: 10px 14px; border-radius: var(--radius); font-size: 13px; }
.flash-error { border-left-color: var(--danger); }
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.activity-item .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-item time { color: var(--muted); font-size: 11px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 28px; }
.login-card h1 { font-size: 20px; margin-bottom: 6px; }
.login-card p.sub { color: var(--muted); font-size: 12px; margin-bottom: 24px; }
.login-card .field + .field { margin-top: 16px; }
.login-card .btn { width: 100%; margin-top: 22px; height: 38px; }
.login-error { color: var(--danger); font-size: 12px; margin-top: 12px; min-height: 18px; }

/* ==========================================================================
   Home: flat tabular layout (left ad rail | main | right rail)
   ========================================================================== */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.theme-toggle {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 16px; line-height: 1;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.home-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
  padding-top: 24px;
  padding-bottom: 24px;
}
.ad-rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 86px; }
.ad-rail-left .ad-slot:last-child { min-height: 600px; }
.home-main { min-width: 0; }
.home-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 86px; }

.ad-slot {
  min-height: 250px; width: 100%;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface); display: grid; place-items: center;
  overflow: hidden; text-align: center;
}
.ad-placeholder {
  color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; line-height: 1.9;
}
.ad-placeholder small { display: block; font-size: 10px; font-weight: 500; opacity: .8; }
.bottom-ad { margin-top: 32px; }
.bottom-ad .ad-slot { min-height: 90px; width: 100%; }
.after-nav-ad { margin-top: 12px; margin-bottom: 4px; }
.after-nav-ad .ad-slot { min-height: 90px; width: 100%; }

/* Join buttons above the table */
.promo-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.promo-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600;
}
.promo-btn:hover { border-color: var(--accent); color: var(--accent); }
.promo-btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.promo-btn-accent:hover { background: var(--accent); color: var(--accent-ink); opacity: .9; }
.promo-btn-icon { font-size: 16px; line-height: 1; }
.promo-btn-icon-img { width: 22px; height: 22px; object-fit: contain; flex: none; }

/* Predictions table — deliberately no row or column dividing lines */
.page-head-flush { padding-top: 30px; }
.predictions-panel { margin-bottom: 36px; }
.panel-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.panel-head h1, .panel-head h2 { font-size: 22px; margin-top: 6px; }
.panel-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.table-scroll { overflow-x: visible; }
.prediction-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; }
.prediction-table th {
  padding: 8px 8px 10px; border: 0; background: none;
  color: var(--muted); font-size: 10px; font-weight: 700;
  text-align: left; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
}
.prediction-table td {
  padding: 10px 8px; border: 0; background: none;
  font-size: 12px; vertical-align: middle;
}
.prediction-table th:nth-child(1), .prediction-table td:nth-child(1) { width: 9%; }
.prediction-table th:nth-child(2), .prediction-table td:nth-child(2) { width: 27%; }
.prediction-table th:nth-child(3), .prediction-table td:nth-child(3) { width: 6%; }
.prediction-table th:nth-child(4), .prediction-table td:nth-child(4) { width: 27%; }
.prediction-table th:nth-child(5), .prediction-table td:nth-child(5) { width: 19%; }
.prediction-table th:nth-child(6), .prediction-table td:nth-child(6) { width: 12%; }
.prediction-table tbody tr:hover { background: var(--surface); }
.pt-league { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.pt-league img, .pt-team img { max-height: 32px; object-fit: contain; flex: none; }
.pt-team { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: normal; overflow-wrap: break-word; }
.pt-team strong { font-size: 12px; font-weight: 600; white-space: normal; overflow-wrap: break-word; }
.pt-team .team-fallback { width: 28px; height: 28px; font-size: 10px; flex: none; }
.pt-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pt-vs { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.pt-tip { white-space: normal; overflow-wrap: break-word; }
.pt-tip strong { color: var(--accent); font-weight: 700; overflow-wrap: break-word; }
.prediction-table td:last-child { white-space: normal; overflow-wrap: break-word; }
.pt-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Grouped table — league row, then date row, then its matches. No divider lines. */
.prediction-table-grouped { min-width: 0; }
.prediction-table .group-row td { padding: 0; border: 0; }
.prediction-table tbody tr.group-league:hover { background: none; }
.prediction-table tbody tr.group-date:hover { background: none; }
.group-league td { background: var(--surface-2); }
.group-league-inner {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  color: var(--text); font-size: 13px; white-space: nowrap;
}
.group-league-inner > .flag-img { flex: none; max-height: 32px; width: auto; height: auto; font-size: 10px; }
.group-league-inner strong { font-size: 13px; font-weight: 600; white-space: nowrap; }
.group-count {
  margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 500;
}
.group-date td { background: var(--bg); }
.group-date-inner {
  display: block; padding: 8px 12px;
  color: var(--accent); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
}

/* Match-day navigation */
.date-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.date-nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 30px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600;
}
.date-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.date-nav-btn.is-disabled { color: var(--muted); opacity: .5; cursor: default; }
.date-nav-btn.is-disabled:hover { border-color: var(--border); color: var(--muted); }
.date-nav-current { display: flex; align-items: baseline; gap: 8px; text-align: center; }
.date-nav-label {
  color: var(--muted); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
}
.date-nav-current time { font-size: 13px; font-weight: 700; }

/* Concise predictions table — fits its container, no scrolling */
.compact-predictions { width: 100%; table-layout: fixed; border-collapse: collapse; }
.compact-predictions th {
  padding: 8px; border: 0; background: none; text-align: left;
  color: var(--muted); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
}
.compact-predictions td { padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 12px; }
.compact-predictions tbody tr:last-child td { border-bottom: 0; }
.cp-match { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cp-team { display: flex; align-items: center; gap: 5px; min-width: 0; flex: 1; }
.cp-team > span { white-space: normal; overflow-wrap: break-word; }
.cp-team img, .cp-team .team-fallback { max-height: 32px; width: auto; height: auto; flex: none; font-size: 9px; }
.cp-vs { color: var(--muted); font-size: 10px; text-transform: uppercase; flex: none; }
.cp-tip { color: var(--accent); font-weight: 700; }

/* Home predictions feed — recent results, compact and never clipped */
.home-predictions-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.home-predictions-table th {
  padding: 8px; border: 0; background: none; text-align: left;
  color: var(--muted); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
}
.home-predictions-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 12px; }
.home-predictions-table tbody tr:last-child td { border-bottom: 0; }
.hp-league { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.hp-league > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-date { color: var(--muted); font-size: 11px; white-space: nowrap; }
.hp-match { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.hp-team { display: flex; align-items: center; gap: 5px; min-width: 0; white-space: normal; overflow-wrap: break-word; }
.hp-team > span { white-space: normal; overflow-wrap: break-word; }
.hp-team .flag-img { max-height: 32px; width: auto; height: auto; flex: none; }
.hp-vs { color: var(--muted); font-size: 10px; text-transform: uppercase; flex: none; }
.hp-tip { color: var(--accent); font-weight: 700; white-space: normal; overflow-wrap: break-word; }
.home-predictions-table td:last-child { white-space: normal; }
/* Date and league group rows in the home feed */
.home-predictions-table .group-row td { padding: 0; border: 0; }
.home-predictions-table tbody tr.group-row:hover { background: none; }

/* Sidebar: latest article + promo cards */
.side-card { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.side-card-head {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
}
.sidebar-post img { width: 100%; height: 132px; object-fit: cover; background: var(--surface-2); }
.sidebar-post-body { padding: 14px; }
.sidebar-post-body h3 { font-size: 14px; line-height: 1.4; }
.sidebar-post-body p {
  margin-top: 8px; color: var(--muted); font-size: 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.sidebar-post-body .read-more { display: inline-block; margin-top: 12px; color: var(--accent); font-size: 12px; font-weight: 700; }

.promo-cards { display: flex; flex-direction: column; gap: 12px; }
.promo-card {
  display: flex; gap: 12px; padding: 14px;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius);
}
.promo-card:hover { border-color: var(--border-strong); }
.promo-avatar {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: 50%;
  background: var(--surface-2); color: var(--accent);
  font-size: 12px; font-weight: 800; overflow: hidden;
}
.promo-avatar img { width: 100%; height: 100%; padding: 4px; object-fit: contain; }
.promo-card-body { min-width: 0; }
.promo-card h3 { font-size: 13px; line-height: 1.4; }
.promo-card p { margin-top: 6px; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.promo-cta {
  display: inline-flex; align-items: center; height: 28px; margin-top: 10px; padding: 0 10px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius); font-size: 11px; font-weight: 700;
}
.promo-cta:hover { opacity: .9; color: var(--accent-ink); }

/* Compact news list under the table */
.compact-news { display: flex; flex-direction: column; }
.compact-news-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.compact-news-item:last-child { border-bottom: 0; }
.compact-news-thumb { width: 92px; height: 62px; flex: none; background: var(--surface-2); border-radius: var(--radius); overflow: hidden; }
.compact-news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.compact-news-body { flex: 1; min-width: 0; }
.compact-news-body strong { display: block; font-size: 14px; line-height: 1.4; }
.compact-news-body small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.compact-news-arrow { color: var(--accent); font-size: 16px; }

@media (max-width: 1180px) {
  .home-layout { grid-template-columns: 130px minmax(0, 1fr) 270px; gap: 16px; }
}
@media (max-width: 980px) {
  .home-layout { grid-template-columns: minmax(0, 1fr) 270px; }
  .ad-rail-left { display: none; }
}
@media (max-width: 720px) {
  .home-layout { grid-template-columns: 1fr; }
  .home-sidebar { position: static; }
  .promo-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date-nav { flex-wrap: wrap; }
  .date-nav-current { order: -1; width: 100%; justify-content: center; }
}

@media (max-width: 860px) {
  .admin-sidebar { width: 72px; }
  .admin-brand .text, .admin-nav-label, .admin-nav a span.label, .admin-sidebar-foot span.label, .admin-user .meta { display: none; }
  .admin-nav a { justify-content: center; }
  .admin-main { padding: 20px 16px; }
  .footer-grid { gap: 20px 28px; }
}
@media (max-width: 640px) {
  .site-nav { display: none; }
  .mobile-nav-toggle { display: grid; }
  .site-nav.open { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-top: 0; padding: 8px 16px; }
  .content-row-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-header { align-items: start; flex-direction: column; }
}

/* ==========================================================================
   Matches (livescore-style cards)
   ========================================================================== */
.matches-panel { margin-bottom: 36px; }
.ls-wrap { display: flex; flex-direction: column; gap: 20px; }
.ls-league { display: flex; flex-direction: column; gap: 8px; }
.ls-league-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ls-league-title {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.ls-league-title .flag-img { max-height: 18px; width: auto; height: auto; flex: none; }
.ls-league-title strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-league-count { color: var(--muted); font-size: 11px; font-weight: 600; flex: none; }

.ls-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.ls-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
}
.ls-card.is-live { border-color: var(--accent); }
.ls-card-row {
  display: flex;
  align-items: stretch;
  min-height: 56px;
}
.ls-state {
  width: 60px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  text-align: center;
}
.ls-state-main {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.ls-card.is-live .ls-state-main { color: var(--accent); }
.ls-card.is-ft .ls-state-main { color: var(--text); }
.ls-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }
.ls-divider {
  width: 1px;
  background: var(--border);
  margin: 8px 0;
  flex: none;
}
.ls-fixture {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}
.ls-side {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ls-home { justify-content: flex-end; text-align: right; }
.ls-away { justify-content: flex-start; text-align: left; }
.ls-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ls-badge, .ls-side .flag-img {
  max-height: 22px;
  width: auto;
  height: auto;
  flex: none;
  object-fit: contain;
}
.ls-center {
  flex: none;
  min-width: 64px;
  text-align: center;
}
.ls-scoreline {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: 0.02em;
}
.ls-card.is-live .ls-scoreline { color: var(--accent); }
.ls-card.is-scheduled .ls-scoreline { color: var(--muted); font-weight: 600; font-size: 13px; }

.ls-card-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 8px 73px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
}
.ls-tip-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.ls-tip-text { color: var(--accent); font-weight: 700; }
.ls-tip-status { margin-left: auto; }
.ls-tip-status .badge { font-size: 10px; padding: 1px 7px; }

@media (max-width: 640px) {
  .ls-fixture { gap: 6px; padding: 10px 8px; }
  .ls-state { width: 52px; }
  .ls-name { font-size: 12px; }
  .ls-center { min-width: 52px; }
  .ls-scoreline { font-size: 13px; }
  .ls-badge, .ls-side .flag-img { max-height: 18px; }
  .ls-card-tip { padding-left: 61px; }
}


/* ==========================================================================
   Prediction cards (home feed) - similar to match cards
   ========================================================================== */
.pred-cards-wrap { display: flex; flex-direction: column; gap: 18px; }
.pred-date-group { display: flex; flex-direction: column; gap: 8px; }
.pred-date-group .group-date-inner {
  display: block;
  padding: 8px 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pred-league-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}
.pred-league-head .match-league-title { display: inline-flex; align-items: center; gap: 8px; }
.pred-league-head .flag-img { max-height: 18px; width: auto; height: auto; }
.pred-cards-list { display: flex; flex-direction: column; gap: 8px; }
.pred-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.pred-card-row {
  padding: 10px 12px;
  min-height: 52px;
}
.pred-center {
  flex: none;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}
.pred-tip {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.pred-result .badge { font-size: 10px; padding: 1px 7px; }

@media (max-width: 640px) {
  .pred-card-row { padding: 10px 8px; gap: 6px; }
  .pred-center { min-width: 74px; }
  .pred-tip { font-size: 12px; }
}

/* ==========================================================================
   View counts & icons
   ========================================================================== */
.views-count { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); white-space: nowrap; font: inherit; }
.views-count .icon-eye, .icon-eye { width: 14px; height: 14px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.views-count-inline { font: inherit; }
.news-card-meta-right { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.sidebar-post-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.sidebar-post-meta .read-more { margin-top: 0; }
.article-meta .views-count { color: var(--muted); }

/* Admin flag / image previews */
.flag-preview { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.flag-preview img, .flag-thumb-preview { max-height: 28px; max-width: 48px; width: auto; height: auto; object-fit: contain; border-radius: 3px; border: 1px solid var(--border); background: var(--surface-2); vertical-align: middle; }
.flag-preview-url { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.flag-input-wrap { display: flex; flex-direction: column; gap: 6px; }
.flag-input-preview img { max-height: 40px; max-width: 80px; width: auto; height: auto; object-fit: contain; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-2); }
td .flag-preview { max-width: 100%; }
