[hidden] { display: none !important; }
:root {
  --bg: #f6f7f4; --surface: #ffffff; --surface-2: #eef0ea; --line: #dfe2d9;
  --text: #1b1d19; --muted: #5f6559; --accent: #2f6f3e; --accent-ink: #ffffff;
  --accent-soft: #dcebd9; --warn: #9a5b00; --warn-soft: #fbecd2; --danger: #b3261e;
  --scrim: rgba(0,0,0,.38); --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --radius: 18px; --tap: 48px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121412; --surface: #1c1f1b; --surface-2: #262a25; --line: #343932;
    --text: #e6e9e2; --muted: #a1a89b; --accent: #8fd19e; --accent-ink: #0d2614;
    --accent-soft: #23402b; --warn: #f2bd6b; --warn-soft: #3b2e17; --danger: #ffb4ab;
    --scrim: rgba(0,0,0,.6); --shadow: none;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh; overscroll-behavior-y: contain;
}
button { font: inherit; color: inherit; }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg);
  padding: calc(var(--safe-t) + 14px) 0 10px; }
.top h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.top .sub { color: var(--muted); font-size: 14px; }

/* list */
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin: 22px 4px 8px; }
.card { width: 100%; display: flex; gap: 14px; align-items: center; text-align: left;
  background: var(--surface); border: 0; border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); margin-bottom: 10px; cursor: pointer; min-height: 84px;
  transition: transform .12s ease; }
.card:active { transform: scale(.985); }
.date { flex: none; width: 56px; height: 56px; border-radius: 14px; background: var(--accent-soft);
  color: var(--accent); display: grid; place-items: center; line-height: 1.05; text-align: center; }
.date b { font-size: 22px; display: block; }
.date small { font-size: 12px; font-weight: 600; text-transform: uppercase; }
.card .main { flex: 1; min-width: 0; }
.card .when { font-size: 20px; font-weight: 650; }
.card .club { color: var(--muted); font-size: 15px; }
.card .who { font-size: 14px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px;
  border-radius: 99px; background: var(--surface-2); color: var(--muted); vertical-align: 2px; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.chev { color: var(--muted); font-size: 22px; }
.card.past { opacity: .7; box-shadow: none; background: var(--surface-2); }
.card.past .date { background: var(--line); color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }

.feed { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.feed p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.feed code { display: block; font-size: 13px; background: var(--surface-2); padding: 10px;
  border-radius: 10px; overflow-x: auto; white-space: nowrap; margin-bottom: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

details summary { list-style: none; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
details summary .section-title::after { content: " ▾"; }
details[open] summary .section-title::after { content: " ▴"; }

/* buttons */
.btn { min-height: var(--tap); border-radius: 99px; border: 0; padding: 0 20px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:disabled { opacity: .4; }
.btn.tonal { background: var(--surface-2); color: var(--text); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.block { width: 100%; font-size: 17px; min-height: 56px; }

/* bottom: FAB + tabs */
.spacer { height: calc(150px + var(--safe-b)); }
.fab { position: fixed; z-index: 6; right: max(16px, calc(50% - 264px));
  bottom: calc(76px + var(--safe-b)); height: 56px; padding: 0 22px 0 18px; border-radius: 18px;
  background: var(--accent); color: var(--accent-ink); border: 0; font-weight: 650; font-size: 17px;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.18); cursor: pointer; }
.fab span { font-size: 26px; line-height: 0; margin-top: -2px; }
.tabs { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; background: var(--surface);
  border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: var(--safe-b); }
.tabs button { flex: 1; max-width: 186px; border: 0; background: none; min-height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button i { font-style: normal; font-size: 20px; width: 56px; height: 30px; border-radius: 99px;
  display: grid; place-items: center; }
.tabs button[aria-current="page"] { color: var(--text); }
.tabs button[aria-current="page"] i { background: var(--accent-soft); }

/* sheet */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; opacity: 0;
  pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  max-height: 92dvh; background: var(--surface); border-radius: 26px 26px 0 0;
  display: flex; flex-direction: column; transform: translateY(105%);
  transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.sheet.open { transform: translateY(0); }
.sheet.dragging { transition: none; }
.grab { padding: 10px 20px 4px; touch-action: none; cursor: grab; }
.grab .handle { width: 36px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 12px; }
.grab h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.grab .sub { color: var(--muted); font-size: 14px; }
.sheet .body { overflow-y: auto; padding: 4px 20px 12px; overscroll-behavior: contain; }
.sheet .foot { padding: 10px 20px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
.sheet .foot .hint { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 8px; min-height: 18px; }
.label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 0 8px;
  display: flex; justify-content: space-between; align-items: baseline; }
.label .live { font-weight: 500; }

.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chips.clubs { grid-template-columns: 1fr; }
.chips.players { display: flex; flex-wrap: wrap; }
.chip { min-height: 56px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 4px;
  cursor: pointer; position: relative; transition: background .12s, border-color .12s; }
.chip b { font-size: 17px; font-weight: 650; }
.chip small { font-size: 12px; color: var(--muted); }
.chip.full small { color: var(--warn); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] small { color: var(--accent-ink); opacity: .85; }
.chip .star { position: absolute; top: 3px; right: 6px; font-size: 11px; }
.chip.was::after { content: "teraz"; position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 700; background: var(--surface); color: var(--muted); padding: 0 5px;
  border-radius: 6px; border: 1px solid var(--line); }
.chips.clubs .chip { flex-direction: row; justify-content: space-between; padding: 0 16px; }
.chips.players .chip { min-height: 44px; flex-direction: row; padding: 0 14px; border-radius: 99px; gap: 6px; font-weight: 600; }
.chips.players .chip[aria-pressed="true"]::before { content: "✓"; }
.chip.skeleton small { color: transparent; background: var(--surface-2); border-radius: 4px;
  animation: pulse 1s infinite ease-in-out; }
@keyframes pulse { 50% { opacity: .4; } }

.days { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -20px; padding: 2px 20px 6px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day { flex: none; scroll-snap-align: start; width: 64px; min-height: 76px; border-radius: 16px;
  border: 1.5px solid var(--line); background: var(--surface); display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer; gap: 1px; position: relative; }
.day small { font-size: 12px; color: var(--muted); font-weight: 600; }
.day b { font-size: 22px; }
.day .tag { font-size: 11px; font-weight: 600; color: var(--accent); }
.day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day[aria-pressed="true"] small, .day[aria-pressed="true"] .tag { color: var(--accent-ink); }
.day:disabled { opacity: .45; cursor: not-allowed; }
.weekend { background: var(--surface-2); }

.note { font-size: 13px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); margin-top: 12px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.more { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.more .btn { min-height: 48px; font-size: 15px; }
.more .danger { grid-column: 1 / -1; }

/* toast */
.toast { position: fixed; z-index: 30; left: 16px; right: 16px; max-width: 528px; margin: 0 auto;
  bottom: calc(148px + var(--safe-b)); background: #2b2f29; color: #f1f3ee; border-radius: 14px;
  padding: 6px 6px 6px 16px; display: flex; align-items: center; gap: 8px; min-height: 52px;
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { transform: none; opacity: 1; pointer-events: auto; }
.toast span { flex: 1; font-size: 15px; }
.toast .btn { color: #a8e0b4; min-height: 40px; padding: 0 14px; }

@media (min-width: 720px) {
  .sheet { bottom: auto; top: 50%; border-radius: 26px; max-height: 86vh;
    transform: translateY(-46%) scale(.97); opacity: 0; pointer-events: none;
    transition: transform .2s, opacity .2s; }
  .sheet.open { transform: translateY(-50%); opacity: 1; pointer-events: auto; }
  .grab .handle { display: none; }
  .toast { bottom: 96px; }
}

/* additions over the prototype */
.signed-out { text-align: center; padding: 18vh 24px 0; }
.signed-out h2 { margin: 0 0 8px; font-size: 24px; }
.signed-out p { color: var(--muted); margin: 0 auto 6px; max-width: 340px; }
.signed-out .steps { font-weight: 600; color: var(--text); margin-top: 14px; }
.ballot { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 10px; }
.ballot .opt { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.ballot .opt:first-of-type { border-top: 0; }
.ballot .opt b { font-weight: 600; }
.ballot .opt span { color: var(--muted); text-align: right; }
.status-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface);
  border-radius: 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
.status-row small { color: var(--muted); display: block; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; background: var(--muted); }
.dot.ok { background: #3c9a52; } .dot.bad { background: var(--danger); }
.chip.unknown small { color: var(--muted); }
.newname { display: flex; gap: 8px; margin-top: 10px; }
.newname input { flex: 1; min-height: 44px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--text); padding: 0 16px; font: inherit; font-size: 16px; }
.newname input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
.empty.tight { padding-top: 8px; }
.aside { color: var(--muted); font-size: 14px; }
