@font-face {
  font-family: "Twemoji Country Flags";
  unicode-range:
    U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E,
    U+E0073-E0074, U+E0077, U+E007F;
  src: url("/static/fonts/TwemojiCountryFlags.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #301f13;
  --surface: #3b2817;
  --surface-2: #47301b;
  --line: #6c4b24;
  --text: #fcecd9;
  --tan: #ecba7c;
  --gold: #d69c52;
  --purple: #8c52c1;
  --purple-dark: #5f3787;
  --green: #6ac065;
  --red: #d9534f;
  /* miejsce na czcionkę pikselową jak w launcherze – wystarczy podmienić tę zmienną */
  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Twemoji Country Flags", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
}
a {
  color: var(--tan);
}
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
h1,
h2,
h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  color: var(--tan);
}
h1 {
  text-align: center;
}
.center {
  text-align: center;
}
.back a {
  color: var(--text);
}
.lead {
  max-width: 640px;
  margin: 0 auto 20px;
  text-align: center;
  white-space: pre-line;
  font-size: 1.1rem;
}

/* ---- guziki ---- */
.btn {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  background: var(--purple);
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
  text-align: center;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 3px 0 var(--purple-dark);
}
.btn:hover,
.btn:focus-visible {
  filter: brightness(1.12);
}
.btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--purple-dark);
}
.btn.secondary {
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--tan);
  padding: 8px 18px;
  box-shadow: none;
}

/* ---- układ strony głównej ---- */
.home {
  display: grid;
  gap: 24px;
  grid-template-columns: 340px 1fr;
  align-items: start;
}
.side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel {
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.panel h2 {
  font-size: 1.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand img {
  flex: none;
}
.brand h1 {
  margin: 0;
  text-align: left;
  font-size: 1.7rem;
}
.report p {
  margin: 0 0 14px;
  white-space: pre-line;
}
.report .btn {
  display: block;
}
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-size: 0.8rem;
  vertical-align: middle;
}
.main .panel {
  margin-bottom: 20px;
}
.gate {
  padding: 18px;
  text-align: center;
}
form.gate {
  max-width: 480px;
  margin: 24px auto;
}
.actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* ---- kafelki ---- */
.tiles {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  text-align: center;
  color: var(--text);
  text-decoration: none;
}
.tile:hover,
.tile:focus-visible {
  border-color: var(--gold);
  background: var(--line);
}
.tile h3 {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.tile .date {
  margin: 0;
  color: var(--gold);
  font-size: 0.8rem;
}
.tile-logo {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.tile-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile-logo .ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 2px dashed var(--line);
  border-radius: 8px;
  color: var(--line);
  font-size: 2.4rem;
  font-weight: 700;
}

/* ---- kalendarz ---- */
.calnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.calnav a {
  padding: 2px 12px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--tan);
  text-decoration: none;
  font-size: 1.3rem;
  line-height: 1.2;
}
.calnav a:hover,
.calnav a:focus-visible {
  background: var(--line);
}
.calnav strong {
  color: var(--tan);
  font-family: var(--font-display);
}
.calgrid table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 2px;
}
.calgrid th {
  padding: 4px 0;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
}
.calgrid td {
  padding: 0;
  border-radius: 6px;
  background: var(--surface-2);
  text-align: center;
  vertical-align: top;
  font-size: 0.85rem;
}
.calgrid td > .d,
.calgrid td > a.day {
  display: block;
  min-height: 44px;
  padding-top: 4px;
}
.calgrid a.day {
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.calgrid a.day:hover,
.calgrid a.day:focus-visible {
  background: var(--gold);
  color: var(--bg);
}
.calgrid a.day:hover i,
.calgrid a.day:focus-visible i {
  background: var(--bg);
}
.calgrid td.sel {
  background: var(--purple);
}
.calgrid td.sel a.day:hover {
  background: var(--purple);
  color: var(--text);
}
.calgrid td.sel a.day:hover i {
  background: var(--green);
}
[data-cal]:focus {
  outline: none;
}
.calgrid .hint {
  margin: 10px 0 0;
  color: var(--gold);
  font-size: 0.8rem;
  text-align: center;
}
.dayinfo {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
}
.dayinfo h3 {
  margin: 0 0 4px;
}
.dayinfo .events .when {
  display: block;
}
.calgrid td.out {
  opacity: 0.35;
}
.calgrid td.today {
  outline: 2px solid var(--tan);
  outline-offset: -2px;
}
.calgrid td.has {
  background: var(--line);
}
.calgrid .d {
  display: block;
}
.calgrid .dots {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-top: 3px;
}
.calgrid .dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.cal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.cal-actions > .btn,
.cal-actions .dropdown {
  flex: 1 1 auto;
}
.cal-actions .dropdown summary {
  width: 100%;
}
.cal-actions.solo {
  justify-content: center;
}
.cal-actions.solo .dropdown {
  flex: 0 0 auto;
}
.panel h3 {
  margin: 14px 0 6px;
  font-size: 1rem;
}

.events {
  margin: 0;
  padding: 0;
  list-style: none;
}
.events li {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.events li:last-child {
  border-bottom: 0;
}
.events .when {
  display: block;
  color: var(--gold);
  font-size: 0.8rem;
}
.events a {
  color: var(--text);
  font-weight: 600;
}
.calmonth {
  max-width: 640px;
  margin: 20px auto;
}
.calmonth .events {
  padding: 0 4px;
}
.calendar-page .calgrid {
  max-width: 520px;
  margin: 0 auto 20px;
}

.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown summary {
  list-style: none;
  cursor: pointer;
}
.dropdown summary::-webkit-details-marker {
  display: none;
}
.dropdown .menu {
  position: absolute;
  z-index: 5;
  left: 0;
  min-width: 280px;
  margin: 6px 0 0;
  padding: 6px;
  list-style: none;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.dropdown .menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
.dropdown .menu a:hover,
.dropdown .menu a:focus-visible {
  background: var(--line);
}

/* ---- podstrona kafelka, kontakt ---- */
.cards {
  display: grid;
  gap: 20px;
  justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
}
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}
.card h2 {
  margin: 0;
  font-size: 1.3rem;
}
.avatar {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
}
.avatar.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--line);
  color: var(--line);
  font-size: 3rem;
  font-weight: 700;
}
.members {
  margin: 0;
  color: var(--gold);
  font-size: 0.9rem;
}
.desc {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.expired {
  margin: 0;
  color: var(--red);
}
.actions {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: auto; /* guziki zawsze przy dolnej krawędzi karty */
  padding-top: 6px;
}
.actions .btn {
  overflow-wrap: anywhere;
}

/* ---- podziękowania i stopka ---- */
.credits {
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.credits li {
  margin: 10px 0;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.credits p {
  margin: 6px 0 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.kind {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--gold);
  font-size: 0.75rem;
}
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
  margin: 40px 16px 20px;
  text-align: center;
  font-size: 1.1rem;
}
.site-footer .sep {
  color: var(--line);
}
.ficon {
  vertical-align: -5px;
}

/* ---- sekcje zwijane (<details class="fold">): na komputerze zawsze otwarte, zwija się tylko na telefonie ---- */
.fold > summary {
  list-style: none;
  pointer-events: none; /* komputer: bez zwijania */
}
.fold > summary::-webkit-details-marker {
  display: none;
}
.fold > summary h2 {
  margin: 0;
}
.fold[open] > summary {
  margin-bottom: 12px;
}

/* ---- telefon: logo, zgłoszenie, kalendarz (domyślnie zwinięty), kategorie ---- */
@media (max-width: 880px) {
  .wrap {
    padding: 12px 10px 32px;
  }
  .home {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .side {
    display: contents;
  }
  .brand {
    order: 1;
  }
  .report {
    order: 2;
  }
  .calpanel {
    order: 3;
  }
  .main {
    order: 4;
    width: 100%;
  }
  .main .panel {
    margin-bottom: 12px;
  }
  .panel {
    padding: 14px;
  }
  .fold > summary {
    position: relative;
    padding-right: 28px;
    cursor: pointer;
    pointer-events: auto;
  }
  .fold > summary::after {
    content: "\25B8";
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 1.3rem;
  }
  .fold[open] > summary::after {
    content: "\25BE";
  }
  .tiles {
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  .tile {
    gap: 6px;
    padding: 8px;
  }
  .tile h3 {
    font-size: 0.85rem;
  }
  .tile .date {
    font-size: 0.7rem;
  }
  .dropdown .menu {
    min-width: 0;
    width: 100%;
  }
}

/* ---- „Ukryj NSFW” w prawym górnym rogu odblokowanej kategorii 18+ ---- */
.category {
  position: relative;
}
.hide-nsfw {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
}
.hide-nsfw .btn.secondary {
  padding: 4px 12px;
  font-size: 0.8rem;
}
.has-hide > summary {
  padding-right: 130px; /* tytuł zawija się przed guzikiem */
}
@media (max-width: 880px) {
  .hide-nsfw {
    top: 12px;
    right: 44px; /* miejsce na strzałkę zwijania */
  }
  .has-hide > summary {
    padding-right: 150px;
  }
}
