:root {
  --bg: #101412;
  --bg-color: #101412;
  --accent: #e94560;
  --panel: rgba(16, 20, 24, 0.9);
  --line: rgba(255, 255, 255, 0.15);
  --text: #e8eaed;
  --muted: #8b93a1;
  --red: #e11d2e;
  --green: #10b981;
  --font: 'Courier New', Courier, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  background: var(--bg-color);
  color: var(--text);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overflow: hidden;
}
body {
  display: grid;
  place-items: center;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
#visualizer {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.3;
}
.gate {
  position: relative;
  z-index: 10;
  width: min(500px, 92%);
  margin: 0 auto;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 40px;
  box-shadow: 0 0 50px rgba(0,0,0,1);
}
.gate__mark {
  letter-spacing: 2px;
  color: var(--accent);
  font-size: 11px;
  margin: 0 0 20px;
  font-weight: bold;
  text-transform: uppercase;
}
h1 { font-size: clamp(20px, 5vw, 20px); font-weight: bold; margin: 0 0 6px; line-height: 1.2; color: var(--accent); text-transform: uppercase; letter-spacing: 2px; }
.gate__sub { color: var(--muted); margin: 0 0 22px; font-size: 13px; line-height: 1.4; }
.gate__hint { color: var(--muted); font-size: 11px; text-align: center; margin: 16px 0 0; opacity: 0.7; }
.blocks {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}
.block {
  width: 4.2em;
  flex: 1;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: clamp(16px, 4.5vw, 18px);
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: none;
  padding: 14px 6px;
  border-radius: 8px;
  min-height: 48px;
}
.block:focus { outline: 2px solid var(--green); border-color: var(--green); outline-offset: 0; }
.dash { color: var(--muted); font-size: 14px; flex-shrink: 0; }
.err { color: var(--red); font-size: 12px; margin: 0 0 10px; line-height: 1.4; word-break: break-word; }
button {
  width: 100%;
  background: #1a1f27;
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 14px;
  cursor: pointer;
  border-radius: 8px;
  min-height: 48px;
  touch-action: manipulation;
}
button:hover { border-color: var(--green); color: var(--green); }
button:active { transform: scale(0.99); }
button:disabled { opacity: 0.5; cursor: wait; }

/* Telefony małe 320px */
@media (max-width: 360px) {
  body { padding: 12px; }
  .gate { width: 100%; }
  .blocks { gap: 4px; }
  .block { padding: 12px 4px; font-size: 15px; letter-spacing: 0.1em; }
  h1 { font-size: 19px; }
}
/* Telefony średnie 375-414 */
@media (min-width: 361px) and (max-width: 414px) {
  .block { padding: 13px 6px; }
}
/* Tablety pionowo */
@media (min-width: 415px) and (max-width: 768px) {
  .gate { width: min(440px, 92%); }
}
/* Desktop - i tak blokujemy JS, ale CSS też ukrywa */
@media (min-width: 769px) {
  body { padding: 24px; }
}
/* PWA standalone - więcej przestrzeni */
@media (display-mode: standalone) {
  body { padding-top: max(20px, env(safe-area-inset-top)); }
}
/* Landscape na telefonie */
@media (max-height: 500px) and (orientation: landscape) {
  body { place-items: start center; padding-top: 12px; }
  .gate__mark { margin: 0 0 12px; }
  h1 { font-size: 18px; }
  .gate__sub { margin: 0 0 14px; }
}
