@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&display=swap');

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0a140a;
}

/* ===== TŁO: CRT TERMINAL ===== */
.crt-container {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  overflow: hidden;
  background: #0a140a;
  pointer-events: none;
  border-radius: 32px;
  margin: 12px;
  box-shadow:
    inset 0 0 120px rgba(0,0,0,.9),
    inset 0 0 40px rgba(20,80,20,.3);
}
.crt-container canvas {
  width: 100%; height: 100%; display: block;
  filter: blur(0.4px) brightness(1.3) contrast(1.1);
}

/* Linie skanujące (repeating) */
.crt-container::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,.3) 3px
  );
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}

/* Pasek skanujący — szeroki, ciemny, zaokrąglony (CRT lens) */
.crt-container::after {
  content: '';
  position: absolute; left: 0; width: 100%; height: 48px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(20,140,20,.06) 15%,
    rgba(20,160,20,.14) 50%,
    rgba(20,140,20,.06) 85%,
    transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 100% at 50% 50%,
    #000 0%, #000 55%, transparent 100%);
          mask-image: radial-gradient(ellipse 60% 100% at 50% 50%,
    #000 0%, #000 55%, transparent 100%);
  border-radius: 50% / 50%;
  filter: blur(12px);
  animation: scan-sweep 6s linear infinite;
  pointer-events: none;
  z-index: 2;
}
@keyframes scan-sweep {
  from { top: -60px; }
  to   { top: 100%; }
}

/* Vignette (ciemne krawędzie) */
.crt-vignette {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(ellipse at center,
    transparent 40%,
    rgba(0,0,0,.7) 100%);
  border-radius: 32px;
  margin: 12px;
}

/* Ziarno (noise) */
.crt-grain {
  position: fixed; inset: 0; z-index: 99; pointer-events: none; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  .crt-container::after { animation: none; }
}
