:root { --bg: #f6f5f1; --surface: #fff; --text: #1d1d1f; --muted: #6b6b70; --line: #e2dfd8; --accent: #1d5fc4;
  --green: #2e8b57; --blue: #2779b8; --yellow: #c9930a; --orange: #cc5f1c; --grey: #85858c; --red: #b3261e;
  --ok-bg: #e3f3e9; --bad-bg: #fbe4e2; --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 14px rgb(0 0 0 / .05); }
@media (prefers-color-scheme: dark) {
  :root { --bg: #121214; --surface: #1c1c20; --text: #ececee; --muted: #9a9aa2; --line: #2f2f35; --accent: #7db8ff;
    --green: #3aa56c; --blue: #3b8fd0; --yellow: #d6a51f; --orange: #e0752f; --grey: #5e5e66; --red: #ff6b60;
    --ok-bg: #173a28; --bad-bg: #462220; --shadow: 0 1px 2px rgb(0 0 0 / .4); }
}
/* native controls and scrollbars follow the light or dark theme */
:root { color-scheme: light dark; }
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
body { margin: 0 auto; max-width: 880px; padding: 20px 16px 40px; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: .9rem; }

/* Header: the name as a row of tiles, coloured like the clues. */
header { text-align: center; }
.wordmark { display: flex; justify-content: center; gap: 6px; margin: 4px 0 8px; font-size: 1.5rem; }
.wordmark span { display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 8px;
  font-weight: 800; color: #fff; background: var(--grey); box-shadow: var(--shadow); }
.wordmark span:nth-child(1), .wordmark span:nth-child(4) { background: var(--green); }
.wordmark span:nth-child(2), .wordmark span:nth-child(6) { background: var(--yellow); }
.tagline { margin: 0 0 14px; }

/* Game switcher. */
.tabs { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px; margin: 0 0 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.tabs button { font: inherit; font-weight: 600; padding: 8px 16px; border: 0; border-radius: 9px;
  background: none; color: var(--muted); cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .tabs button[aria-selected="true"] { color: #0d1b2e; } }

/* Endless mode switch (testing aid). */
.mode { font: inherit; font-size: .85rem; font-weight: 600; padding: 5px 12px; border-radius: 99px; cursor: pointer;
  border: 1px dashed var(--line); background: none; color: var(--muted); }
.mode[aria-pressed="true"] { border-style: solid; border-color: var(--accent); color: var(--accent); }
header p { margin: 0 0 14px; }

.lead { font-size: 1.35rem; font-weight: 700; margin: 0 0 10px; text-align: center; }

/* Instructions: a "?" button next to the title and a popup. */
.help-btn { font: inherit; font-size: .95rem; font-weight: 800; width: 1.7em; height: 1.7em; padding: 0; margin-left: 4px;
  vertical-align: middle; border-radius: 50%; border: 2px solid var(--accent); background: none; color: var(--accent); cursor: pointer; }
.help-btn:hover { background: var(--accent); color: var(--surface); }
dialog.help { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 20px 22px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text);
  box-shadow: 0 12px 48px rgb(0 0 0 / .3); }
dialog.help::backdrop { background: rgb(0 0 0 / .5); }
dialog.help h2 { font-size: 1.25rem; margin: 0 32px 10px 0; }
dialog.help ol { margin: 0 0 8px; padding-left: 22px; }
dialog.help li { margin: 8px 0; }
.help-close { position: absolute; top: 10px; right: 12px; font-size: 1.5rem; line-height: 1; padding: 2px 8px;
  border: 0; background: none; color: var(--muted); cursor: pointer; }
.help-ok { text-align: center; margin: 14px 0 0; }

/* Progress markers. */
.marks { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 0 12px; }
.marks .muted { margin-right: 4px; }
.mark { width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--line); background: none; }
.mark.used { background: var(--grey); border-color: var(--grey); }
.mark.ok { background: var(--green); border-color: var(--green); }
.mark.bad { background: var(--red); border-color: var(--red); }

/* Buttons and the guess box. */
.btn { font: inherit; font-weight: 600; padding: 9px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.yes { background: var(--green); border-color: var(--green); color: #fff; }
.btn.no { background: var(--red); border-color: var(--red); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0d1b2e; } .btn.no { color: #2a0d0b; } }
.btn:disabled { opacity: .5; cursor: default; }
.guess { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.guess input { flex: 1 1 220px; font: inherit; padding: 9px 12px; border-radius: 10px; border: 2px solid var(--line);
  background: var(--surface); color: var(--text); }
.guess input:focus { outline: none; border-color: var(--accent); }
.guess.choice { justify-content: center; }
.guess.choice .btn { flex: 1 1 140px; max-width: 220px; padding: 12px 18px; font-size: 1.05rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  margin: 12px 0; box-shadow: var(--shadow); }

/* Clue grid. */
.grid-scroll { overflow-x: auto; margin: 0 -4px; }
table.grid { border-collapse: separate; border-spacing: 5px; width: 100%; font-size: .85rem; }
table.grid th { font-weight: 600; color: var(--muted); text-align: center; font-size: .74rem;
  text-transform: uppercase; letter-spacing: .03em; padding: 0 2px 2px; }
table.grid td { padding: 9px 6px; border-radius: 8px; text-align: center; color: #fff; min-width: 86px;
  font-weight: 600; box-shadow: var(--shadow); }
table.grid td.name { background: var(--surface); color: var(--text); border: 1px solid var(--line); text-align: left; }
td.green, .pill.green { background: var(--green); }
td.blue, .pill.blue { background: var(--blue); }
td.yellow, .pill.yellow { background: var(--yellow); }
.pill.orange { background: var(--orange); }
td.grey, .pill.grey { background: var(--grey); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; color: #fff; font-size: .8rem; font-weight: 600; }
/* The newest guess turns over, one tile after another. */
@media (prefers-reduced-motion: no-preference) {
  tr.latest td { animation: flip .45s ease both; }
  tr.latest td:nth-child(2) { animation-delay: .06s; } tr.latest td:nth-child(3) { animation-delay: .12s; }
  tr.latest td:nth-child(4) { animation-delay: .18s; } tr.latest td:nth-child(5) { animation-delay: .24s; }
  tr.latest td:nth-child(6) { animation-delay: .30s; } tr.latest td:nth-child(7) { animation-delay: .36s; }
  tr.latest td:nth-child(8) { animation-delay: .42s; }
  @keyframes flip { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
}

.amend { white-space: pre-wrap; font-family: Georgia, "Times New Roman", serif; }
.result { font-weight: 700; padding: 10px 14px; border-radius: 10px; text-align: center; margin: 12px 0; }
.result.ok { color: var(--green); background: var(--ok-bg); }
.result.bad { color: var(--red); background: var(--bad-bg); }
.card > .result { text-align: left; margin-top: 0; }
.photo { width: 120px; height: 150px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.reveal { display: flex; gap: 14px; align-items: flex-start; }
.reveal p { margin: 0 0 4px; }
ul.votes { list-style: none; padding: 0; margin: 6px 0 0; }
ul.votes li { margin: 0; padding: 7px 0; border-top: 1px solid var(--line); }
ul.votes li:first-child { border-top: 0; }
.v-yes { color: var(--green); font-weight: 700; } .v-no { color: var(--red); font-weight: 700; }
.v-abstain { color: var(--yellow); font-weight: 700; } .v-absent { color: var(--grey); font-weight: 700; }
footer { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 12px; text-align: center; }

/* What an amendment changes in the bill. */
details.context { margin: 12px 0; border-top: 1px solid var(--line); padding-top: 10px; font-size: .92rem; }
details.context summary { cursor: pointer; color: var(--muted); }
.rows .r { padding: 2px 6px 2px calc(6px + var(--d, 0) * 1.2em); border-radius: 3px; font-family: Georgia, serif; }
.rows .r-context, .rows .r-parent, .rows .r-gap { color: var(--muted); font-size: .9em; }
.rows .r-added, .rows ins { background: var(--ok-bg); text-decoration: none; }
.rows .r-removed, .rows del { background: var(--bad-bg); }
.rows .r-removed { text-decoration: line-through; }

@media (max-width: 520px) {
  .wordmark { font-size: 1.2rem; gap: 4px; }
  .tabs { display: flex; }
  .tabs button { flex: 1 1 auto; padding: 8px 10px; }
  .reveal { flex-direction: column; }
}

/* "Kim jestem?" timeline: clue cards, guesses with what they got right, the answer. */
.clue-label { margin: 0 0 6px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.clue-value { font-size: 1.1rem; font-weight: 600; }
.card.guessed { border-width: 2px; padding: 10px 14px; }
.card.guessed.green { border-color: var(--green); }
.card.guessed.blue { border-color: var(--blue); }
.card.guessed.yellow { border-color: var(--yellow); }
.card.guessed.grey { border-color: var(--grey); }
.guessed-name { margin: 0; font-weight: 700; }
.guessed-fb { margin: 2px 0 0; font-size: .9rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.green { background: var(--green); } .dot.blue { background: var(--blue); } .dot.yellow { background: var(--yellow); } .dot.grey { background: var(--grey); }
.card.answer { border-width: 2px; }
.card.answer.won { border-color: var(--green); }
.card.answer.lost { border-color: var(--red); }
.card.answer .reveal { border: 0; box-shadow: none; padding: 0; margin: 0; background: none; }
.next { text-align: center; margin: 14px 0 0; }

/* The result to share: the text as it will be pasted, then where to send it. */
.card.share { text-align: center; }
.share-text { margin: 0 0 12px; font: inherit; line-height: 1.3; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.share-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.share-actions a.btn { text-decoration: none; }
.share-status { margin: 8px 0 0; }
.share-status:empty { display: none; }
.btn.quiet { box-shadow: none; border-style: dashed; color: var(--muted); font-weight: 500; }
.axis { font-weight: 600; }
ul.committees { margin: 0; padding-left: 20px; font-size: 1rem; font-weight: 500; }
ul.committees li { margin: 3px 0; }

/* Level switch and the easy-mode grid of MPs grouped by club. */
.level { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 0; flex-wrap: wrap; }
.segs { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: var(--surface); }
.seg { font: inherit; font-size: .88rem; font-weight: 600; padding: 5px 14px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.seg[aria-pressed="true"] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .seg[aria-pressed="true"] { color: #0d1b2e; } }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font: inherit; font-size: .82rem; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); cursor: pointer; }
.chip:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.chip:disabled { opacity: .4; text-decoration: line-through; cursor: default; }

/* The list of MPs: a popup with one column per club, scrolled sideways. */
dialog.picker { width: min(1040px, calc(100vw - 16px)); max-height: calc(100vh - 24px); padding: 18px 18px 14px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text);
  box-shadow: 0 12px 48px rgb(0 0 0 / .3); overflow: hidden; }
dialog.picker[open] { display: flex; flex-direction: column; }
dialog.picker::backdrop { background: rgb(0 0 0 / .5); }
dialog.picker h2 { font-size: 1.25rem; margin: 0 32px 2px 0; }
.picker-hint { margin: 0 0 10px; }
dialog.picker input[type="search"] { font: inherit; width: 100%; padding: 9px 12px; border-radius: 10px;
  border: 2px solid var(--line); background: var(--bg); color: var(--text); }
dialog.picker input[type="search"]:focus { outline: none; border-color: var(--accent); }
.club-jump { display: flex; gap: 5px; margin: 10px 0; overflow-x: auto; padding-bottom: 2px; }
.club-jump .chip { flex: none; }
.club-cols { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; flex: 1 1 auto; min-height: 0;
  padding-bottom: 8px; overscroll-behavior: contain; }
.club-col { flex: 0 0 230px; display: flex; flex-direction: column; min-height: 0; max-height: 58vh; scroll-snap-align: start;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow: hidden; }
.club-col[hidden] { display: none; }
.club-col h3 { margin: 0; padding: 9px 12px; font-size: .92rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.club-col ul { list-style: none; margin: 0; padding: 4px; overflow-y: auto; overscroll-behavior: contain; }
.club-col li[hidden] { display: none; }
.club-col .name { display: block; width: 100%; text-align: left; font: inherit; font-size: .9rem; padding: 6px 9px;
  border: 0; border-radius: 7px; background: none; color: var(--text); cursor: pointer; }
.club-col .name:hover:not(:disabled) { background: var(--surface); color: var(--accent); }
.club-col .name:disabled { opacity: .4; text-decoration: line-through; cursor: default; }
@media (max-width: 520px) { .club-col { flex-basis: 76vw; max-height: 52vh; } }

/* Prezydium and Siatka: slots to fill, each with its conditions. */
.score-line { text-align: center; margin: 0 0 2px; }
.points-source { text-align: center; margin: 0 0 10px; font-size: .82rem; }
.slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 100%; min-height: 124px;
  padding: 10px 8px; text-align: center; font: inherit; color: var(--text); background: var(--surface);
  border: 2px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
button.slot { border-style: dashed; cursor: pointer; }
button.slot:hover { border-color: var(--accent); }
button.slot.active { border-style: solid; border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.slot.missed { box-shadow: none; background: none; }
.slot-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.slot-cond { font-size: .9rem; font-weight: 600; line-height: 1.25; }
.slot-cond small { display: block; font-size: .74rem; font-weight: 400; color: var(--muted); }
.slot-plus { font-size: 1.7rem; font-weight: 300; line-height: 1; color: var(--muted); }
.slot .thumb { width: 44px; height: 55px; margin-top: 4px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.slot-name { font-size: .86rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.pts { min-width: 2.4em; padding: 1px 8px; border-radius: 99px; color: #fff; font-size: .8rem; font-weight: 700; }
.pts.green { background: var(--green); } .pts.yellow { background: var(--yellow); }
.pts.orange { background: var(--orange); } .pts.none { background: var(--grey); }
.picking { text-align: center; margin: 12px 0 0; }
ul.answers { margin: 8px 0 0; padding-left: 20px; }
ul.answers li { margin: 5px 0; }
/* Prezydium: the Marshal alone in the first row, the deputies below. */
.seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.seats > :first-child { grid-column: 1 / -1; justify-self: center; width: calc((100% - 16px) / 3); }
/* Siatka: conditions along the top and down the side. */
table.siatka { width: 100%; max-width: 600px; margin: 12px auto; table-layout: fixed; border-collapse: separate; border-spacing: 6px; }
table.siatka th { padding: 2px; font-size: .8rem; font-weight: 700; line-height: 1.2; text-align: center; vertical-align: middle;
  overflow-wrap: anywhere; hyphens: auto; }
table.siatka td { padding: 0; }
table.siatka .slot { min-height: 112px; padding: 6px 4px; }
@media (max-width: 520px) {
  .seats { grid-template-columns: repeat(2, 1fr); }
  .seats > :first-child { width: calc((100% - 8px) / 2); }
  table.siatka { border-spacing: 4px; }
  table.siatka th { font-size: .7rem; }
  table.siatka .slot { min-height: 104px; }
  .slot-name { font-size: .78rem; }
}

/* "Wesprzyj": a pill fixed in the corner, as on the main site. Dialogs open above it. */
.support-pill { position: fixed; right: 16px; bottom: 16px; z-index: 5; padding: 9px 18px; border-radius: 99px;
  background: var(--surface); border: 2px solid var(--accent); color: var(--text); font-size: .92rem; font-weight: 700;
  text-decoration: none; box-shadow: var(--shadow); opacity: .9; }
.support-pill:hover { opacity: 1; background: var(--accent); color: var(--surface); }
body { padding-bottom: 84px; } /* so the pill never covers the last line */
@media (max-width: 520px) { .support-pill { padding: 8px 14px; font-size: .84rem; right: 10px; bottom: 10px; } }
@media print { .support-pill { display: none; } }
