/* Agoga: the one stylesheet. Colors, type and spacing follow docs/designs. */

/* ---------- Fonts (self-hosted, SIL OFL: fonts/OFL.txt) ---------- */

@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/barlow-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/barlow-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/barlow-condensed-latin-ext-800-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens ---------- */

:root {
    --navy-950: #0e1628;      /* sidebar, top bar, match header */
    --navy-800: #1e293b;      /* active navigation item */
    --navy-600: #475569;
    --slate-400: #94a3b8;
    --slate-200: #e2e8f0;

    --bg: #f3f2ef;            /* page */
    --surface: #ffffff;       /* cards, tables */
    --surface-muted: #ebe9e5; /* segmented toggle */
    --border: #e6e3de;
    --text: #0f172a;
    --text-muted: #5b6b80;

    --accent: #c2410c;        /* buttons, active tab, links */
    --accent-hover: #9a3412;
    --accent-soft: #fdf0e7;   /* "Igrač utakmice" card */
    --accent-bright: #fb923c; /* highlight on dark */
    --positive: #15803d;
    --negative: #b91c1c;
    --youtube: #cc0000;

    --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgb(15 23 42 / 0.04);
    --sidebar-width: 232px;
    --topbar-height: 56px;
    --gutter: 16px;
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; }

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

h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1:focus { outline: none; }

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

.icon { flex: none; display: block; }

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

.skip-link {
    position: absolute; left: 8px; top: -48px; z-index: 100;
    padding: 8px 12px; border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* ---------- Shell: sidebar on desktop, top bar + drawer on phones ---------- */

.shell { min-height: 100vh; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    height: var(--topbar-height);
    padding: 0 var(--gutter);
    background: var(--navy-950);
    color: #fff;
}
.topbar-menu {
    display: grid; place-items: center;
    width: 40px; height: 40px; margin-left: -8px;
    border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer;
}
.topbar-brand {
    font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: 0.02em;
    text-decoration: none;
}
.topbar-login { margin-left: auto; font-weight: 600; text-underline-offset: 3px; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50;
    display: flex; flex-direction: column;
    width: min(var(--sidebar-width), 85vw);
    padding: 20px 14px 14px;
    overflow-y: auto;
    background: var(--navy-950);
    color: var(--slate-200);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
}
.nav-open .sidebar { transform: none; }

.nav-backdrop {
    position: fixed; inset: 0; z-index: 40;
    background: rgb(15 23 42 / 0.5);
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
}
.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
.nav-open body { overflow: hidden; }

.sidebar-top { display: flex; align-items: center; justify-content: space-between; margin: 0 6px 24px; }
.sidebar-close {
    display: grid; place-items: center; width: 36px; height: 36px;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--slate-400); cursor: pointer;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-logo {
    width: 44px; height: 44px; border-radius: 50%;
    background: #fdfdfd; object-fit: cover;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: 0.03em; line-height: 1.05; }
.brand-place { font-size: 12px; color: var(--slate-400); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 14px;
    min-height: 44px; padding: 0 14px;
    border-radius: 10px;
    color: var(--slate-200); text-decoration: none; font-size: 16px; font-weight: 500;
}
.nav-item .icon { color: var(--slate-400); }
.nav-item:hover { background: rgb(255 255 255 / 0.05); }
.nav-item.active { background: var(--navy-800); color: #fff; font-weight: 600; }
.nav-item.active .icon { color: var(--accent-bright); }
.nav-heading {
    margin: 22px 14px 6px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--slate-400);
}

.sidebar-footer { margin-top: auto; padding-top: 24px; }
.sidebar-login {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 14px; border-radius: 10px;
    background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; font-size: 17px;
}
.sidebar-login:hover { background: var(--accent-hover); }
.nav-hint { margin: 0 14px; font-size: 14px; line-height: 1.4; color: var(--slate-400); }

.content {
    width: 100%; max-width: 1440px;
    padding: 24px var(--gutter) 48px;
}

@media (min-width: 1024px) {
    .topbar, .nav-backdrop, .sidebar-close { display: none; }
    .sidebar { width: var(--sidebar-width); transform: none; transition: none; }
    .content { margin-left: var(--sidebar-width); width: auto; padding: 32px 40px 64px; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar, .nav-backdrop { transition: none; }
}

/* ---------- Page header ---------- */

.page-header {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px;
    margin-bottom: 28px;
}
.page-eyebrow { font-size: 14px; font-weight: 500; color: var(--navy-600); margin-bottom: 6px; }
.page-title {
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(32px, 6vw, 44px); line-height: 1; letter-spacing: -0.005em;
}
.page-subtitle { margin-top: 6px; color: var(--text-muted); }

.section-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; font-size: 22px; font-weight: 700; }
.section-count { font-size: 14px; font-weight: 500; color: var(--text-muted); }

/* ---------- Buttons and messages ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 20px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-icon {
    display: inline-grid; place-items: center; width: 48px; height: 48px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer;
}
.btn-icon[hidden] { display: none; }
.fav-button { color: var(--accent); align-self: flex-start; }
.fav-button[aria-pressed="true"] svg { fill: currentColor; }

.notice {
    padding: 14px 16px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
}
.notice-error { border-color: #f3c7c7; background: #fdf2f2; color: var(--negative); }
.stats-refresh { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.notice-inline { font-size: 14px; color: var(--positive); }
.notice-inline.notice-error { background: none; color: var(--negative); }
.recount { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; font-size: 14px; color: var(--positive); }
.recount[hidden] { display: none; }
.recount.recount-running { color: var(--text-muted); }
.recount.recount-error { color: var(--negative); }
.recount-bar { position: relative; flex: 0 1 240px; height: 8px; border-radius: 4px; background: var(--surface-muted); overflow: hidden; }
.recount-bar[hidden] { display: none; }
.recount-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }
.recount-bar-indeterminate span { width: 30%; animation: recount-slide 1.2s ease-in-out infinite; }
@keyframes recount-slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .recount-bar-indeterminate span { animation: none; width: 100%; opacity: .4; } }

/* ---------- Project cards (Početna) ---------- */

.project-grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
.project-card {
    display: flex; flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow);
    text-decoration: none;
}
.project-card:hover .project-card-name { color: var(--accent); }
.project-card-cover {
    display: grid; place-items: center;
    height: 160px;
    background: var(--badge, var(--navy-800));
}
.project-card-badge {
    display: grid; place-items: center;
    width: 100px; height: 100px; border-radius: 50%;
    border: 3px solid rgb(255 255 255 / 0.85);
    overflow: hidden;
    color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 26px; text-align: center; line-height: 1;
}
.project-card-badge img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.project-card-body { padding: 14px 18px 16px; }
.project-card-name { font-size: 19px; font-weight: 700; }
.project-card-meta { margin-top: 2px; font-size: 14px; color: var(--text-muted); }

/* ---------- Common building blocks ---------- */

.muted { color: var(--text-muted); }
.nowrap { white-space: nowrap; }
.positive { color: var(--positive); }
.negative { color: var(--negative); }

.page-kicker {
    margin-bottom: 8px;
    font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}

.card {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow);
}
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; padding: 20px 20px 12px; }
.card-title { font-size: 22px; font-weight: 700; }
.card > .card-title { padding: 20px 20px 12px; }
.card-note { font-size: 14px; color: var(--text-muted); }
.card-empty { padding: 0 20px 20px; color: var(--text-muted); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-link { display: inline-block; padding: 10px 0; margin: -10px 0; font-weight: 600; color: var(--accent); text-decoration: none; }
.home-section { margin-bottom: 36px; }
.project-news { margin-top: 36px; }

.pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: middle;
}
.pill-active { background: #0f766e; color: #fff; }
.pill-inactive { background: var(--navy-600); color: #fff; }
.pill-accent { background: var(--accent-soft); color: var(--accent); letter-spacing: 0; text-transform: none; font-size: 14px; }

.breadcrumbs { margin-bottom: 16px; font-size: 14px; color: var(--text-muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0 10px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { content: "›"; margin-right: 10px; }
.breadcrumbs a { display: inline-block; padding: 8px 0; margin: -4px 0; color: var(--navy-600); text-underline-offset: 3px; }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 600; }

/* Badges and avatars */
.badge {
    display: inline-grid; place-items: center; flex: none;
    width: var(--size, 28px); height: var(--size, 28px); border-radius: 50%;
    background: var(--badge, var(--navy-600)); color: #fff;
    font-size: calc(var(--size, 28px) * 0.36); font-weight: 700; line-height: 1; letter-spacing: 0.02em;
}
.badge-logo { object-fit: cover; background: #fff; border: 1px solid var(--border); }
.badge-empty { background: transparent; border: 2px dashed var(--slate-400); }
.avatar {
    display: inline-grid; place-items: center; flex: none;
    width: var(--size, 32px); height: var(--size, 32px); border-radius: 50%; object-fit: cover;
}
.avatar-initials { background: #ebeae6; color: var(--navy-600); font-size: calc(var(--size, 32px) * 0.36); font-weight: 700; }
.team-cell { display: inline-flex; align-items: center; gap: 10px; }
.player-link { color: inherit; text-decoration: none; }
.player-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Score box */
.score {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 76px; height: 38px; padding: 0 12px; border-radius: var(--radius-sm);
    background: var(--navy-950); color: #fff;
    font-family: var(--font-display); font-weight: 800; font-size: 24px; font-variant-numeric: tabular-nums;
}
.score-sep { color: var(--slate-400); }
.score-pending { font-family: var(--font); font-size: 15px; font-weight: 600; }
.score-live { background: var(--negative); }
.score-sm { min-width: 52px; height: 30px; font-size: 19px; padding: 0 8px; gap: 3px; }
.score.score-sm:not(.score-live) { background: #ebeae6; color: var(--text); }
.events .score.score-sm { background: var(--navy-950); color: #fff; }

.live-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--negative); color: #fff; font-size: 13px; font-weight: 700; }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--negative); box-shadow: 0 0 0 4px rgb(185 28 28 / 0.15); }

/* Toggle and tabs */
.toggle {
    display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; margin-bottom: 24px;
    border-radius: 12px; background: var(--surface-muted);
}
.toggle-item {
    padding: 9px 22px; border-radius: 9px;
    font-weight: 600; font-size: 17px; text-decoration: none; color: var(--text);
}
.toggle-item.active { background: var(--navy-950); color: #fff; }
.tabs {
    display: flex; gap: 8px; margin-bottom: 24px; overflow-x: auto;
    border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.tab {
    flex: none; padding: 10px 6px 12px; margin-right: 18px; margin-bottom: -1px;
    border-bottom: 3px solid transparent;
    font-size: 18px; font-weight: 600; color: var(--navy-600); text-decoration: none; cursor: pointer;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* Tables */
/* position: relative keeps absolutely placed content (screen-reader-only labels) inside the scroll box;
   without it they stretch the whole page on phones. */
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.data-table th {
    padding: 14px 12px; text-align: left; white-space: nowrap;
    font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy-600);
    border-bottom: 1px solid var(--border);
}
.data-table th a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; padding: 8px 0; margin: -8px 0; }
.data-table th.sorted, .data-table th[aria-sort] { color: var(--accent); }
.data-table th abbr { text-decoration: none; }
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 16px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; }
.data-table td.num a { display: inline-block; min-width: 32px; padding: 8px 0; margin: -8px 0; }
.data-table .num-col { width: 44px; text-align: center; color: var(--navy-600); font-weight: 600; }
.data-table .right { text-align: right; }
.data-table .center { text-align: center; }
.data-table .team-cell { white-space: nowrap; font-weight: 500; }
.points {
    display: inline-grid; place-items: center; min-width: 40px; height: 34px; padding: 0 6px; border-radius: 7px;
    background: var(--navy-950); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 20px;
}
.table-card { overflow: hidden; }
.table-footer {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; color: var(--text-muted); font-size: 15px;
}
.table-empty { padding: 20px; color: var(--text-muted); }
.legend { margin-top: 16px; font-size: 14px; color: var(--text-muted); }

.group-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.group-title { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; font-size: 22px; font-weight: 700; }
.standings-compact td, .standings-compact th { padding-left: 8px; padding-right: 8px; }

/* Pager */
.pager { display: flex; flex-wrap: wrap; gap: 8px; }
.pager-item {
    display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
    color: var(--text); font-weight: 600; text-decoration: none;
}
.pager-item.active { background: var(--navy-950); border-color: var(--navy-950); color: #fff; }

/* ---------- Match rows and rounds ---------- */

.round { margin-bottom: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.round-head {
    display: flex; align-items: baseline; gap: 14px; padding: 16px 20px;
    background: #faf9f7; cursor: pointer; list-style: none;
}
.round-head::-webkit-details-marker { display: none; }
.round[open] .round-head { border-bottom: 1px solid var(--border); }
.round-name { font-family: var(--font-display); font-weight: 800; font-size: 24px; }
.round-dates { color: var(--text-muted); font-size: 15px; }
.round-chevron { margin-left: auto; align-self: center; transition: transform 0.15s ease; }
.round[open] .round-chevron { transform: rotate(180deg); }

.match-row {
    display: grid; align-items: center; gap: 8px 14px;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "when when when" "home score guest";
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    color: inherit; text-decoration: none;
}
.round-matches > .match-row:last-child { border-bottom: 0; }
.match-row:hover { background: #faf9f7; }
.match-row-when { grid-area: when; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.match-row-date { font-weight: 700; }
.match-row-time, .match-row-league { color: var(--text-muted); font-size: 14px; }
.match-row-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.match-row-home { grid-area: home; justify-content: flex-end; text-align: right; }
.match-row-guest { grid-area: guest; }
.match-row-score { grid-area: score; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.match-row-score-note { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.match-row-name { overflow: hidden; text-overflow: ellipsis; }
.winner { font-weight: 700; }

@media (min-width: 760px) {
    .match-row {
        grid-template-columns: 150px 1fr auto 1fr;
        grid-template-areas: "when home score guest";
        padding: 16px 20px;
    }
    .match-row-when { flex-direction: column; gap: 0; }
    .match-row-date { font-size: 17px; }
}

/* ---------- Project page ---------- */

.entity-head { display: flex; align-items: center; gap: 20px; }
.season-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 24px; }
.season-bar .toggle { margin-bottom: 0; }
.season-label { font-weight: 600; color: var(--navy-600); }
.project-layout { display: grid; gap: 24px; align-items: start; }
.league-list { margin: 0; padding: 0 20px 20px; list-style: none; display: grid; gap: 12px; }
.league-item {
    display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px;
    text-decoration: none; color: inherit;
}
.league-item:hover { border-color: var(--accent); }
.league-item-name { display: block; font-size: 18px; font-weight: 700; }
.league-item-meta { display: block; margin-top: 2px; font-size: 14px; color: var(--text-muted); }
.stats-card { overflow: hidden; min-width: 0; }
.stats .team-cell { white-space: normal; }
.stats td, .stats th { padding-left: 10px; padding-right: 10px; }
.stats-player { display: flex; flex-direction: column; min-width: 0; }
.stats-club { display: none; font-size: 13px; font-weight: 400; color: var(--text-muted); }
.label-short { display: none; }

/* All-time stats (request 025) */
.stats-meta { font-size: 13px; font-weight: 400; color: var(--text-muted); }
.overall-rank { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); white-space: nowrap; }
.all-time tr { scroll-margin-top: 96px; }
.all-time .row-highlight td { background: var(--accent-soft); }
.all-time .row-highlight td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.all-time .row-deleted td { color: var(--text-muted); }
.home-more { margin-top: 16px; text-align: center; }
.player-all-time { margin-top: 12px; }
.player-all-time a { color: #fff; font-weight: 600; }

/* Phones: every table's key numbers stay on screen without scrolling sideways. */
@media (max-width: 599px) {
    .tab { margin-right: 8px; padding: 10px 4px 12px; font-size: 16px; }
    .standings .col-goals { display: none; }
    .standings td, .standings th { padding-left: 6px; padding-right: 6px; }
    .standings .num-col { width: 28px; }
    .standings .team-col, .stats .team-col { width: 100%; max-width: 0; }
    .standings .team-cell { display: flex; min-width: 0; }
    .standings .team-cell > :first-child { flex: none; }
    .standings .team-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .standings .points { min-width: 32px; height: 28px; font-size: 17px; }
    .stats .col-club { display: none; }
    .all-time .col-age, .all-time .stats-meta { display: none; }
    .stats-club { display: block; }
    .stats .label-long { display: none; }
    .stats .label-short { display: inline; }
    .stats td, .stats th { padding-left: 6px; padding-right: 6px; }
    .stats th { letter-spacing: 0.02em; }
    .stats th:not(.sorted) .icon { display: none; }
    .stats td { font-size: 15px; }
    /* A player's matches: each row as a small card, date on top and "Home 3:1 Guest" below. */
    .history thead { display: none; }
    .history, .history tbody { display: block; }
    .history tr { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
    .history tr:last-child { border-bottom: 0; }
    .history td { display: block; padding: 0; border: 0; }
    .history td:first-child, .history td:last-child { grid-column: 1 / -1; }
    .history td:first-child { white-space: normal; }
    .history td .history-league { white-space: normal; }
    .history td:last-child:not(:has(.mom-pill)) { display: none; }
    /* Two project cards per row, so the projects don't take several screens. */
    .project-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .project-card-cover { height: 110px; }
    .project-card-badge { width: 72px; height: 72px; font-size: 20px; }
    .project-card-body { padding: 10px 12px 12px; }
    .project-card-name { font-size: 16px; }
    .project-card-meta { font-size: 13px; }
}

@media (min-width: 1100px) {
    .project-layout { grid-template-columns: minmax(240px, 1fr) 3fr; }
}

/* ---------- Cup bracket ---------- */

.bracket {
    display: grid; gap: 24px; align-items: center;
    grid-template-columns: repeat(var(--columns), minmax(260px, 1fr));
    overflow-x: auto; padding-bottom: 8px;
}
.bracket-col { display: flex; flex-direction: column; gap: 16px; align-self: stretch; }
.bracket-matches { display: flex; flex: 1; flex-direction: column; justify-content: space-around; gap: 16px; }
.bracket-round { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-600); }
.bracket-third { margin-top: 12px; }
.bracket-match {
    display: block; overflow: hidden;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    color: inherit; text-decoration: none;
}
.bracket-match:hover { border-color: var(--navy-600); }
.bracket-match-final { border: 3px solid var(--navy-950); }
.bracket-match-head {
    display: flex; justify-content: space-between; padding: 8px 14px;
    background: #faf9f7; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-muted);
}
.bracket-team { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 17px; }
.bracket-team + .bracket-team { border-top: 1px solid var(--border); }
.bracket-team-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket-score {
    display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 6px;
    background: #ebeae6; font-family: var(--font-display); font-weight: 800; font-size: 19px;
}
.bracket-team.winner .bracket-score { background: var(--navy-950); color: #fff; }
.champion {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px;
    border-radius: var(--radius); background: var(--navy-950); color: #fff; text-align: center;
}
.champion .icon { color: var(--accent-bright); }
.champion-label { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate-200); }
.champion-name { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.05; }
.bracket-lists { margin-top: 32px; }

/* ---------- Match page ---------- */

.match-page { max-width: 760px; margin: 0 auto; }
.match-head {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    margin: 0 calc(var(--gutter) * -1) 20px; padding: 22px var(--gutter) 24px;
    background: var(--navy-950); color: #fff; text-align: center;
}
.match-head-meta { color: var(--slate-200); font-size: 15px; }
.match-head-teams {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
    width: 100%; margin: 16px 0 10px;
}
.match-head-team { display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.match-head-team .badge { border: 3px solid #fff; }
.match-head-score { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.big-score { font-family: var(--font-display); font-weight: 800; font-size: 72px; line-height: 1; font-variant-numeric: tabular-nums; }
.big-score-sep { margin: 0 8px; color: var(--navy-600); }
.big-score-pending { font-size: 40px; }
.shootout { font-size: 14px; color: var(--slate-200); }
.status-pill {
    padding: 4px 14px; border-radius: 999px; background: var(--navy-800);
    font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate-200);
}
.status-live { background: var(--negative); color: #fff; }
.btn-youtube {
    width: 100%; max-width: 560px; margin-top: 18px; min-height: 52px; border-radius: 999px;
    background: var(--youtube); color: #fff; font-size: 18px; font-weight: 700;
}
.btn-youtube:hover { background: #a80000; }

.mom-card {
    display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 16px 20px;
    border-radius: var(--radius); background: var(--accent-soft); color: var(--text); text-decoration: none;
}
.mom-card > .icon { color: var(--accent); }
.mom-label { display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.mom-name { display: block; font-size: 20px; font-weight: 700; }
.mom-arrow { margin-left: auto; }

.match-tab-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.match-tab-list .tab { margin: 0; text-align: center; }
.match-panel { display: none; }
#tab-sazetak:checked ~ .panel-sazetak,
#tab-postava:checked ~ .panel-postava,
#tab-suci:checked ~ .panel-suci { display: block; }
#tab-sazetak:checked ~ .match-tab-list [for="tab-sazetak"],
#tab-postava:checked ~ .match-tab-list [for="tab-postava"],
#tab-suci:checked ~ .match-tab-list [for="tab-suci"] { color: var(--text); border-bottom-color: var(--accent); }
#tab-sazetak:focus-visible ~ .match-tab-list [for="tab-sazetak"],
#tab-postava:focus-visible ~ .match-tab-list [for="tab-postava"],
#tab-suci:focus-visible ~ .match-tab-list [for="tab-suci"] { outline: 2px solid var(--accent); }
.match-panel .section-title { margin-top: 24px; }

.events { margin: 0; padding: 0; list-style: none; }
.event { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.event:last-child { border-bottom: 0; }
.event-minute { width: 40px; flex: none; font-weight: 700; color: var(--navy-600); font-size: 18px; }
.event-bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--badge); }
.event-body { flex: 1; min-width: 0; }
.event-player { display: block; font-size: 18px; font-weight: 700; }
.event-detail { display: block; font-size: 14px; color: var(--text-muted); }
.event-type { font-size: 13px; font-weight: 600; color: var(--navy-600); text-align: right; }
.event-type::before { content: ""; display: inline-block; width: 10px; height: 14px; margin-right: 6px; border-radius: 2px; vertical-align: -2px; background: transparent; }
.event-yellow_card::before { background: #facc15; }
.event-red_card::before { background: var(--negative); }

.lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 18px 20px; }
.lineup-team { margin-bottom: 8px; font-size: 17px; font-weight: 700; color: var(--badge); }
.lineup-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.lineup-list li { display: flex; align-items: baseline; gap: 8px; }
.lineup-bench { color: var(--text-muted); }
.lineup-bench:first-of-type, .lineup-list li:not(.lineup-bench) + .lineup-bench { margin-top: 10px; }
.shirt { min-width: 22px; font-weight: 700; color: var(--navy-600); font-variant-numeric: tabular-nums; }
.lineup-note { font-size: 12px; color: var(--positive); font-weight: 600; }

.vote { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
.vote[hidden] { display: none; }
.vote-label { font-size: 14px; color: var(--text-muted); }
.vote-stars { display: inline-flex; flex-direction: row-reverse; }
.vote-star {
    padding: 2px 3px; border: 0; background: none; cursor: pointer;
    font-size: 26px; line-height: 1; color: #d6d3cd;
}
/* Hovering a star lights it and the ones before it (the row is reversed, so "before" is "after" in the DOM). */
.vote-stars:not(:has(:disabled)) .vote-star:hover,
.vote-stars:not(:has(:disabled)) .vote-star:hover ~ .vote-star,
.vote-star.on { color: var(--accent); }
.vote-star:disabled { cursor: default; }
.vote-msg { font-size: 14px; font-weight: 600; color: var(--navy-600); }

.officials { margin: 0; padding: 0; list-style: none; }
.official { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.official:last-child { border-bottom: 0; }
.official-role { grid-column: 1 / -1; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy-600); }
.official-name { font-size: 18px; font-weight: 600; }

@media (min-width: 1024px) {
    .match-head { margin: 0 0 20px; border-radius: 20px; }
}

/* ---------- Player profile ---------- */

.player-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; margin-bottom: 24px; padding: 28px;
    border-radius: 20px; background: var(--navy-950); color: #fff;
}
.player-photo { padding: 4px; border-radius: 50%; border: 4px solid var(--accent-bright); }
.player-photo .avatar-initials { background: var(--navy-800); color: var(--slate-200); }
.player-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-family: var(--font-display); font-weight: 800; font-size: clamp(36px, 7vw, 56px); line-height: 1; }
.player-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 10px; font-size: 18px; color: var(--slate-200); }
.player-meta strong { color: #fff; }
.result-legend { display: flex; gap: 16px; font-size: 14px; color: var(--text-muted); }
.result-w { color: #0f766e; } .result-d { color: var(--navy-600); } .result-l { color: var(--negative); }
.history .row-link { color: inherit; text-decoration: none; }
.history .row-link:hover strong { text-decoration: underline; }
/* The date link stretches over its whole row (request 015): a click anywhere on the row opens the match. */
.history tr { position: relative; }
.history .row-link::after { content: ""; position: absolute; inset: 0; }
.history tbody tr:hover { background: var(--bg); }
.history-league { display: block; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.history .own-team { font-weight: 700; }
.result {
    display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 8px; border-radius: 6px;
    color: #fff; font-size: 13px; font-weight: 700; vertical-align: middle;
}
.result.result-w { background: #0f766e; color: #fff; }
.result.result-d { background: var(--navy-600); color: #fff; }
.result.result-l { background: var(--negative); color: #fff; }
.mom-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; white-space: nowrap;
    background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}

/* ---------- Teams ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.search-field {
    flex: 1 1 280px; display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 48px;
    border: 1px solid #d6d3cd; border-radius: 10px; background: var(--surface); color: var(--text-muted);
}
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); }
.search-field:focus-within { border-color: var(--accent); }
.filters select {
    min-height: 48px; padding: 0 14px; border: 1px solid #d6d3cd; border-radius: 10px; background: var(--surface); font: inherit;
}
.teams td:first-child { width: 100%; }

/* ---------- Partners ---------- */

.partner-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.partner-card { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.partner-logo { display: grid; place-items: center; height: 170px; padding: 20px; background: #faf9f7; }
.partner-logo img { max-height: 130px; width: auto; object-fit: contain; }
.partner-logo-name { font-family: var(--font-display); font-weight: 800; font-size: 28px; color: var(--navy-600); }
.partner-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px 20px 20px; }
.partner-name { font-size: 22px; font-weight: 700; }
.partner-name a { color: inherit; text-decoration: none; }
.partner-name a:hover { color: var(--accent); }
.partner-description { margin-top: 2px; color: var(--text-muted); }

/* ---------- News ---------- */

.news-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.news-tile {
    display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
    color: inherit; text-decoration: none;
}
.news-tile-image { display: block; aspect-ratio: 16 / 9; background: #ebeae6; }
.news-tile-image img { width: 100%; height: 100%; object-fit: cover; }
.news-tile-placeholder {
    display: grid; place-items: center; width: 100%; height: 100%;
    background: var(--badge); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 40px;
}
.news-tile-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 20px; }
.news-tile-meta { font-size: 13px; color: var(--text-muted); }
.news-tile-title { font-size: 20px; font-weight: 700; line-height: 1.2; }
.news-tile:hover .news-tile-title { color: var(--accent); }
.news-tile-summary { color: var(--navy-600); }

.article { max-width: 760px; margin: 0 auto; }
.article-head { margin-bottom: 20px; }
.article-summary { margin-top: 12px; font-size: 20px; color: var(--navy-600); }
.article-author { margin-top: 10px; font-weight: 600; }
.article-image { width: 100%; margin-bottom: 24px; border-radius: var(--radius); }
.article-body { font-size: 18px; line-height: 1.65; }
.article-body > * + * { margin-top: 1em; }
.article-body h2, .article-body h3 { margin-top: 1.5em; }
.article-body a { color: var(--accent); }
.article-body img { border-radius: var(--radius-sm); }
.article-body blockquote { margin: 1em 0; padding-left: 16px; border-left: 4px solid var(--border); color: var(--navy-600); }
.article-body table { border-collapse: collapse; }
.article-body td, .article-body th { padding: 6px 10px; border: 1px solid var(--border); }
.article-updated { margin-top: 24px; font-size: 14px; color: var(--text-muted); }
/* News gallery (request 019): a grid of 256 px thumbnails, gallery.js shows the 800 px pictures. */
.article-gallery { margin-top: 32px; }
.article-gallery-title { margin-bottom: 12px; font-size: 22px; font-weight: 700; }
.gallery-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(45%, 160px), 1fr)); padding: 0; list-style: none; }
.gallery-grid a { display: block; }
.gallery-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }
.gallery-viewer { max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; padding: 0; border: 0; background: rgb(0 0 0 / 0.92); color: #fff; }
.gallery-viewer[open] { display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.gallery-viewer::backdrop { background: rgb(0 0 0 / 0.7); }
.gallery-viewer img { grid-column: 2; max-width: 100%; max-height: calc(100vh - 96px); margin: auto; object-fit: contain; }
.gallery-viewer button { width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.12); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.gallery-viewer button:hover { background: rgb(255 255 255 / 0.25); }
.gallery-viewer button[hidden] { visibility: hidden; display: block; }
.gallery-prev { grid-column: 1; margin-left: 8px; }
.gallery-next { grid-column: 3; margin-right: 8px; }
.gallery-close { position: absolute; top: 12px; right: 12px; }
.gallery-counter { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-size: 14px; }

/* ---------- Logged in: sidebar user card, top bar ---------- */

.user-menu { position: relative; }
.user-card {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
    background: var(--navy-800); color: #fff; cursor: pointer; list-style: none;
}
.user-card::-webkit-details-marker { display: none; }
.user-avatar {
    display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
    background: var(--accent); color: #fff; font-weight: 700;
}
.user-text { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 13px; color: var(--slate-400); }
.user-more { margin-left: auto; color: var(--slate-400); }
.user-menu-items {
    position: absolute; left: 0; right: 0; bottom: calc(100% + 6px);
    padding: 6px; border-radius: 12px; background: var(--navy-800); box-shadow: 0 8px 24px rgb(0 0 0 / 0.35);
}
.user-menu-items form { margin: 0; }
.user-menu-item {
    display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px;
    background: none; color: var(--slate-200); text-align: left; text-decoration: none; font-weight: 600; cursor: pointer;
}
.user-menu-item:hover { background: rgb(255 255 255 / 0.06); color: #fff; }
.topbar-user {
    display: grid; place-items: center; width: 36px; height: 36px; margin-left: auto; border-radius: 50%;
    background: var(--accent); color: #fff; font-weight: 700; text-decoration: none;
}

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field input:not([type="file"]) {
    min-height: 48px; padding: 0 14px; border: 1px solid #d6d3cd; border-radius: 10px;
    background: var(--surface); font: inherit; color: var(--text);
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(194 65 12 / 0.15); }
.field .invalid { border-color: var(--negative); }
.field-hint { font-size: 13px; color: var(--text-muted); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: default; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Login (Prijava) ---------- */

.login { display: grid; min-height: 100vh; }
.login-hero {
    display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    padding: 32px var(--gutter); background: var(--navy-950); color: #fff;
}
.login-brand { display: flex; align-items: center; gap: 16px; color: #fff; text-decoration: none; }
.login-brand img { border-radius: 50%; background: #fdfdfd; }
.login-brand span { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: 0.03em; text-transform: uppercase; }
.login-headline {
    font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
    font-size: clamp(36px, 7vw, 76px); line-height: 0.95;
}
.login-headline span { color: var(--accent-bright); }
.login-projects { margin-top: 18px; max-width: 34em; font-size: 18px; color: var(--slate-200); }
.login-panel { display: grid; place-items: center; padding: 40px var(--gutter); background: var(--bg); }
.login-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.login-title { font-family: var(--font-display); font-weight: 800; font-size: 44px; text-transform: uppercase; line-height: 1; }
.login-lead { color: var(--text-muted); }
.login-help { text-align: center; color: var(--text-muted); }
.login-rule { width: 100%; border: 0; border-top: 1px solid var(--border); margin: 0; }
.login-skip { text-align: center; font-weight: 600; color: var(--text); text-underline-offset: 3px; }

@media (min-width: 900px) {
    .login { grid-template-columns: 1fr 1fr; }
    .login-hero { padding: 56px 64px; }
}

/* ---------- Own account ---------- */

.account-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); align-items: start; }
.account-card { padding-bottom: 20px; }
.account-card > *:not(.card-title) { margin-left: 20px; margin-right: 20px; }
.account-card .form { margin-top: 4px; }
.account-card .notice { margin-top: 16px; }
.account-profile { display: flex; align-items: center; gap: 18px; }
.account-name { font-size: 22px; font-weight: 700; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.account-card .field-hint { display: block; margin-top: 8px; }

/* ---------- Shared controls for the logged-in screens ---------- */

.btn-small { min-height: 34px; padding: 0 12px; font-size: 14px; border-color: var(--border); background: var(--surface); color: var(--text); }
.btn-small.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { background: var(--negative); border-color: var(--negative); color: #fff; }
.btn-outline { border: 1px dashed var(--accent); background: var(--accent-soft); color: var(--accent); }
.btn-light { background: #fff; color: var(--text); }
.btn-dark-outline { border-color: var(--navy-600); background: transparent; color: #fff; }
.link-button { border: 0; background: none; padding: 10px 0; margin: -10px 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }
.icon-button {
    display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none;
    border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--navy-600); cursor: pointer;
}
.icon-button:hover { color: var(--accent); border-color: var(--accent); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.check-inline { display: inline-flex; margin-left: auto; font-size: 13px; color: var(--text-muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field select, .admin-panel select, .field input[type="number"] {
    min-height: 44px; padding: 0 12px; border: 1px solid #d6d3cd; border-radius: 10px; background: var(--surface); font: inherit; color: var(--text);
}
.field-label { font-weight: 600; font-size: 15px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 12px; background: var(--surface-muted); }
.segment { min-height: 42px; border: 0; border-radius: 9px; background: none; font-weight: 600; cursor: pointer; }
.segment.active { background: var(--navy-950); color: #fff; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 90; background: rgb(15 23 42 / 0.55); }
.dialog {
    position: fixed; z-index: 91; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto;
    display: flex; flex-direction: column; gap: 16px; padding: 22px;
    border-radius: 16px; background: var(--bg); box-shadow: 0 20px 60px rgb(0 0 0 / 0.35);
}
/* Without this the flex column squeezes its sections to fit the max height, and nothing scrolls. */
.dialog > * { flex-shrink: 0; }
.dialog-title { font-size: 22px; font-weight: 700; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Officials' match screen (Zapisnik utakmice) ---------- */

.admin-match { display: grid; gap: 24px; align-items: start; }
.admin-match-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.admin-head { margin: 0; border-radius: 20px; }
.admin-head .match-head-teams { margin: 12px 0 0; }
.admin-mom { margin-top: 14px; }
.admin-tabs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.admin-tabs .tabs { margin-bottom: 0; flex: 1; }
.admin-tabs .tab { background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; }

.admin-events { margin: 0; padding: 8px 0; list-style: none; }
.admin-event {
    display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 12px;
    padding: 10px 16px;
}
.admin-event-side { display: flex; flex-direction: column; min-width: 0; }
.admin-event-home .admin-event-side { grid-column: 1; text-align: right; }
.admin-event-guest .admin-event-side { grid-column: 3; grid-row: 1; }
.admin-event-mid { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 10px; }
.admin-event .icon-button { grid-column: 4; grid-row: 1; }
.admin-event .event-minute { width: auto; }
@media (max-width: 599px) {
    /* One column on phones: minute and score, then who, then edit; the edge colour tells the side. */
    .admin-event { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; border-left: 3px solid var(--navy-950); }
    .admin-event-guest { border-left-color: var(--accent); }
    .admin-event-mid { grid-column: 1; grid-row: 1; }
    .admin-event-home .admin-event-side, .admin-event-guest .admin-event-side { grid-column: 2; grid-row: 1; text-align: left; }
    .admin-event .icon-button { grid-column: 3; }
}

.admin-panel {
    display: flex; flex-direction: column; gap: 14px; padding: 20px;
    border-radius: 20px; background: var(--navy-950); color: #fff;
}
.admin-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-panel-title { font-size: 21px; font-weight: 700; }
.pill-accent-dark { background: var(--accent); color: #fff; }
.admin-label { font-size: 14px; color: var(--slate-200); margin-bottom: -6px; }
.admin-clock {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px;
    border-radius: 14px; background: var(--navy-800); text-align: center;
}
.admin-clock-label { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate-200); }
.admin-clock-time { font-family: var(--font-display); font-weight: 800; font-size: 64px; line-height: 1; font-variant-numeric: tabular-nums; }
.admin-clock .link-button { color: var(--slate-400); margin-top: 6px; }
.admin-clock-edit { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.admin-clock-edit input, .admin-score-row input { width: 64px; min-height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--navy-600); background: var(--navy-950); color: #fff; font: inherit; }
.admin-status { width: 100%; min-height: 48px; font-weight: 700; }
.admin-panel .admin-status { background: var(--navy-800); color: #fff; border-color: var(--navy-600); }
.admin-panel .admin-status.finished { background: #0f766e; border-color: #0f766e; }
.admin-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: #fde68a; }
.admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin-action {
    display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 12px; text-align: left;
    border: 1px solid var(--navy-600); border-radius: 10px; background: var(--navy-800); color: #fff;
    font: inherit; font-weight: 600; line-height: 1.15; cursor: pointer;
}
.admin-action:hover:not(:disabled) { border-color: var(--accent-bright); }
.admin-action:disabled { opacity: 0.6; }
.admin-action-wide { grid-column: 1 / -1; justify-content: center; }
.admin-action-wide .icon { color: var(--accent-bright); }
.admin-action-mark { width: 12px; height: 18px; flex: none; border-radius: 3px; border: 2px solid var(--slate-200); }
.mark-goal .admin-action-mark, .mark-own-goal .admin-action-mark { width: 18px; border-radius: 50%; }
.mark-own-goal .admin-action-mark { border-color: #f87171; }
.mark-penalty .admin-action-mark, .mark-missed .admin-action-mark { width: 16px; height: 12px; border-radius: 2px; }
.mark-missed .admin-action-mark { border-color: #f87171; }
.mark-yellow .admin-action-mark { background: #facc15; border-color: #facc15; }
.mark-red .admin-action-mark { background: var(--negative); border-color: var(--negative); }
.mark-injury .admin-action-mark { border: 0; background: linear-gradient(#ef4444, #ef4444) center / 100% 5px no-repeat, linear-gradient(#ef4444, #ef4444) center / 5px 100% no-repeat; width: 16px; height: 16px; }
.mark-two-min .admin-action-mark { border: 0; width: auto; height: auto; }
.mark-two-min .admin-action-mark::before { content: "2'"; font-weight: 800; }
.admin-inline-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--navy-800); }
.admin-inline-form select { width: 100%; background: var(--navy-950); color: #fff; border-color: var(--navy-600); }
.admin-inline-actions { display: flex; gap: 8px; }
.admin-score summary { cursor: pointer; color: var(--slate-200); font-size: 14px; }
.admin-score[open] summary { margin-bottom: 10px; }
.admin-score-row { display: flex; align-items: center; gap: 8px; }
.admin-score .check { color: var(--slate-200); font-size: 14px; }
.admin-message { padding: 10px 12px; border-radius: 10px; background: rgb(15 118 110 / 0.25); font-size: 14px; }
.admin-message-error { background: rgb(185 28 28 / 0.3); }
.admin-entry { margin-bottom: 20px; }

.lineup-editor { padding-bottom: 16px; }
.lineup-editor-teams { display: grid; gap: 20px; padding: 0 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.lineup-table td, .lineup-table th { padding: 8px 6px; font-size: 15px; }
.lineup-table input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.shirt-input { width: 60px; min-height: 36px; padding: 0 6px; border: 1px solid #d6d3cd; border-radius: 8px; font: inherit; }
.lineup-editor-actions, .lineup-editor .notice { margin: 16px 16px 0; }

@media (min-width: 1200px) {
    .admin-match { grid-template-columns: minmax(0, 1fr) 360px; }
    .admin-panel { position: sticky; top: 24px; }
}
@media (max-width: 1199px) {
    /* At the pitch the controls come first. */
    .admin-panel { order: -1; }
}

/* ---------- Admin lists and dialogs ---------- */

.pill-soft-active { background: #dcfce7; color: #166534; letter-spacing: 0; text-transform: none; font-size: 14px; }
.pill-soft-inactive { background: #ebeae6; color: var(--navy-600); letter-spacing: 0; text-transform: none; font-size: 14px; }
.docs { font-weight: 700; }
.docs-done { color: #0f766e; }
.docs-missing { color: var(--accent); }
.admin-players td { vertical-align: middle; }
.danger { color: var(--negative); }
.push-right { margin-left: auto; }

.dialog-wide { width: min(760px, calc(100vw - 24px)); background: var(--surface); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.dialog-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.player-form { display: grid; gap: 22px; }
.player-form-side { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.player-form-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.field input:not([type="file"]):not([type="checkbox"]) { width: 100%; }
.field select { width: 100%; }
.check-box { justify-content: space-between; align-self: stretch; padding: 14px 16px; border-radius: 12px; background: var(--bg); font-weight: 600; }
.check-box input { width: 22px; height: 22px; }
.docs-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.docs-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: #faf9f7; border-bottom: 1px solid var(--border); }
.docs-card-head h3 { font-size: 18px; font-weight: 700; }
.docs-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 17px; }
.docs-row:last-child { border-bottom: 0; }
.docs-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: #0f766e; }
.docs-row a { color: var(--text); overflow-wrap: anywhere; }

.news-editor { display: grid; gap: 20px; align-items: start; }
.news-editor-main, .news-editor-side { display: flex; flex-direction: column; gap: 16px; padding: 20px; min-width: 0; }
.news-editor textarea {
    width: 100%; padding: 12px 14px; border: 1px solid #d6d3cd; border-radius: 10px; background: var(--surface);
    font: inherit; color: var(--text); resize: vertical;
}
.news-body { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 15px; line-height: 1.55; min-height: 360px; }
.news-preview { min-height: 360px; padding: 4px 2px; }
.news-editor .tabs { margin-bottom: 0; }
.news-editor .tab { background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; }
.news-editor-image { width: 100%; height: auto; border-radius: var(--radius-sm); }
@media (min-width: 1100px) {
    .news-editor { grid-template-columns: minmax(0, 1fr) 320px; }
}

.th-sort { display: inline-flex; align-items: center; gap: 4px; padding: 8px 0; margin: -8px 0; border: 0; background: none; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.color-row { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.color-row input[type="color"] { width: 56px; height: 40px; padding: 2px; border: 1px solid #d6d3cd; border-radius: 8px; background: var(--surface); }

@media (min-width: 760px) {
    .player-form { grid-template-columns: 200px 1fr; }
}

.header-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-section-title { margin-top: 28px; }
.admin-section-title:first-of-type { margin-top: 0; }
.admin-round { margin-bottom: 16px; padding: 0; overflow: hidden; }
.admin-round .round-head { cursor: default; border-bottom: 1px solid var(--border); }
.admin-round .round-name { font-size: 20px; }
.admin-round td { vertical-align: middle; }
.admin-round td .pill { margin-left: 8px; }
@media (max-width: 599px) {
    /* A league's matches for admins: each as a small card, so the "Zapisnik" and edit buttons stay on screen. */
    .admin-matches, .admin-matches tbody { display: block; }
    .admin-matches tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
    .admin-matches tr:last-child { border-bottom: 0; }
    .admin-matches td { display: block; padding: 0; border: 0; }
    .admin-matches td:nth-child(1) { grid-row: 1; grid-column: 1; }
    .admin-matches td:nth-child(4) { grid-row: 1; grid-column: 2; text-align: right; }
    .admin-matches td:nth-child(2) { grid-row: 2; grid-column: 1; font-weight: 600; }
    .admin-matches td:nth-child(3) { grid-row: 2; grid-column: 2; }
    .admin-matches td:nth-child(5) { grid-row: 3; grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 599px) {
    /* A season's leagues for admins: name and half length on one line, the buttons below. */
    .admin-leagues, .admin-leagues tbody { display: block; }
    .admin-leagues tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
    .admin-leagues tr:last-child { border-bottom: 0; }
    .admin-leagues td { display: block; padding: 0; border: 0; }
    .admin-leagues td:nth-child(3) { grid-column: 1 / -1; text-align: left; white-space: normal; }
}
.officials-form { display: grid; gap: 14px; padding: 16px; }
.draw-card { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; padding: 18px 20px; }
.draw-head { font-size: 17px; font-weight: 700; }
.draw-fields { display: grid; gap: 12px 16px; align-items: end; }
.draw-label { font-size: 14px; font-weight: 600; }
.draw-link { display: flex; gap: 6px; min-width: 0; }
.draw-link select:first-child { flex: 1; min-width: 0; }
.draw-link select:last-child { flex: 0 0 auto; width: auto; }
.draw-link select { min-height: 44px; padding: 0 8px; border: 1px solid #d6d3cd; border-radius: 10px; background: var(--surface); font: inherit; }
.draw-save { display: flex; justify-content: flex-end; }
.draw-steps { display: grid; gap: 6px; margin: 0 0 20px; padding-left: 20px; font-size: 15px; }
.draw-steps .icon { vertical-align: -2px; }
.draw-round-section { margin-bottom: 28px; }
.draw-round-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.draw-round-title { font-family: var(--font-display); font-weight: 800; font-size: 26px; }
.draw-round-name { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.draw-round-name select { min-height: 44px; padding: 0 10px; border: 1px solid #d6d3cd; border-radius: 10px; background: var(--surface); font: inherit; font-weight: 400; }
.draw-card-head { display: flex; align-items: center; gap: 10px; }
.draw-card-head[draggable="true"] { cursor: grab; }
.draw-grip { display: inline-grid; place-items: center; width: 28px; height: 36px; border-radius: 6px; color: var(--text-muted); }
.draw-card-head[draggable="true"]:hover .draw-grip { background: var(--bg); color: var(--text); }
.draw-number { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--navy-600); }
.draw-head { flex: 1; min-width: 0; }
.draw-date { margin-left: 6px; font-size: 14px; font-weight: 400; color: var(--text-muted); }
.draw-arrows { display: flex; gap: 2px; }
.draw-card.dragging { opacity: 0.45; }
.draw-card.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }
.draw-round-grab { display: flex; align-items: center; gap: 8px; }
.draw-round-grab[draggable="true"] { cursor: grab; }
.draw-round-grab[draggable="true"]:hover .draw-grip { background: var(--surface); color: var(--text); }
.draw-round-section.dragging { opacity: 0.45; }
.draw-round-section.drop-target { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: 8px; }
/* Ordered admin lists (projects, groups, gallery): OrderArrows plus DragOrder. */
.order-cell { width: 1%; white-space: nowrap; }
.order-cell .draw-arrows, .order-cell .draw-grip { display: inline-flex; vertical-align: middle; }
tr[draggable="true"] .draw-grip { cursor: grab; }
.data-table tr.dragging, .gallery-item.dragging { opacity: 0.45; }
.data-table tr.drop-target, .gallery-item.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
@media (min-width: 900px) {
    .draw-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
}

.admin-form-card { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; padding: 20px; }
.admin-subtitle { font-size: 16px; font-weight: 700; }
.phase-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; }
.phase-head .field { flex: 1 1 240px; }
.phase-head .check { align-self: center; }
.phase-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 4px 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); font-size: 14px; font-weight: 600; }
.chip-remove { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-muted); cursor: pointer; }
.chip-remove:hover { background: var(--border); color: var(--negative); }
.inline-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-add input:not(.shirt-input), .inline-add select { flex: 1 1 200px; min-width: 0; min-height: 36px; padding: 0 10px; border: 1px solid #d6d3cd; border-radius: 8px; background: var(--surface); font: inherit; }
.group-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.group-head input { flex: 1 1 160px; min-height: 36px; padding: 0 10px; border: 1px solid #d6d3cd; border-radius: 8px; font: inherit; font-weight: 700; }
.round-names { display: flex; flex-direction: column; gap: 8px; }

@media (min-width: 640px) {
    .officials-form { grid-template-columns: 1fr 1fr; }
    .officials-wide { grid-column: 1 / -1; }
}

/* ---------- Blazor's own UI ---------- */

#blazor-error-ui {
    display: none;
    position: fixed; left: 0; bottom: 0; z-index: 1000;
    width: 100%; padding: 12px 48px 12px 20px;
    background: #fdf2f2; color: var(--negative);
    box-shadow: 0 -1px 2px rgb(0 0 0 / 0.2);
}
#blazor-error-ui .reload { margin-left: 8px; font-weight: 600; }
#blazor-error-ui .dismiss { position: absolute; right: 16px; top: 8px; font-size: 22px; cursor: pointer; }

.blazor-error-boundary { padding: 14px 16px; border-radius: var(--radius); background: #fdf2f2; color: var(--negative); }
.blazor-error-boundary::after { content: "Došlo je do pogreške."; }

.validation-message { color: var(--negative); font-size: 14px; }
.officials-edit { margin-bottom: 16px; }

/* Officials' votes (admin, request 018) */
.votes .vote-excluded td { color: var(--text-muted); }
.votes .vote-excluded strong { text-decoration: line-through; }
.vote-by { display: block; margin-top: 4px; font-size: 13px; color: var(--text-muted); }

/* News editor gallery (admin, request 019) */
.news-gallery-editor { margin-top: 24px; padding: 20px; }
.news-gallery-editor .card-head { padding: 0 0 12px; }
.gallery-admin { margin-bottom: 16px; }
.gallery-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.gallery-item[draggable="true"] { cursor: grab; }
.gallery-item img { border-radius: 0; }
.gallery-item-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; padding: 4px; }

/* Footer and contact page (request 017) */
.site-footer { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-muted); }
.footer-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.footer-brand { display: flex; flex-direction: column; gap: 2px; }
.footer-brand strong { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.04em; color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a, .footer-copy a { color: var(--text); text-decoration: none; }
.footer-links a:hover, .footer-copy a:hover { text-decoration: underline; }
.footer-links a { display: inline-block; padding: 10px 0; }
.social-links { display: flex; gap: 8px; padding: 0; list-style: none; }
.social-links a { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 50%; color: var(--text); }
.social-links a:hover { border-color: var(--accent); color: var(--accent); }
.footer-copy { margin-top: 16px; }
.contact-layout { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.contact-card { display: flex; flex-direction: column; gap: 12px; padding: 24px; line-height: 1.6; }
.contact-card a { color: var(--accent); }
.contact-list { display: flex; flex-direction: column; gap: 10px; padding: 0; list-style: none; }
.contact-list li { display: flex; align-items: center; gap: 10px; }

/* Team page and team links (request 021) */
.team-link { color: inherit; text-decoration: none; }
.team-link:hover { text-decoration: underline; }
/* Matches left, leagues and players right; capped so a team with little data doesn't stretch across a wide screen. */
.team-layout { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); align-items: start; max-width: 1100px; }
.team-column { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.team-column .card { overflow: hidden; }
.roster { margin: 0; padding: 0; list-style: none; }
.roster-player { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--border); }
/* The name's link covers the whole row: an easy tap on a phone. */
.roster-player .player-link::after { content: ""; position: absolute; inset: 0; }
.roster-player:has(.player-link):hover { background: var(--bg); }
.roster-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-player .player-link { color: inherit; }
.roster-age { font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.share-button { position: relative; }
.share-button[hidden] { display: none; }
.share-msg:not(:empty) { position: absolute; top: calc(100% + 6px); right: 0; padding: 4px 10px; border-radius: 6px; background: var(--navy-950); color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; z-index: 5; }
.match-share { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: -8px 0 20px; }
.article-head .share-button { margin-top: 16px; }
.team-players { grid-column: 1; overflow: hidden; }

/* Team search (request 023): typing a team's name instead of a list of every team. */
.team-search { position: relative; min-width: 0; }
/* Only in the filter row does it share the width; in a column (dialogs, league settings) it keeps its own height. */
.filters .team-search { flex: 1 1 260px; }
.team-search .search-field { min-height: 40px; }
.team-search-hits { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 320px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgb(15 23 42 / 0.12); }
.team-search-hit { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.team-search-hit:hover, .team-search-hit.active { background: var(--bg); }
.team-search-note { margin-top: 6px; font-size: 14px; color: var(--text-muted); }
.add-team { display: flex; flex-direction: column; gap: 10px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 6px 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
/* In a dialog (which scrolls) the hits push the content down instead of hanging over the dialog's edge. */
.dialog .team-search-hits { position: static; margin-top: 4px; box-shadow: none; }
.official-picker { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.official-picker .filter-chip { align-self: flex-start; }
