:root {
    --bg: #11161c;
    --bg-deep: #0d1116;
    --surface: #181e25;
    --surface-2: #202831;
    --surface-3: #29333d;
    --text: #f2f1ef;
    --muted: #b8bec4;
    --muted-2: #858e97;
    --accent: #c49378;
    --accent-hover: #d5a78d;
    --accent-soft: rgba(196, 147, 120, 0.13);
    --line: rgba(255, 255, 255, 0.10);
    --line-strong: rgba(255, 255, 255, 0.18);
    --danger: #ffaaa4;
    --success: #a6d7b2;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    --font-heading: "Montserrat", Arial, sans-serif;
    --font-body: "Inter", Arial, sans-serif;
    --container: 1460px;
    --header-height: 72px;
    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 28px;
    --transition: 180ms ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 82% 14%, rgba(74, 94, 108, 0.23), transparent 32rem),
        linear-gradient(180deg, #12171d 0%, var(--bg) 48%, #0f141a 100%);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
}

body.menu-open {
    overflow: hidden;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
    max-width: 100%;
}

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

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    padding: 10px 14px;
    transform: translateY(-160%);
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--bg-deep);
    font-weight: 700;
}

.skip-link:focus {
    transform: translateY(0);
}

/* Header — mobile first */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--line);
    background: rgba(15, 20, 26, 0.985);
}

/*
 * Nie nakładamy backdrop-filter bezpośrednio na header.
 * Filtr tworzył osobny kontekst dla position: fixed i ucinał mobilne menu
 * do wysokości nagłówka w części przeglądarek.
 */
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: rgba(15, 20, 26, 0.92);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.site-header__inner {
    position: relative;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-family: var(--font-heading);
}

.brand__mark {
    position: relative;
    width: 39px;
    height: 39px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(196, 147, 120, 0.52);
    border-radius: 9px 17px 9px 17px;
    background: linear-gradient(145deg, rgba(196, 147, 120, 0.25), rgba(196, 147, 120, 0.04));
    color: var(--accent-hover);
    transform: rotate(-4deg);
}

.brand__mark::after {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transform: skewX(-18deg);
}

.brand__mark span {
    position: relative;
    z-index: 1;
    font-size: 1.05rem;
    font-weight: 700;
    transform: rotate(4deg);
}

.brand__copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1;
}

.brand__copy strong {
    font-size: 0.9rem;
    letter-spacing: 0.14em;
}

.brand__copy small {
    margin-top: 5px;
    color: var(--muted-2);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.22em;
}

.nav-toggle {
    position: relative;
    z-index: 3;
    width: 44px;
    height: 44px;
    display: grid;
    place-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
    cursor: pointer;
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
    transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-menu {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: auto;
    left: 0;
    z-index: 99;
    width: 100%;
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 18px 14px max(32px, env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 85% 12%, rgba(74, 94, 108, 0.23), transparent 24rem),
        rgba(13, 17, 22, 0.995);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(100%);
    transition:
        transform 240ms ease,
        opacity 180ms ease,
        visibility 180ms ease;
}

.site-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.main-nav,
.header-actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 6px;
}

.main-nav a,
.header-link {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    transition: color var(--transition), background var(--transition);
}

.main-nav a:hover,
.main-nav a:focus-visible,
.header-link:hover,
.header-link:focus-visible,
.header-link.is-active {
    background: var(--surface-2);
    color: var(--text);
}

.header-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.header-link--panel {
    color: var(--accent-hover);
}

.header-actions .button {
    width: 100%;
}

/* Buttons */
.button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 700;
    text-align: center;
    transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.button:hover {
    transform: translateY(-2px);
}

.button--primary {
    background: var(--accent);
    color: #16110e;
}

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

.button--secondary {
    border-color: var(--line-strong);
    background: var(--surface-2);
    color: var(--text);
}

.button--secondary:hover {
    border-color: rgba(196, 147, 120, 0.5);
}

.button--ghost {
    border-color: var(--line);
    background: transparent;
    color: var(--muted);
}

.button--ghost:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.button--small {
    min-height: 44px;
    padding-inline: 16px;
    font-size: 0.82rem;
}

.button--wide {
    width: 100%;
}

/* Shared */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-hover);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--accent);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
}

/* Index */
.hero {
    position: relative;
    overflow: hidden;
    padding: 72px 0 78px;
}

.hero__grid {
    display: grid;
    gap: 54px;
}

.hero__content h1 {
    max-width: 760px;
    margin: 20px 0 0;
    font-size: clamp(2.7rem, 13vw, 5.5rem);
    line-height: 0.96;
    letter-spacing: -0.055em;
}

.hero__content h1 span {
    color: var(--accent-hover);
}

.hero__text {
    max-width: 680px;
    margin: 25px 0 0;
    color: var(--muted);
    font-size: 1rem;
}

.hero__actions {
    display: grid;
    gap: 12px;
    margin-top: 30px;
}

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 30px;
    color: var(--muted-2);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.hero__meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero__meta span::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.hero-visual {
    position: relative;
    min-height: 410px;
    display: grid;
    place-items: center;
}

.hero-visual__glow {
    position: absolute;
    width: 82%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(65, 85, 98, 0.38);
    filter: blur(65px);
}

.court-card {
    position: relative;
    width: min(100%, 520px);
    padding: 18px;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(43, 53, 63, 0.9), rgba(21, 27, 34, 0.98));
    box-shadow: var(--shadow);
    transform: rotate(2deg);
}

.court-card__top {
    display: flex;
    justify-content: space-between;
    color: var(--muted-2);
    font-size: 0.61rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.court {
    position: relative;
    min-height: 310px;
    margin: 15px 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 14px 34px 14px 34px;
    background:
        linear-gradient(90deg, transparent 49.7%, rgba(255, 255, 255, 0.18) 49.7% 50.3%, transparent 50.3%),
        linear-gradient(180deg, rgba(196, 147, 120, 0.09), rgba(26, 42, 50, 0.64));
}

.court::before,
.court::after {
    content: "";
    position: absolute;
    inset: 38px 23px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.court::after {
    inset: 72px 23px;
    border-right: 0;
    border-left: 0;
}

.court__net {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    box-shadow: 0 0 18px rgba(196, 147, 120, 0.55);
}

.ball {
    position: absolute;
    top: 27%;
    right: 25%;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #d4df79;
    box-shadow: 0 0 18px rgba(212, 223, 121, 0.5);
}

.racket {
    position: absolute;
    right: 14%;
    bottom: 16%;
    width: 76px;
    height: 96px;
    border: 7px solid #20262c;
    border-radius: 50% 50% 46% 46%;
    background: repeating-linear-gradient(45deg, rgba(196, 147, 120, 0.8) 0 2px, transparent 2px 9px);
    transform: rotate(-28deg);
}

.racket::after {
    content: "";
    position: absolute;
    top: 82px;
    left: 24px;
    width: 15px;
    height: 66px;
    border-radius: 4px;
    background: var(--accent);
}

.court-card > p {
    margin: 0;
    color: var(--muted-2);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
}

/* Auth */
.auth-page {
    padding: 48px 0 76px;
}

.auth-shell {
    display: grid;
    gap: 34px;
}

.auth-intro h1 {
    max-width: 700px;
    margin: 20px 0 18px;
    font-size: clamp(2.45rem, 11vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.auth-intro > p {
    max-width: 620px;
    color: var(--muted);
}

.demo-box,
.feature-list {
    margin: 28px 0 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(32, 40, 49, 0.66);
    color: var(--muted);
    font-size: 0.82rem;
}

.demo-box strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
}

.demo-box p {
    margin: 4px 0;
    overflow-wrap: anywhere;
}

.feature-list {
    display: grid;
    gap: 10px;
    padding-left: 42px;
}

.feature-list li::marker {
    color: var(--accent);
}

.auth-card {
    width: 100%;
    padding: 24px 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: rgba(24, 30, 37, 0.94);
    box-shadow: var(--shadow);
}

.auth-card__heading > span {
    color: var(--accent);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.auth-card__heading h2 {
    margin: 12px 0 5px;
    font-size: 2rem;
}

.auth-card__heading p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.auth-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.79rem;
    font-weight: 600;
}

.field input,
.field select {
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: 0;
    background: #11171d;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.field select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 23px,
        calc(100% - 13px) 23px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.field input:focus,
.field select:focus {
    border-color: var(--accent);
    background: #141b22;
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 72px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    min-height: 36px;
    padding: 0 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--accent-hover);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
}

.checkbox-field {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 10px;
    align-items: start;
    color: var(--muted);
    font-size: 0.8rem;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--accent);
}

.form-alert {
    margin-top: 22px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 170, 164, 0.33);
    border-radius: 10px;
    background: rgba(255, 170, 164, 0.08);
    color: var(--danger);
    font-size: 0.82rem;
}

.form-alert p {
    margin: 3px 0;
}

.auth-switch {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    text-align: center;
}

.auth-switch a {
    color: var(--accent-hover);
    font-weight: 700;
}

/* Flash */
.flash-stack {
    position: relative;
    z-index: 20;
    display: grid;
    gap: 8px;
    padding-top: 12px;
}

.flash {
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 0.84rem;
}

.flash--success {
    border-color: rgba(166, 215, 178, 0.35);
    color: var(--success);
}

.flash--error {
    border-color: rgba(255, 170, 164, 0.35);
    color: var(--danger);
}

/* Account and panels */
.dashboard-page,
.status-page {
    min-height: calc(100vh - var(--header-height) - 96px);
    padding: 58px 0 86px;
}

.dashboard-grid {
    display: grid;
    gap: 18px;
}

.profile-card,
.dashboard-card,
.panel-placeholder,
.status-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(32, 40, 49, 0.94), rgba(18, 24, 30, 0.96));
    box-shadow: var(--shadow);
}

.profile-card,
.dashboard-card {
    padding: 26px;
}

.avatar {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    margin-top: 28px;
    border: 1px solid rgba(196, 147, 120, 0.45);
    border-radius: 22px;
    background: var(--accent-soft);
    color: var(--accent-hover);
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
}

.profile-card h1 {
    margin: 24px 0 5px;
    font-size: 2rem;
    overflow-wrap: anywhere;
}

.profile-card > p {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.role-badge {
    display: inline-flex;
    margin-top: 10px;
    padding: 7px 11px;
    border: 1px solid rgba(196, 147, 120, 0.35);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-hover);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-card__label {
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.dashboard-card h2 {
    margin: 28px 0 14px;
    font-size: clamp(2rem, 8vw, 3.7rem);
    line-height: 1.03;
    letter-spacing: -0.045em;
}

.dashboard-card > p,
.panel-placeholder > p,
.status-card > p {
    max-width: 720px;
    color: var(--muted);
}

.dashboard-actions {
    display: grid;
    gap: 10px;
    margin-top: 32px;
}

.panel-placeholder,
.status-card {
    padding: 30px 22px;
}

.panel-placeholder > h1,
.status-card > h1 {
    margin: 20px 0 14px;
    font-size: clamp(2.5rem, 10vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.placeholder-grid {
    display: grid;
    gap: 12px;
    margin-top: 36px;
}

.placeholder-grid article {
    min-height: 190px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(17, 23, 29, 0.72);
}

.placeholder-grid article > span {
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.placeholder-grid h2 {
    margin: 50px 0 8px;
    font-size: 1.25rem;
}

.placeholder-grid p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.status-card .button {
    margin-top: 22px;
}

.section-placeholder {
    max-width: 920px;
}

.section-placeholder .button {
    margin-top: 22px;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--bg-deep);
}

.site-footer__inner {
    display: grid;
    gap: 4px;
    padding-block: 24px;
    color: var(--muted-2);
    font-size: 0.75rem;
}

.site-footer p {
    margin: 0;
}

@media (min-width: 620px) {
    .hero__actions,
    .dashboard-actions {
        display: flex;
        flex-wrap: wrap;
    }

    .hero__actions .button {
        min-width: 170px;
    }

    .placeholder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-card {
        padding: 34px;
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-footer__inner {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
}

@media (min-width: 820px) {
    .container {
        width: min(calc(100% - 56px), var(--container));
    }

    .hero {
        padding: 100px 0 110px;
    }

    .hero__grid,
    .auth-shell,
    .dashboard-grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
        align-items: center;
    }

    .hero__content h1 {
        font-size: clamp(4.4rem, 8.5vw, 7.5rem);
    }

    .auth-page {
        padding: 80px 0 100px;
    }

    .auth-shell {
        gap: 60px;
    }

    .auth-intro h1 {
        font-size: clamp(3.5rem, 6vw, 5.7rem);
    }

    .auth-card {
        justify-self: end;
        max-width: 610px;
    }

    .dashboard-grid {
        align-items: stretch;
    }

    .profile-card,
    .dashboard-card {
        padding: 40px;
    }

    .profile-card {
        max-width: 480px;
    }

    .panel-placeholder {
        padding: 54px;
    }

    .placeholder-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1240px) {
    :root {
        --header-height: 80px;
    }

    body.menu-open {
        overflow: auto;
    }

    .nav-toggle {
        display: none;
    }

    .site-header__inner {
        justify-content: flex-start;
    }

    .site-menu {
        position: static;
        inset: auto;
        z-index: auto;
        min-width: 0;
        flex: 1;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 18px;
        width: auto;
        height: auto;
        min-height: 0;
        overflow: visible;
        padding: 0;
        background: transparent;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        transition: none;
    }

    .main-nav,
    .header-actions {
        flex-direction: row;
        align-items: center;
        gap: 2px;
    }

    .main-nav a,
    .header-link {
        width: auto;
        min-height: 42px;
        padding: 0 9px;
        font-size: 0.66rem;
        letter-spacing: 0.07em;
        white-space: nowrap;
    }

    .header-actions {
        margin-top: 0;
        padding-top: 0;
        padding-left: 14px;
        border-top: 0;
        border-left: 1px solid var(--line);
    }

    .header-actions .button {
        width: auto;
        white-space: nowrap;
    }

    .hero__grid {
        grid-template-columns: minmax(0, 1.08fr) minmax(450px, 0.92fr);
        gap: 86px;
    }
}

@media (min-width: 1440px) {
    .main-nav a,
    .header-link {
        padding-inline: 13px;
        font-size: 0.71rem;
    }

    .site-menu {
        gap: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
