body{
  margin:0;
  min-height:100vh;
  color:#e5e7eb;
  background:
    radial-gradient(1000px 600px at 20% 10%, rgba(16,185,129,.20), transparent 60%),
    radial-gradient(900px 500px at 80% 20%, rgba(34,211,238,.14), transparent 55%),
    linear-gradient(180deg, #050608, #070a0f);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
.nh-card{
  position:relative;
  overflow:hidden;
}
.nh-card::before{
  content:"";
  position:absolute; inset:-2px;
  background: linear-gradient(135deg, rgba(16,185,129,.35), rgba(34,211,238,.18), rgba(16,185,129,.10));
  filter: blur(14px);
  opacity:.45;
  pointer-events:none;
}
.nh-card::after{
  content:"";
  position:absolute; inset:0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity:.12;
  pointer-events:none;
}
.nh-title{ font-size:22px; letter-spacing:.4px; }
.nh-sub{ color: rgba(229,231,235,.72); }


.nh-ctf{max-width:760px;margin:18px auto;padding:10px;  min-height: 100vh;
  display:flex;
  align-items:center;}
.nh-card{
  border-radius:16px;
  padding:18px;
  background: rgba(16,18,27,.55);
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.nh-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;}
.nh-title{font-size:18px;font-weight:700;letter-spacing:.2px;}
.nh-sub{opacity:.75;font-size:13px;margin-top:2px;}
.nh-score{display:flex;flex-direction:column;align-items:flex-end;}
.nh-score-label{opacity:.7;font-size:12px;}
.nh-score-val{font-size:20px;font-weight:800;}
.nh-row{display:flex;gap:10px;align-items:center;}
.nh-input{
  flex:1;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: inherit;
  outline:none;
}
.nh-input:focus{border-color: rgba(255,255,255,.25);}

.nh-btn{
  appearance:none !important;
  -webkit-appearance:none !important;

  background: linear-gradient(135deg,#1f2937,#111827) !important;
  color:#fff !important;

  border:1px solid rgba(255,255,255,.18) !important;
  opacity: 1 !important;
  filter: none !important;

  cursor:pointer !important;
}

/* WAŻNE: nawet jak disabled, nie rób szarego "systemowego" */
.nh-btn:disabled{
  opacity: 1 !important;
  color:#fff !important;
  background: linear-gradient(135deg,#1f2937,#111827) !important;
  cursor:not-allowed !important;
}



.nh-btn{
  appearance:none;
  -webkit-appearance:none;
}

.nh-btn{
  padding:12px 16px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.18);

  background: linear-gradient(135deg,#1f2937,#111827);
  color:#fff;

  cursor:pointer;
  font-weight:700;
  transition: all .18s ease;
}




.nh-btn:hover{
  background: linear-gradient(135deg,#374151,#1f2937);
  transform: translateY(-1px);
}

.nh-btn:active{
  transform: translateY(0);
  opacity:.9;
}
.nh-btn:focus{
  outline:none;
  box-shadow:0 0 0 2px rgba(59,130,246,.5);
}
.nh-msg{margin-top:12px;font-family:ui-monospace, SFMono-Regular, Menlo, monospace;font-size:13px;opacity:.9;white-space:pre-wrap;}
.nh-mini{margin-top:10px;display:flex;align-items:center;gap:10px;opacity:.8;font-size:12px;}
.nh-badge{padding:4px 10px;border-radius:999px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.06);}
.nh-dot{width:4px;height:4px;border-radius:50%;background:rgba(255,255,255,.4);display:inline-block;}


/* NUCLEAR OVERRIDE: przebija większość motywów WP */
.nh-ctf .nh-card .nh-row .nh-btn{
  appearance:none !important;
  -webkit-appearance:none !important;

  background: #111827 !important;
  color: #ffffff !important;

  border: 2px solid rgba(255,255,255,.35) !important;
  opacity: 1 !important;
  filter: none !important;

  padding: 12px 16px !important;
  border-radius: 12px !important;

  font-weight: 800 !important;
  cursor: pointer !important;
}

.nh-ctf .nh-card .nh-row .nh-btn:hover{
  filter: brightness(1.15) !important;
}

.nh-row{
  display:flex;
  gap:12px;
  align-items:center;
}

.nh-input{
  flex: 1 1 auto;
  min-width: 0; /* ważne w flex */
}

.nh-btn{
  flex: 0 0 auto;
  white-space: nowrap;
}

.nh-msg{
  margin-top:12px;
  padding:10px 12px;
  border-radius:12px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.08);
  display: inline-flex;
  gap:10px;
  align-items:center;
  max-width: 100%;
}

.nh-row{display:flex;gap:12px;align-items:center;}
.nh-input{flex:1;min-width:0;}
.nh-btn{white-space:nowrap;}

.nh-back{
  display:inline-block;
  margin: 6px 0 14px;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration:none;
  color: inherit;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  opacity:.9;
}
.nh-back:hover{ opacity:1; filter: brightness(1.1); }

/* =========================
   MATRIX THEME OVERRIDES
   Wklej na KONIEC style.css
   ========================= */

/* Tło całej strony */
body{
  background:#000 !important;
  color:#00ff41 !important;
  font-family: "Courier New", Courier, monospace !important;

  /* nie wymuszamy flex/100vh, bo Ty masz już layout w .nh-ctf */
  margin:0 !important;
  overflow-x:hidden !important;
}

/* Scanlines + lekki RGB shift (migoczące tło) */
body::before{
  content:"";
  display:block;
  position:fixed;
  inset:0;
  background:
    linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,.25) 50%),
    linear-gradient(90deg, rgba(255,0,0,.06), rgba(0,255,0,.02), rgba(0,0,255,.06));
  background-size: 100% 2px, 3px 100%;
  z-index:1;
  pointer-events:none;
  opacity:.9;
}

/* Kontener (zostawiamy Twoje max-width itp.) */
.nh-ctf{
  position:relative;
  z-index:2; /* nad scanlines */
}

/* Twoje okienko = "box" */
.nh-card{
  position:relative;
  z-index:3;

  background: rgba(0, 0, 0, 0.85) !important;
  border: 2px solid #00ff41 !important;
  border-radius: 10px !important;
  box-shadow: 0 0 20px rgba(0,255,65,.35) !important;
  backdrop-filter: blur(6px);
}

/* Nagłówki */
.nh-title, .ctf-panel h3{
  color:#00ff41 !important;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Delikatna linia pod nagłówkami sekcji */
.ctf-panel h3{
  border-bottom: 1px solid rgba(0,255,65,.55);
  padding-bottom: 8px;
}

/* Input + button w klimacie terminala */
.nh-input{
  width:100%;
  background:#000 !important;
  border:1px solid #00ff41 !important;
  color:#00ff41 !important;
  font-family: inherit !important;
}

.nh-input:focus{
  box-shadow: 0 0 10px rgba(0,255,65,.8) !important;
  border-color:#00ff41 !important;
}

/* Przyciski */
.nh-btn{
  background:#004400 !important;
  border:1px solid #00ff41 !important;
  color:#00ff41 !important;
  font-family: inherit !important;
  font-weight:800 !important;
  transition: .2s ease !important;
}

.nh-btn:hover{
  background:#00ff41 !important;
  color:#000 !important;
  box-shadow: 0 0 12px rgba(0,255,65,.65) !important;
}

.nh-btn:disabled{
  opacity: .8 !important;
  cursor:not-allowed !important;
}

/* Komunikaty */
.nh-msg{
  background: rgba(0,20,0,.45) !important;
  border: 1px solid rgba(0,255,65,.35) !important;
  color:#00ff41 !important;
}

/* Badge */
.nh-badge{
  border:1px solid rgba(0,255,65,.35) !important;
  background: rgba(0,20,0,.35) !important;
  color:#00ff41 !important;
}

/* Linki/teksty poboczne */
.nh-sub, .nh-score-label{
  color: rgba(0,255,65,.75) !important;
}

/* Debug pre (result) jak terminal */
#result{
  color:#00ff41;
  background: rgba(0,0,0,.55);
  border:1px solid rgba(0,255,65,.25);
  border-radius:10px;
  padding:10px 12px;
}

/* Drobna kosmetyka listy leaderboard */
#boardList li{
  margin: 6px 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0,20,0,.22);
  border: 1px solid rgba(0,255,65,.12);
}

#flagMsg.success{
  color:#00ff41;
  text-shadow:0 0 8px rgba(0,255,65,.8);
}

#flagMsg.error{
  color:#ff3b3b;
  border-color:rgba(255,0,0,.4) !important;
  text-shadow:0 0 8px rgba(255,0,0,.7);
}
.box {
    position: relative;
    z-index: 10;

    width: min(720px, 92vw);   /* 🔥 klucz */
    max-width: 720px;

    padding: 32px 36px;

    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);

    border: 2px solid #00ff41;
    border-radius: 8px;

    box-shadow:
        0 0 20px #00ff41,
        inset 0 0 25px rgba(0,255,65,.15);
}

.nh-card,
.box {
    line-height: 1.6;
    letter-spacing: 0.5px;
}

.nh-card,
.box {
    line-height: 1.6;
    letter-spacing: 0.5px;
}


/* ===== WIDTH FIX (NA KONIEC PLIKU) ===== */

/* Kontener strony – pozwól mu być szerszym */
.nh-ctf{
  max-width: 980px !important;      /* było 760px */
  width: min(980px, 94vw) !important;
  margin: 24px auto !important;
  padding: 16px !important;

  display: flex !important;
  justify-content: center !important;  /* wycentruj poziomo */
  align-items: flex-start !important;  /* nie wciskaj w pionie */
}

/* Sama karta – niech bierze pełną szerokość kontenera */
.nh-card{
  width: 100% !important;
}

/* (opcjonalnie) trochę miejsca na formularz i leaderboard */
.ctf-panel{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 820px){
  .ctf-panel{ grid-template-columns: 1fr; }
}

/* =========================================
   NOIRTHHACK — NEO MATRIX THEME (v1)
   Wklej na SAM KONIEC style.css
   ========================================= */

:root{
  --mx-green: #00ff41;
  --mx-green-soft: rgba(0,255,65,.35);
  --mx-bg: #020403;
  --mx-panel: rgba(0, 0, 0, 0.78);
  --mx-border: rgba(0,255,65,.55);
  --mx-shadow: 0 0 22px rgba(0,255,65,.22), inset 0 0 20px rgba(0,255,65,.08);
  --mx-text: rgba(0,255,65,.92);
  --mx-text-dim: rgba(0,255,65,.70);
  --mx-red: #ff3b3b;
}

/* Tło strony */
body{
  background: var(--mx-bg) !important;
  color: var(--mx-text) !important;
  font-family: "Courier New", Courier, monospace !important;
  overflow-x: hidden !important;
}

/* scanlines + delikatny RGB shift */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,.24) 50%),
    linear-gradient(90deg, rgba(255,0,0,.05), rgba(0,255,0,.02), rgba(0,0,255,.05));
  background-size: 100% 2px, 3px 100%;
  opacity: .95;
}

/* Kontener */
.nh-ctf{
  position: relative;
  z-index: 1; /* nad scanlines */
}

/* Karta główna */
.nh-card{
  background: var(--mx-panel) !important;
  border: 2px solid var(--mx-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--mx-shadow) !important;
  backdrop-filter: blur(6px);
}

/* subtelny grid na karcie */
.nh-card::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(90deg, rgba(0,255,65,.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0,255,65,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity:.22;
  mix-blend-mode: screen;
}

/* Head */
.nh-title{
  color: var(--mx-green) !important;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 22px !important;
}
.nh-sub{
  color: var(--mx-text-dim) !important;
}

/* Score */
.nh-score-label{ color: var(--mx-text-dim) !important; }
.nh-score-val{
  color: var(--mx-green) !important;
  text-shadow: 0 0 10px rgba(0,255,65,.22);
}

/* Inputy */
.nh-input{
  background: rgba(0,0,0,.85) !important;
  border: 1px solid rgba(0,255,65,.55) !important;
  color: var(--mx-green) !important;
  border-radius: 12px !important;
}
.nh-input::placeholder{
  color: rgba(0,255,65,.35);
}
.nh-input:focus{
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(0,255,65,.25), 0 0 18px rgba(0,255,65,.18) !important;
}

/* Button */
.nh-btn{
  background: rgba(0, 40, 0, .55) !important;
  border: 1px solid rgba(0,255,65,.6) !important;
  color: var(--mx-green) !important;
  font-family: inherit !important;
  font-weight: 800 !important;
  border-radius: 12px !important;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease !important;
}
.nh-btn:hover{
  background: rgba(0,255,65,.9) !important;
  color: #000 !important;
  box-shadow: 0 0 16px rgba(0,255,65,.35) !important;
  transform: translateY(-1px);
}
.nh-btn:active{
  transform: translateY(0);
}
.nh-btn:disabled{
  opacity: .75 !important;
  cursor: not-allowed !important;
}

/* Mini / badge */
.nh-mini{ color: var(--mx-text-dim) !important; }
.nh-badge{
  border: 1px solid rgba(0,255,65,.45) !important;
  background: rgba(0, 35, 0, .35) !important;
  color: var(--mx-green) !important;
}
.nh-dot{ background: rgba(0,255,65,.35) !important; }

/* Wiadomość (flagMsg) */
.nh-msg{
  background: rgba(0, 25, 0, .35) !important;
  border: 1px solid rgba(0,255,65,.28) !important;
  color: var(--mx-green) !important;
}

/* pre result */
#result{
  color: var(--mx-green);
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(0,255,65,.22);
  border-radius: 12px;
  padding: 10px 12px;
}

/* Leaderboard list */
#boardList li{
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 20, 0, .25);
  border: 1px solid rgba(0,255,65,.14);
}

/* Success/Error klasy — dodamy je z JS */
#flagMsg.success{
  border-color: rgba(0,255,65,.45) !important;
  text-shadow: 0 0 10px rgba(0,255,65,.35);
}
#flagMsg.error{
  color: var(--mx-red) !important;
  border-color: rgba(255,0,0,.35) !important;
  text-shadow: 0 0 10px rgba(255,0,0,.22);
}
.nh-card:hover{
  box-shadow: 0 0 26px rgba(0,255,65,.28), inset 0 0 22px rgba(0,255,65,.10) !important;
}



 =========================
   MATRIX THEME OVERRIDES
   Wklej na KONIEC style.css
   ========================= */

/* Tło całej strony */
body{
  background:#000 !important;
  color:#00ff41 !important;
  font-family: "Courier New", Courier, monospace !important;

  /* nie wymuszamy flex/100vh, bo Ty masz już layout w .nh-ctf */
  margin:0 !important;
  overflow-x:hidden !important;
}

#matrix {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1; /* tło pod kartami */
  background: #000;
}


/* Scanlines + lekki RGB shift (migoczące tło) */
body::before{
  content:"";
  display:block;
  position:fixed;
  inset:0;
  background:
    linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,.25) 50%),
    linear-gradient(90deg, rgba(255,0,0,.06), rgba(0,255,0,.02), rgba(0,0,255,.06));
  background-size: 100% 2px, 3px 100%;
  z-index:1;
  pointer-events:none;
  opacity:.9;
}

/* Kontener (zostawiamy Twoje max-width itp.) */
.nh-ctf{
  position:relative;
  z-index:2; /* nad scanlines */
}

/* Twoje okienko = "box" */
.nh-card{
  position:relative;
  z-index:3;

  background: rgba(0, 0, 0, 0.85) !important;
  border: 2px solid #00ff41 !important;
  border-radius: 10px !important;
  box-shadow: 0 0 20px rgba(0,255,65,.35) !important;
  backdrop-filter: blur(6px);
}

/* Nagłówki */
.nh-title, .ctf-panel h3{
  color:#00ff41 !important;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Delikatna linia pod nagłówkami sekcji */
.ctf-panel h3{
  border-bottom: 1px solid rgba(0,255,65,.55);
  padding-bottom: 8px;
}

/* Input + button w klimacie terminala */
.nh-input{
  width:100%;
  background:#000 !important;
  border:1px solid #00ff41 !important;
  color:#00ff41 !important;
  font-family: inherit !important;
}

.nh-input:focus{
  box-shadow: 0 0 10px rgba(0,255,65,.8) !important;
  border-color:#00ff41 !important;
}

/* Przyciski */
.nh-btn{
  background:#004400 !important;
  border:1px solid #00ff41 !important;
  color:#00ff41 !important;
  font-family: inherit !important;
  font-weight:800 !important;
  transition: .2s ease !important;
}

.nh-btn:hover{
  background:#00ff41 !important;
  color:#000 !important;
  box-shadow: 0 0 12px rgba(0,255,65,.65) !important;
}

.nh-btn:disabled{
  opacity: .8 !important;
  cursor:not-allowed !important;
}

/* Komunikaty */
.nh-msg{
  background: rgba(0,20,0,.45) !important;
  border: 1px solid rgba(0,255,65,.35) !important;
  color:#00ff41 !important;
}

/* Badge */
.nh-badge{
  border:1px solid rgba(0,255,65,.35) !important;
  background: rgba(0,20,0,.35) !important;
  color:#00ff41 !important;
}

/* Linki/teksty poboczne */
.nh-sub, .nh-score-label{
  color: rgba(0,255,65,.75) !important;
}

/* Debug pre (result) jak terminal */
#result{
  color:#00ff41;
  background: rgba(0,0,0,.55);
  border:1px solid rgba(0,255,65,.25);
  border-radius:10px;
  padding:10px 12px;
}

/* Drobna kosmetyka listy leaderboard */
#boardList li{
  margin: 6px 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0,20,0,.22);
  border: 1px solid rgba(0,255,65,.12);
}

@media (max-width: 480px){
  .nh-card{
    padding: 20px 16px;
  }

  .nh-title{
    font-size: 20px;
  }

  .nh-row{
    flex-direction: column;
    align-items: stretch;
  }

  .nh-btn{
    width: 100%;
  }
}

.nh-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin:14px 0;
}
.nh-lablink{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  border:1px solid rgba(0,255,65,.35);
  border-radius:12px;
  text-decoration:none;
  color:inherit;
  background:rgba(0,0,0,.25);
}
.nh-lablink:hover{
  border-color: rgba(0,255,65,.8);
  box-shadow: 0 0 18px rgba(0,255,65,.15);
}
.nh-labname{ font-weight:700; letter-spacing:.5px; }
.nh-labmeta{ opacity:.9; }


#labState.is-solved{
  border-color: rgba(0,255,65,.9);
  box-shadow: 0 0 18px rgba(0,255,65,.18);
}
.nh-auth{
  margin-top:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(6px);
}

.nh-btn-mini{
  padding:8px 10px;
  font-size:12px;
  line-height:1;
}

.nh-auth-status{
  opacity:.9;
  font-size:13px;
}

.nh-modal{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.6);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding:16px;
}

.nh-modal-card{
  width:min(720px, 100%);
  background: rgba(10,12,16,.95);
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  padding:16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}

.nh-modal-title{
  font-size:16px;
  font-weight:700;
  opacity:.95;
}

.nh-lablink.is-locked{
  opacity: .55;
  cursor: not-allowed;
  pointer-events: auto; /* ważne: ma klikać, ale ma blokować */
}

.nh-lablink.is-locked:hover{
  opacity: .7;
}

.nh-lock{
  font-weight: 700;
}

/* Modal base */
.nh-modal{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.65);
  z-index: 9999;
}

.nh-modal-card{
  width: min(520px, 100%);
  border-radius: 14px;
  background: rgba(10,12,16,.92);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  padding: 14px;
}

.nh-modal-head{
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.nh-modal-title{
  font-weight: 700;
  font-size: 18px;
}

.nh-modal-sub{
  opacity: .8;
  font-size: 13px;
  margin-top: 3px;
}

.nh-x{
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  opacity: .8;
}
.nh-x:hover{ opacity: 1; }

.nh-modal-body{ padding-top: 4px; }

.nh-paywall-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.nh-btn-ghost{
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nh-paywall-foot{
  margin-top: 12px;
  opacity: .75;
}

.nh-teaser{
  margin-top: 8px;
  opacity: .78;
  font-size: 13px;
  line-height: 1.35;
}
.nh-teaser.is-blur{
  filter: blur(3px);
  opacity: .45;
  user-select: none;
}

.nh-modal{
  position: fixed;
  inset: 0;
  display: none;              /* JS ustawia na flex */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.70);
  z-index: 99999;
}

.nh-modal-card{
  width: min(520px, calc(100vw - 28px));
  border-radius: 16px;
  padding: 16px;
}

#paywallModal { display:none; }
#paywallModal.is-open { display:flex; }

/* PAYWALL: stan ukryty/pokazany sterowany aria-hidden */
#paywallModal[aria-hidden="true"] { display: none !important; }
#paywallModal[aria-hidden="false"] { display: flex !important; }

#paywallModal { position: fixed; inset: 0; z-index: 99999; }
#paywallModal .nh-modal__backdrop { position: absolute; inset: 0; }
#paywallModal .nh-modal__panel { position: relative; z-index: 100000; }

#paywallModal .nh-modal__backdrop { z-index: 0; }
#paywallModal .nh-modal__panel { z-index: 1; }


/* Ghost preview (locked) */
.nh-ghost {
  position: relative;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  overflow: hidden;
}

.nh-ghost__content {
  filter: blur(2.6px);
  opacity: .85;
  user-select: none;
  pointer-events: none; /* żeby nie dało się kliknąć linków w środku */
  transform: translateZ(0);
}

.nh-ghost__content a,
.nh-ghost__content button,
.nh-ghost__content input {
  pointer-events: none !important;
}

/* gradient mask: dół znika */
.nh-ghost::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,.10) 55%,
    rgba(0,0,0,.65) 100%);
  pointer-events: none;
}

.nh-ghost__overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nh-ghost__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  opacity: .95;
}

.nh-ghost__cta {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nh-teaser.is-blur{
  filter: blur(1.8px);
  opacity: .85;
  user-select: none;
}

.nh-muted {
  color: rgba(255,255,255,.65);
  letter-spacing: .02em;
}

.nh-muted::before {
  content: "• ";
  opacity: .6;
}

/* 1) Globalnie: przewidywalne liczenie szerokości */
*, *::before, *::after { box-sizing: border-box; }

/* 2) Modal overlay – niech zawsze centruje i nie ucina */
.nh-modal{
  position: fixed;
  inset: 0;
  display: none;           /* JS ustawia flex */
  align-items: center;
  justify-content: center;
  padding: 16px;           /* ważne na mobile */
  z-index: 9999;
}

/* 3) Karta modala – limit szerokości + responsywność */
.nh-modal-card{
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 16px;     /* jeśli masz, zostaw */
}

/* 4) Inputy – 100% i bez “wyjeżdżania” */
.nh-modal .nh-input{
  width: 100%;
  max-width: 100%;
}

/* 5) Przyciski w modalach – zawijanie na małych ekranach */
.nh-modal-actions,
.nh-actions,
.nh-paywall-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nh-modal-actions .nh-btn,
.nh-actions .nh-btn,
.nh-paywall-actions .nh-btn{
  flex: 1 1 160px;         /* rośnie i zawija */
  min-width: 140px;
}

/* 6) (opcjonalnie) na bardzo małych ekranach – pełna szerokość */
@media (max-width: 420px){
  .nh-modal-card{ padding: 14px; }
  .nh-modal-actions .nh-btn,
  .nh-actions .nh-btn{ flex: 1 1 100%; }
}

/* === MODALS: mobile-safe, no overflow === */
.nh-modal {
  position: fixed;
  inset: 0;
  display: none;           /* JS ustawia flex */
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.nh-modal * { box-sizing: border-box; }

.nh-modal-card,
.nh-modal__panel {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 14px;
}

.nh-modal-card .nh-input,
.nh-modal__panel .nh-input {
  width: 100%;
  max-width: 100%;
}

.nh-modal-actions,
.nh-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nh-modal-actions .nh-btn,
.nh-actions .nh-btn {
  flex: 1 1 160px;        /* na mobile ładnie się łamie */
  min-width: 140px;
}

@media (max-width: 420px) {
  .nh-modal { padding: 10px; }
  .nh-modal-card,
  .nh-modal__panel { width: calc(100vw - 20px); }
  .nh-modal-actions .nh-btn,
  .nh-actions .nh-btn { flex: 1 1 100%; min-width: 0; }
}


/* FIX: lock/preview muszą łapać klik (często giną przez pointer-events:none) */
.nh-labmeta,
.nh-labmeta * {
  pointer-events: auto !important;
}

.nh-lock-btn,
.nh-preview-btn {
  pointer-events: auto !important;
  cursor: pointer;
}

/* 1) Modal ma być na pewno martwy, gdy aria-hidden=true */
.nh-modal[aria-hidden="true"]{
  display: none !important;
  pointer-events: none !important;
}

/* 2) Gdy modal otwarty - ma łapać klik */
.nh-modal{
  pointer-events: auto;
}

/* 3) Kłódka/preview muszą łapać klik zawsze */
.nh-lock-btn,
.nh-preview-btn{
  pointer-events: auto !important;
  cursor: pointer;
}

/* --- mobile/layout safety --- */
.nh-card, .nh-modal__panel {
  box-sizing: border-box;
}

.nh-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nh-input {
  flex: 1 1 220px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.nh-btn {
  max-width: 100%;
}

/* paywall modal sizing */
#paywallModal {
  padding: 12px;
  box-sizing: border-box;
}

#paywallModal .nh-modal__panel {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
}

/* action buttons in modal */
#paywallModal .nh-actions,
#paywallModal .nh-actions button {
  flex: 1 1 160px;
}

@media (max-width: 520px) {
  #paywallModal .nh-actions {
    flex-direction: column;
  }
}

/* ===== MODAL HOTFIX (paywall vs login/register) ===== */

/* wszystkie modale jako overlay */
.nh-modal{
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;              /* JS ustawia flex */
  align-items: center;
  justify-content: center;
  padding: 14px;
}

/* paywall: podbij z-index (nad login/register) */
#paywallModal{
  z-index: 2000;
}

/* paywall backdrop */
#paywallModal .nh-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}

/* paywall panel */
#paywallModal .nh-modal__panel{
  position: relative;
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border-radius: 18px;
}

/* login/register: ogranicz szerokość karty, żeby nie rozpychało */
#loginModal .nh-modal-card,
#registerModal .nh-modal-card{
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
}

/* przyciski w modalach niech nie udają kafli */
#paywallModal .nh-btn,
#loginModal .nh-btn,
#registerModal .nh-btn{
  width: auto;
  height: auto;
  min-height: 44px;
}

/* =========================
   NOIRTHHACK — modal legal links
   ========================= */

#registerModal a,
#loginModal a,
#paywallModal a {
  color: #00ffd5;
  text-decoration: none;
  border-bottom: 1px dashed rgba(0, 255, 213, 0.7);
  transition: color .18s ease, border-color .18s ease, text-shadow .18s ease;
}

#registerModal a:hover,
#loginModal a:hover,
#paywallModal a:hover {
  color: #9affef;
  border-bottom-color: #9affef;
  text-shadow: 0 0 10px rgba(0, 255, 213, 0.35);
}


#registerModal a:visited,
#loginModal a:visited,
#paywallModal a:visited {
  color: #9ee7ff;
}

#registerModal a:focus-visible,
#loginModal a:focus-visible,
#paywallModal a:focus-visible {
  outline: 1px solid #7cffe1;
  outline-offset: 2px;
  border-radius: 3px;
}

/* =========================
   NOIRTHHACK — consent checkboxes
   ========================= */

#registerModal input[type="checkbox"] {
  accent-color: #00ff66;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

#registerModal .nh-consents label {
  cursor: pointer;
}

#registerModal .nh-consents span {
  color: #bfffd8;
}

/* =========================
   NOIRTHHACK — register modal fixes
   Wklej na SAM KONIEC style.css
   ========================= */

/* 1) Pusty komunikat błędu/sukcesu w rejestracji ma nie być widoczny */
#regMsg:empty,
#loginMsg:empty {
  display: none !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  margin-top: 0 !important;
}

/* 2) Gdy komunikat już istnieje — ma wyglądać normalnie */
#regMsg:not(:empty),
#loginMsg:not(:empty) {
  display: block !important;
  width: 100%;
  margin-top: 10px !important;
}

/* 3) Linki w modalach — mocniejszy kontrast i bez słabego visited */
#registerModal a,
#loginModal a,
#paywallModal a {
  color: #7cffe1 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  border-bottom: 0 !important;
  transition: color .18s ease, text-shadow .18s ease, opacity .18s ease;
}

#registerModal a:hover,
#loginModal a:hover,
#paywallModal a:hover {
  color: #c8fff5 !important;
  text-shadow: 0 0 10px rgba(124, 255, 225, 0.35);
}

#registerModal a:visited,
#loginModal a:visited,
#paywallModal a:visited {
  color: #7cffe1 !important;
}

#registerModal a:focus-visible,
#loginModal a:focus-visible,
#paywallModal a:focus-visible {
  outline: 1px solid #7cffe1 !important;
  outline-offset: 2px;
  border-radius: 3px;
}

/* 4) Checkboxy + tekst przy zgodach */
#registerModal input[type="checkbox"] {
  accent-color: #00ff66;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

#registerModal .nh-consents label {
  cursor: pointer;
}

#registerModal .nh-consents span {
  color: #c6ffe0 !important;
}

/* 5) Box z klauzulą RODO */
#registerModal .nh-consents > .nh-msg {
  background: rgba(0, 255, 102, 0.06) !important;
  border: 1px solid rgba(0, 255, 102, 0.35) !important;
  border-radius: 14px !important;
  padding: 14px 16px !important;
  color: #c6ffe0 !important;
  display: block !important;
  line-height: 1.55;
}

/* 6) Drobne wyrównanie pionowe checkboxów */
#registerModal .nh-consents label input[type="checkbox"] {
  margin-top: 4px;
}

/* =========================
   NOIRTHHACK — back link + layout fix
   ========================= */

.nh-ctf{
  min-height: auto !important;
  align-items: flex-start !important;
  justify-content: center !important;
}

.nh-card{
  width: 100% !important;
  overflow: visible !important;
}

.ctf-panel{
  margin-bottom: 18px !important;
}

.nh-back{
  display: inline-block !important;
  margin: 18px 0 0 !important;
  padding: 10px 14px !important;
  border-radius: 999px !important;
  text-decoration: none !important;
  color: #00ff41 !important;
  border: 1px solid rgba(0,255,65,.45) !important;
  background: rgba(0,20,0,.35) !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: relative !important;
  z-index: 20 !important;
}

.nh-back:hover{
  color: #000 !important;
  background: #00ff41 !important;
  box-shadow: 0 0 12px rgba(0,255,65,.45) !important;
}

.nh-paywall-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  width: 100%;
}

.nh-paywall-actions .nh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  height: auto !important;
  padding: 12px 18px !important;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  box-sizing: border-box;
}

#paywallClose {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .nh-paywall-actions {
    grid-template-columns: 1fr;
  }
}

#paywallModal .nh-modal-card {
  padding: 20px;
}

#paywallModal p,
#paywallModal .nh-help,
#paywallModal .nh-note {
  margin-bottom: 12px;
}


.nh-ghost__content {
  pointer-events: none;
  user-select: none;
}

.nh-ghost__content button,
.nh-ghost__content .nh-btn,
.nh-ghost__content a,
.nh-ghost__content input,
.nh-ghost__content textarea,
.nh-ghost__content select,
.nh-ghost__content form {
  visibility: hidden !important;
}


