@font-face {
  font-family: "PKOBankPolski";
  src: url("../fonts/pkobankpolski-light.woff2") format("woff2"),
       url("../fonts/pkobankpolski-light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PKOBankPolski";
  src: url("../fonts/pkobankpolski-regular.woff2") format("woff2"),
       url("../fonts/pkobankpolski-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PKOBankPolski";
  src: url("../fonts/pkobankpolski-bold.woff2") format("woff2"),
       url("../fonts/pkobankpolski-bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #17305c;
  --muted: #5d6d86;
  --blue: #0c4da2;
  --blue-deep: #08356f;
  --blue-soft: #3c78c2;
  --green: #1f8f4a;
  --red: #d22630;
  --line: #e4ebf3;
  --card: #ffffff;
  --bg: #f4f7f5;
  --shadow: 0 18px 50px rgba(23, 48, 92, 0.08);
  --a: var(--blue);
  --b: var(--blue-deep);
  --c: var(--green);
  --d: var(--red);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: "PKOBankPolski", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(63, 157, 69, 0.16), transparent 60%),
    radial-gradient(700px 380px at -10% 0%, rgba(11, 78, 162, 0.12), transparent 55%),
    var(--bg);
}
button, input { font-family: inherit; }
img { max-width: 100%; display: block; }

.brand-bar {
  padding: 18px 22px 0;
}
.brand-logos, .partner-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}
.brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
}
.logo-slot {
  min-width: 120px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1.5px dashed #b7c6d8;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.shell {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 12px 0 28px;
}
.shell-host { width: min(1180px, calc(100% - 28px)); }
.hero { text-align: center; margin: 8px 0 16px; }
.wordmark { width: min(520px, 100%); margin: 0 auto 8px; }
.wordmark-fallback { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wm-e {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 400;
  color: var(--blue);
  letter-spacing: -0.03em;
}
.wm-day {
  font-size: clamp(64px, 14vw, 108px);
  line-height: 0.85;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(100deg, #1f8f4a 0%, #1d7ed0 48%, #f0b429 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline {
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 400;
  color: var(--blue-deep);
}
.tagline span { color: var(--green); font-weight: 700; }
.hero-cars { margin: 14px auto 0; width: min(640px, 100%); }
.slot-wide {
  border: 1.5px dashed #b7c6d8;
  border-radius: 16px;
  padding: 22px 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  font-size: 14px;
}

.card {
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.join-form { display: flex; flex-direction: column; gap: 10px; }
label { font-weight: 700; }
input[type="text"], input[type="password"], input:not([type]) {
  width: 100%;
  border: 1px solid #d5e0ec;
  background: #f8fafc;
  border-radius: 14px;
  padding: 16px 16px;
  font-size: 18px;
  color: var(--ink);
}
input:focus { outline: 2px solid rgba(11, 78, 162, 0.25); border-color: var(--blue); }
.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-deep); }
.btn-ghost {
  background: transparent;
  color: var(--blue);
  border: 1px solid #d5e0ec;
}
.btn-stack { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.form-error { color: var(--a); margin: 0; font-weight: 700; }
.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.meta { color: var(--muted); margin: 0 0 8px; }
h1 { margin: 0 0 8px; font-size: 32px; line-height: 1.15; }
.question-text { font-size: clamp(22px, 4vw, 30px); font-weight: 700; line-height: 1.25; margin: 8px 0 16px; }

.timer-wrap { margin-bottom: 14px; }
.timer-label { font-size: 14px; font-weight: 700; color: var(--blue); margin-bottom: 6px; }
.timer-track { height: 12px; background: #e7eef6; border-radius: 99px; overflow: hidden; }
.timer-bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: var(--green);
  transition: transform 0.1s linear;
}
.timer-wrap.is-reading .timer-bar { background: var(--blue-soft); }
.timer-bar.warn { background: var(--blue-deep); }
.timer-bar.danger { background: var(--red); }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  color: var(--ink);
  background: #fff;
  border: 2px solid #d5e0ec;
  border-radius: 16px;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}
.option .key {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: 0 0 auto;
}
.option.A .key { background: var(--blue); }
.option.B .key { background: var(--blue-deep); }
.option.C .key { background: var(--green); }
.option.D .key { background: var(--red); }
.option.selected {
  border-color: var(--blue);
  background: #e8f1fb;
}
.option.correct {
  border-color: var(--green);
  background: #e7f6ec;
}
.option.wrong { opacity: 0.45; }
.option .count {
  margin-left: auto;
  min-width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #e7eef6;
  color: var(--blue-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.option:disabled { cursor: default; }
.confirm-answer { margin-top: 14px; width: 100%; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eef6ef;
  color: var(--green);
  font-weight: 700;
  border-radius: 999px;
  padding: 8px 12px;
}
.ranking { width: 100%; border-collapse: collapse; }
.ranking th, .ranking td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.ranking tr.me { background: #eaf3ff; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin-top: 12px; }
.podium-col { flex: 1; text-align: center; }
.podium-block {
  border-radius: 16px 16px 8px 8px;
  padding: 16px 8px;
  color: white;
  font-weight: 700;
}
.podium-col.p1 .podium-block { background: var(--blue); min-height: 160px; }
.podium-col.p2 .podium-block { background: #5f86c4; min-height: 120px; }
.podium-col.p3 .podium-block { background: #8aa6d4; min-height: 96px; }
.place-no { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.nick { font-size: 20px; margin-top: 8px; word-break: break-word; }
.score { margin-top: 6px; font-weight: 400; }

.partners { padding: 8px 16px 28px; text-align: center; }
.partners-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}
.view-player.playing .hero-cars,
.view-player.playing .partners,
.view-player.playing .slot-wide { display: none; }
.view-player.playing .brand-logo,
.view-player.playing .logo-slot { height: 28px; min-height: 28px; }

.view-host .shell-host {
  width: min(480px, 100%);
  padding: 8px 16px calc(28px + env(safe-area-inset-bottom));
}
.host-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.host-top-gap { flex: 1; }
.host-side {
  min-height: 56px;
  padding: 12px 18px;
  font-size: 18px;
}
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #d5e0ec;
  background: #fff;
  color: var(--blue-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.icon-btn svg,
.host-main-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.view-host .btn-stack { gap: 12px; }
.host-status {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}
.host-main-btn {
  min-height: 76px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-next { background: var(--green); color: #fff; }
.btn-next:hover { background: #18753c; }
.host-main-btn:disabled { opacity: 0.38; }
.host-hint {
  margin: 0 0 12px;
  color: var(--blue-deep);
  font-weight: 700;
  font-size: 16px;
}
.host-question {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.25;
}
.view-host .card + .card { margin-top: 12px; }
.view-host #host-roster h3,
.view-host #host-archive h3 { margin: 0 0 8px; font-size: 16px; }
.plan { margin: 0; padding: 0; list-style: none; }
.plan li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.plan li.current { font-weight: 700; color: var(--blue); }
.roster { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #f3f6fb; border-radius: 999px; padding: 6px 10px; font-weight: 700; }
.note { background: #fff8e8; border-radius: 12px; padding: 10px 12px; color: #6a4b00; }

.view-screen { min-height: 100vh; }
.screen-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px 0;
}
.screen-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.view-screen .brand-logo { height: 48px; }
.view-screen .logo-slot { min-width: 0; min-height: 44px; font-size: 14px; }
.screen-mark { text-align: right; }
.view-screen .wordmark-fallback { align-items: flex-end; }
.view-screen .wm-e { font-size: 22px; }
.view-screen .wm-day { font-size: 52px; }
.view-screen .tagline { font-size: 18px; margin: 4px 0 0; }
.screen-shell { padding: 12px 28px 120px; min-height: calc(100vh - 140px); }
.view-screen .question-text { font-size: clamp(36px, 4vw, 64px); }
.view-screen .options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.view-screen .option { min-height: 110px; font-size: 28px; border-radius: 20px; }
.screen-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; }
.screen-lobby {
  min-height: 62vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: center;
}
.screen-names { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.view-screen .chip { font-size: 22px; padding: 10px 16px; }
.qr-box { background: white; padding: 12px; border-radius: 16px; width: max-content; box-shadow: var(--shadow); }
.join-url { font-size: clamp(28px, 3vw, 48px); font-weight: 700; color: var(--blue); word-break: break-all; }
.player-count { font-size: 28px; font-weight: 700; }
.screen-dock {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 5;
}
.people-bubble {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 28px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.people-bubble svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.qr-corner { background: #fff; padding: 8px; border-radius: 12px; box-shadow: var(--shadow); }
.opt-stat {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue-deep);
  font-size: 22px;
  font-weight: 700;
}
.opt-stat svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.opt-pct { color: var(--muted); font-weight: 400; }
.verdict { display: block; text-align: center; font-size: 28px; margin-top: 14px; }
.status-pill.is-ok { background: #e7f6ec; color: var(--green); }
.status-pill.is-bad { background: #fdecee; color: var(--red); }
.status-pill.is-missed { background: #eef2f7; color: var(--blue-deep); }
.view-screen .podium-block { min-height: 220px; }
.view-screen .nick { font-size: 32px; }
.view-screen body, .view-screen {
  background-image: var(--screen-bg);
  background-size: cover;
  background-position: center bottom;
}

@media (max-width: 860px) {
  .host-grid, .screen-lobby, .view-screen .options { grid-template-columns: 1fr; }
  .view-screen .option { min-height: 72px; font-size: 20px; }
}

/* Uczestnik: telefon, duży tekst, grube pola do stuknięcia. */
.view-player {
  font-size: 20px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.view-player .shell {
  width: min(480px, 100%);
  padding: 8px 16px calc(28px + env(safe-area-inset-bottom));
}
.view-player .brand-bar {
  padding: 14px 16px 0;
}
.view-player .brand-logos,
.view-player .partner-logos {
  display: grid;
  gap: 8px;
  width: 100%;
}
.view-player .brand-logos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.view-player .partner-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.view-player .logo-slot {
  min-width: 0;
  width: 100%;
  min-height: 48px;
  padding: 8px 6px;
  font-size: 13px;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}
.view-player .brand-logo {
  height: 36px;
  max-width: 32%;
}
.view-player .hero { margin: 12px 0 18px; }
.view-player .wm-e { font-size: 36px; }
.view-player .wm-day { font-size: 84px; }
.view-player .tagline { font-size: 22px; margin-top: 10px; }
.view-player .slot-wide { display: none; }
.view-player .card {
  border-radius: 24px;
  padding: 22px 18px;
}
.view-player label { font-size: 20px; }
.view-player input[type="text"],
.view-player input[type="password"],
.view-player input:not([type]) {
  font-size: 22px;
  min-height: 64px;
  padding: 16px 18px;
  border-radius: 16px;
}
.view-player .btn {
  font-size: 22px;
  min-height: 64px;
  border-radius: 16px;
}
.view-player h1 { font-size: 36px; }
.view-player .question-text {
  font-size: 32px;
  line-height: 1.2;
  margin: 12px 0 18px;
}
.view-player .eyebrow { font-size: 15px; letter-spacing: 0.08em; }
.view-player .meta { font-size: 18px; }
.view-player .timer-label { font-size: 18px; }
.view-player .timer-track { height: 18px; }
.view-player .options { gap: 12px; }
.view-player .option {
  min-height: 84px;
  font-size: 22px;
  line-height: 1.25;
  padding: 16px;
  border-radius: 18px;
  touch-action: manipulation;
}
.view-player .option .key {
  width: 48px;
  height: 48px;
  font-size: 22px;
  border-radius: 12px;
}
.view-player .status-pill { font-size: 18px; padding: 12px 16px; }
.view-player .ranking { font-size: 18px; }
.view-player .ranking th,
.view-player .ranking td { padding: 14px 6px; }
.view-player .nick { font-size: 22px; }
.view-player .partners-label { font-size: 13px; }
.view-player.playing .brand-bar { padding-top: 10px; }
.view-player.playing .shell { padding-top: 8px; }
.view-player.playing .card {
  background: transparent;
  box-shadow: none;
  padding: 4px 0 12px;
}

@media (max-width: 380px) {
  .view-player .wm-day { font-size: 72px; }
  .view-player .question-text { font-size: 28px; }
  .view-player .option { font-size: 20px; min-height: 76px; }
}
