/* ===== Motyw – zmień te zmienne, gdy przyjdą grafiki od klienta ===== */
:root {
  --bg: #f4f1e8;            /* tło strony (ciepła kość słoniowa) */
  --card: #ffffff;          /* tło kart */
  --ink: #1f2a24;           /* tekst główny */
  --muted: #6b7570;         /* tekst pomocniczy */
  --line: #e2ddd0;          /* obramowania */
  --shadow: 0 4px 16px rgba(30, 40, 30, 0.10);

  --accent-eco: #2e7d32;    /* zieleń – ekologia */
  --accent-eco-dark: #1b5e20;
  --accent-cyber: #1e4f8f;  /* granat – cyberbezpieczeństwo */
  --accent-cyber-dark: #143a6a;

  /* Kolory kart odpowiedzi (4 decyzje) */
  --c-stosuje: #2e7d32;     /* Stosuję się */
  --c-ignoruje: #c62828;    /* Ignoruję! */
  --c-kontakt: #1e4f8f;     /* Kontaktuję się z właściwą osobą lub instytucją */
  --c-weryfikuje: #6a1b9a;  /* Weryfikuję u źródła */

  /* Kolory pionków (do 6 graczy) */
  --p0: #e53935; --p1: #1e88e5; --p2: #43a047;
  --p3: #fb8c00; --p4: #8e24aa; --p5: #00acc1;

  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 19px;            /* duża czcionka – odbiorcy 55+ */
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); font-weight: normal; }
.mt { margin-top: 1.4rem; }

.app { max-width: 720px; margin: 0 auto; padding: 0 14px 40px; }

/* ===== Górny pasek ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0 6px;
}
.topbar-title { font-weight: 800; color: var(--accent-eco-dark); font-size: 1.05rem; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-meta { color: var(--muted); font-size: .95rem; }

/* ===== Tablica wyników (obie drużyny, zawsze widoczna w grze) ===== */
.scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 6px; }
.score-tile {
  position: relative; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px 10px; border: 3px solid transparent;
}
.score-tile.answering { border-color: var(--accent-cyber); }
.score-tile.leader { background: #fff8dc; }
.score-name { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1rem; overflow-wrap: anywhere; }
.score-name .dot { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.score-big { font-size: 2.6rem; font-weight: 900; line-height: 1.05; margin: 4px 0 2px; color: var(--ink); }
.score-big small { font-size: .9rem; color: var(--muted); font-weight: 700; margin-left: 5px; }
.score-tile.changed .score-big { animation: bump .6s ease; }
@keyframes bump { 0% { transform: scale(1.35); color: var(--accent-cyber); } 100% { transform: none; } }
.score-foot { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.score-foot .role { text-transform: uppercase; letter-spacing: .04em; font-size: .75rem; }
.score-tile.answering .score-foot .role { color: var(--accent-cyber); font-weight: 800; }
@media (max-width: 400px) {
  .score-big { font-size: 2.1rem; }
  .score-name { font-size: .9rem; }
}

/* ===== Ekrany ===== */
.screen { display: flex; flex-direction: column; gap: 16px; padding-top: 12px; }
.screen-center { min-height: 80vh; justify-content: center; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

/* ===== Hero ===== */
.hero { text-align: center; padding: 24px 8px 8px; }
.hero-title { font-size: 2.6rem; font-weight: 900; color: var(--accent-eco-dark); letter-spacing: -0.5px; }
.hero-sub { color: var(--muted); font-size: 1.05rem; }
.hero-badges { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; color: #fff;
}
.badge-eco { background: var(--accent-eco); }
.badge-cyber { background: var(--accent-cyber); }

.rules { padding-left: 1.3em; margin: 0; }
.rules li { margin-bottom: .6em; }

.chip {
  display: inline-block; padding: 1px 10px; border-radius: 999px; color: #fff; font-weight: 700; font-size: .9rem;
  white-space: nowrap;
}
.chip-stosuje { background: var(--c-stosuje); }
.chip-ignoruje { background: var(--c-ignoruje); }
.chip-kontakt { background: var(--c-kontakt); }
.chip-weryfikuje { background: var(--c-weryfikuje); }

/* ===== Formularz ===== */
.player-inputs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.player-row { display: flex; align-items: center; gap: 10px; }
.player-row .dot { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.player-row input[type="text"] {
  flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
}
.player-row input:focus, .field-row input:focus { outline: 3px solid rgba(46,125,50,.35); border-color: var(--accent-eco); }
.field-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.field-row input[type="number"] {
  font: inherit; font-size: 1.2rem; font-weight: 700; width: 100px; padding: 10px 12px; text-align: center;
  border: 2px solid var(--line); border-radius: 12px;
}
.form-error { color: var(--c-ignoruje); font-weight: 600; }
.footer-note { text-align: center; color: var(--muted); font-size: .9rem; }

/* ===== Przyciski ===== */
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border: none; border-radius: 14px;
  padding: 14px 20px; min-height: 56px; width: 100%;
  transition: transform .05s ease, filter .15s ease;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent-eco); color: #fff; }
.btn-primary:not(:disabled):hover { filter: brightness(1.08); }
.btn-secondary { background: #fff; color: var(--accent-eco-dark); border: 2px solid var(--accent-eco); }
.btn-ghost { background: transparent; color: var(--muted); border: 2px solid var(--line); }
.btn-small { width: auto; min-height: 40px; padding: 6px 12px; font-size: .9rem; white-space: nowrap; }
@media (max-width: 480px) { .topbar-meta { display: none; } }
.btn-big { font-size: 1.15rem; min-height: 64px; }

/* ===== Popup (runda / koniec) ===== */
.popup { text-align: center; padding: 30px 22px; }
.popup-kicker { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .9rem; }
.popup-label { margin-top: 14px; color: var(--muted); }
.popup-name { font-size: 2.4rem; font-weight: 900; color: var(--accent-cyber); margin: 2px 0 14px; word-break: break-word; }
.popup-text { color: var(--ink); }
.mini-scores { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0 20px; }
.mini-score {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px;
  background: var(--bg); font-size: .95rem; font-weight: 600;
}
.trophy { font-size: 4rem; line-height: 1; }

/* ===== Pytanie ===== */
.round-info { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 600; flex-wrap: wrap; gap: 6px; }
.round-info .host { color: var(--accent-cyber); }
.qcard {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; border-top: 8px solid var(--accent-cyber);
  position: relative;
}
.qcard-compact { padding: 16px 20px; }
.qcard .q-name { font-size: 1.5rem; font-weight: 900; margin: 6px 0 12px; }
.qcard-compact .q-name { font-size: 1.15rem; margin-bottom: 6px; }
.qcard .q-text { font-size: 1.25rem; line-height: 1.5; }
.qcard-compact .q-text { font-size: 1.0rem; color: var(--ink); }
.qcard .q-num { position: absolute; top: 12px; right: 16px; color: var(--muted); font-size: .85rem; }
.section-title { margin: 4px 0 -6px; }

.answers-list { display: flex; flex-direction: column; gap: 12px; }
.answer-row {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
}
.answer-row .who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 800; font-size: 1.1rem; }
.answer-row .who .dot { width: 18px; height: 18px; border-radius: 50%; }
.answer-row .who .pos { margin-left: auto; color: var(--muted); font-weight: 600; font-size: .95rem; }
.ans-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.ans-row { display: grid; grid-template-columns: 1fr 52px; gap: 8px; align-items: stretch; }
.ans-btn {
  font: inherit; font-weight: 700; font-size: 1.1rem; line-height: 1.2; cursor: pointer; text-align: left;
  min-height: 60px; padding: 12px 16px 12px 20px; border-radius: 12px; background: #fff; color: var(--ink);
  border: 3px solid var(--ans-color); border-left-width: 12px; transition: all .12s ease;
}
.ans-help {
  font: inherit; font-weight: 900; font-size: 1.3rem; cursor: pointer; border-radius: 12px;
  background: #fff; color: var(--muted); border: 2px dashed var(--line);
}
.ans-help:hover, .ans-help:focus-visible { color: var(--accent-cyber); border-color: var(--accent-cyber); }
.ans-btn[aria-pressed="true"] { background: var(--ans-color); color: #fff; transform: scale(1.02); box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.ans-btn.dim { opacity: .45; }
.ans-stosuje { --ans-color: var(--c-stosuje); }
.ans-ignoruje { --ans-color: var(--c-ignoruje); }
.ans-kontakt { --ans-color: var(--c-kontakt); }
.ans-weryfikuje { --ans-color: var(--c-weryfikuje); }

/* ===== Okienko „?” ===== */
.help {
  border: none; border-radius: var(--radius); padding: 0; width: min(92vw, 520px); background: transparent;
  color: var(--ink); font-family: var(--font); font-size: inherit;
}
.help::backdrop { background: rgba(20, 30, 25, .55); }
.help[open] { display: flex; flex-direction: column; gap: 12px; }
.help-body {
  background: var(--card); border-radius: var(--radius); padding: 22px 22px 18px; box-shadow: var(--shadow);
  border-top: 10px solid var(--help-color, var(--accent-eco));
}
.help .btn-secondary { background: var(--card); }
.help-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 6px; }
.help-title { font-size: 1.45rem; font-weight: 900; color: var(--help-color, var(--ink)); margin-bottom: 8px; }
.help-desc { font-weight: 700; font-size: 1.1rem; }
.help-when-label { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: .85rem; margin-bottom: 2px; }
.help-when { margin: 0; }

/* ===== Odkrycie ===== */
.verdict { border-left: 8px solid var(--verdict-color, var(--c-stosuje)); }
.verdict .v-label { color: var(--muted); font-weight: 600; }
.verdict .v-answer { font-size: 1.7rem; font-weight: 900; line-height: 1.2; margin: 2px 0 12px; }
.verdict .v-or { color: var(--muted); font-size: 1.1rem; font-weight: 600; }
.verdict .v-key { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.verdict .v-key .k {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 2px solid var(--k-color); color: var(--k-color); font-weight: 700; font-size: .9rem;
}
.verdict .v-key .k b { font-size: 1rem; }
.verdict .v-why-label { font-weight: 800; margin-bottom: 2px; }
.verdict .v-why { margin: 0; }

.results { display: flex; flex-direction: column; gap: 10px; }
.result-row { display: grid; grid-template-columns: 18px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.result-row:last-child { border-bottom: none; }
.result-row .dot { width: 18px; height: 18px; border-radius: 50%; }
.result-row .name { font-weight: 800; overflow-wrap: anywhere; }
.result-row .name small { display: block; color: var(--muted); font-weight: 600; font-size: .85rem; }
.result-row .chip { font-size: .85rem; }
.result-row .delta { font-weight: 900; font-size: 2rem; line-height: 1; min-width: 72px; text-align: right; }
.result-row .delta small { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
.delta.pos { color: var(--c-stosuje); }
.delta.neg { color: var(--c-ignoruje); }
.delta.zero { color: var(--muted); }

/* ===== Ranking / komunikaty ===== */
.ranking { display: flex; flex-direction: column; gap: 6px; text-align: left; margin: 10px 0 20px; }
.rank-row { display: grid; grid-template-columns: 36px 20px 1fr auto; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; }
.rank-row.leader { background: #fff8dc; }
.rank-row .place { font-weight: 900; color: var(--muted); }
.rank-row .dot { width: 20px; height: 20px; border-radius: 50%; }
.rank-row .name { font-weight: 800; overflow-wrap: anywhere; }
.rank-row .score { font-weight: 900; font-size: 1.2rem; }
.rank-row .score small { color: var(--muted); font-weight: 600; font-size: .8rem; }

.notice { background: #fff3cd; border: 2px solid #ffe08a; color: #5c4500; border-radius: 14px; padding: 14px 16px; font-weight: 700; text-align: center; }
.notice.win { background: #e6f4ea; border-color: #a5d6a7; color: var(--accent-eco-dark); }

/* Kolory pionków */
.dot.c0 { background: var(--p0); } .dot.c1 { background: var(--p1); }
.dot.c2 { background: var(--p2); } .dot.c3 { background: var(--p3); }
.dot.c4 { background: var(--p4); } .dot.c5 { background: var(--p5); }

@media (min-width: 720px) {
  body { font-size: 20px; }
  .hero-title { font-size: 3.2rem; }
}
