* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #8fd3ff; overflow: hidden; font-family: 'Segoe UI', Arial, sans-serif; user-select: none; }
canvas { display: block; }
.hidden { display: none !important; }

/* Ekrany na całą stronę (start, wyniki, szatnia) — jasne, cukierkowe */
.screen {
  position: fixed; inset: 0; z-index: 100;
  background: linear-gradient(160deg, #ffd6f0 0%, #cde9ff 55%, #d9ffe3 100%);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  color: #2b2350; text-align: center; overflow-y: auto; padding: 20px;
}
.screen h1 { font-size: 64px; color: #ff3d8a; text-shadow: 3px 3px 0 #fff, 6px 6px 0 rgba(122, 76, 255, .25); letter-spacing: 2px; margin-bottom: 6px; }
.screen .subtitle { font-size: 21px; color: #5a3fc9; margin-bottom: 16px; font-weight: bold; }
.screen .instrukcja {
  background: rgba(255,255,255,0.65); border: 3px solid #fff; border-radius: 18px;
  padding: 14px 24px; margin: 8px 0 14px; font-size: 16px; line-height: 1.6; max-width: 760px;
}
.screen .instrukcja b { color: #ff3d8a; }
.screen .instrukcja .opis { margin-top: 10px; color: #4a4470; font-size: 15px; }
.sterowanie { margin: 0 auto; border-collapse: collapse; }
.sterowanie td, .sterowanie th { padding: 3px 18px; text-align: left; font-size: 17px; }
.sterowanie th { color: #5a3fc9; }
.tryby { margin-bottom: 6px; }
.monetyInfo { font-size: 22px; font-weight: bold; color: #b0145a; margin: 6px 0 10px; }

.btn {
  padding: 16px 44px; font-size: 24px; font-weight: bold; color: #fff;
  background: linear-gradient(135deg, #ff7ad9, #ff3d8a);
  border: none; border-radius: 18px; cursor: pointer; margin: 8px; font-family: inherit;
  box-shadow: 0 6px 0 #b0145a;
}
.btn:hover { transform: scale(1.05); }
.btn:active { transform: translateY(4px); box-shadow: none; }
.btn.blue { background: linear-gradient(135deg, #6fc3ff, #3d8bff); box-shadow: 0 6px 0 #1b4fa8; }
.btn.green { background: linear-gradient(135deg, #7dff9a, #2fbf5a); box-shadow: 0 6px 0 #167a36; }
.btn.gray { background: linear-gradient(135deg, #bbb, #888); box-shadow: 0 6px 0 #555; font-size: 18px; padding: 10px 24px; }
.btn.small { font-size: 16px; padding: 8px 16px; margin: 4px; border-radius: 12px; box-shadow: 0 4px 0 rgba(0,0,0,.3); }
.btn.tryb { font-size: 20px; padding: 12px 28px; opacity: .55; }
.btn.tryb.aktywny { opacity: 1; outline: 4px solid #fff; }
.btn:disabled { opacity: .35; cursor: default; transform: none; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; display: none; }
.panel {
  position: absolute; background: rgba(255,255,255,0.82); border: 3px solid #fff;
  border-radius: 16px; padding: 10px 14px; color: #2b2350; font-size: 16px; min-width: 230px;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
#hudG1 { top: 12px; left: 12px; }
#hudG2 { top: 12px; right: 12px; }
.panel .kto { font-weight: bold; font-size: 19px; margin-bottom: 4px; }
.panel .kto small { color: #777; font-weight: normal; font-size: 12px; display: block; }
.row { display: flex; justify-content: space-between; gap: 14px; margin: 3px 0; }
.row small { color: #888; font-size: 12px; }
.val { font-weight: bold; color: #5a3fc9; }
.val.moc { color: #ff3d8a; }

#odliczanie {
  position: absolute; top: 28%; left: 50%; transform: translateX(-50%);
  font-size: 150px; font-weight: 900; color: #fff; text-shadow: 0 0 30px #ff3d8a, 6px 6px 0 #5a3fc9;
  display: none;
}
#komunikat {
  position: absolute; top: 15%; left: 50%; transform: translateX(-50%);
  font-size: 36px; font-weight: bold; color: #fff; text-shadow: 0 0 14px #5a3fc9, 3px 3px 0 #2b2350;
  opacity: 0; transition: opacity .3s; text-align: center; white-space: nowrap;
}
#czekanie {
  position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,0.85); border: 3px solid #fff; border-radius: 14px;
  padding: 8px 22px; color: #2b2350; font-size: 20px; font-weight: bold; display: none;
}

/* Pasek postępu z kropkami zawodników */
#postep { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); width: min(70vw, 900px); height: 30px; }
#postepTor { position: absolute; left: 0; right: 36px; top: 9px; height: 12px; background: rgba(255,255,255,.75); border: 2px solid #fff; border-radius: 8px; }
#postepMeta { position: absolute; right: 0; top: -2px; font-size: 26px; }
.kropka { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.kropka.gracz { width: 26px; height: 26px; margin: -13px 0 0 -13px; font-size: 14px; font-weight: bold; color: #fff; text-align: center; line-height: 22px; z-index: 2; text-shadow: 0 0 3px #000; border-width: 3px; }

/* Wyniki: podium i tabela */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; margin: 6px 0 14px; }
.stopien { background: rgba(255,255,255,.75); border: 3px solid #fff; border-radius: 16px 16px 0 0; padding: 10px 8px; width: 160px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.stopien.m1 { height: 230px; background: linear-gradient(#fff6c7, #ffe34d); }
.stopien.m2 { height: 195px; background: linear-gradient(#f4f4f4, #c9c9c9); }
.stopien.m3 { height: 175px; background: linear-gradient(#ffe0c2, #e39b5a); }
.stopien .nr { font-size: 36px; }
.stopien .imie { font-weight: bold; font-size: 18px; margin-top: 4px; }
.stopien .czas { color: #5a3fc9; font-size: 15px; }
.tabela { border-collapse: collapse; background: rgba(255,255,255,.7); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.tabela td, .tabela th { padding: 3px 14px; font-size: 16px; text-align: left; }
.tabela th { background: rgba(255,255,255,.5); color: #5a3fc9; }
.tabela tr.ja { background: rgba(255, 227, 77, .6); font-weight: bold; }
#monetyWynik { background: rgba(255,255,255,.7); border-radius: 14px; padding: 10px 22px; margin-bottom: 8px; font-size: 17px; line-height: 1.5; }
#monetyWynik b { color: #b0145a; }
#monetyWynik .suma { font-size: 22px; }

/* Fasolka w CSS (podgląd skina w szatni i na podium) */
.fasolkaIkona { width: 64px; height: 84px; border-radius: 50% 50% 46% 46%; margin: 4px auto; position: relative; box-shadow: inset -8px -8px 0 rgba(0,0,0,.12), 0 3px 6px rgba(0,0,0,.2); }
.fasolkaIkona .oko { position: absolute; top: 26px; width: 14px; height: 14px; background: #fff; border-radius: 50%; }
.fasolkaIkona .oko::after { content: ''; position: absolute; left: 4px; top: 4px; width: 7px; height: 7px; background: #222; border-radius: 50%; }
.fasolkaIkona .oko.l { left: 14px; } .fasolkaIkona .oko.p { right: 14px; }
.fasolkaIkona .usta { position: absolute; top: 46px; left: 24px; width: 16px; height: 8px; border-bottom: 3px solid #662222; border-radius: 0 0 10px 10px; }
.fasolkaIkona .akc { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 26px; }

/* Szatnia */
.skiny { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; width: min(1050px, 95vw); margin-bottom: 12px; }
.skin { background: rgba(255,255,255,.75); border: 3px solid #fff; border-radius: 18px; padding: 10px 8px 8px; }
.skin.zalozony { border-color: #2fbf5a; box-shadow: 0 0 0 3px rgba(47,191,90,.35); }
.skin .nazwa { font-weight: bold; font-size: 16px; margin-top: 4px; }
.skin .cena { color: #b0145a; font-weight: bold; font-size: 15px; margin: 2px 0 4px; }
.skin .cena.masz { color: #167a36; }
.skin .btn.small { font-size: 14px; padding: 6px 12px; }
