/* ---------- Base & Theme (seamless background) ---------- */
:root{
  --bg:#0e0f12;
  --card:rgba(255,255,255,0.04);
  --border:rgba(255,255,255,0.10);
  --text:#e6edf3;
  --muted:#94a3b8;
  --brand:#faa61a;
  --radius:16px;
  --shadow:0 10px 30px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:'Rubik',ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial;
  color:var(--text);
  line-height:1.6;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;

  /* Unified, non-overlapping background layers to avoid mid-screen seam */
  background:
    radial-gradient(1200px 800px at 80% -20%, rgba(255,122,24,0.09) 0%, rgba(255,122,24,0) 60%),
    radial-gradient(900px 900px at 20% 120%, rgba(255,61,61,0.09) 0%, rgba(255,61,61,0) 60%),
    radial-gradient(1000px 1000px at -10% 20%, rgba(34,139,230,0.05) 0%, rgba(34,139,230,0) 60%),
    #0e0f12;
  background-repeat:no-repeat, no-repeat, no-repeat, no-repeat;
  background-attachment: fixed, fixed, fixed, fixed;
}

/* Remove heavy blurred overlays that could create banding seams */
.bg{display:none}

/* ---------- Topbar ---------- */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 20px; border-bottom:1px solid var(--border);
  background:linear-gradient(180deg, rgba(255,255,255,.03), transparent);
  position:sticky; top:0; backdrop-filter: blur(8px);
}
.brand{display:flex; align-items:center; gap:12px}
.logo{width:40px; height:40px; border-radius:8px; object-fit:cover}
.site-title{font-size:1.3rem; margin:0; letter-spacing:.3px}
.site-subtitle{margin:0; color:var(--muted); font-size:.9rem}
.rust-mark{display:inline-block; font-weight:800; letter-spacing:.5px; padding:2px 6px; border:1px solid var(--brand); border-radius:6px; color:var(--brand);}

.top-actions{display:flex; gap:10px; align-items:center}
.btn{
  appearance:none; border:none; cursor:pointer;
  padding:10px 14px; border-radius:12px; font-weight:700;
  transition: transform .06s ease, filter .2s ease, background .2s ease, border-color .2s ease;
}
.btn.primary{background:linear-gradient(180deg, var(--brand), #ffb347); color:#1a1203; box-shadow:0 8px 22px rgba(250,166,26,.25);}
.btn.outline{background:transparent; border:1px solid var(--border); color:var(--text);}
.btn.ghost{background:transparent; color:var(--text);}
.btn:active{transform:translateY(1px)}
.btn:hover{filter:brightness(1.04)}

/* ---------- Hero ---------- */
.hero{padding:40px 20px 10px; display:flex; justify-content:center}
.hero-content{max-width:1100px; width:100%}
.hero-title{font-size: clamp(1.6rem, 3vw, 2.2rem); margin:.1rem 0 .4rem; letter-spacing:.2px}
.hero-lead{color:var(--muted); max-width:720px}
.hero-badges{display:flex; flex-wrap:wrap; gap:8px; margin-top:10px}
.badge{border:1px solid var(--border); color:var(--muted); font-size:.82rem; padding:6px 10px; border-radius:999px}
.accent{color:var(--brand)}

/* ---------- Layout ---------- */
.container{display:flex; justify-content:center; padding:20px}
.grid{
  width:100%; max-width:1100px;
  display:grid; gap:16px; grid-template-columns:1fr; align-items:start;
}
@media (min-width: 900px){
  .grid{ grid-template-columns: 1fr 1fr; }
}
.card{
  background:linear-gradient(180deg, var(--card), transparent);
  border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:16px;
  overflow: hidden; /* przytnij efekty wewnątrz */
}

/* ---------- Calculator & Materials ---------- */

/* Ukryj natywne strzałki liczby (wszystkie silniki) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }  /* WebKit/Blink */
input[type="number"]{ -moz-appearance: textfield; appearance: textfield; }               /* Firefox + standard */

/* ITEM ROW: 3 kolumny: ikona | label | kontrolka */
.item-row{
  display: grid;
  grid-template-columns: auto 1fr clamp(140px, 22vw, 180px); /* ostatnia kolumna responsywnie */
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.item-row:hover{ background: rgba(255,255,255,.03); border-color: var(--border); }
.item-row img{ width: 46px; height: 46px; }
.card-title{margin:0 0 10px; font-size:1.05rem}
.itemname{font-weight:700}

/* Ogólny wygląd inputów number (poza wrapperem) */
input[type="number"]{
  width:100%; padding:10px 12px; border-radius:10px;
  background:#0b0d11; color:var(--text);
  border:1px solid var(--border); outline:none; transition:border-color .2s ease, background .2s ease;
}
input[type="number"]:focus{border-color:var(--brand); background:#0e1117}

/* CUSTOM number input: przyciski +/− wewnątrz wrappera
   ---------------------------------------------------- */
.number-input{
  width: 100%;                                  /* dopasuj do 3. kolumny item-row */
  display: grid;
  grid-template-columns: 42px 1fr 42px;         /* + / pole / − (lub odwrotnie) */
  align-items: center;
  background: #0b0d11;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: none;                             /* bez mocnego „glow” */
}
.number-input:focus-within{
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(250,166,26,.18);   /* subtelny focus */
}

/* PATCH: w gridzie input domyślnie ma min-width:auto → potrafi wypchnąć kolumny.
   Min-width:0 pozwala mu się zwężać i NIE ucina przycisku „+”. */
.number-input input{
  min-width: 0;                                 /* <<< kluczowe */
  width: 100%;
  height: 36px;
  border: 0;                                    /* nadpisuje ogólny border */
  background: transparent;
  color: var(--text);
  text-align: center;
  font-size: 16px;
  padding: 0 6px;
  outline: none;
}

.number-input button{
  width: 42px; height: 36px;
  background: #16181e;
  color: var(--brand);
  border: 0;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  user-select: none;
  transition: background .15s ease, color .15s ease;
}
.number-input button:hover{ background: #1f232b; }
.number-input .decrement{ border-right: 1px solid var(--border); }
.number-input .increment{ border-left: 1px solid var(--border); }

/* Mobile tweaks */
@media (max-width: 480px){
  .item-row{ grid-template-columns: auto 1fr 132px; }
  .number-input{ grid-template-columns: 36px 1fr 36px; }
  .number-input button{ width: 36px; height: 34px; }
  .number-input input{ height: 34px; }
}

/* ---------- Materials list ---------- */
.requirements{display:grid; gap:8px; margin-top:10px}
.requirements p{display:flex; align-items:center; gap:10px; margin:0; background:rgba(255,255,255,.03); border:1px solid var(--border); padding:8px 10px; border-radius:10px}
.requirements img{width:34px; height:34px}
.material-img{width:28px; height:28px}

/* ---------- Footer ---------- */
.site-footer{display:flex; justify-content:center; padding:20px; color:var(--muted); border-top:1px solid var(--border)}
.site-footer a{color:var(--text); text-decoration:none; border-bottom:1px dotted var(--border)}
.site-footer a:hover{color:var(--brand)}

/* ---------- Modal ---------- */
.modal{display:none; position:fixed; inset:0; z-index:1000; background:rgba(0,0,0,.55); backdrop-filter: blur(2px);}
.modal .modal-content{
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:min(92vw, 580px); background:#111317; border:1px solid var(--border); border-radius:14px; padding:18px;
  box-shadow:var(--shadow);
}
.close-btn{position:absolute; right:10px; top:10px; background:transparent; border:1px solid var(--border); border-radius:10px; padding:4px 8px; color:var(--text); cursor:pointer}
.close-btn:hover{border-color:var(--brand); color:var(--brand)}

/* ---------- Utilities ---------- */
.sr-only{position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0}


/* ---------- FAQ (accordion) ---------- */
/* Kontener FAQ: prosta siatka kart */
.faq{
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

/* Pojedyncze pytanie/odpowiedź */
.faq details{
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  overflow: hidden;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.faq details:hover{
  background: rgba(255,255,255,.04);
}
.faq details[open]{
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(250,166,26,.12) inset; /* subtelny akcent po otwarciu */
}

/* Pasek tytułu pytania */
.faq summary{
  list-style: none;                       /* ukryj domyślny znacznik */
  cursor: pointer;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;        /* tekst | chevron */
  gap: 10px;
  align-items: center;
  font-weight: 800;
  color: var(--text);
}
.faq summary::-webkit-details-marker{ display:none; } /* WebKit */
.faq summary::marker{ content:""; }                   /* Firefox */

/* Chevron po prawej */
.faq summary::after{
  content:"";
  width: 12px; height: 12px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);               /* „>” */
  transition: transform .2s ease, border-color .2s ease;
}
.faq details[open] summary::after{
  transform: rotate(45deg);                /* „v” po otwarciu */
  border-color: var(--brand);
}

/* Treść odpowiedzi */
.faq details > *:not(summary){
  padding: 0 16px 14px 16px;
  color: var(--muted);
}
.faq details p{ margin: 10px 0 0; }
.faq details ul{
  margin: 8px 0 0 18px;
  list-style: disc;
  color: var(--muted);
}

/* Linki w treści */
.faq a{
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}
.faq a:hover{ text-decoration: underline; }

/* Podświetlenie pytania trafionego kotwicą (#q-...) */
.faq details:target{
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(250,166,26,.18);
}

/* (opcjonalnie) przycisk-odsyłacz w tekście, np. „Updates” */
.link{
  background: none;
  border: none;
  color: var(--brand);
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.link:hover{ text-decoration: underline; }

/* Mobile drobne oddechy */
@media (max-width: 520px){
  .faq summary{ padding: 12px 14px; }
  .faq details > *:not(summary){ padding: 0 14px 12px 14px; }
}

/* ---------- Custom scrollbars (global) ---------- */
/* Firefox */
html {
  /* kolor kciuka i tła (thumb track) */
  scrollbar-width: thin; /* auto | thin | none */
  scrollbar-color: var(--brand) rgba(255,255,255,0.10);
}

/* WebKit/Blink: Chrome, Edge, Safari */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.06);             /* ciemne tło toru */
}
*::-webkit-scrollbar-thumb {
  /* ten sam „Rust orange” co w UI */
  background: linear-gradient(180deg, var(--brand), #ffb347);
  border-radius: 10px;
  /* odrobina „oddechu” dookoła kciuka */
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  filter: brightness(1.05);
}
*::-webkit-scrollbar-corner { background: transparent; }

/* (opcjonalnie) stałe miejsce na scrollbar – mniej skoków layoutu */
body { scrollbar-gutter: stable; }
