html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, Arial, sans-serif;
  background: #f4f6fa;
  color: #1d2230;
}

/* ---------- intro ---------- */

.intro {
  position: relative;
  z-index: 2;
  margin: 40px 16px;
  text-align: center;
}

.intro h1 { margin: 0 0 12px; font-size: 2.2rem; }
.intro h2 { margin: 0 0 8px; font-size: 1.4rem; }
.intro h3 { margin: 0 0 24px; font-size: 1rem; font-weight: 600; color: #4a5270; }

.golomb-button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  animation: dziobanie 1.6s ease-in-out infinite;
}

.golomb-button img {
  width: min(300px, 80vw);
  height: auto;
  display: block;
}

.golomb-button:focus-visible {
  outline: 3px solid #3fae8c;
  outline-offset: 6px;
  border-radius: 12px;
}

.spacje {
  min-height: 1.5em;
  font-weight: 700;
  font-size: 1.2rem;
  color: #8a4fb3;
}

.noscript {
  margin: 40px 16px;
  text-align: center;
  font-size: 1.4rem;
}

@keyframes dziobanie {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  40%      { transform: rotate(0deg) translateY(0); }
  50%      { transform: rotate(6deg) translateY(8px); }
  60%      { transform: rotate(0deg) translateY(0); }
}

/* ---------- chaos ---------- */

body.chaos {
  cursor: url('../img/kursor.svg') 20 16, auto;
  animation: niebo 12s linear infinite;
}

body.chaos .intro h1 { animation: trzesienie 0.4s linear infinite; }

@keyframes niebo {
  0%   { background: #f4f6fa; }
  25%  { background: #e3f4ee; }
  50%  { background: #efe6f6; }
  75%  { background: #fdf0e1; }
  100% { background: #f4f6fa; }
}

@keyframes trzesienie {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25%      { transform: translate(-2px, 1px) rotate(-1deg); }
  50%      { transform: translate(2px, -1px) rotate(1deg); }
  75%      { transform: translate(-1px, -2px) rotate(0); }
}

.niebo, .kupy {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.niebo { z-index: 3; }
.kupy  { z-index: 1; }

.lecacy {
  position: absolute;
  left: 0;
  top: 0;
  width: 120px;
  height: auto;
  pointer-events: none;
  will-change: transform;
}

.kupa {
  position: absolute;
  width: 34px;
  height: 26px;
  margin: -13px 0 0 -17px;
  border-radius: 50% 45% 55% 50%;
  background:
    radial-gradient(circle at 50% 55%, #6d6f63 0 18%, transparent 20%),
    radial-gradient(circle at 30% 30%, #fff 0 30%, #f1f1ea 55%, #d9dacb 100%);
  box-shadow: 8px 6px 0 -6px #f1f1ea, -9px 4px 0 -7px #f1f1ea, 2px -9px 0 -8px #f1f1ea;
  animation: plask 0.25s ease-out;
}

@keyframes plask {
  from { transform: scale(0.2); opacity: 0.4; }
  to   { transform: scale(1); opacity: 1; }
}

.dymek {
  position: absolute;
  padding: 6px 10px;
  border-radius: 12px;
  background: #fff;
  border: 2px solid #1d2230;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  animation: dymek 1.6s ease-out forwards;
}

@keyframes dymek {
  0%   { opacity: 0; transform: translate(-50%, -80%); }
  15%  { opacity: 1; transform: translate(-50%, -100%); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -140%); }
}

.licznik {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  padding: 8px 14px;
  border-radius: 999px;
  background: #1d2230;
  color: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- udawane hakowanie ---------- */

.haker {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(640px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(8, 12, 10, 0.93);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: #3dff7a;
  font: 14px/1.5 Consolas, 'Courier New', monospace;
  pointer-events: none;
  transition: opacity 1s;
}

.haker.schowany { opacity: 0; }

.haker-tytul {
  padding: 6px 12px;
  background: #1f2a24;
  color: #9fb8a8;
  font-size: 12px;
}

.haker-tekst {
  height: min(360px, calc(100vh - 80px));
  padding: 12px 16px;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

.haker .alarm {
  color: #ff4d4d;
  font-size: 20px;
  font-weight: 700;
  animation: migotanie 1s steps(2) infinite;
}

.haker .koniec { color: #fff; }

.haker-tekst > div:empty { height: 1.5em; }

@keyframes migotanie {
  50% { opacity: 0.35; }
}

/* ---------- okienko (popup) ---------- */

body.okienko {
  display: grid;
  place-items: center;
  text-align: center;
  cursor: none;
  user-select: none;
}

body.okienko img {
  width: 150px;
  height: auto;
  animation: dziobanie 1.2s ease-in-out infinite;
}

body.okienko p {
  margin: 8px 12px 0;
  font-weight: 700;
  font-size: 1.1rem;
}

@media (prefers-reduced-motion: reduce) {
  .golomb-button,
  body.okienko img,
  body.chaos .intro h1,
  .haker .alarm { animation: none; }
}
