:root{--bg:#f5f7fb;--card:#fff;--text:#172033;--muted:#6b7280;--line:#e5e7eb;--accent:#1d4ed8;--accent2:#eef4ff;--danger:#b91c1c}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.topbar{position:sticky;top:0;z-index:10;display:flex;gap:24px;align-items:center;justify-content:space-between;padding:14px 24px;background:rgba(255,255,255,.92);border-bottom:1px solid var(--line);backdrop-filter:blur(10px)}.brand{font-weight:800;color:var(--text);text-decoration:none}.topbar nav{display:flex;gap:12px;flex-wrap:wrap}.topbar a{color:var(--text);text-decoration:none}.topbar nav a{padding:8px 10px;border-radius:999px}.topbar nav a:hover{background:var(--accent2)}.container{max-width:1280px;margin:0 auto;padding:24px}h1{font-size:34px;margin:0 0 18px}h2{margin:0 0 14px}.hero{display:flex;justify-content:space-between;gap:24px;align-items:center;background:linear-gradient(135deg,#e0ecff,#fff);border:1px solid var(--line);border-radius:28px;padding:30px;margin-bottom:24px}.hero p{font-size:18px;max-width:760px}.card,.match-card{background:var(--card);border:1px solid var(--line);border-radius:22px;padding:18px;box-shadow:0 8px 24px rgba(15,23,42,.04)}.grid{display:grid;gap:16px}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.grid.groups{grid-template-columns:repeat(4,minmax(0,1fr))}.grid.bracket{grid-template-columns:repeat(4,minmax(0,1fr))}.actions,.player-list,.toolbar,.filters{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.button,button{border:0;border-radius:12px;background:var(--accent);color:white;padding:10px 14px;font-weight:700;text-decoration:none;cursor:pointer;font-size:14px}.button.secondary{background:#e5e7eb;color:var(--text)}button.danger{background:var(--danger)}.pill{display:block;padding:10px 12px;background:var(--accent2);border-radius:999px;color:var(--accent);font-weight:700;text-decoration:none}.table-wrap{overflow:auto;background:white;border:1px solid var(--line);border-radius:18px}table{border-collapse:collapse;width:100%;background:white}th,td{padding:10px 12px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}th{font-size:13px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);background:#fafafa}.muted{color:var(--muted);font-size:13px}.filters{background:white;border:1px solid var(--line);border-radius:18px;padding:14px;margin-bottom:16px}.filters input,.filters select,input,select{border:1px solid var(--line);border-radius:10px;padding:9px 10px;background:white;min-height:39px}.score-inputs{white-space:nowrap}.score-inputs input{width:56px;text-align:center}.score-inputs span{padding:0 6px}.notice{padding:12px 14px;background:#dcfce7;border:1px solid #86efac;border-radius:14px;margin-bottom:14px}.error{color:var(--danger);font-weight:700}.narrow{max-width:520px;margin:40px auto}.form-row{display:flex;gap:10px}.sticky{position:sticky;top:65px;z-index:5;background:rgba(245,247,251,.92);padding:12px 0}.match-list{display:grid;gap:10px}.match-card{display:flex;flex-direction:column;gap:4px}.inline{display:inline-flex;margin:0 8px 8px 0}@media(max-width:900px){.grid.two,.grid.groups,.grid.bracket{grid-template-columns:1fr}.hero{flex-direction:column;align-items:flex-start}.topbar{align-items:flex-start;flex-direction:column}.container{padding:14px}h1{font-size:28px}th,td{padding:8px}.sticky{top:116px}}
.summary-card{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;margin-bottom:16px}.summary-card strong{display:block;font-size:26px;margin-top:4px}.summary-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}.filled-row td{background:#ecfdf5!important}.filled-row td:first-child{box-shadow:inset 5px 0 0 #16a34a}.filled-row:hover td{background:#dcfce7!important}.filled-badge{display:inline-flex;margin-top:6px;padding:3px 8px;border-radius:999px;background:#bbf7d0;color:#166534;font-weight:800;font-size:12px}.points{display:inline-flex;margin-top:4px;padding:2px 8px;border-radius:999px;background:#dcfce7;color:#166534;font-weight:800;font-size:12px}.score-inputs input:invalid{border-color:var(--danger);background:#fff1f2}@media(max-width:900px){.summary-card{grid-template-columns:1fr 1fr}.summary-actions{justify-content:flex-start;grid-column:1/-1}}

.nav-dropdown{position:relative}.nav-dropdown summary{list-style:none;cursor:pointer;padding:8px 10px;border-radius:999px}.nav-dropdown summary::-webkit-details-marker{display:none}.nav-dropdown summary:hover,.nav-dropdown[open] summary{background:var(--accent2)}.nav-dropdown-menu{position:absolute;right:0;top:38px;min-width:210px;background:white;border:1px solid var(--line);border-radius:16px;box-shadow:0 16px 36px rgba(15,23,42,.12);padding:8px;display:grid;gap:4px}.nav-dropdown-menu a{padding:10px 12px;border-radius:12px;white-space:nowrap}.nav-dropdown-menu a:hover{background:var(--accent2)}.autosave-hint{color:var(--muted);font-size:13px;margin-left:auto}.auto-filters noscript{display:inline-flex}@media(max-width:900px){.nav-dropdown-menu{left:0;right:auto}.autosave-hint{width:100%;margin-left:0}}
.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:16px}.page-head h1{margin-bottom:6px}.checkbox-filter{display:inline-flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:#fff;min-height:39px}.checkbox-filter input{min-height:auto}.compare-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:16px}.compare-summary strong{display:block;font-size:26px;margin-top:4px}.compare-table .prediction-filled{background:#f0fdf4}.diff-row td:first-child{box-shadow:inset 5px 0 0 #f59e0b}.diff-badge{display:inline-flex;margin-top:6px;padding:3px 8px;border-radius:999px;background:#fef3c7;color:#92400e;font-weight:800;font-size:12px}.small-team{display:inline-block;max-width:190px;line-height:1.25}@media(max-width:900px){.page-head{display:block}.compare-summary{grid-template-columns:1fr}.compare-table th,.compare-table td{min-width:120px}}

.prediction-cell{font-weight:400;border-left:5px solid transparent}.prediction-cell .points{margin-right:6px}.accuracy-label{display:inline-flex;margin-top:4px;padding:2px 8px;border-radius:999px;font-weight:800;font-size:12px}.accuracy-exact{background:#dcfce7!important;border-left-color:#16a34a}.accuracy-exact .accuracy-label{background:#bbf7d0;color:#166534}.accuracy-diff{background:#fef9c3!important;border-left-color:#ca8a04}.accuracy-diff .accuracy-label{background:#fde68a;color:#854d0e}.accuracy-outcome{background:#ffedd5!important;border-left-color:#f97316}.accuracy-outcome .accuracy-label{background:#fed7aa;color:#9a3412}.accuracy-missed{background:#fee2e2!important;border-left-color:#dc2626}.accuracy-missed .accuracy-label{background:#fecaca;color:#991b1b}

/* Match prediction accuracy styling */
.prediction-cell .points{background:transparent;color:inherit;border:1px solid currentColor;margin-right:0}
.prediction-cell.accuracy-exact .points{color:#166534}
.prediction-cell.accuracy-diff .points{color:#854d0e}
.prediction-cell.accuracy-outcome .points{color:#9a3412}
.prediction-cell.accuracy-missed .points{color:#991b1b}

/* Equal score columns on matches page */
.score-col{width:112px;min-width:112px;max-width:112px;text-align:center!important;vertical-align:middle!important}
.fact-cell{font-weight:800}
.fact-cell b{font-weight:900}
.prediction-cell{font-weight:400;text-align:center!important}
.prediction-cell .muted,.fact-cell .muted{display:inline-block;margin-top:3px}
.prediction-cell .points{justify-content:center;margin-left:auto;margin-right:auto}
.empty-prediction{background:#fff}
@media(max-width:900px){.score-col{width:96px;min-width:96px;max-width:96px}}

/* Group table forecast accuracy */
.compact-legend{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:16px;padding:12px 14px}
.legend-item{display:inline-flex;padding:5px 10px;border-radius:999px;font-weight:800;font-size:13px}
.group-exact td{background:#dcfce7!important}
.group-exact td:first-child{box-shadow:inset 5px 0 0 #16a34a}
.group-missed td{background:#fee2e2!important}
.group-missed td:first-child{box-shadow:inset 5px 0 0 #dc2626}
.legend-item.group-exact{background:#dcfce7;color:#166534}
.legend-item.group-missed{background:#fee2e2;color:#991b1b}

/* Group prediction accuracy highlighting */
.groups table tr.group-exact > td,
.groups table td.group-exact {
  background-color: #dcfce7 !important;
}
.groups table tr.group-exact > td:first-child,
.groups table td.group-exact:first-child {
  box-shadow: inset 5px 0 0 #16a34a;
}
.groups table tr.group-missed > td,
.groups table td.group-missed {
  background-color: #fee2e2 !important;
}
.groups table tr.group-missed > td:first-child,
.groups table td.group-missed:first-child {
  box-shadow: inset 5px 0 0 #dc2626;
}
.groups table tr.group-exact .muted { color: #166534; }
.groups table tr.group-missed .muted { color: #991b1b; }

/* Stage forecast accuracy highlighting */
.forecast-section{margin-top:18px}.forecast-card{overflow:auto}.stage-forecast-table td:first-child{width:56px}.stage-row.stage-exact > td,.stage-forecast-table td.stage-exact{background:#dcfce7!important}.stage-row.stage-exact > td:first-child,.stage-forecast-table td.stage-exact:first-child{box-shadow:inset 5px 0 0 #16a34a}.stage-row.stage-missed > td,.stage-forecast-table td.stage-missed{background:#fee2e2!important}.stage-row.stage-missed > td:first-child,.stage-forecast-table td.stage-missed:first-child{box-shadow:inset 5px 0 0 #dc2626}

/* Rating details */
.rating-detail-table{table-layout:fixed;width:auto;min-width:720px}
.rating-detail-table th,.rating-detail-table td{height:44px;vertical-align:middle}
.rating-criterion-col{width:280px;min-width:280px;text-align:left}
.rating-player-col{width:132px;min-width:132px;max-width:132px;text-align:center!important}
.rating-value{font-variant-numeric:tabular-nums;font-weight:700}
.rating-total-row td{background:#eef2ff!important;font-weight:900}
.rating-total-row .rating-value{font-size:18px}
@media(max-width:900px){.rating-criterion-col{width:230px;min-width:230px}.rating-player-col{width:110px;min-width:110px;max-width:110px}}

/* Prediction lock and group place alignment */
.group-place-col, .group-place-cell { text-align: center !important; }
.locked-row td { background: #f8fafc !important; color: #64748b; }
.locked-row td:first-child { box-shadow: inset 5px 0 0 #94a3b8; }
.locked-badge { display:inline-flex;margin-top:6px;padding:3px 8px;border-radius:999px;background:#e2e8f0;color:#475569;font-weight:800;font-size:12px; }
.lock-notice { background:#eff6ff;border-color:#bfdbfe; }
.locked-row input:disabled, .locked-row select:disabled { background:#e5e7eb;color:#64748b;cursor:not-allowed; }

/* Team flags via flag-icons */
.team-label{display:inline-flex;align-items:center;gap:.42rem;line-height:1.2;vertical-align:middle}
.team-flag{width:1.35em;line-height:1em;border-radius:2px;box-shadow:0 0 0 1px rgba(15,23,42,.12);flex:0 0 auto;background-size:cover}
.team-name{display:inline-block;min-width:0}
.score-col .team-label,.muted .team-label{justify-content:center}
.match-card .team-label{font-weight:inherit}
.team-label-no-flag{gap:0}

/* API results sync */
.error-notice{background:#fee2e2;border-color:#fecaca;color:#991b1b}
code{background:#f1f5f9;border:1px solid #e2e8f0;border-radius:6px;padding:1px 5px;font-size:.92em}

/* Local fallback for Argentina flag: some browsers/CDN caches may fail to load fi-ar.svg. */
.fi.fi-ar{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 480'%3E%3Cpath fill='%2374acdf' d='M0 0h640v480H0z'/%3E%3Cpath fill='%23fff' d='M0 160h640v160H0z'/%3E%3Ccircle cx='320' cy='240' r='42' fill='%23f6b40e'/%3E%3Cpath fill='%2385330a' d='M320 186l8 36 29-23-20 31 37-3-35 13 35 13-37-3 20 31-29-23-8 36-8-36-29 23 20-31-37 3 35-13-35-13 37 3-20-31 29 23 8-36z' opacity='.55'/%3E%3C/svg%3E")!important;}

.sync-status {
  margin-top: 0.8rem;
  padding: 0.85rem 1rem;
  border: 1px solid #d7e4f2;
  border-radius: 12px;
  background: #f6fbff;
  line-height: 1.45;
}

.error-text {
  color: #b42318;
  font-weight: 600;
}
