/*
  Soccer4Fun — vizuální identita "Dva týmy, jeden míč"
  ------------------------------------------------------------
  Subjekt: amatérský fotbal, správa klubů a týmů, volné termíny na přátelák.
  Směr: přátelský, barevný "MudBlazor"-styl vycházející přímo z loga
  hrajemefotbal.cz — travnatě zelená jako hlavní barva, mátové pozadí
  stránky (stejný tón jako karta loga), zaoblené karty s měkkým stínem.
  Signature prvek: tenká vlnitá duhová linka pod hlavičkovým bannerem —
  odkaz na pět barevných stuzek z ilustrace loga, použitá jen jednou.
*/

:root {
    /* Barvy — odvozeno z loga "hrajemefotbal.cz": travnatě zelená jako hlavní barva,
       mátově zelené pozadí karty loga, a pět vlnitých stuzek jako doplňkové akcenty
       (používané informativně — barva stuzky kóduje věkovou kategorii zápasu — ne dekorativně). */
    --pitch: #198754;             /* hlavní zelená — CTA, aktivní stav, logo hřiště */
    --pitch-dark: #13703f;        /* hover/aktivní tón zelené */
    --pitch-soft: #e3f5ea;        /* světlý nádech zelené — aktivní/hover pozadí, chip fill */
    --mint: #f6fbf3;              /* pozadí stránky — stejný tón jako karta loga */
    --paper: #ffffff;             /* plocha karet, postranního panelu */
    --line: #e4ece2;              /* jemné linky/okraje s nádechem zelené */
    --accent: #fd7e14;            /* tangerine stuzka — hlavní teplý CTA akcent (tlačítka, badge) */
    --accent-dark: #dd6a08;
    --focus-ring: rgba(253, 126, 20, 0.28);
    --ink: #212529;               /* hlavní text — stejná tmavá jako ve wordmarku loga */
    --ink-soft: #6c757d;          /* sekundární text — stejná šedá jako podtitulek loga */
    --success: #198754;
    --info: #0d6efd;              /* modrý hráč z loga */
    --danger: #dc3545;            /* červený hráč z loga */

    /* Stuzky loga — pětice akcentových barev, používaná k odlišení věkových kategorií
       zápasů (mládežnické/dorostenecké/dospělé), ne jako náhodná dekorace. */
    --ribbon-amber: #ffc107;
    --ribbon-tangerine: #fd7e14;
    --ribbon-magenta: #d63384;
    --ribbon-violet: #6f42c1;
    --ribbon-cyan: #0dcaf0;

    --font-display: "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, monospace;

    --radius: 16px;
    --radius-lg: 22px;
    --radius-pill: 999px;
    --shadow-1: 0 1px 2px rgba(33, 37, 41, 0.05), 0 2px 6px rgba(33, 37, 41, 0.06);
    --shadow-2: 0 4px 10px rgba(33, 37, 41, 0.07), 0 10px 24px rgba(25, 135, 84, 0.10);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--mint);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 0.5rem 0;
    color: var(--ink);
}

a {
    color: var(--info);
}

/* Focus visibility — accessibility floor */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.nav-item a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* FocusOnNavigate programmatically focuses the page's h1 on route change. Using
   :focus-visible (not :focus) keeps this ring for keyboard-driven focus only, so it
   doesn't draw a box around the headline on every page load for mouse/touch users. */
h1:focus-visible {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* ---------- Tile grid (match / club cards) — used by the two public listing pages ---------- */

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.5rem;
}

.tile-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: var(--paper);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: 1.15rem 1.25rem 1.3rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 160ms ease, transform 160ms ease;
}

.tile-card:hover {
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}

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

.tile-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
}

.tile-card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--ink);
    line-height: 1.3;
}

.tile-card-sub {
    font-size: 0.84rem;
    color: var(--ink-soft);
}

.tile-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.86rem;
    color: var(--ink-soft);
}

.tile-card-meta .meta-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tile-card-meta svg {
    flex-shrink: 0;
    opacity: 0.7;
    color: var(--pitch);
}

.tile-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: 0.2rem;
}

/* Age-category chip — colour is meaningful, not decorative: it groups match slots
   by age tier so a scanning eye can sort youth vs. adult matches at a glance. */
.category-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.category-chip.tier-mini { background: rgba(13, 202, 240, 0.14); color: #0a94ac; }
.category-chip.tier-junior { background: rgba(111, 66, 193, 0.14); color: #6f42c1; }
.category-chip.tier-youth { background: rgba(214, 51, 132, 0.14); color: #d63384; }
.category-chip.tier-adult { background: var(--pitch-soft); color: var(--pitch-dark); }

/* ---------- Demo mode toggle (top nav) ---------- */

.demo-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.demo-toggle:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
}

.demo-toggle-on {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.demo-toggle-on:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
}

/* ---------- Section heading (used by the homepage's compact match preview) ---------- */

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.6rem 0 1rem;
}

.section-heading h2 {
    font-size: 1.2rem;
    margin: 0;
}

.section-heading-link {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--pitch);
    text-decoration: none;
    white-space: nowrap;
}

.section-heading-link:hover {
    color: var(--pitch-dark);
    text-decoration: underline;
}

.demo-banner {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--accent) 14%, white);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, white);
    color: var(--ink-soft);
    font-size: 0.85rem;
}

.demo-banner svg {
    flex-shrink: 0;
    color: var(--accent);
}

.tile-card-demo {
    cursor: default;
    opacity: 0.92;
}

.tile-card-demo:hover {
    transform: none;
    box-shadow: var(--shadow-1);
}

/* ---------- Match detail page: two-column info + map layout ---------- */

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.1rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

@media (max-width: 860px) {
    .detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

.detail-info-card,
.detail-map-card {
    padding: 1.15rem 1.25rem 1.3rem;
}

.detail-fact-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.8rem 0 0;
}

.detail-fact {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--line);
}

.detail-fact:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-fact dt {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-soft);
    white-space: nowrap;
}

.detail-fact dt svg {
    flex-shrink: 0;
    color: var(--pitch);
    opacity: 0.8;
}

.detail-fact dd {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
    text-align: right;
}

.map-embed {
    position: relative;
    width: 100%;
    padding-top: 66%;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--mint);
}

.map-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- Filter rail — pill-shaped selects, used by the two public listing pages ---------- */

.filter-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: center;
    background: var(--paper);
    border-radius: var(--radius-pill);
    padding: 0.6rem 0.8rem;
    margin: 1.3rem 0 1.4rem;
    box-shadow: var(--shadow-1);
}

.filter-rail .filter-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--mint);
    border-radius: var(--radius-pill);
    padding: 0.3rem 0.3rem 0.3rem 0.9rem;
}

.filter-rail .filter-pill label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ink-soft);
    white-space: nowrap;
}

.filter-rail .filter-pill select {
    background: transparent;
    padding: 0.4rem 1.9rem 0.4rem 0.5rem;
}

.filter-rail .filter-pill select:focus {
    background-color: var(--paper);
}

.filter-rail .filter-reset {
    background: transparent;
    box-shadow: none;
    color: var(--ink-soft);
    font-size: 0.82rem;
    padding: 0.4rem 0.7rem;
    margin-left: auto;
}

.filter-rail .filter-reset:hover {
    background: var(--mint);
    color: var(--ink);
}

/* ---------- Layout shell ---------- */

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Full-width waves header: the seamless-tile background layer (logo-bg-waves-tile.svg)
   repeats horizontally to fill any viewport width, while the transparent foreground
   layer (logo-fg-transparent.svg — pitch, players, wordmark) sits centred on top.
   This is the site's signature moment, so it runs the full width of the browser
   rather than being boxed into a card like the rest of the page. */
.site-header {
    position: relative;
    width: 100%;
    overflow: hidden;
    box-shadow: var(--shadow-2);
}

.site-header-bg {
    position: absolute;
    inset: 0;
    background-repeat: repeat-x;
    background-size: auto 100%;
    background-position: left center;
}

.site-header-inner {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    height: clamp(120px, 20vw, 220px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
}

.site-header-inner a {
    display: flex;
    align-items: center;
    height: 100%;
}

.site-header-logo {
    height: 100%;
    max-height: 100%;
    width: auto;
}

/* Horizontal top navigation — replaces the old left sidebar. Sticky so the primary
   links (Zápasy / Kluby / Registrace klubu) and the login control stay reachable
   while scrolling long tile grids. */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--paper);
    box-shadow: var(--shadow-1);
}

.top-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.6rem 1.5rem;
    flex-wrap: wrap;
}

.top-nav-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--ink);
    flex-shrink: 0;
}

.top-nav-brand .crest {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    color: #fff;
    font-size: 0.92rem;
}

.top-nav-brand .brand-name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}

.top-nav-links {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-wrap: wrap;
}

.top-nav-auth {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
}

.top-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-pill);
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    background: transparent;
    box-shadow: none;
    transition: background-color 120ms ease, color 120ms ease;
}

.top-nav .nav-link svg {
    flex-shrink: 0;
    opacity: 0.75;
}

.top-nav .nav-link:hover {
    background: var(--pitch-soft);
    color: var(--pitch);
}

.top-nav .nav-link.active {
    background: var(--pitch-soft);
    color: var(--pitch);
}

.top-nav .nav-link.active svg {
    opacity: 1;
}

/* Login is a deliberate call-to-action right next to the primary links, not a
   quiet text link — it uses the tangerine accent so it reads as "start here" for
   a first-time visitor scanning the nav. */
.top-nav .nav-link-login {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-1);
}

.top-nav .nav-link-login:hover {
    background: var(--accent-dark);
    color: #fff;
}

.top-nav .nav-link-button {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.top-nav .account-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--pitch-soft);
    border-radius: var(--radius-pill);
    padding: 0.3rem 0.75rem 0.3rem 0.3rem;
}

.top-nav .account-chip .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--pitch);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.76rem;
    flex-shrink: 0;
}

.top-nav .account-chip .name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
}

.app-main {
    flex: 1;
    min-width: 0;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3rem;
    background: var(--mint);
}

@media (max-width: 720px) {
    .top-nav-inner {
        padding: 0.5rem 1rem;
    }

    .top-nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        padding-top: 0.35rem;
        border-top: 1px solid var(--line);
        margin-top: 0.35rem;
    }

    .top-nav .account-chip .name {
        display: none;
    }

    .app-main {
        padding: 1.25rem 1rem 2rem;
    }
}

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

.turf-panel {
    padding: 0.75rem 0 1.5rem;
}

.page-title-with-icon {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.page-title-icon {
    flex-shrink: 0;
    color: var(--pitch);
}

.turf-panel h1 {
    color: var(--ink);
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
}

.turf-panel p {
    color: var(--ink-soft);
    max-width: 46em;
    margin: 0;
}

/* ---------- Cards: Material-style elevation instead of borders ---------- */

.card {
    background: var(--paper);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.card-header {
    background: var(--pitch);
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.86rem;
    font-weight: 700;
    padding: 0.75rem 1.2rem;
}

.card-body {
    padding: 1rem 1.1rem;
}

/* Quick-link shortcut grid — a real navigation aid (not decoration), each tile
   opens the section it names, mirroring the reference IS's "quick links" block. */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--paper);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: 1rem 1.1rem;
    text-decoration: none;
    color: var(--ink);
    transition: box-shadow 120ms ease, transform 120ms ease;
}

.quick-link:hover {
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
}

.quick-link .quick-link-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--pitch-soft);
    color: var(--pitch);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-link .quick-link-label {
    font-weight: 700;
    font-size: 0.95rem;
}

.quick-link .quick-link-sub {
    font-size: 0.8rem;
    color: var(--ink-soft);
    display: block;
}

/* ---------- Controls / filter bar ---------- */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    background: var(--paper);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-1);
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 170px;
}

.filter-field label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
}

input[type="text"], input[type="email"], input[type="password"], input[type="datetime-local"] {
    font-family: var(--font-body);
    font-size: 0.92rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--mint);
    color: var(--ink);
    transition: box-shadow 120ms ease, background-color 120ms ease;
}

/* Custom chevron replaces the native select arrow so it matches across browsers;
   sunken fill echoes the paper-form look of a printed match report. */
select {
    font-family: var(--font-body);
    font-size: 0.92rem;
    padding: 0.55rem 2.1rem 0.55rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background-color: var(--mint);
    color: var(--ink);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364707d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    cursor: pointer;
    transition: box-shadow 120ms ease, background-color 120ms ease;
}

select:hover {
    background-color: var(--pitch-soft);
}

select:focus, input:focus {
    outline: none;
    background-color: var(--paper);
    box-shadow: 0 0 0 3px var(--focus-ring), inset 0 0 0 1px var(--accent);
}

/* Checkboxes / radios — tinted to the accent and sized up slightly, so they read
   like ticking a box on a printed match report rather than a raw OS default. */
input[type="checkbox"], input[type="radio"] {
    accent-color: var(--accent);
    width: 1.05rem;
    height: 1.05rem;
    cursor: pointer;
}

button, .btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.88rem;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
    background: var(--pitch);
    color: #fff;
    box-shadow: var(--shadow-1);
    transition: background-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
}

button:hover, .btn:hover {
    background: var(--pitch-dark);
    box-shadow: var(--shadow-2);
}

button:active, .btn:active {
    transform: translateY(1px);
}

.btn-gold {
    background: var(--accent);
    color: #fff;
}

.btn-gold:hover {
    background: var(--accent-dark);
}

/* ---------- Match listing table ---------- */

/* Used inside a .card, which already supplies the border/shadow/radius chrome —
   this just handles horizontal scrolling on narrow viewports. */
.match-table-wrapper {
    overflow-x: auto;
}

table.match-table {
    width: 100%;
    border-collapse: collapse;
}

.match-table thead th {
    text-align: left;
    font-family: var(--font-body);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.7rem 0.9rem;
    white-space: nowrap;
}

.match-table thead th button {
    background: transparent;
    color: inherit;
    padding: 0.15rem 0.35rem;
    margin: -0.15rem -0.35rem;
    border-radius: 6px;
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: none;
    transition: background-color 120ms ease, color 120ms ease;
}

.match-table thead th button:hover {
    background: var(--pitch-soft);
    color: var(--pitch);
    box-shadow: none;
}

.match-table tbody td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    font-size: 0.9rem;
}

.match-table tbody tr:hover {
    background: var(--pitch-soft);
}

.match-date {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-open {
    background: #e5f4ea;
    color: var(--success);
}

.badge-requested {
    background: #fdf1de;
    color: var(--accent-dark);
}

.badge-confirmed {
    background: #e6eefd;
    color: var(--info);
}

.badge-rejected {
    background: #fbe6e8;
    color: var(--danger);
}

/* Per-category toggle chips on the club registration form. One chip per raw TeamCategory,
   visually bucketed under its age-bracket heading so 14 options stay scannable. */
.category-group-heading {
    margin: 0.9rem 0 0.4rem 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink);
}

.category-group-heading:first-of-type {
    margin-top: 0.35rem;
}

/* Column count follows the card width, not the viewport: the registration card is much
   narrower than the window, so viewport media queries would over-columnise the grid. */
.category-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.5rem;
}

.category-chip {
    width: 100%;
    padding: 0.6rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
    color: var(--ink);
    background: var(--mint);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    box-shadow: none;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.category-chip:hover {
    background: var(--pitch-soft);
    border-color: var(--pitch-soft);
    color: var(--ink);
}

.category-chip.is-selected {
    background: var(--pitch);
    border-color: var(--pitch);
    color: #fff;
}

.category-chip.is-selected:hover {
    background: var(--pitch-dark);
    border-color: var(--pitch-dark);
    color: #fff;
}

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--ink-soft);
}

.empty-state strong {
    display: block;
    font-family: var(--font-display);
    color: var(--ink);
    margin-bottom: 0.35rem;
}

/* ---------- Blazor framework hooks (loading indicator / error banner) ---------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--danger);
    color: #fff;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.2);
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
    padding: 0 0.5rem;
}

#blazor-error-ui a {
    color: #fff;
    text-decoration: underline;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem;
}

.loading-progress circle {
    fill: none;
    stroke: var(--line);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    text-align: center;
    font-family: var(--font-mono);
    color: var(--ink-soft);
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Načítání…");
}

/* ---------- Auth forms (login/register) ---------- */

.auth-card {
    max-width: 28rem;
    background: var(--paper);
    border: none;
    border-radius: var(--radius-lg);
    padding: 1.85rem;
    box-shadow: var(--shadow-1);
}

/* Registration only — the two-column form and city autocomplete need more width than
   the login card, which keeps its narrower 28rem measure. */
.auth-card--wide {
    max-width: 62rem;
}

.auth-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.auth-tabs button {
    background: transparent;
    color: var(--ink-soft);
    box-shadow: none;
    border-radius: 8px 8px 0 0;
    padding: 0.5rem 1rem;
}

.auth-tabs button.active {
    background: var(--pitch-soft);
    color: var(--pitch);
    border: 1px solid var(--line);
    border-bottom-color: var(--pitch-soft);
    margin-bottom: -1px;
}

.registration-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

.form-column-heading {
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--ink);
    border-bottom: 2px solid color-mix(in srgb, var(--accent) 38%, white);
}

.captcha-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.captcha-refresh-link {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.12rem;
}

.captcha-refresh-link:hover {
    color: var(--accent-dark);
}

@media (max-width: 860px) {
    .registration-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.9rem;
    }
}

/* ---------- Form fields — Material 3 text-field proportions ----------
   Roomier container (~3.25rem tall, body-large 1rem input text), 12px corner radius,
   a resting elevation that deepens on focus on top of the existing accent focus ring. */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.35rem;
}

/* M3 keeps a persistent supporting-text line under a field. Reserving it also means an
   error message appearing/disappearing on blur cannot shift the page under a pointer
   that is mid-click on the next control. */
.field-message {
    min-height: 1.1rem;
    line-height: 1.1rem;
}

.field-message .validation-message,
.field-message .form-error {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.1rem;
}

.form-field label {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--ink-soft);
}

/* InputText without an explicit type renders no type attribute at all, so match every
   input inside a form field rather than enumerating types. */
.form-field input,
.form-field select {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background-color: var(--paper);
    box-shadow: var(--shadow-1);
    transition: box-shadow 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.form-field select {
    padding-right: 2.4rem;
    background-position: right 1rem center;
}

.form-field input:hover,
.form-field select:hover {
    background-color: var(--paper);
    border-color: var(--pitch-soft);
    box-shadow: var(--shadow-2);
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    background-color: var(--paper);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow-2);
}

.form-field input::placeholder {
    color: var(--ink-soft);
    opacity: 0.75;
}

/* ---------- City autocomplete (registration) ---------- */

.city-autocomplete {
    position: relative;
}

.city-input-wrap {
    position: relative;
    width: 100%;
}

.city-autocomplete-list {
    position: absolute;
    top: calc(100% + 0.3rem);
    left: 0;
    right: 0;
    z-index: 20;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    max-height: 20rem;
    overflow-y: auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-2);
}

.city-autocomplete-item {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
    background: transparent;
    border-radius: 8px;
    box-shadow: none;
    transition: background-color 120ms ease;
}

.city-autocomplete-item:hover,
.city-autocomplete-item:focus-visible {
    background: var(--pitch-soft);
    color: var(--ink);
    box-shadow: none;
}

.city-autocomplete-item .city-okres {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--ink-soft);
}

.form-error {
    color: var(--danger);
    font-size: 0.88rem;
    margin-top: 0.75rem;
}

/* Blazor emits this class from <ValidationMessage>; match the manual .form-error look. */
.validation-message {
    color: var(--danger);
    font-size: 0.88rem;
    margin: 0;
}

.form-field .form-error {
    margin-top: 0.4rem;
}

/* M3-sized primary action for the auth forms only. */
.auth-card > form > .btn-primary,
.auth-card > .btn-primary {
    min-height: 2.75rem;
    padding: 0.75rem 1.6rem;
    font-size: 0.95rem;
    border-radius: var(--radius-pill);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--danger);
    color: #fff;
}

/* ---------- Nav user / logout ---------- */

.nav-user {
    margin-top: auto;
    padding: 0.85rem 0.8rem 0;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    padding: 0 0.1rem;
}

.nav-link-button {
    background: transparent;
    box-shadow: none;
    text-align: left;
    width: 100%;
    color: var(--ink-soft);
}

.nav-link-button:hover {
    background: var(--pitch-soft);
    color: var(--pitch);
}

/* ---------- Top account strip (account chip, top-right) ---------- */

.account-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--paper);
    box-shadow: var(--shadow-1);
    border-radius: 999px;
    padding: 0.35rem 0.6rem 0.35rem 0.35rem;
}

.account-chip .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--pitch-soft);
    color: var(--pitch);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.account-chip .name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
}

.account-chip button {
    background: transparent;
    box-shadow: none;
    color: var(--ink-soft);
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

.account-chip button:hover {
    background: var(--pitch-soft);
    color: var(--pitch);
}

/* ---------- Create-match form (Vytvořit zápas) ---------- */

/* Anonymous call-to-action above the read-only preview of the form. */
.cta-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1.1rem 1.35rem;
    background: var(--pitch-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}

.cta-banner strong {
    display: block;
    color: var(--ink);
}

.cta-banner span {
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.cta-banner-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cta-banner-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--pitch-dark);
}

.success-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.35rem;
    padding: 0.9rem 1.1rem;
    background: var(--mint);
    border-left: 4px solid var(--pitch);
    border-radius: 12px;
    font-weight: 600;
    color: var(--ink);
}

.success-banner a {
    font-weight: 600;
    color: var(--pitch-dark);
}

/* The read-only club label shown when the user administers exactly one approved club. */
.readonly-value {
    margin: 0;
    padding: 0.9rem 1rem;
    min-height: 3.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--mint);
    border-radius: 12px;
}

/* "input + action button" pairs: the input takes the free space, the button stays intrinsic. */
.slot-add-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.6rem;
}

.slot-add-row input {
    flex: 1 1 12rem;
    width: auto;
}

.slot-add-row .btn-primary {
    flex: 0 0 auto;
    padding: 0.75rem 1.3rem;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.slot-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.85rem 0 0 0;
    padding: 0;
    list-style: none;
}

.slot-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem 0.45rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--mint);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
}

.slot-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1;
    color: var(--ink-soft);
    background: transparent;
    border-radius: 50%;
    box-shadow: none;
}

.slot-chip-remove:hover:not(:disabled) {
    background: var(--danger);
    color: #fff;
}

.form-hint {
    margin: 0.5rem 0 0 0;
    font-size: 0.82rem;
    color: var(--ink-soft);
}

.coach-mode-panel {
    margin-bottom: 1.35rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--mint);
}

.coach-mode-panel .readonly-value {
    margin-bottom: 0.55rem;
}

.slot-management-section {
    margin-top: 1.2rem;
}

.slot-actions-cell {
    min-width: 14rem;
}

.slot-owner-note {
    margin-top: 0.45rem;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

/* A checkbox is the one control inside .form-field that must not stretch full width. */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}

.form-field .checkbox-label input[type="checkbox"] {
    width: 1.1rem;
    min-height: 0;
    height: 1.1rem;
    padding: 0;
    box-shadow: none;
    accent-color: var(--pitch);
}

.form-field input:disabled,
.form-field select:disabled,
.slot-chip-remove:disabled {
    background-color: var(--mint);
    color: var(--ink-soft);
    box-shadow: none;
    cursor: not-allowed;
}

/* A disabled action must look disabled — the read-only preview of the create-match form for
   anonymous visitors relies on this, and it also covers the "busy" state of submit buttons. */
.btn-primary:disabled {
    background: var(--line);
    color: var(--ink-soft);
    box-shadow: none;
    cursor: not-allowed;
}
