/* =====================================================================
   zabawne.pl - arkusz stylow
   ===================================================================== */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --brand: #ff6b3d;
  --brand-dark: #e8552a;
  --accent: #ffd23f;
  --line: #e6e8ee;
  --danger: #e23c3c;
  --shadow: 0 6px 20px rgba(31,36,48,.07);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* ---- Naglowek ---- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { flex: none; display: block; filter: drop-shadow(0 3px 6px rgba(255,77,109,.25)); }
.logo-text { font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; }
.logo-text span { color: var(--brand); }
.logo:hover { text-decoration: none; }
.user-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav-link { color: var(--muted); font-weight: 600; }
.nav-user { color: var(--ink); font-weight: 600; }

/* ---- Pasek kategorii ---- */
.cat-bar { background: var(--card); border-bottom: 1px solid var(--line); }
.cat-bar-inner { display: flex; gap: 8px; overflow-x: auto; padding: 10px 18px; -webkit-overflow-scrolling: touch; }
.cat-chip {
  white-space: nowrap; padding: 7px 14px; border-radius: 999px;
  background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 600;
  border: 1px solid var(--line);
}
.cat-chip:hover { background: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ---- Uklad z bocznym menu kategorii ---- */
.layout { display: flex; align-items: flex-start; gap: 24px; max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.main-content { flex: 1 1 auto; min-width: 0; padding: 26px 0 60px; min-height: 60vh; }
.cat-side {
  flex: 0 0 230px; width: 230px; margin-top: 26px; padding: 12px;
  position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.cat-side-top { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 15px; padding: 6px 8px 10px; }
.cat-side-close { display: none; background: none; border: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.cat-list { display: flex; flex-direction: column; gap: 3px; }
.cat-link { padding: 9px 12px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 14.5px; }
.cat-link:hover { background: var(--bg); text-decoration: none; }
.cat-link-rnd { background: var(--accent); }
.cat-link-rnd:hover { background: #ffbf00; }
.cat-link-adult { color: var(--danger); }
.cat-toggle { display: none; background: none; border: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink); padding: 0 4px; }
.cat-side-backdrop { display: none; }
@media (max-width: 900px) {
  .cat-toggle { display: inline-block; }
  .layout { display: block; }
  .main-content { padding: 20px 0 50px; }
  .cat-side {
    position: fixed; top: 0; left: 0; bottom: 0; margin: 0; width: 280px; max-width: 85vw;
    max-height: none; border-radius: 0; z-index: 120; transform: translateX(-100%); transition: transform .25s ease;
  }
  .cat-side.open { transform: translateX(0); }
  .cat-side-close { display: inline-block; }
  .cat-side-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 110; }
  .cat-side-backdrop[hidden] { display: none; }
}

/* ---- Udostepnianie ---- */
.joke-share { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.share-label { font-size: 14px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.share-btn { cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 7px 13px; font-size: 13.5px; font-weight: 700; font-family: inherit; }
.share-btn:hover { background: var(--bg); }
.share-fb:hover { border-color: #1877f2; color: #1877f2; }
.share-ig:hover { border-color: #c13584; color: #c13584; }
.share-copy:hover { border-color: var(--brand); color: var(--brand-dark); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: #20233a; color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.28); opacity: 0; transition: opacity .3s ease, transform .3s ease; z-index: 200; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Strony prawne (regulamin, polityka prywatnosci) ---- */
.legal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px 34px; max-width: 820px; margin: 8px auto; }
.legal h1 { margin: 0 0 6px; font-size: 28px; }
.legal-date { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.legal h2 { font-size: 18px; margin: 24px 0 8px; }
.legal p, .legal li { color: #384049; font-size: 15.5px; line-height: 1.7; }
.legal ul { padding-left: 20px; margin: 8px 0; }
.legal li { margin-bottom: 6px; }
.legal-foot { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); font-weight: 700; }

/* ---- Akcje na stronie glownej (hero) ---- */
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.hero-actions .btn-big { padding: 13px 24px; font-size: 16px; }
.btn-hero-best { background: linear-gradient(135deg, #ff9a3d, #ff4d6d); color: #fff; }
.btn-hero-best:hover { filter: brightness(1.06); color: #fff; }
.btn-hero-new { background: var(--ink); color: #fff; }
.btn-hero-new:hover { background: #000; color: #fff; }
.btn-hero-rnd { background: var(--accent); color: #1f2430; }
.btn-hero-rnd:hover { background: #ffbf00; color: #1f2430; }
.see-all { margin: 14px 0 0; font-weight: 700; }

/* ---- Nastepny / Losowy pod glosowaniem ---- */
.joke-next { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 4px; }
.btn-next { background: linear-gradient(135deg, #ff9a3d, #ff4d6d); color: #fff; }
.btn-next:hover { filter: brightness(1.06); color: #fff; }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }

/* ---- Okruszki (breadcrumbs) ---- */
.breadcrumbs { font-size: 13px; color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.breadcrumbs a { color: var(--muted); font-weight: 600; }
.breadcrumbs a:hover { color: var(--brand-dark); }
.breadcrumbs .sep { margin: 0 6px; opacity: .55; }
.breadcrumbs .current { color: var(--ink); }
@media (max-width: 560px) { .legal { padding: 22px 18px; } }

/* ---- Przyciski ---- */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 999px; border: none;
  font-weight: 700; font-size: 15px; cursor: pointer; text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, #ff9a3d, #ff4d6d); color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, #ff8a1f, #ff3355); color: #fff; }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-big { padding: 14px 30px; font-size: 17px; background: var(--ink); color: #fff; margin-top: 10px; }
.btn-big:hover { background: #000; color: #fff; }
.btn-block { width: 100%; margin-top: 8px; }
.btn-sm { padding: 7px 14px; font-size: 14px; }

/* ---- Glowna sekcja ---- */
.main { padding: 26px 18px 60px; min-height: 60vh; }
.hero {
  text-align: center; background: linear-gradient(135deg, #fff7f2 0%, #fff0f3 100%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 44px 24px; margin-bottom: 32px;
  box-shadow: var(--shadow);
}
.hero h1 {
  margin: 0 0 10px; font-size: 36px; letter-spacing: -1px;
  background: linear-gradient(135deg, #ff8a3d, #ff4d6d);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { margin: 0 auto; max-width: 620px; color: var(--muted); font-size: 17px; }
.section-title { font-size: 22px; margin: 30px 0 16px; }

/* ---- Siatka dowcipow ---- */
.joke-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.joke-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.joke-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(31,36,48,.12); }
.joke-cat {
  align-self: flex-start; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--brand-dark); background: #fff2ec;
  padding: 4px 10px; border-radius: 999px;
}
.joke-body { color: var(--ink); display: block; }
.joke-body:hover { text-decoration: none; }
.joke-body p { margin: 0; font-size: 16px; }
.joke-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}

/* ---- Pojedynczy dowcip ---- */
.joke-single {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.joke-single-body p { font-size: 21px; line-height: 1.7; margin: 16px 0; }
.joke-single-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.back-link { margin: 18px 0; }

/* ---- Naglowek kategorii ---- */
.cat-head { margin-bottom: 20px; }
.cat-head h1 { margin: 0 0 6px; font-size: 30px; }
.cat-head p { margin: 2px 0; color: var(--muted); }
.cat-count { font-size: 14px; }

/* ---- Formularze ---- */
.form-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); max-width: 440px; margin: 10px auto;
}
.form-wide { max-width: 640px; }
.form-card h1 { margin: 0 0 6px; font-size: 26px; }
.form-sub { color: var(--muted); margin: 0 0 18px; }
.form-card label { display: block; font-weight: 600; margin-bottom: 14px; font-size: 15px; }
.form-card input, .form-card select, .form-card textarea {
  width: 100%; margin-top: 6px; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; font-family: inherit; background: #fff;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,107,61,.15);
}
.form-alt { text-align: center; margin-top: 16px; color: var(--muted); }

/* ---- Komunikaty ---- */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.flash-success { background: #e7f7ec; color: #1c7a3f; border: 1px solid #b6e6c6; }
.flash-error { background: #fdecec; color: #b02121; border: 1px solid #f4c2c2; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 17px; }

/* ---- Paginacja ---- */
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 30px 0; }
.pager a { font-weight: 700; }
.pager-info { color: var(--muted); }

/* ---- Panel admina ---- */
.stats { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0 6px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 24px; text-align: center; box-shadow: var(--shadow); min-width: 120px;
}
.stat strong { display: block; font-size: 28px; color: var(--brand-dark); }
.stat span { color: var(--muted); font-size: 14px; }
.mod-list { display: flex; flex-direction: column; gap: 14px; }
.mod-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.mod-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.mod-author { color: var(--muted); font-size: 13px; }
.mod-content { font-size: 16px; margin: 8px 0 14px; }
.mod-actions { display: flex; gap: 10px; }

/* ---- Stopka ---- */
.site-footer { background: var(--card); border-top: 1px solid var(--line); padding: 26px 0; margin-top: 40px; color: var(--muted); text-align: center; }
.footer-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

/* ---- Wyszukiwarka ---- */
.search-form {
  display: flex; align-items: center; flex: 1 1 240px; max-width: 430px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 4px 5px 4px 18px; transition: border-color .15s ease, box-shadow .15s ease;
}
.search-form:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 107, 61, .12); }
.search-form input {
  border: none; background: transparent; outline: none; flex: 1; min-width: 0;
  font-size: 15px; padding: 9px 0; color: var(--ink); font-family: inherit;
}
.search-form input::placeholder { color: #9aa0ab; }
.search-btn {
  border: none; background: linear-gradient(135deg, #ff9a3d, #ff4d6d); color: #fff;
  border-radius: 999px; width: 40px; height: 40px; flex: none; cursor: pointer;
  font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: filter .15s ease;
}
.search-btn:hover { filter: brightness(1.08); }

/* ---- Chip "Losowy" ---- */
.cat-chip-rnd { background: var(--accent); border-color: var(--accent); }
.cat-chip-rnd:hover { background: #ffbf00; border-color: #ffbf00; }

/* ---- Lapki (glosowanie) ---- */
.joke-vote { display: flex; gap: 8px; }
.vote {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 6px 13px; font-size: 14px; font-weight: 700;
  font-family: inherit; transition: background .12s ease, border-color .12s ease;
}
.vote:hover { background: var(--bg); }
.vote-up.picked { background: #e7f7ec; border-color: #b6e6c6; color: #1c7a3f; }
.vote-down.picked { background: #fdecec; border-color: #f4c2c2; color: #b02121; }
.joke-vote.voted .vote { cursor: default; }
.joke-vote.voted .vote:not(.picked) { opacity: .55; }
.joke-vote.voting { opacity: .6; pointer-events: none; }
.joke-single .joke-vote { margin: 18px 0 4px; }

/* ---- Brama 18+ ---- */
.age-gate {
  text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 44px 24px; box-shadow: var(--shadow);
  max-width: 520px; margin: 24px auto;
}
.age-gate h1 { margin: 0 0 10px; font-size: 30px; }
.age-gate p { color: var(--muted); margin: 6px 0; }
.age-gate .age-q { color: var(--ink); font-size: 20px; font-weight: 700; margin: 18px 0; }
.age-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* ---- Modale (popup powitalny, formularz reklamowy) ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; padding: 18px;
  background: rgba(15, 20, 32, .55);
  display: flex; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative; margin: auto; background: var(--card); border-radius: var(--radius);
  max-width: 460px; width: 100%; padding: 30px 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3); text-align: center;
  animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.modal h2 { margin: 0 0 12px; font-size: 24px; }
.modal p { color: var(--muted); margin: 0 0 18px; text-align: left; }
.modal .modal-sub { text-align: center; }
.modal-close {
  position: absolute; top: 8px; right: 14px; background: none; border: none;
  font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
.modal form label { display: block; text-align: left; font-weight: 600; margin-bottom: 12px; font-size: 14px; }
.modal form input, .modal form textarea {
  width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; font-family: inherit; background: #fff;
}
.modal form input:focus, .modal form textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 107, 61, .15);
}
.hp-field { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.form-status { margin: 10px 0 0; font-weight: 600; text-align: center; min-height: 20px; }
.form-status.ok { color: #1c7a3f; }
.form-status.err { color: #b02121; }

/* ---- Popup powitalny / ostrzezenie 18+ (caly ekran) ---- */
.gate-overlay { background: linear-gradient(135deg, rgba(255,138,61,.96), rgba(255,77,109,.96)); }
.gate-box {
  position: relative; margin: auto; background: var(--card); border-radius: 20px;
  max-width: 520px; width: 100%; padding: 42px 30px 36px; text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: modalIn .2s ease;
}
.gate-emoji { font-size: 46px; line-height: 1; margin-bottom: 10px; }
.gate-box h2 { margin: 0 0 14px; font-size: 28px; }
.gate-box p { color: var(--muted); text-align: center; margin: 0 0 14px; }
.gate-small { font-size: 13px; }
.gate-box .btn-big { margin-top: 10px; }

/* ---- Strefa reklamowa (dol strony) ---- */
.ad-zone { margin: 44px 0 6px; }
.ad-zone-label {
  text-align: center; text-transform: uppercase; letter-spacing: 2px;
  font-size: 12px; color: var(--muted); margin: 0 0 12px; font-weight: 700;
}
.ad-box {
  display: flex; align-items: center; gap: 18px; width: 100%; text-align: left;
  padding: 22px 26px; border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow); cursor: pointer; font-family: inherit; margin-bottom: 14px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.ad-box:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(31,36,48,.14); }
.ad-box-main { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.ad-box-main strong { font-size: 21px; letter-spacing: .3px; }
.ad-box-sub { font-size: 14px; font-weight: 500; }
.ad-box-cta { flex: none; font-weight: 800; font-size: 15px; white-space: nowrap; padding: 11px 18px; border-radius: 999px; }
/* Reklama Pestigo (kolory marki: ciemna zielen, limonka, turkus) */
.ad-box-pestigo { background: #ffffff; border: 1px solid #d7e6d2; border-left: 6px solid #86c53f; padding: 22px 26px; }
.ad-box-pestigo:hover { border-color: #86c53f; }
.ad-pestigo-logo { flex: none; width: 92px; height: 92px; object-fit: contain; border-radius: 12px; }
.ad-pestigo-tag {
  display: inline-block; align-self: flex-start; background: #e9f6e6; color: #2f7d3f;
  font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 2px;
}
.ad-box-pestigo strong { color: #16362b; font-size: 21px; }
.ad-box-pestigo .ad-box-sub { color: #3a4a42; }
.ad-box-pestigo .ad-box-sub b { color: #2f7d3f; }
.ad-box-pestigo .ad-box-cta { background: linear-gradient(135deg, #86c53f, #5fa32f); color: #fff; }
@media (max-width: 560px) {
  .ad-pestigo-logo { width: 64px; height: 64px; }
  .ad-box-pestigo strong { font-size: 18px; }
}
/* Reklama IT Agencja (technologiczna, granatowo-fioletowa) */
.ad-box-it { background: linear-gradient(135deg, #1e3a8a, #6d28d9); color: #fff; border: none; }
.ad-box-it strong { color: #fff; }
.ad-box-it .ad-box-sub { color: rgba(255,255,255,.85); }
.ad-it-logo { flex: none; width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; font-size: 38px; background: rgba(255,255,255,.14); border-radius: 14px; }
.ad-it-tag { display: inline-block; align-self: flex-start; background: rgba(255,255,255,.18); color: #fff; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; padding: 3px 10px; border-radius: 999px; margin-bottom: 2px; }
.ad-box-it .ad-box-cta { background: #fff; color: #1e3a8a; }
@media (max-width: 560px) { .ad-it-logo { width: 56px; height: 56px; font-size: 30px; } }

/* Wolny slot reklamowy (zapraszajacy) */
.ad-box-empty { background: #fff; border: 2px dashed var(--brand); }
.ad-box-empty strong { color: var(--brand-dark); }
.ad-box-empty .ad-box-sub { color: var(--muted); }
.ad-box-empty .ad-box-cta { background: var(--brand); color: #fff; }
@media (max-width: 560px) {
  .ad-box { flex-wrap: wrap; gap: 12px; padding: 18px; }
  .ad-box-cta { width: 100%; text-align: center; }
}

/* ---- Responsywnosc ---- */
@media (max-width: 560px) {
  .hero h1 { font-size: 27px; }
  .header-inner { height: auto; padding: 12px 0; flex-wrap: wrap; }
  .search-form { order: 3; flex-basis: 100%; max-width: none; }
  .joke-single-body p { font-size: 18px; }
}
