/* Siatkówka Łąck. Mobile first, bez frameworka. */
:root {
  --ink: #16233f;
  --ink-2: #3c4864;
  --muted: #6b7489;
  --bg: #f4f1ea;
  --card: #ffffff;
  --line: #e4dfd3;
  --ball: #f5b82e;
  --ball-deep: #d99a0b;
  --ok: #1f7a4d;
  --ok-bg: #e5f4ec;
  --res: #8a5a00;
  --res-bg: #fdf1d6;
  --bad: #b3261e;
  --bad-bg: #fbe9e7;
  --info-bg: #e8eef9;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(22, 35, 63, .06), 0 4px 16px rgba(22, 35, 63, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding-top: 16px; padding-bottom: 24px; }
a { color: var(--ink); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.is-admin .wrap { max-width: 980px; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: .85rem; }
.center { text-align: center; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: .9em; }

/* Nagłówek */
.top { background: var(--ink); color: #fff; padding-top: env(safe-area-inset-top); }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.nav { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; font-size: .95rem; }
.nav a, .nav .linkbtn { color: #dfe5f2; text-decoration: none; }
.nav form { margin: 0; }
.foot { padding-top: 8px; padding-bottom: 24px; font-size: .9rem; color: var(--muted); }
.foot a { color: var(--muted); }

/* Karty */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
details.card > summary { cursor: pointer; font-weight: 600; }
details.card[open] > summary { margin-bottom: 12px; }

/* Komunikaty */
.flash { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-weight: 500; }
.flash--ok { background: var(--ok-bg); color: var(--ok); }
.flash--info { background: var(--info-bg); color: var(--ink); }
.flash--error { background: var(--bad-bg); color: var(--bad); }
.banner { background: var(--info-bg); border-radius: 10px; padding: 10px 12px; margin: 12px 0; }
.banner--bad { background: var(--bad-bg); color: var(--bad); }
.hint { color: var(--muted); font-size: .92rem; margin: 8px 0; }

/* Gra */
.event__kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--ball-deep); margin: 0; }
.event__title { font-size: 2.2rem; margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.event__place { margin: 0 0 6px; color: var(--ink-2); }
.count { display: flex; align-items: center; gap: 16px; margin: 16px 0 8px; }
.count__num { font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.count__num span { font-size: 3.4rem; font-weight: 800; letter-spacing: -.03em; }
.count__num small { font-size: 1.5rem; color: var(--muted); font-weight: 600; }
.count__side { flex: 1; min-width: 0; }
.count__side p { margin: 6px 0 0; color: var(--ink-2); }
.bar { height: 10px; background: #ece7db; border-radius: 99px; overflow: hidden; }
.bar__fill { height: 100%; background: linear-gradient(90deg, var(--ball), var(--ball-deep)); border-radius: 99px; }
.phase { margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-2); }

.me__status { font-size: 1.15rem; font-weight: 600; margin: 0 0 6px; }
.me__status--in { color: var(--ok); }
.me__status--res { color: var(--res); }
.price { margin: 12px 0 0; font-size: .92rem; color: var(--ink-2); }

/* Przyciski */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; cursor: pointer; text-decoration: none;
  background: var(--ball); color: var(--ink); font: inherit; font-weight: 700;
  padding: 10px 18px; min-height: 44px; transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .linkbtn:focus-visible, .toggle:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.btn--big { width: 100%; min-height: 56px; font-size: 1.1rem; margin-top: 10px; }
.btn--ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
.btn--danger { background: var(--bad); color: #fff; }
.btn--small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.linkbtn.danger { color: var(--bad); }

/* Listy graczy */
.lists h2 { display: flex; justify-content: space-between; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.people__n { min-width: 2.2em; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; text-align: right; }
.people__name { flex: 1; min-width: 0; }
.people li.is-me { background: #fff7e0; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 8px; font-weight: 700; }
.people--res .people__n { color: var(--res); }
.people--admin .people__name .small { display: block; }
.people--admin form { margin: 0; }
.tag { display: inline-block; font-size: .72rem; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--ink); color: #fff; vertical-align: 2px; margin-left: 4px; }
.tag--pay { background: var(--res-bg); color: var(--res); }
.legend { font-size: .85rem; color: var(--muted); margin: 0 0 8px; }
.nextlink { text-align: center; }

/* Formularze */
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; }
.form input:not([type=checkbox]), .form select, .form textarea {
  width: 100%; font: inherit; font-weight: 400; color: var(--ink); background: #fff;
  border: 1.5px solid #cfc8b8; border-radius: 10px; padding: 10px 12px; min-height: 46px;
}
.form textarea { min-height: 0; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(245, 184, 46, .45); }
.form .pin { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.form label.check { display: flex; align-items: center; gap: 10px; }
.form label.check input { width: 22px; height: 22px; accent-color: var(--ink); }
.form--row { grid-template-columns: 1fr auto; align-items: end; }
.grid2 { grid-template-columns: 1fr; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 8px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

/* Panel */
.eventrow { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; text-decoration: none; }
.eventrow__stats { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); }
.warn { color: var(--res); font-weight: 600; }
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--info-bg); margin-left: 6px; }
.pill--cancelled, .pill--blocked { background: var(--bad-bg); color: var(--bad); }
.pill--priority { background: #fff3cf; color: var(--res); }
.pill--open, .pill--active { background: var(--ok-bg); color: var(--ok); }
.pill--invited { background: var(--res-bg); color: var(--res); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { display: grid; gap: 2px; padding: 14px; font-size: .85rem; color: var(--muted); }
.stat__n { font-size: 1.6rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.cols { display: grid; gap: 0 14px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
.missing { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.missing form { margin: 0; }
.dangerzone { margin: 8px 0 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions form { margin: 0; }
.tablewrap { overflow-x: auto; padding: 6px 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 6px; }
.table td { padding: 10px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.table form { margin: 0; }
.table tr.is-blocked td { opacity: .55; }
.toggle { font: inherit; font-size: .85rem; font-weight: 700; border: 0; border-radius: 99px; padding: 4px 12px; cursor: pointer; background: #ece7db; color: var(--muted); min-width: 52px; }
.toggle.is-on { background: var(--ink); color: #fff; }
.invites { border: 2px solid var(--ball); }
.invite { padding: 12px 0; border-top: 1px solid var(--line); }
.invite textarea { width: 100%; font: inherit; font-size: .9rem; margin: 6px 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--bg); }
.invite__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.prose h2 { margin-top: 20px; }
.prose ul { padding-left: 20px; margin: 0; }
.prose li { margin: 4px 0; }

@media (min-width: 720px) {
  h1 { font-size: 1.9rem; }
  .card { padding: 22px; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid2 .span2 { grid-column: span 2; }
  .cols { grid-template-columns: 1.3fr 1fr; align-items: start; }
}

@media (hover: hover) {
  .nav a:hover, .nav .linkbtn:hover { color: #fff; text-decoration: underline; }
  .btn:hover { background: var(--ball-deep); }
  .btn--ghost:hover { background: var(--ink); color: #fff; }
  .btn--danger:hover { background: #8c1d17; }
  .eventrow:hover { box-shadow: 0 0 0 2px var(--ball), var(--shadow); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Na telefonie: abonenci bez zapisu nad listą */
.cols { display: flex; flex-direction: column; }
.cols > section:nth-child(2) { order: -1; }
.cols h2 + .plain + h2, .cols .plain + h2 { margin-top: 18px; }
@media (min-width: 720px) {
  .cols { display: grid; }
  .cols > section:nth-child(2) { order: 0; }
}
