/* ------------------------------------------------------------------
   Rajd Corsa Baltica — arkusz stylów
   Estetyka: papierowy roadbook. Kremowy papier, druk, rosso corsa.
   Panel organizatora to negatyw tego samego języka.
------------------------------------------------------------------- */

:root {
  --paper: #f2eee5;
  --paper-deep: #e8e2d5;
  --ink: #16130f;
  --ink-soft: #4a443b;
  --ink-faint: #8c8478;
  /* Czerwień wzięta wprost z logo Corsa Baltica (#e30613), żeby akcenty
     strony i znak nie rozjeżdżały się o odcień. Wariant -deep służy do
     tekstu na jasnym tle, gdzie firmowa czerwień ma za mały kontrast. */
  --rosso: #e30613;
  --rosso-deep: #a3050f;
  --carbon: #12100e;
  --carbon-soft: #1c1916;
  --carbon-line: #2e2924;

  /* Jedna rodzina na całość — neutralna, firmowa, czytelna na telefonie.
     Nagłówki różnicujemy grubością i światłem między literami, nie krojem. */
  --display: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --sans: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

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

a {
  color: inherit;
}

/* Ziarno papieru — nakładka na całą stronę */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.42;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
}

body.dark {
  background: var(--carbon);
  color: var(--paper);
}

body.dark::after {
  mix-blend-mode: screen;
  opacity: 0.16;
}

/* Cyfry o stałej szerokości — numery załóg, godziny, czasy */
.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* --------------------------- animacje --------------------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sweep {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.rise {
  animation: rise 0.66s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.sweep {
  transform-origin: left;
  animation: sweep 0.9s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.d1 { animation-delay: 80ms; }
.d2 { animation-delay: 160ms; }
.d3 { animation-delay: 240ms; }
.d4 { animation-delay: 320ms; }
.d5 { animation-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
  .rise,
  .sweep {
    animation: none;
  }
}

/* --------------------------- typografia --------------------------- */

.brand {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  color: var(--ink-soft);
}

body.dark .brand {
  color: rgb(242 238 229 / 0.4);
}

.eyebrow {
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
}

.display {
  font-family: var(--display);
  letter-spacing: -0.022em;
  line-height: 1.1;
  font-weight: 600;
}

.lead {
  color: var(--ink-soft);
  max-width: 26rem;
  font-size: 0.98rem;
  line-height: 1.65;
}

body.dark .lead {
  color: rgb(242 238 229 / 0.5);
}

/* ----------------------- układ uczestnika ----------------------- */

.shell {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  min-height: 100dvh;
}

.head {
  margin-bottom: 3.5rem;
}

.head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.head-count {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
}

.rule {
  height: 1px;
  background: rgb(22 19 15 / 0.25);
  margin-top: 0.75rem;
}

.rule-red {
  height: 1px;
  width: 3rem;
  background: var(--rosso);
}

h1.title {
  font-family: var(--display);
  font-size: clamp(2rem, 7.5vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.12;
}

/* ----------------------------- pola ----------------------------- */

.fields {
  margin-top: 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}

.field label {
  display: block;
}

/* Pole formularza: miękka karta zamiast surowej linii.
   Stan skupienia gra ciepłą szarością — czerwień zostawiamy na akcenty. */
.field-input {
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.8rem 1.05rem;
  border: 1px solid rgb(22 19 15 / 0.14);
  border-radius: 14px;
  background: rgb(255 253 248 / 0.55);
  outline: none;
  font-family: var(--sans);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  transition:
    border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.field-input.big {
  font-size: 2.6rem;
  padding: 0.55rem 1.05rem;
}

.field-input.mid {
  font-size: 1.75rem;
  padding: 0.65rem 1.05rem;
}

.field-input:hover {
  border-color: rgb(22 19 15 / 0.28);
}

.field-input:focus {
  border-color: rgb(22 19 15 / 0.5);
  background: #fdfbf6;
  box-shadow:
    0 0 0 4px rgb(22 19 15 / 0.05),
    0 10px 26px -16px rgb(22 19 15 / 0.55);
  transform: translateY(-1px);
}

.field-input::placeholder {
  color: var(--ink-faint);
  opacity: 0.5;
}

/* Etykieta lekko ciemnieje, gdy pole jest aktywne */
.field:focus-within .eyebrow {
  color: var(--ink);
}

.field .eyebrow {
  transition: color 0.28s ease;
}

textarea.answer {
  width: 100%;
  resize: vertical;
  min-height: 7rem;
  padding: 0.9rem 1.05rem;
  border: 1px solid rgb(22 19 15 / 0.14);
  border-radius: 14px;
  background: rgb(255 253 248 / 0.55);
  font-family: var(--sans);
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink);
  outline: none;
  transition:
    border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

textarea.answer:hover {
  border-color: rgb(22 19 15 / 0.28);
}

textarea.answer:focus {
  border-color: rgb(22 19 15 / 0.5);
  background: #fdfbf6;
  box-shadow:
    0 0 0 4px rgb(22 19 15 / 0.05),
    0 10px 26px -16px rgb(22 19 15 / 0.55);
}

/* --------------------------- przyciski --------------------------- */

.btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding: 1.25rem 1.75rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  cursor: pointer;
  border-radius: 14px;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover {
  background: var(--rosso);
  border-color: var(--rosso);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -18px rgb(189 18 32 / 0.9);
}

.btn:active {
  transform: translateY(0);
}

.btn .arrow {
  transition: transform 0.3s ease;
}

.btn:hover .arrow {
  transform: translateX(4px);
}

.note {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.76rem;
  color: var(--ink-faint);
}

.alert {
  margin-top: 1.5rem;
  border-left: 2px solid var(--rosso);
  background: rgb(189 18 32 / 0.05);
  padding: 0.75rem 0 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--rosso-deep);
}

/* ------------------------------ quiz ------------------------------ */

.progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.progress-track {
  flex: 1;
  height: 1px;
  background: rgb(22 19 15 / 0.15);
}

.progress-bar {
  height: 1px;
  background: var(--rosso);
}

.progress-count {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
}

.questions {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

fieldset.question {
  border: 0;
}

legend.question-text {
  margin-bottom: 1.5rem;
  padding: 0;
}

.q-num {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--rosso);
  margin-right: 0.75rem;
}

.q-body {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.012em;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid rgb(22 19 15 / 0.14);
  border-radius: 14px;
  background: rgb(255 253 248 / 0.55);
  cursor: pointer;
  transition:
    background-color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.22s ease,
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.option:hover {
  border-color: rgb(22 19 15 / 0.32);
  background: #fdfbf6;
  transform: translateY(-1px);
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-letter {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  transition: color 0.2s ease;
  min-width: 0.9rem;
}

.option-text {
  font-size: 0.95rem;
  line-height: 1.35;
}

.option:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 10px 24px -16px rgb(22 19 15 / 0.8);
}

.option:has(input:checked) .option-letter {
  color: var(--rosso);
}

.option:has(input:focus-visible) {
  outline: none;
  border-color: rgb(22 19 15 / 0.5);
  box-shadow: 0 0 0 4px rgb(22 19 15 / 0.08);
}

/* ----------------------------- koniec ----------------------------- */

.summary {
  margin-top: 3.5rem;
  border-top: 1px solid rgb(22 19 15 / 0.2);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.summary-row dt {
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--ink-faint);
}

.summary-row dd {
  font-size: 1.25rem;
  font-weight: 500;
}

.sendoff {
  margin-top: 4rem;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--ink-faint);
}

.center-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}

.center-body {
  margin: auto;
  max-width: 24rem;
}

.center-screen .rule-red {
  margin: 0 auto;
}

.center-screen .lead {
  margin-left: auto;
  margin-right: auto;
}

/* ------------------------- znaki i stopka ------------------------- */

/* Znak rajdu jest pełnokolorowym blokiem, więc traktujemy go jak plakietkę:
   stała wysokość i lekkie zaokrąglenie, żeby nie wyglądał jak zgubiony
   prostokąt na papierze. */
.brandmark {
  height: 1.7rem;
  width: auto;
  border-radius: 4px;
  flex-shrink: 0;
}

.brandmark-big {
  height: auto;
  width: min(19rem, 100%);
  border-radius: 6px;
  margin: 0 auto;
}

.partners {
  margin-top: 4.5rem;
}

.center-screen .partners {
  margin-top: 2rem;
}

.partners-rule {
  height: 1px;
  background: rgb(22 19 15 / 0.12);
}

.partners-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.25rem, 6vw, 2.5rem);
  flex-wrap: wrap;
  padding-top: 1.75rem;
}

/* Znaki dealerów: czarne na przezroczystym, więc siadają wprost na papierze.
   Pełne krycie — to znaki firmowe, nie ozdoba. */
.partners-row img {
  height: auto;
  width: clamp(7.5rem, 32vw, 9.5rem);
  opacity: 0.85;
}

.partners-sep {
  width: 1px;
  align-self: stretch;
  min-height: 1.75rem;
  background: rgb(22 19 15 / 0.14);
}

@media (max-width: 26rem) {
  .partners-sep {
    display: none;
  }
}

/* =====================================================================
   PANEL ORGANIZATORA
   Ten sam papier, ten sam krój i te same zaokrąglenia co strony załogi.
   Panel czyta się na słońcu i na telefonie, więc kontrast i wielkość
   liter są ważniejsze od efektu.
   ===================================================================== */

.admin-shell {
  max-width: 78rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 6rem;
}

@media (min-width: 640px) {
  .admin-shell {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ------------------------------ belka ------------------------------ */

.panel-head {
  margin-bottom: 2rem;
}

.panel-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.panel-brand-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--ink-faint);
}

.panel-exit {
  margin-left: auto;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.2s ease;
}

.panel-exit:hover {
  color: var(--rosso);
}

/* ----------------------------- zakładki ----------------------------- */

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-top: 1.5rem;
  border-bottom: 1px solid rgb(22 19 15 / 0.12);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  padding: 0.75rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-faint);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 10px 10px 0 0;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.tab:hover {
  color: var(--ink);
  background: rgb(22 19 15 / 0.03);
}

.tab-on {
  color: var(--ink);
}

/* Podkreślenie aktywnej zakładki — jedyny mocny akcent w nawigacji */
.tab-on::after {
  content: "";
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: -1px;
  height: 2px;
  background: var(--rosso);
  border-radius: 2px 2px 0 0;
}

/* --------------------------- nagłówek widoku --------------------------- */

.widok-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 2rem 0 1.5rem;
}

.widok-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.028em;
}

.widok-sub {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 42rem;
}

.wroc {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.2s ease;
}

.wroc:hover {
  color: var(--rosso);
}

.widok-akcje {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ---------------------------- przyciski ---------------------------- */

.btn-akcja {
  display: inline-block;
  padding: 0.65rem 1.15rem;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease,
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.btn-akcja:hover {
  background: var(--rosso);
  border-color: var(--rosso);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -14px rgb(227 6 19 / 0.9);
}

.btn-akcja-cichy {
  background: transparent;
  color: var(--ink);
  border-color: rgb(22 19 15 / 0.22);
}

.btn-akcja-cichy:hover {
  background: transparent;
  color: var(--rosso);
  border-color: var(--rosso);
  box-shadow: none;
}

/* ---------------------------- szukajka ---------------------------- */

.szukajka {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.szukajka input[type="search"] {
  flex: 1;
  min-width: 14rem;
  padding: 0.65rem 1rem;
  border: 1px solid rgb(22 19 15 / 0.14);
  border-radius: 12px;
  background: rgb(255 253 248 / 0.6);
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.szukajka input[type="search"]:focus {
  border-color: rgb(22 19 15 / 0.5);
  background: #fdfbf6;
  box-shadow: 0 0 0 4px rgb(22 19 15 / 0.05);
}

.szukajka input[type="search"]::placeholder {
  color: var(--ink-faint);
  opacity: 0.65;
}

/* ------------------------------ karta ------------------------------ */

.karta {
  border: 1px solid rgb(22 19 15 / 0.12);
  border-radius: 14px;
  background: rgb(255 253 248 / 0.7);
  overflow: hidden;
}

.karta + .sekcja {
  margin-top: 2.5rem;
}

.sekcja {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 1rem;
}

.pusto {
  border: 1px dashed rgb(22 19 15 / 0.18);
  border-radius: 14px;
  padding: 4rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.stopka-info {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ------------------------------ tabele ------------------------------ */

.karta {
  overflow-x: auto;
}

table.tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.tabela th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  background: rgb(22 19 15 / 0.03);
  border-bottom: 1px solid rgb(22 19 15 / 0.1);
  white-space: nowrap;
}

table.tabela td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgb(22 19 15 / 0.07);
  vertical-align: middle;
}

table.tabela tbody tr:last-child td {
  border-bottom: 0;
}

.col-lp {
  width: 3rem;
  color: var(--ink-faint);
}

.col-srodek {
  text-align: center;
}

.col-akcja {
  text-align: right;
  width: 8rem;
}

.mocne {
  font-weight: 600;
  font-size: 1rem;
}

tr.wiersz {
  cursor: pointer;
  transition: background-color 0.18s ease;
}

tr.wiersz:hover {
  background: rgb(22 19 15 / 0.025);
}

tr.wiersz-on {
  background: rgb(22 19 15 / 0.05);
}

.rozwin {
  border: 1px solid rgb(22 19 15 / 0.18);
  border-radius: 10px;
  background: transparent;
  padding: 0.35rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

tr.wiersz:hover .rozwin {
  border-color: var(--ink);
  color: var(--ink);
}

/* ------------------------- wynik i kary ------------------------- */

.kara {
  display: inline-block;
  min-width: 2.6rem;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: rgb(227 6 19 / 0.1);
  color: var(--rosso-deep);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.kara-zero {
  background: rgb(79 122 74 / 0.14);
  color: #3f6a3a;
}

.wynik-mini {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.w-trakcie {
  color: var(--rosso);
  font-weight: 600;
}

.potwierdzone {
  color: #3f6a3a;
  font-weight: 600;
}

/* --------------------- rozwinięte odpowiedzi --------------------- */

tr.szczegoly td {
  background: rgb(22 19 15 / 0.035);
  padding: 0.5rem 1rem 1.5rem;
}

ol.odpowiedzi {
  list-style: none;
  counter-reset: pyt;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

ol.odpowiedzi li {
  counter-increment: pyt;
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.2rem 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  background: rgb(255 253 248 / 0.85);
  border-left: 2px solid transparent;
}

ol.odpowiedzi li.odp-ok {
  border-left-color: #4f7a4a;
}

ol.odpowiedzi li.odp-zle {
  border-left-color: var(--rosso);
}

.odp-znak {
  grid-row: span 2;
  font-weight: 700;
  font-size: 0.95rem;
}

li.odp-ok .odp-znak {
  color: #3f6a3a;
}

li.odp-zle .odp-znak {
  color: var(--rosso);
}

.odp-pytanie {
  font-size: 0.84rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.odp-tresc {
  font-size: 0.92rem;
  line-height: 1.45;
}

/* -------------------------- kafle punktów -------------------------- */

.punkty {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .punkty { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .punkty { grid-template-columns: repeat(3, 1fr); }
}

.punkt {
  display: block;
  padding: 1.25rem;
  border: 1px solid rgb(22 19 15 / 0.12);
  border-radius: 14px;
  background: rgb(255 253 248 / 0.7);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.22s ease, background-color 0.22s ease,
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
}

.punkt:hover {
  border-color: rgb(22 19 15 / 0.3);
  background: #fdfbf6;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -20px rgb(22 19 15 / 0.7);
}

.punkt-gora {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.punkt-nr {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink-faint);
}

.plakietka {
  font-size: 0.56rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgb(22 19 15 / 0.18);
  color: var(--ink-soft);
  white-space: nowrap;
}

.plakietka-test {
  border-color: var(--rosso);
  background: rgb(227 6 19 / 0.08);
  color: var(--rosso-deep);
}

.punkt-nazwa {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 0.6rem;
}

.punkt-rola {
  margin-top: 0.25rem;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--rosso-deep);
}

.punkt-dol {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
}

.punkt-liczba {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1;
}

.punkt-opis {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  margin-top: 0.3rem;
}

.punkt-ostatnia {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* -------------------------- kanał zdarzeń -------------------------- */

ul.kanal {
  list-style: none;
}

ul.kanal li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgb(22 19 15 / 0.07);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

ul.kanal li:last-child {
  border-bottom: 0;
}

.kanal-czas {
  color: var(--ink-faint);
  min-width: 4.5rem;
}

.kanal-zaloga {
  font-weight: 600;
  min-width: 7rem;
}

.kanal-gdzie {
  flex: 1;
  min-width: 8rem;
}

.kanal-gdzie a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.kanal-gdzie a:hover {
  color: var(--ink);
  border-bottom-color: var(--rosso);
}

/* ---------------------------- tabele PRJ ---------------------------- */

.time-input {
  border: 1px solid rgb(22 19 15 / 0.16);
  border-radius: 10px;
  background: rgb(255 253 248 / 0.8);
  color: var(--ink);
  padding: 0.45rem 0.65rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  outline: none;
  width: 100%;
  min-width: 7rem;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.time-input:hover {
  border-color: rgb(22 19 15 / 0.3);
}

.time-input:focus {
  border-color: rgb(22 19 15 / 0.5);
  background: #fdfbf6;
  box-shadow: 0 0 0 4px rgb(22 19 15 / 0.05);
}

.cell-meta {
  min-width: 9rem;
}

.col-usun {
  width: 2.5rem;
  text-align: right;
}

/* Kasowanie to akcja destrukcyjna — przycisk jest dyskretny, czerwienieje
   dopiero pod kursorem, a samo kliknięcie i tak wymaga potwierdzenia. */
.usun-btn {
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-faint);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.usun-btn:hover {
  color: var(--rosso);
  border-color: rgb(227 6 19 / 0.4);
  background: rgb(227 6 19 / 0.06);
}

/* Meta na odcinkach z kodem QR: czas ze skanu jest wartością wiodącą,
   poprawka sędziego chowa się pod dyskretną ikoną. */
.meta-czas {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.czas-glowny {
  font-size: 1rem;
  font-weight: 600;
}

.czas-poprawiony {
  color: var(--rosso-deep);
}

.czas-oryginal {
  font-size: 0.72rem;
  color: var(--ink-faint);
  text-decoration: line-through;
}

.poprawka {
  margin-left: auto;
}

.poprawka summary {
  list-style: none;
  cursor: pointer;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border: 1px solid rgb(22 19 15 / 0.14);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--ink-faint);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.poprawka summary::-webkit-details-marker {
  display: none;
}

.poprawka summary:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgb(255 253 248 / 0.9);
}

.poprawka[open] summary {
  border-color: var(--rosso);
  color: var(--rosso);
}

.poprawka-tresc {
  position: relative;
  z-index: 2;
  margin-top: 0.5rem;
  padding: 0.75rem;
  min-width: 11rem;
  border: 1px solid rgb(22 19 15 / 0.14);
  border-radius: 12px;
  background: #fdfbf6;
  box-shadow: 0 12px 28px -18px rgb(22 19 15 / 0.8);
}

.poprawka-tresc .stat-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

.poprawka-tresc .cell-note {
  margin-top: 0.4rem;
  line-height: 1.4;
}

.ikona-przyklad {
  display: inline-grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  border: 1px solid rgb(22 19 15 / 0.2);
  border-radius: 6px;
  font-size: 0.7rem;
  vertical-align: -0.2em;
}

.cell-note {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: var(--ink-faint);
}

.uwagi {
  font-size: 0.78rem;
  color: var(--rosso-deep);
  max-width: 14rem;
}

tr.row-problem td {
  background: rgb(227 6 19 / 0.05);
}

.dur {
  color: var(--ink-faint);
}

.pending {
  color: var(--rosso);
  font-weight: 600;
}

.time-big {
  font-size: 1rem;
  font-weight: 600;
}

.score {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.score.good {
  background: rgb(79 122 74 / 0.14);
  color: #3f6a3a;
}

.score.mid {
  background: rgb(180 140 40 / 0.16);
  color: #7a5c14;
}

.score.poor {
  background: rgb(227 6 19 / 0.1);
  color: var(--rosso-deep);
}

/* --------------------------- komunikaty --------------------------- */

.warn-box,
.ok-box {
  margin: 1.25rem 0;
  padding: 0.9rem 1.1rem;
  border-left: 2px solid;
  border-radius: 0 12px 12px 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.warn-box {
  border-color: var(--rosso);
  background: rgb(227 6 19 / 0.07);
  color: var(--rosso-deep);
}

.ok-box {
  border-color: #4f7a4a;
  background: rgb(79 122 74 / 0.12);
  color: #3f6a3a;
}

.warn-box code {
  font-size: 0.85em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgb(22 19 15 / 0.07);
}

/* ------------------------ dopisywanie załogi ------------------------ */

.dopisz {
  margin-top: 1.5rem;
  border: 1px solid rgb(22 19 15 / 0.12);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  background: rgb(255 253 248 / 0.5);
}

.dopisz summary {
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

.dopisz summary:hover {
  color: var(--rosso);
}

.dopisz-pola {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  margin-top: 1rem;
}

.dopisz-pola .stat-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

.chip-save {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--rosso);
  border-radius: 12px;
  background: var(--rosso);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.chip-save:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* ----------------------------- macierz ----------------------------- */

table.tabela.matrix th.matrix-head a {
  color: inherit;
  text-decoration: none;
  display: block;
}

table.tabela.matrix th.matrix-head a:hover {
  color: var(--rosso);
}

.matrix-head-type {
  display: block;
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-top: 0.2rem;
}

table.tabela.matrix td.cell {
  border-left: 1px solid rgb(22 19 15 / 0.06);
  min-width: 5.5rem;
  text-align: center;
}

.cell-empty {
  color: rgb(22 19 15 / 0.18);
}

.cell-time {
  display: block;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.cell .score {
  margin-top: 0.3rem;
  font-size: 0.75rem;
}

.plate {
  text-transform: uppercase;
}

/* ------------------------------ logowanie ------------------------------ */

.login {
  width: 100%;
  max-width: 24rem;
  text-align: left;
}

.login h1 {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.028em;
  margin-top: 1.75rem;
}

.login button {
  width: 100%;
  margin-top: 3rem;
  padding: 1rem;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.login button:hover {
  border-color: var(--rosso);
  background: var(--rosso);
}

.login .alert {
  margin-top: 1.25rem;
}
/* -------------------------------- kody QR -------------------------------- */

.qr-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .qr-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.qr-card {
  border: 1px solid rgb(22 19 15 / 0.2);
  background: rgb(232 226 213 / 0.3);
  padding: 1.75rem;
  text-align: center;
  break-inside: avoid;
}

.qr-card img {
  margin: 1.25rem auto 0;
  max-width: 15rem;
  width: 100%;
}

.qr-card .url {
  margin-top: 1rem;
  font-size: 0.7rem;
  color: var(--ink-faint);
  word-break: break-all;
}

.qr-card .missing {
  margin: 1.25rem auto 0;
  border: 1px dashed rgb(22 19 15 / 0.3);
  padding: 2.5rem 1rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

@media print {
  .no-print {
    display: none !important;
  }
  body::after {
    display: none;
  }
  .qr-card {
    border-color: #999;
  }
}