/* ==========================================================================
   Tenis Mława – arkusz stylów
   Motyw: zieleń kortu, białe linie, żółta piłka.
   ========================================================================== */

:root {
    --court: #1f6b4f;
    --court-2: #24805d;
    --court-dark: #0f3d2e;
    --court-deep: #08261c;
    --ball: #d7f205;
    --ball-2: #b8d000;
    --line: #ffffff;
    --bg: #f3f6f1;
    --surface: #ffffff;
    --surface-2: #eaf1ec;
    --text: #13261f;
    --muted: #5b6e66;
    --border: #dbe5de;
    --danger: #d64545;
    --success: #1f9d5c;
    --info: #2a6fb0;
    --gold: #f2b705;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px -12px rgba(8, 38, 28, .25);
    --shadow-lg: 0 24px 50px -20px rgba(8, 38, 28, .45);
    --ease: cubic-bezier(.22, 1, .36, 1);
    --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--court); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--court-2); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.05; letter-spacing: .01em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
code { background: rgba(0, 0, 0, .06); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.muted-light { color: rgba(255, 255, 255, .7); }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.inline { display: inline; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ball); color: var(--court-deep); padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--ball); outline-offset: 2px; }

/* --- Piłka i puchar --------------------------------------------------------- */
.ball-icon {
    --s: 26px;
    width: var(--s);
    height: var(--s);
    flex: none;
    display: inline-block;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    vertical-align: middle;
    background: radial-gradient(circle at 32% 28%, #f4ff8a, var(--ball) 45%, var(--ball-2) 100%);
    box-shadow: inset -3px -4px 6px rgba(0, 0, 0, .18);
}
.ball-icon::before, .ball-icon::after {
    content: "";
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: calc(var(--s) * .08) solid rgba(255, 255, 255, .92);
}
.ball-icon::before { left: -64%; }
.ball-icon::after { left: 64%; }
.ball-icon.big { --s: 64px; margin: 0 auto 14px; animation: bounce 1.6s var(--ease) infinite; }

.trophy-icon {
    --s: 1.1em;
    display: inline-block;
    width: var(--s);
    height: var(--s);
    vertical-align: -0.15em;
    background: linear-gradient(160deg, #ffe27a, var(--gold) 55%, #c98d00);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h10v2h4v3a5 5 0 0 1-4.6 5A5 5 0 0 1 13 15.9V18h3a2 2 0 0 1 2 2v2H6v-2a2 2 0 0 1 2-2h3v-2.1A5 5 0 0 1 7.6 12 5 5 0 0 1 3 7V4h4V2zm0 4H5v1a3 3 0 0 0 2 2.8V6zm10 0v3.8A3 3 0 0 0 19 7V6h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h10v2h4v3a5 5 0 0 1-4.6 5A5 5 0 0 1 13 15.9V18h3a2 2 0 0 1 2 2v2H6v-2a2 2 0 0 1 2-2h3v-2.1A5 5 0 0 1 7.6 12 5 5 0 0 1 3 7V4h4V2zm0 4H5v1a3 3 0 0 0 2 2.8V6zm10 0v3.8A3 3 0 0 0 19 7V6h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.trophy-icon.xl { --s: 64px; }

/* --- Nagłówek ----------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(8, 38, 28, .92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    transition: box-shadow .3s, background .3s;
}
.site-header.is-scrolled { box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .5); background: rgba(8, 38, 28, .97); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--font-head); font-size: 1.55rem; text-transform: uppercase; letter-spacing: .04em; }
.logo:hover { color: #fff; }
.logo strong { color: var(--ball); font-weight: 800; }
.logo:hover .ball-icon { animation: spin 0.8s var(--ease); }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a, .nav-logout button {
    position: relative;
    color: rgba(255, 255, 255, .85);
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    padding: 8px 14px;
    border-radius: 999px;
    transition: color .25s, background .25s;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}
.main-nav a::after {
    content: "";
    position: absolute;
    left: 14px; right: 14px; bottom: 3px;
    height: 2px;
    background: var(--ball);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s var(--ease);
}
.main-nav a:hover, .nav-logout button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.main-nav a:hover::after, .main-nav a.active::after { transform: scaleX(1); }
.main-nav a.active { color: #fff; }
.main-nav .nav-admin { background: var(--ball); color: var(--court-deep); }
.main-nav .nav-admin:hover { background: #e8ff3a; color: var(--court-deep); }
.nav-logout { margin: 0; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; transition: transform .3s var(--ease), opacity .3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Przyciski ------------------------------------------------------------------ */
.btn {
    --btn-bg: var(--surface-2);
    --btn-fg: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    border: 2px solid transparent;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font: 700 .95rem/1.2 var(--font);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform .25s var(--ease), box-shadow .25s, background .25s, color .25s;
}
.btn::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .6s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--btn-fg); }
.btn:hover::before { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { --btn-bg: var(--court); --btn-fg: #fff; }
.btn-primary:hover { background: var(--court-2); }
.btn-ball { --btn-bg: var(--ball); --btn-fg: var(--court-deep); }
.btn-ball:hover { background: #e6ff2e; }
.btn-outline-light { --btn-bg: transparent; --btn-fg: #fff; border-color: rgba(255, 255, 255, .6); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--court); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--court); background: var(--surface); }
.btn-danger { --btn-bg: transparent; --btn-fg: var(--danger); border-color: rgba(214, 69, 69, .35); }
.btn-danger:hover { --btn-fg: #fff; background: var(--danger); border-color: var(--danger); }
.btn-small { padding: 6px 14px; font-size: .85rem; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-draw .ball-icon { --s: 20px; }
.btn-draw:hover .ball-icon { animation: spin .7s var(--ease); }

/* --- Hero ------------------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: calc(100vh - var(--header-h));
    min-height: calc(100svh - var(--header-h));
    display: flex;
    align-items: center;
    color: #fff;
    background:
        radial-gradient(1200px 600px at 80% 10%, rgba(215, 242, 5, .12), transparent 60%),
        linear-gradient(160deg, var(--court-2) 0%, var(--court) 40%, var(--court-dark) 100%);
    overflow: hidden;
    padding: 60px 0 100px;
}
.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, rgba(8, 38, 28, .5));
    pointer-events: none;
}
.hero-court { position: absolute; inset: 0; perspective: 900px; pointer-events: none; }
.hero-court svg {
    position: absolute;
    right: -8%;
    top: 50%;
    width: 75%;
    height: auto;
    transform: translateY(-50%) rotateX(52deg) rotateZ(-14deg);
    transform-origin: center;
    opacity: .5;
}
.court-svg > * { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw-line 2.4s var(--ease) forwards; }
.court-svg > *:nth-child(2) { animation-delay: .2s; }
.court-svg > *:nth-child(3) { animation-delay: .35s; }
.court-svg > *:nth-child(4) { animation-delay: .5s; }
.court-svg > *:nth-child(5) { animation-delay: .65s; }
.court-svg > *:nth-child(6) { animation-delay: .8s; }
.court-svg .net { animation-delay: 1s; }
.hero-ball-track {
    position: absolute;
    left: 40%;
    top: 30%;
    width: 50%;
    height: 40%;
    animation: ball-x 3.2s ease-in-out infinite alternate;
}
.hero-ball {
    position: absolute;
    left: 0;
    top: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #f4ff8a, var(--ball) 45%, var(--ball-2) 100%);
    box-shadow: 0 0 40px rgba(215, 242, 5, .55), inset -5px -6px 10px rgba(0, 0, 0, .2);
    animation: ball-y 1.6s cubic-bezier(.45, 0, .55, 1) infinite;
}
.hero-ball::before, .hero-ball::after {
    content: "";
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, .9);
}
.hero-ball::before { left: -64%; clip-path: circle(50% at 114% 50%); }
.hero-ball::after { left: 64%; clip-path: circle(50% at -14% 50%); }
.hero-content { position: relative; z-index: 2; }
.eyebrow {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ball);
    margin-bottom: 14px;
}
.hero-title {
    font-size: clamp(3.4rem, 11vw, 8.5rem);
    font-weight: 800;
    text-transform: uppercase;
    line-height: .9;
    margin-bottom: 22px;
    text-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
.hero-title span { color: var(--ball); display: inline-block; }
.hero-lead { max-width: 560px; font-size: 1.15rem; color: rgba(255, 255, 255, .85); margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 48px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; }
.hero-stats > div {
    min-width: 140px;
    padding: 14px 20px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: transform .3s var(--ease), background .3s;
}
.hero-stats > div:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .13); }
.hero-stats dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .7); }
.hero-stats dd { margin: 0; font: 800 2.4rem/1 var(--font-head); color: var(--ball); }
.hero-stats-dark { margin-top: 24px; }
.hero-scroll {
    position: absolute;
    left: 50%;
    bottom: 26px;
    z-index: 3;
    width: 28px;
    height: 46px;
    margin-left: -14px;
    border: 2px solid rgba(255, 255, 255, .6);
    border-radius: 999px;
}
.hero-scroll span { position: absolute; left: 50%; top: 8px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--ball); animation: scroll-dot 1.8s ease-in-out infinite; }

/* --- Sekcje ------------------------------------------------------------------------ */
.section { padding: 72px 0; }
.section-tight { padding: 36px 0 0; }
.section-alt { background: var(--surface-2); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head .section-title { margin: 0; }
.section-title { font-size: clamp(2rem, 4.5vw, 2.9rem); text-transform: uppercase; font-weight: 800; position: relative; padding-bottom: 10px; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 4px; border-radius: 4px; background: var(--ball); transition: width .6s var(--ease) .3s; }
.reveal:not(.is-visible) .section-title::after, .section-title.reveal:not(.is-visible)::after { width: 0; }
.link-more { font-weight: 700; text-decoration: none; transition: letter-spacing .3s var(--ease); }
.link-more:hover { letter-spacing: .03em; }
.month-title { font-size: 1.6rem; text-transform: uppercase; color: var(--court); margin: 36px 0 16px; }
.month-title:first-child { margin-top: 0; }

.page-hero {
    position: relative;
    color: #fff;
    padding: 56px 0 48px;
    background:
        linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 255, 255, .12) calc(50% - 1px), rgba(255, 255, 255, .12) calc(50% + 1px), transparent calc(50% + 1px)),
        linear-gradient(160deg, var(--court-2), var(--court-dark));
    overflow: hidden;
}
.page-hero::before {
    content: "";
    position: absolute;
    inset: 18px 20px;
    border: 2px solid rgba(255, 255, 255, .12);
    pointer-events: none;
}
.page-hero .container { position: relative; }
.page-title { font-size: clamp(2.6rem, 7vw, 4.8rem); font-weight: 800; text-transform: uppercase; margin-bottom: 14px; }
.page-lead { max-width: 640px; color: rgba(255, 255, 255, .85); }
.page-lead a { color: var(--ball); }
.back-link { display: inline-block; margin-bottom: 16px; color: inherit; opacity: .8; text-decoration: none; font-weight: 600; transition: opacity .2s, transform .3s var(--ease); }
.back-link:hover { opacity: 1; transform: translateX(-4px); color: inherit; }
.page-hero .back-link { display: block; width: max-content; }
.page-hero .badge { margin-bottom: 10px; }
.t-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 0; margin: 0 0 12px; font-weight: 600; }
.fact-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ball); font-weight: 700; }
.t-description { max-width: 720px; color: rgba(255, 255, 255, .85); margin-top: 12px; }

/* --- Odznaki ----------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: var(--surface-2);
    color: var(--muted);
    white-space: nowrap;
}
.badge-phase-nadchodzace { background: #e4efff; color: var(--info); }
.badge-phase-trwajace { background: var(--ball); color: var(--court-deep); }
.badge-phase-trwajace::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); animation: pulse 1.4s infinite; }
.badge-phase-zakonczone { background: #e3ece6; color: var(--court); }
.badge-pending { background: #fff4d6; color: #8a6500; }
.badge-ready { background: var(--ball); color: var(--court-deep); }
.badge-done { background: #e3ece6; color: var(--court); }
.badge-walkover, .badge-retired { background: #fde7e7; color: #a33232; }
.badge-bye { background: var(--surface-2); color: var(--muted); }

/* --- Karty turniejów ----------------------------------------------------------------- */
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.t-card {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 18px;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    box-shadow: 0 2px 0 rgba(0, 0, 0, .02);
    overflow: hidden;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.t-card::before {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid var(--surface-2);
    transition: transform .6s var(--ease), border-color .4s;
}
.t-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; color: var(--text); }
.t-card:hover::before { transform: scale(1.6); border-color: rgba(215, 242, 5, .6); }
.t-date {
    flex: none;
    width: 78px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(160deg, var(--court-2), var(--court-dark));
    color: #fff;
    font-family: var(--font-head);
    line-height: 1;
    padding: 12px 6px;
    transition: transform .4s var(--ease);
}
.t-card:hover .t-date { transform: rotate(-4deg) scale(1.04); }
.t-day { font-size: 2.3rem; font-weight: 800; }
.t-month { font-size: 1rem; font-weight: 700; color: var(--ball); letter-spacing: .08em; }
.t-year { font-size: .85rem; opacity: .75; margin-top: 3px; }
.t-info { flex: 1; min-width: 0; position: relative; }
.t-info h3 { font-size: 1.55rem; margin: 8px 0 6px; text-transform: uppercase; }
.t-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .9rem; margin: 0; }
.t-winner { margin: 8px 0 0; font-weight: 700; }
.t-arrow { align-self: center; font-size: 1.5rem; color: var(--court); transition: transform .35s var(--ease); position: relative; }
.t-card:hover .t-arrow { transform: translateX(6px); }
.phase-zakonczone .t-date { background: linear-gradient(160deg, #50645b, #2b3a34); }

/* --- Mistrz ----------------------------------------------------------------------- */
.section-champion { padding: 0; }
.champion {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 36px;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(400px 200px at 0% 0%, rgba(242, 183, 5, .35), transparent 70%),
        linear-gradient(130deg, var(--court-dark), var(--court-deep));
    box-shadow: var(--shadow-lg);
    transform: translateY(-36px);
    position: relative;
    overflow: hidden;
}
.champion-trophy { width: 110px; height: 110px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .08); animation: float 3s ease-in-out infinite; }
.champion-name { font-size: clamp(2rem, 5vw, 3.2rem); text-transform: uppercase; margin-bottom: 4px; }
.champion-meta { color: rgba(255, 255, 255, .75); }

/* --- Karty meczów ------------------------------------------------------------------- */
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.match-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.match-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.match-card-head { display: flex; justify-content: space-between; gap: 10px; padding: 10px 16px; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--surface-2); text-transform: uppercase; letter-spacing: .04em; }
.match-context { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-context a { color: var(--court); text-decoration: none; }
.match-card-head time { white-space: nowrap; }
.match-card-body { padding: 8px 16px 12px; }
.mc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; }
.mc-row + .mc-row { border-top: 1px dashed var(--border); }
.mc-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.mc-name a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-name a:hover { color: var(--court); text-decoration: underline; }
.mc-row.is-winner .mc-name { font-weight: 800; }
.mc-row.is-loser { color: var(--muted); }
.win-mark { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--ball); box-shadow: 0 0 0 3px rgba(215, 242, 5, .3); }
.mc-sets, .bsets { display: flex; gap: 4px; flex: none; }
.set {
    min-width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    padding: 0 4px;
    border-radius: 6px;
    font: 700 .95rem/1 var(--font-head);
    background: var(--surface-2);
    color: var(--muted);
}
.set-won { background: var(--court); color: #fff; }
.set-ret { background: #fde7e7; color: #a33232; }
.match-card.is-finished.is-visible .set { animation: pop-in .5s var(--ease) both; }
.match-card.is-visible .set:nth-child(2) { animation-delay: .1s; }
.match-card.is-visible .set:nth-child(3) { animation-delay: .2s; }
.match-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--border); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); background: var(--surface); border-radius: var(--radius); border: 2px dashed var(--border); }
.empty p { margin-bottom: 16px; }

/* --- Zakładki ------------------------------------------------------------------------- */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; margin-bottom: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.tab { position: relative; padding: 9px 18px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 700; transition: color .25s, background .3s var(--ease); }
.tab:hover { color: var(--court); }
.tab.active { background: var(--court); color: #fff; }
.tab-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 4px; border-radius: 999px; font-size: .75rem; background: rgba(0, 0, 0, .07); }
.tab.active .tab-count { background: var(--ball); color: var(--court-deep); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade-up .5s var(--ease); }

/* --- Drabinka ------------------------------------------------------------------------- */
.bracket-wrap {
    overflow-x: auto;
    padding: 10px 4px 24px;
    margin: 0 -4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.bracket { --gap: 46px; --w: 230px; display: flex; gap: var(--gap); min-width: max-content; }
.round { width: var(--w); display: flex; flex-direction: column; scroll-snap-align: start; }
.round-title {
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--court);
    text-align: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    margin-bottom: 12px;
}
.round:last-child .round-title { background: var(--ball); color: var(--court-deep); }
.round-matches { flex: 1; display: flex; flex-direction: column; }
.slot { flex: 1; display: flex; align-items: center; position: relative; padding: 8px 0; min-height: 96px; }
.round:not(:last-child) .slot::after {
    content: "";
    position: absolute;
    right: calc(var(--gap) / -2);
    width: calc(var(--gap) / 2);
    height: 50%;
    border-right: 2px solid #b9cbbf;
}
.round:not(:last-child) .slot:nth-child(odd)::after { top: 50%; border-top: 2px solid #b9cbbf; border-top-right-radius: 8px; }
.round:not(:last-child) .slot:nth-child(even)::after { bottom: 50%; border-bottom: 2px solid #b9cbbf; border-bottom-right-radius: 8px; }
.round:not(:first-child) .slot::before {
    content: "";
    position: absolute;
    left: calc(var(--gap) / -2);
    width: calc(var(--gap) / 2);
    top: 50%;
    border-top: 2px solid #b9cbbf;
}
.bmatch {
    position: relative;
    display: block;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 2px 6px -3px rgba(8, 38, 28, .15);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
    z-index: 1;
}
.bmatch.is-final { border: 2px solid var(--ball); box-shadow: 0 0 0 4px rgba(215, 242, 5, .2), var(--shadow); }
.bmatch.is-bye { opacity: .75; border-style: dashed; }
.bmatch:hover { transform: scale(1.03); box-shadow: var(--shadow); color: var(--text); }
.bmatch.is-editable { cursor: pointer; }
.bmatch.is-editable:hover { border-color: var(--court); }
.bplayer { display: flex; align-items: center; gap: 8px; padding: 7px 10px; min-height: 38px; position: relative; }
.bplayer + .bplayer { border-top: 1px solid var(--border); }
.bplayer.is-winner { background: linear-gradient(90deg, rgba(215, 242, 5, .28), transparent 80%); font-weight: 800; }
.bplayer.is-winner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ball); }
.bplayer.is-loser { color: var(--muted); }
.bplayer .bname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.bplayer em { color: var(--muted); font-weight: 400; }
.bsets .set { min-width: 22px; height: 22px; font-size: .88rem; }
.seed { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 5px; font-size: .7rem; font-weight: 800; background: var(--court-dark); color: var(--ball); flex: none; }
.bedit { display: block; text-align: center; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 5px; background: var(--surface-2); color: var(--court); transition: background .25s, color .25s; }
.bmatch.is-editable:hover .bedit { background: var(--court); color: #fff; }

/* animowane pojawianie się drabinki */
.js .reveal-bracket .round { opacity: 0; transform: translateX(-24px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc((var(--r) - 1) * .22s); }
.js .reveal-bracket .bmatch { opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js .reveal-bracket.is-visible .round { opacity: 1; transform: none; }
.js .reveal-bracket.is-visible .bmatch { opacity: 1; transform: none; transition-delay: calc((var(--r) - 1) * .22s + var(--i) * .05s + .15s); }
.js .reveal-bracket .slot::after, .js .reveal-bracket .slot::before { opacity: 0; transition: opacity .5s ease; }
.js .reveal-bracket.is-visible .slot::after, .js .reveal-bracket.is-visible .slot::before { opacity: 1; transition-delay: calc(var(--r) * .22s + .3s); }
.js .reveal-bracket.is-visible .bplayer.is-winner::before { animation: grow-y .5s var(--ease) both; animation-delay: calc(var(--r) * .22s + .4s); }
.js .reveal-bracket.is-visible .bmatch:hover { transition-delay: 0s; }

.round-nav { display: none; gap: 6px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 4px; }
.round-nav button { flex: none; border: 1px solid var(--border); background: var(--surface); color: var(--court); padding: 6px 14px; border-radius: 999px; font: 700 .82rem var(--font); cursor: pointer; }
.round-nav button.active { background: var(--court); color: #fff; border-color: var(--court); }

.progress { width: 200px; max-width: 100%; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; width: var(--p); border-radius: inherit; background: linear-gradient(90deg, var(--court), var(--ball)); animation: grow-x 1.4s var(--ease) both .4s; transform-origin: left; }

/* --- Zwycięzca ---------------------------------------------------------------------- */
.winner-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 26px 30px;
    border-radius: 22px;
    background: linear-gradient(120deg, #fff8d6, #fff 60%);
    border: 2px solid var(--gold);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.winner-banner .eyebrow { color: #a07400; margin-bottom: 2px; }
.winner-name { font: 800 clamp(2rem, 5vw, 3rem)/1 var(--font-head); text-transform: uppercase; margin: 0; }
.winner-name a { color: var(--court-dark); text-decoration: none; }
.winner-banner.is-visible .trophy-icon { animation: trophy 1s var(--ease) both .2s; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; background: var(--ball); opacity: 0; }
.winner-banner.is-visible .confetti i { animation: confetti 2.6s ease-in forwards; }
.confetti i:nth-child(1) { left: 10%; animation-delay: .1s !important; }
.confetti i:nth-child(2) { left: 22%; background: var(--gold); animation-delay: .4s !important; }
.confetti i:nth-child(3) { left: 35%; background: var(--court); animation-delay: .2s !important; }
.confetti i:nth-child(4) { left: 48%; animation-delay: .6s !important; }
.confetti i:nth-child(5) { left: 60%; background: var(--gold); animation-delay: .3s !important; }
.confetti i:nth-child(6) { left: 72%; background: var(--court); animation-delay: .5s !important; }
.confetti i:nth-child(7) { left: 84%; animation-delay: .15s !important; }
.confetti i:nth-child(8) { left: 94%; background: var(--gold); animation-delay: .45s !important; }

/* --- Gracze ---------------------------------------------------------------------------- */
.player-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; }
.player-chips a, .player-chips > li > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.player-chips a:hover { transform: translateY(-3px); border-color: var(--court); box-shadow: var(--shadow); color: var(--court); }
.search-box { margin-bottom: 14px; max-width: 360px; }
.ratio { display: inline-block; width: 90px; height: 8px; border-radius: 999px; background: #f1d6d6; overflow: hidden; vertical-align: middle; }
.ratio span { display: block; height: 100%; width: var(--p); background: var(--court); }
.win-num { color: var(--court); font-weight: 800; }

/* --- Tabele ---------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 16px; background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: #f7faf7; }
.table a.strong { color: var(--text); text-decoration: none; }
.table a.strong:hover { color: var(--court); }
.table .num { text-align: right; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * { margin-left: 4px; }
.table-compact td, .table-compact th { padding: 8px 12px; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 36px; }
.pagination a { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); text-decoration: none; font-weight: 700; transition: transform .25s var(--ease); }
.pagination a:hover { transform: translateY(-2px); }
.pagination a.active { background: var(--court); color: #fff; border-color: var(--court); }

/* --- Formularze ------------------------------------------------------------------------ */
.form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="search"], select, textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 11px 14px;
    font: 500 1rem var(--font);
    color: var(--text);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231f6b4f' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--court); box-shadow: 0 0 0 4px rgba(31, 107, 79, .15); }
.search-box input { margin-top: 0; border-radius: 999px; padding-left: 18px; }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.span-2 { grid-column: span 2; }
.hint { font-size: .87rem; color: var(--muted); }
fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend { font-weight: 700; font-size: .9rem; margin-bottom: 8px; padding: 0; }
.form .radio-pill, .radio-pill { display: inline-block; margin: 0 6px 8px 0; cursor: pointer; }
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill span { display: inline-block; padding: 9px 16px; border-radius: 999px; border: 2px solid var(--border); background: var(--surface); font-weight: 600; transition: all .25s var(--ease); }
.radio-pill:hover span { border-color: var(--court); }
.radio-pill input:checked + span { background: var(--court); border-color: var(--court); color: #fff; transform: scale(1.04); }
.radio-pill input:focus-visible + span { outline: 3px solid var(--ball); outline-offset: 2px; }
.form-actions { margin-top: 10px; }

/* --- Alerty ---------------------------------------------------------------------------- */
.alert { padding: 13px 18px; border-radius: var(--radius-sm); margin-bottom: 16px; border-left: 5px solid; font-size: .95rem; animation: slide-in .5s var(--ease); }
.alert-error { background: #fdecec; border-color: var(--danger); color: #7d2020; }
.alert-success { background: #e5f6ec; border-color: var(--success); color: #12583a; }
.alert-info { background: #e7f0fa; border-color: var(--info); color: #1d4b78; }

/* --- Logowanie / instalacja ---------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background:
        linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 255, 255, .1) calc(50% - 1px), rgba(255, 255, 255, .1) calc(50% + 1px), transparent calc(50% + 1px)),
        linear-gradient(160deg, var(--court-2), var(--court-deep));
}
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: 22px; padding: 34px 30px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 2.2rem; text-transform: uppercase; }
.auth-logo { display: flex; align-items: center; gap: 10px; font: 800 1.3rem var(--font-head); text-transform: uppercase; color: var(--court); text-decoration: none; margin-bottom: 18px; }
.auth-logo .ball-icon { animation: bounce 1.6s var(--ease) infinite; }
.auth-card .back-link { margin: 18px 0 0; color: var(--muted); }

/* --- Panel administratora --------------------------------------------------------- */
.admin { background: var(--bg); }
.admin-main { padding: 32px 0 80px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.admin-head h1 { font-size: clamp(2rem, 5vw, 2.8rem); text-transform: uppercase; margin: 0; }
.admin-head p { margin: 4px 0 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-subtitle { font-size: 1.6rem; text-transform: uppercase; margin: 34px 0 14px; }
.admin-main .back-link { color: var(--court); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat-card { display: flex; flex-direction: column; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--muted); text-decoration: none; transition: transform .3s var(--ease), box-shadow .3s; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: var(--muted); }
.stat-num { font: 800 2.6rem/1 var(--font-head); color: var(--court); }
.card-list { display: grid; gap: 10px; }
.list-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; transition: transform .3s var(--ease), border-color .3s; }
.list-card:hover { transform: translateX(6px); border-color: var(--court); color: var(--text); }
.list-card strong { display: block; font-size: 1.05rem; }
.list-card .muted { font-size: .88rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px; margin-top: 22px; scroll-margin-top: calc(var(--header-h) + 16px); }
.panel h2 { font-size: 1.8rem; text-transform: uppercase; }
.panel h3 { font-size: 1.3rem; text-transform: uppercase; margin-top: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.panel-head p { margin: 0; }
.panel-narrow { max-width: 520px; }
.count-pill { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 999px; background: var(--ball); color: var(--court-deep); font-size: 1.1rem; vertical-align: middle; }
.admin-columns { display: grid; grid-template-columns: 1fr 2fr; gap: 22px; align-items: start; }
.admin-columns .panel { margin-top: 0; }
.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0; counter-reset: step; flex-wrap: wrap; }
.steps li a { display: block; padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 700; text-decoration: none; font-size: .9rem; }
.steps li.done a { background: #e3ece6; color: var(--court); border-color: transparent; }
.steps li.done a::after { content: " ✓"; }
.steps li.current a { background: var(--court); color: #fff; border-color: var(--court); }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; padding: 10px; border: 2px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 14px; }
.check-list label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 8px; border-radius: 8px; font-weight: 500; cursor: pointer; transition: background .2s; }
.check-list label:hover { background: var(--surface-2); }
.check-list input { width: 18px; height: 18px; accent-color: var(--court); }
.input-seed { max-width: 90px; margin-top: 0 !important; padding: 7px 10px !important; }
.inline-edit input { margin-top: 0; padding: 7px 10px; }
.danger-zone { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--border); font-size: .88rem; }
.draw-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.pairs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pair-card { position: relative; padding: 16px; border-radius: var(--radius); background: var(--surface-2); border: 2px solid transparent; transition: border-color .3s; }
.pair-card:focus-within { border-color: var(--court); }
.pair-no { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.pair-vs { display: block; text-align: center; font: 800 .9rem var(--font-head); color: var(--court); text-transform: uppercase; margin: 4px 0 -2px; }
.pair-select { font-weight: 600; }
.pair-select.is-dup { border-color: var(--danger); background-color: #fdecec; }
.pair-select.is-bye { color: var(--muted); font-style: italic; }
.is-drawn .pair-card { animation: draw-card .6s var(--ease) both; animation-delay: calc(var(--i) * .07s); }
.pairs-status { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 14px; font-weight: 600; font-size: .92rem; }
.pairs-status:empty { display: none; }
.pairs-status.ok { background: #e5f6ec; color: #12583a; }
.pairs-status.warn { background: #fff4d6; color: #7a5900; }
.score-form { max-width: 760px; margin-top: 0; }
.player-pick select { margin-bottom: 8px; }
.score-board { margin: 6px 0 20px; }
.sb-row { display: grid; grid-template-columns: minmax(110px, 260px) repeat(3, 72px); gap: 10px; align-items: center; margin-bottom: 10px; }
.sb-head { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: center; margin-bottom: 4px; }
.sb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-input { margin: 0 !important; text-align: center; font: 800 1.5rem var(--font-head) !important; padding: 8px !important; }
.sb-input { -moz-appearance: textfield; }
.sb-input::-webkit-outer-spin-button, .sb-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sb-input.is-set-won { border-color: var(--court); background: #e3f3e9; color: var(--court); }
.sb-preview { font-weight: 700; color: var(--court); min-height: 1.5em; }
.sb-preview.is-error { color: var(--danger); }
.score-form [data-show-for].is-hidden { display: none; }

/* --- Stopka ---------------------------------------------------------------------------- */
.site-footer { position: relative; margin-top: 0; padding: 56px 0 24px; color: #fff; background: var(--court-deep); overflow: hidden; }
.court-lines { position: absolute; inset: 0; pointer-events: none; opacity: .08; background:
    linear-gradient(#fff, #fff) center / 2px 100% no-repeat,
    linear-gradient(#fff, #fff) center / 60% 2px no-repeat; }
.footer-inner { position: relative; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.footer-nav a { color: rgba(255, 255, 255, .8); text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: var(--ball); }
.footer-bottom { position: relative; margin-top: 30px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; color: rgba(255, 255, 255, .55); }

/* --- Animacje przy przewijaniu ----------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--d, 0) * .12s); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal-bracket { opacity: 1; transform: none; }
.page-transition { animation: page-in .6s var(--ease); }
body.is-leaving .page-transition { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }

@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-14px); } }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes ball-x { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes ball-y {
    0%, 100% { transform: translateY(0) scale(1.05, .92); }
    12% { transform: translateY(-22%) scale(1); }
    50% { transform: translateY(-220%) rotate(180deg); }
    88% { transform: translateY(-22%) rotate(340deg); }
}
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(214, 69, 69, .6); } 100% { box-shadow: 0 0 0 8px rgba(214, 69, 69, 0); } }
@keyframes scroll-dot { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(20px); opacity: 0; } 100% { opacity: 0; } }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes trophy { 0% { transform: scale(0) rotate(-30deg); } 60% { transform: scale(1.2) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes confetti { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(160px) rotate(540deg); } }
@keyframes draw-card { 0% { opacity: 0; transform: rotateX(70deg) translateY(-10px); } 100% { opacity: 1; transform: none; } }

/* --- Responsywność ------------------------------------------------------------------- */
@media (max-width: 900px) {
    .admin-columns { grid-template-columns: 1fr; }
    .hero-court svg { width: 120%; right: -40%; opacity: .3; }
    .hero-ball-track { left: 15%; width: 70%; top: 18%; }
}

@media (max-width: 760px) {
    :root { --header-h: 60px; }
    .container { padding: 0 16px; }
    .nav-toggle { display: block; }
    .main-nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px 16px 20px;
        background: var(--court-deep);
        box-shadow: 0 20px 30px -10px rgba(0, 0, 0, .5);
        transform: translateY(-110%);
        opacity: 0;
        visibility: hidden;
        transition: transform .4s var(--ease), opacity .3s, visibility .4s;
    }
    .main-nav.open { transform: none; opacity: 1; visibility: visible; }
    .main-nav a, .nav-logout button { padding: 12px 14px; font-size: 1.05rem; text-align: left; width: 100%; }
    .main-nav a::after { display: none; }
    .main-nav.open a { animation: slide-in .4s var(--ease) both; }
    .main-nav.open a:nth-child(2) { animation-delay: .05s; }
    .main-nav.open a:nth-child(3) { animation-delay: .1s; }
    .main-nav.open a:nth-child(4) { animation-delay: .15s; }
    .main-nav.open a:nth-child(5) { animation-delay: .2s; }
    .logo { font-size: 1.3rem; }
    .hero { padding: 40px 0 90px; align-items: flex-start; }
    .hero-lead { font-size: 1.02rem; }
    .hero-stats > div { min-width: 0; flex: 1 1 30%; padding: 12px 14px; }
    .hero-stats dd { font-size: 2rem; }
    .section { padding: 52px 0; }
    .t-grid, .match-grid { grid-template-columns: 1fr; }
    .t-card { gap: 14px; padding: 14px; }
    .t-date { width: 66px; }
    .t-day { font-size: 1.9rem; }
    .t-arrow { display: none; }
    .champion { flex-direction: column; text-align: center; padding: 28px 20px; transform: translateY(-28px); }
    .champion-trophy { width: 90px; height: 90px; }
    .winner-banner { flex-direction: column; text-align: center; padding: 24px 18px; }
    .tabs { display: flex; flex-wrap: nowrap; border-radius: 18px; }
    .tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 14px; font-size: .88rem; }
    .tab-count { margin-left: 0; }
    .bracket { --gap: 30px; --w: 210px; }
    .round-nav { display: flex; }
    .page-hero { padding: 40px 0 34px; }
    .page-hero::before { inset: 10px; }
    .hide-sm { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .panel { padding: 20px 16px; border-radius: 16px; }
    .sb-row { grid-template-columns: minmax(80px, 1fr) repeat(3, 54px); gap: 6px; }
    .sb-input { font-size: 1.3rem !important; padding: 8px 2px !important; }
    .table .actions { white-space: normal; }
    .table .actions > * { margin: 2px 0 2px 4px; }
    .admin-head .btn { width: 100%; }
    .admin-actions { width: 100%; }
    .admin-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
    .hero-ball-track { display: none; }
}
