:root {
  color-scheme: dark;
  --bg: #0c1118;
  --panel: #131b25;
  --panel-soft: #182330;
  --line: rgba(220, 230, 240, .11);
  --text: #f2f5f7;
  --muted: #9baab7;
  --red: #ee5360;
  --red-deep: #c32d3d;
  --gold: #f0bd65;
  --green: #59c99a;
  --danger: #ff7a7a;
  --radius: 20px;
  --shadow: 0 18px 60px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background:
    radial-gradient(ellipse at 8% 0%, rgba(195, 45, 61, .13), transparent 31rem),
    radial-gradient(ellipse at 96% 25%, rgba(240, 189, 101, .08), transparent 27rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.page-main { width: 100%; flex: 1; }
.container { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 17, 24, .86);
  backdrop-filter: blur(18px);
}
.header-inner {
  width: min(1240px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand img { filter: drop-shadow(0 4px 10px rgba(195, 45, 61, .35)); }
.brand span { display: grid; line-height: 1.12; }
.brand strong { font-size: 18px; letter-spacing: -.04em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 9px; letter-spacing: .17em; font-weight: 750; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a, .link-button {
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  color: #c5d0d8;
  background: transparent;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.main-nav a:hover, .link-button:hover { color: #fff; background: rgba(255,255,255,.07); }
.main-nav .nav-register { padding: 10px 15px; color: #1b1010; background: var(--gold); }
.main-nav .nav-register:hover { color: #1b1010; background: #ffcf80; }
.nav-user { margin-left: 7px; padding-left: 14px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.nav-logout { margin: 0; }
.nav-logout button { color: var(--muted); }

.flash {
  width: min(1160px, calc(100% - 40px));
  margin: 18px auto 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
}
.flash-success { color: #b9f3d9; background: rgba(38, 127, 91, .19); border-color: rgba(89, 201, 154, .32); }
.flash-warning { color: #ffe2a9; background: rgba(167, 112, 31, .16); border-color: rgba(240, 189, 101, .3); }
.flash-error { color: #ffc4c4; background: rgba(159, 49, 59, .19); border-color: rgba(238, 83, 96, .34); }

.home-wrap { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 72px; }
.hero {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  align-items: center;
  gap: 28px;
  padding: 48px 52px;
  border: 1px solid rgba(240, 189, 101, .18);
  border-radius: 28px;
  background: linear-gradient(115deg, rgba(29, 38, 49, .97) 0%, rgba(24, 34, 46, .94) 57%, rgba(76, 38, 43, .74) 100%);
  box-shadow: var(--shadow);
}
.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image: linear-gradient(90deg, rgba(12,17,24,.12), rgba(12,17,24,.76)), url("siatkowka.jpg");
  background-size: cover;
  background-position: center 42%;
  opacity: .16;
  pointer-events: none;
}
.hero-copy, .hero-art { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 12px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { max-width: 750px; margin: 0; font-size: clamp(38px, 6vw, 66px); letter-spacing: -.065em; line-height: .99; }
.hero h1 span { color: var(--gold); }
.hero-copy > p:not(.eyebrow) { max-width: 570px; margin: 18px 0 0; color: #c4cdd5; font-size: 16px; }
.hero-note { display: flex; gap: 9px; align-items: center; margin-top: 24px; color: #dce3e9; font-size: 12px; }
.hero-note::before { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); content: ""; }
.hero-art { display: grid; place-items: center; }
.hero-art img { width: min(210px, 100%); height: auto; filter: drop-shadow(0 20px 35px rgba(0,0,0,.34)); transform: rotate(-11deg); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 42px 0 17px; }
.section-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.team-card {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 26px 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(25,35,47,.98), rgba(16,24,34,.94));
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.team-card::after {
  position: absolute;
  right: -48px;
  bottom: -95px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 20px rgba(255,255,255,.025), 0 0 0 42px rgba(255,255,255,.02);
  content: "";
}
.team-card:hover { transform: translateY(-4px); border-color: rgba(240,189,101,.52); background-color: var(--panel-soft); }
.team-card.women { border-top: 2px solid var(--red); }
.team-card.men { border-top: 2px solid var(--gold); }
.team-tag { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.team-card h3 { position: relative; z-index: 1; margin: 10px 0 7px; font-size: 29px; letter-spacing: -.045em; }
.team-card p { position: relative; z-index: 1; max-width: 400px; margin: 0; color: #aebac4; font-size: 14px; }
.team-card .team-enter { position: relative; z-index: 1; margin-top: auto; padding-top: 23px; color: var(--gold); font-size: 12px; font-weight: 800; }
.team-enter span { margin-left: 5px; transition: margin .2s ease; }
.team-card:hover .team-enter span { margin-left: 10px; }
.team-count { position: absolute; top: 24px; right: 25px; z-index: 1; color: #71808c; font-size: 11px; text-align: right; }
.team-count strong { display: block; color: #d8e0e6; font-size: 16px; }
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 19px; border: 1px solid var(--line); border-radius: 17px; background: rgba(19,27,37,.66); }
.home-stat { padding: 16px 20px; }
.home-stat + .home-stat { border-left: 1px solid var(--line); }
.home-stat strong { display: block; font-size: 20px; letter-spacing: -.04em; }
.home-stat span { color: var(--muted); font-size: 11px; }
.home-actions { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 26px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255,255,255,.045);
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.27); background: rgba(255,255,255,.09); }
.button-primary { color: #21170c; border-color: transparent; background: var(--gold); }
.button-primary:hover { color: #21170c; background: #ffcf80; }
.button-red { color: #fff; border-color: transparent; background: var(--red-deep); }
.button-red:hover { background: #e13d4b; }
.button-danger { color: #ffcaca; border-color: rgba(238,83,96,.28); background: rgba(159,49,59,.15); }
.button-small { min-height: 34px; padding: 6px 10px; border-radius: 9px; font-size: 11px; }
.button-full { width: 100%; }
.text-link { color: var(--gold); text-decoration-color: rgba(240,189,101,.45); text-underline-offset: 3px; }
.text-link:hover { color: #ffcf80; }

.content-wrap { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 60px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 8px 0 22px; }
.page-heading h1 { margin: 0; font-size: clamp(27px, 4vw, 38px); letter-spacing: -.055em; line-height: 1.08; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.page-heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(22,31,42,.97), rgba(17,24,34,.97));
  box-shadow: 0 12px 38px rgba(0,0,0,.11);
}
.panel + .panel { margin-top: 16px; }
.panel h2, .panel h3 { margin: 0 0 14px; letter-spacing: -.035em; }
.panel h2 { font-size: 21px; }
.panel h3 { font-size: 17px; }
.panel p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 18px 0; }
.stat-card { min-height: 100px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 15px; background: rgba(18,27,37,.8); }
.stat-card span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.stat-card strong { display: block; margin-top: 7px; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.05em; }
.team-switch { display: inline-flex; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,13,18,.4); }
.team-switch a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 750; }
.team-switch a.active { color: #21170c; background: var(--gold); }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 11px; margin: 0 0 16px; }
.toolbar label, .field label { display: block; margin: 0 0 6px; color: #c5d0d8; font-size: 12px; font-weight: 700; }
.toolbar .field { min-width: 145px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.input, .select, .textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid rgba(220,230,240,.16);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: #0c131c;
  font-size: 13px;
}
.textarea { min-height: 100px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(240,189,101,.68); box-shadow: 0 0 0 3px rgba(240,189,101,.09); }
.select option { color: var(--text); background: #111923; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.help { margin: 6px 0 0; color: #82919d; font-size: 11px; }
.check-row { display: flex; align-items: start; gap: 9px; color: var(--muted); font-size: 12px; }
.check-row input { margin-top: 3px; accent-color: var(--gold); }
.auth-shell { width: min(470px, calc(100% - 32px)); margin: 45px auto 70px; }
.auth-heading { margin-bottom: 20px; text-align: center; }
.auth-heading .eyebrow { margin-bottom: 8px; }
.auth-heading h1 { margin: 0; font-size: 34px; letter-spacing: -.055em; }
.auth-heading p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.auth-panel { padding: 26px; }
.auth-form { display: grid; gap: 15px; }
.auth-bottom { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.inline-errors { margin: 0 0 15px; padding: 12px 14px; border: 1px solid rgba(238,83,96,.34); border-radius: 11px; color: #ffc4c4; background: rgba(159,49,59,.15); font-size: 13px; }
.inline-errors ul { margin: 0; padding-left: 18px; }
.auth-info { margin-top: 17px; padding: 13px; border: 1px solid rgba(240,189,101,.2); border-radius: 11px; color: #e5d3b2; background: rgba(167,112,31,.11); font-size: 12px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 740px; font-size: 12px; }
.data-table th { padding: 11px 13px; color: #99a7b3; background: rgba(255,255,255,.035); text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 12px 13px; border-top: 1px solid rgba(220,230,240,.075); vertical-align: middle; }
.data-table tbody tr:hover { background: rgba(255,255,255,.025); }
.data-table .cell-right { text-align: right; }
.data-table .cell-center { text-align: center; }
.data-table th.route-attribution { color: #f2f5f7; font: 400 12px Arial, sans-serif; letter-spacing: normal; text-transform: none; }
.data-table .opponent { font-weight: 750; }
.data-table .subline { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.table-actions form { margin: 0; }
.trip-add-form { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.trip-add-form .input { width: 74px; min-height: 34px; padding: 5px 7px; }
.trip-add-form .km-label { color: var(--muted); font-size: 10px; }
.route-attribution { display: block; margin-top: 2px; color: #f2f5f7; font: 400 12px Arial, sans-serif; letter-spacing: normal; white-space: nowrap; }
.route-attribution a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.status {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #c2ccd4;
  background: rgba(255,255,255,.04);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.status-played { color: #a8edce; border-color: rgba(89,201,154,.25); background: rgba(38,127,91,.12); }
.status-postponed { color: #ffe2a9; border-color: rgba(240,189,101,.25); background: rgba(167,112,31,.11); }
.status-canceled { color: #ffb9bd; border-color: rgba(238,83,96,.25); background: rgba(159,49,59,.12); }
.score { display: inline-block; min-width: 45px; font-weight: 800; white-space: nowrap; }
.empty-state { padding: 35px 16px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--text); }
.filters-line { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.filters-line .field { min-width: 145px; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.pagination-links { display: flex; gap: 8px; }
.ranking-position { width: 40px; color: var(--gold); font-size: 15px; font-weight: 850; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-grid .panel { margin: 0; }
.profile-email { overflow-wrap: anywhere; color: var(--gold); }
.note-box { padding: 14px; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; color: #c5d0d8; background: rgba(240,189,101,.07); font-size: 12px; }
.site-footer { margin-top: 42px; border-top: 1px solid var(--line); background: rgba(8,12,17,.45); }
.footer-inner { width: min(1160px, calc(100% - 40px)); min-height: 74px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 15px; color: #798894; font-size: 11px; }
.footer-brand { color: #cbd4db; font-size: 10px; font-weight: 850; letter-spacing: .13em; text-decoration: none; }
.footer-brand span { padding: 0 5px; color: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .header-inner { min-height: 70px; align-items: flex-start; flex-direction: column; gap: 8px; padding: 12px 0 10px; }
  .main-nav { width: 100%; overflow-x: auto; gap: 3px; padding-bottom: 2px; }
  .main-nav a, .link-button { padding: 8px 10px; white-space: nowrap; }
  .nav-user { display: none; }
  .hero { min-height: 275px; grid-template-columns: 1fr 150px; padding: 32px; }
  .hero-art img { width: 140px; }
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .container, .content-wrap, .home-wrap, .footer-inner { width: min(100% - 26px, 1160px); }
  .header-inner { width: min(100% - 26px, 1240px); }
  .hero { min-height: 0; grid-template-columns: 1fr; padding: 27px 23px 24px; }
  .hero h1 { max-width: 420px; font-size: 43px; }
  .hero-copy > p:not(.eyebrow) { max-width: 430px; font-size: 14px; }
  .hero-art { position: absolute; right: 8px; bottom: 0; opacity: .18; }
  .hero-art img { width: 145px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 5px; margin-top: 31px; }
  .section-heading h2 { font-size: 22px; }
  .team-grid { grid-template-columns: 1fr; gap: 12px; }
  .team-card { min-height: 195px; padding: 22px; }
  .team-count { top: 20px; right: 20px; }
  .team-card h3 { font-size: 26px; }
  .home-stats { grid-template-columns: 1fr; }
  .home-stat { padding: 12px 16px; }
  .home-stat + .home-stat { border-top: 1px solid var(--line); border-left: 0; }
  .home-stat strong { display: inline-block; min-width: 70px; margin: 0 7px 0 0; font-size: 18px; }
  .home-actions { align-items: stretch; flex-direction: column; }
  .content-wrap { padding-top: 21px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr; gap: 8px; }
  .stat-card { min-height: auto; padding: 13px 15px; }
  .stat-card strong { display: inline-block; margin: 0 0 0 8px; font-size: 20px; }
  .toolbar { align-items: stretch; }
  .toolbar .field, .filters-line .field { flex: 1; min-width: 120px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .auth-shell { margin-top: 30px; }
  .auth-panel { padding: 20px; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: 15px 0; gap: 5px; }
  .pagination { align-items: flex-start; flex-direction: column; }
}
