/* Wyglad HUD, ekranow i przyciskow dotykowych. Sam HUD buduje game.js
   (zbudujHud) - strona osadzajaca gre to <link> plus jeden <script>. */

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

body {
  background: #0d0f12;
  color: #e8e6df;
  font: 14px/1.4 "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

canvas#game { display: block; position: fixed; inset: 0; }

.panel {
  position: fixed;
  background: rgba(12, 14, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 8px 12px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

body.bez-hud .panel,
body.bez-hud #atrybucja,
body.bez-hud #dotyk { display: none; }

/* --------------------------------------------------------------- naglowek */
#hud-top { top: 12px; left: 12px; }
#tytul { font-size: 17px; font-weight: 700; letter-spacing: 0.06em; }
#podtytul { font-size: 11px; opacity: 0.6; letter-spacing: 0.14em; text-transform: uppercase; }

/* ------------------------------------------------------------- zadania */
#hud-zadania { top: 12px; right: 12px; width: 232px; }
#zadania-pasek {
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 8px;
}
#zadania-wypelnienie {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #46c07a, #8fe06a);
  transition: width 0.25s ease;
}
#zadania-lista { font-size: 12px; line-height: 1.55; }
#zadania-lista div { opacity: 0.82; }
#zadania-lista div.zrobione { opacity: 0.38; text-decoration: line-through; }
#zadania-lista div.blisko { opacity: 1; color: #ffd166; }
#zadania-lista b { font-weight: 600; }

/* -------------------------------------------------------------- minimapa */
#minimap-wrap { right: 12px; bottom: 12px; padding: 6px; line-height: 0; }
#minimap { width: 150px; height: 150px; border-radius: 6px; }

/* ------------------------------------------------- podpowiedz i komunikaty */
#podpowiedz {
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: 0.02em;
  display: none;
}
#podpowiedz b {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  padding: 1px 6px;
  margin-right: 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 700;
}

#toast {
  position: fixed;
  left: 50%;
  top: 74px;
  transform: translateX(-50%);
  background: rgba(12, 14, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
#toast.widoczny { opacity: 1; }

#atrybucja {
  position: fixed;
  left: 12px;
  bottom: 10px;
  font-size: 10px;
  opacity: 0.42;
  pointer-events: none;
}

/* ------------------------------------------------------------------ dotyk */
#dotyk { display: none; }
body.dotyk #dotyk { display: block; }

#drazek {
  position: fixed;
  left: 26px;
  bottom: 26px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
#drazek-galka {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
}

.klawisz {
  position: fixed;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.klawisz.trzymany { background: rgba(255, 255, 255, 0.3); }
#k-akcja { right: 30px; bottom: 108px; background: rgba(70, 192, 122, 0.28); }
#k-zglos { right: 118px; bottom: 40px; background: rgba(230, 57, 70, 0.26); }

/* ----------------------------------------------------------------- ekrany */
.ekran {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(circle at 50% 45%, rgba(18, 22, 28, 0.82), rgba(6, 8, 11, 0.96));
  z-index: 20;
  text-align: center;
  padding: 24px;
}
.ekran.ukryty { display: none; }
.ekran h1 {
  font-size: clamp(38px, 11vw, 92px);
  letter-spacing: 0.1em;
  font-weight: 800;
  line-height: 1;
}
.ekran h2 {
  font-size: 13px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  opacity: 0.6;
  font-weight: 600;
}
.start-btn {
  margin-top: 10px;
  padding: 12px 34px;
  font: 600 15px/1 "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.1em;
  color: #0d0f12;
  background: #e8e6df;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.start-btn:hover { background: #fff; }
.sterowanie {
  font-size: 12px;
  line-height: 1.9;
  opacity: 0.62;
  max-width: 460px;
}
.sterowanie b {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
}
#wynik-czas { font-size: 34px; font-weight: 700; letter-spacing: 0.04em; }

@media (max-width: 620px) {
  #hud-zadania { width: 170px; font-size: 11px; }
  #minimap { width: 104px; height: 104px; }
  #podpowiedz { bottom: 170px; }
}
