:root {
  color-scheme: dark;
  --paper: #0b0c19;
  --ink: #f4f1ff;
  --muted: #aaa7c0;
  --green: #c1adff;
  --green-dark: #9c83ee;
  --on-accent: #17132a;
  --orange: #ff9a76;
  --yellow: #f3cf83;
  --line: #302d49;
  --white: #f7f4ff;
  --petal: #ff9a76;
  --petal-edge: rgb(255 228 219 / 75%);
  --star-1: rgb(255 255 255 / 62%);
  --star-2: rgb(193 173 255 / 58%);
  --glow-1: rgb(81 61 133 / 20%);
  --glow-2: rgb(39 71 116 / 14%);
  --field: #14132a;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Trebuchet MS", Arial, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --paper: #fbf8ff;
  --ink: #1d1a33;
  --muted: #5c5878;
  --green: #6d4fd6;
  --green-dark: #5a3dbf;
  --on-accent: #ffffff;
  --orange: #d9532b;
  --yellow: #f0b93a;
  --line: #ddd6ee;
  --petal-edge: rgb(255 255 255 / 80%);
  --star-1: transparent;
  --star-2: transparent;
  --glow-1: rgb(193 173 255 / 30%);
  --glow-2: rgb(255 190 160 / 22%);
  --field: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(1px 1px at 24px 36px, var(--star-1), transparent 1.5px),
    radial-gradient(1px 1px at 110px 92px, var(--star-2), transparent 1.5px),
    radial-gradient(ellipse at 76% 18%, var(--glow-1), transparent 42%),
    radial-gradient(ellipse at 8% 60%, var(--glow-2), transparent 48%);
  background-size: 180px 160px, 240px 210px, auto, auto;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 250ms ease, color 250ms ease;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  z-index: 30;
  top: 0.75rem;
  left: 0.75rem;
  transform: translateY(-160%);
  border-radius: 0.4rem;
  background: #30294b;
  color: #fff;
  padding: 0.7rem 1rem;
}

.skip-link:focus {
  transform: translateY(0);
}

.wrap {
  width: min(1120px, calc(100% - 3rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.topbar {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: #211a34;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: italic;
}

.nav {
  display: flex;
  gap: clamp(1rem, 2.4vw, 2rem);
  align-items: center;
  font-size: 0.88rem;
}

.nav a {
  text-decoration: none;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.theme-toggle {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  transition: border-color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--orange);
  transform: rotate(18deg);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  color: var(--green);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 20px;
  height: 2px;
  background: var(--orange);
  content: "";
}

.hero {
  display: grid;
  min-height: 590px;
  grid-template-columns: 1.18fr 0.82fr;
  align-items: center;
  gap: 3rem;
  padding-block: 4.5rem 5rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-block: 1.2rem 1.5rem;
  font-family: var(--serif);
  font-size: clamp(4.5rem, 11vw, 9.5rem);
  font-weight: 400;
  letter-spacing: -0.09em;
  line-height: 0.82;
}

h1 span {
  color: var(--green);
  font-style: italic;
}

.hero-copy {
  max-width: 470px;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.hero-copy strong {
  color: var(--ink);
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: var(--on-accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  transition: background-color 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  background: var(--green-dark);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.button-ghost {
  border: 1px solid var(--green);
  background: transparent;
  color: var(--green);
}

.button-ghost:hover {
  background: var(--green);
  color: var(--on-accent);
}

.button-small {
  min-height: 38px;
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
}

.text-link {
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* ---------- Kwiat ---------- */

.art-col {
  display: grid;
  gap: 0.75rem;
}

.art {
  --px: 0px;
  --py: 0px;
  position: relative;
  display: grid;
  min-height: 380px;
  overflow: hidden;
  place-items: center;
}

.sun {
  position: absolute;
  top: 10%;
  right: 7%;
  width: 80px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 32px rgb(243 207 131 / 34%);
  translate: calc(var(--px) * -1.4) calc(var(--py) * -1.4);
  transition: translate 300ms ease-out;
}

.orbit {
  position: absolute;
  width: min(100%, 380px);
  aspect-ratio: 1;
  border: 1px solid rgb(193 173 255 / 34%);
  border-radius: 50%;
  transform: rotate(-24deg) scaleY(0.7);
}

:root[data-theme="light"] .orbit {
  border-color: rgb(109 79 214 / 30%);
}

.orbit::before,
.orbit::after {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
  content: "";
}

.orbit::before {
  top: 16%;
  left: 14%;
}

.orbit::after {
  right: 7%;
  bottom: 23%;
  width: 6px;
  height: 6px;
  background: var(--green);
}

.flower {
  position: relative;
  z-index: 1;
  width: 220px;
  height: 220px;
  translate: var(--px) var(--py);
  transition: translate 300ms ease-out;
  animation: wobble 8s ease-in-out infinite;
}

.petal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70px;
  height: 110px;
  border: 1px solid var(--petal-edge);
  border-radius: 50% 50% 42% 42%;
  background: var(--petal);
  cursor: pointer;
  opacity: 1;
  transform: translate(-50%, -100%) rotate(var(--r));
  transform-origin: 50% 100%;
  transition: transform 900ms cubic-bezier(0.3, 0, 0.8, 0.6), opacity 900ms ease, background-color 300ms ease;
}

.petal.plucked {
  opacity: 0;
  pointer-events: none;
  transform: translate(calc(-50% + var(--dx)), calc(-100% + 300px)) rotate(calc(var(--r) + 200deg));
}

.flower-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  border: 1px solid rgb(255 255 255 / 76%);
  border-radius: 50%;
  background: var(--yellow);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 160ms ease;
}

.flower-center:hover {
  transform: translate(-50%, -50%) scale(1.12);
}

.art-note {
  position: absolute;
  right: 2%;
  bottom: 7%;
  max-width: 145px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.35;
  transform: rotate(-5deg);
}

.flower-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.flower-status {
  width: 100%;
  min-height: 1.6em;
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  text-align: center;
}

/* ---------- Manifest (ciemny pas w obu motywach) ---------- */

.manifesto {
  background: #17162d;
  color: #f7f4ff;
  box-shadow: 0 0 90px rgb(79 59 130 / 10%);
}

.manifesto-inner {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 5rem;
  padding-block: 6rem;
}

.manifesto .eyebrow {
  color: #d5ccff;
}

.manifesto h2 {
  max-width: 300px;
  margin-block: 1rem 0;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 1;
}

.manifesto-copy {
  max-width: 610px;
  padding-top: 1.8rem;
}

.manifesto-copy p {
  color: #d3d0e4;
  font-size: 1.05rem;
}

.manifesto-copy p:first-child {
  color: #fff;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.35;
}

.manifesto-copy strong {
  color: #f3cf83;
}

/* ---------- Zasady ---------- */

.principles {
  padding-block: 6rem 6.5rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.section-heading h2 {
  margin: 0.8rem 0 0;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 1;
}

.section-heading > p {
  max-width: 300px;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.principle {
  min-height: 215px;
  padding: 1.5rem 1.5rem 1.7rem 0;
}

.principle + .principle {
  border-left: 1px solid var(--line);
  padding-left: 1.5rem;
}

.principle-number {
  display: inline-grid;
  width: 31px;
  height: 31px;
  place-items: center;
  margin-bottom: 1.4rem;
  border-radius: 50%;
  background: var(--yellow);
  color: #211a34;
  font-size: 0.77rem;
  font-weight: 800;
}

.principle h3 {
  margin-bottom: 0.5rem;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.principle p {
  max-width: 290px;
  margin: 0;
  color: var(--muted);
  font-size: 0.91rem;
}

/* ---------- Karty zabawy (ciemne w obu motywach) ---------- */

.interlude {
  padding-block: 0 2rem;
}

.interlude:last-of-type {
  padding-bottom: 6rem;
}

.interlude-card {
  position: relative;
  display: grid;
  min-height: 275px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #383353;
  background: linear-gradient(125deg, #17162d 0%, #211c3b 100%);
  color: #f4f1ff;
  padding: clamp(2rem, 6vw, 4rem);
}

.interlude-card + .interlude-card {
  margin-top: 1.5rem;
}

.interlude-card::after {
  position: absolute;
  top: -110px;
  right: 100px;
  width: 300px;
  height: 300px;
  border: 1px solid rgb(193 173 255 / 18%);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgb(193 173 255 / 5%), 0 0 0 56px rgb(193 173 255 / 5%);
  content: "";
  pointer-events: none;
}

.interlude-card .eyebrow {
  color: #c1adff;
}

.interlude-card h2 {
  position: relative;
  z-index: 1;
  max-width: 570px;
  margin-block: 0.8rem 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.interlude-card h2.fade-in {
  animation: fadeUp 420ms ease both;
}

.card-meta {
  position: relative;
  z-index: 1;
  margin: 1.2rem 0 0;
  color: #aaa7c0;
  font-size: 0.82rem;
}

.card-buttons {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.7rem;
}

.interlude-card .button {
  background: #c1adff;
  color: #17132a;
  white-space: nowrap;
}

.interlude-card .button:hover {
  background: #d9ccff;
}

.interlude-card .button-ghost {
  border: 1px solid #c1adff;
  background: transparent;
  color: #c1adff;
}

.interlude-card .button-ghost:hover {
  background: #c1adff;
  color: #17132a;
}

kbd {
  border: 1px solid #4a4568;
  border-radius: 4px;
  background: #0f0e20;
  font: inherit;
  font-size: 0.75rem;
  padding: 0.05rem 0.4rem;
}

/* ---------- Sekcje wspólne ---------- */

.block {
  padding-block: 5rem 1rem;
}

.block:last-of-type {
  padding-bottom: 6rem;
}

/* ---------- Księga bzdur ---------- */

.book-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
  align-items: start;
}

.book-form {
  display: grid;
  gap: 0.8rem;
}

.book-form label {
  font-size: 0.85rem;
  font-weight: 700;
}

.book-form textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  padding: 0.8rem 1rem;
}

.book-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.char-count {
  color: var(--muted);
  font-size: 0.8rem;
}

.book-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.book-entry {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  animation: fadeUp 360ms ease both;
}

.book-entry p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.icon-button {
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem 0.45rem;
}

.icon-button:hover {
  color: var(--orange);
}

.empty {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
}

/* ---------- Ranking niepotrzebności ---------- */

.rank-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.3rem;
  transition: transform 200ms ease, border-color 200ms ease;
}

.rank-card:hover {
  border-color: var(--green);
  transform: translateY(-3px) rotate(-0.6deg);
}

.rank-pos {
  position: absolute;
  top: 0.9rem;
  right: 1.1rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.1rem;
  font-style: italic;
}

.rank-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.rank-card h3 {
  margin: 0.4rem 0 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.rank-card p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.vote {
  align-self: start;
  margin-top: 0.6rem;
}

/* ---------- Gra ---------- */

.game {
  display: grid;
  gap: 1rem;
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  margin: 0;
  font-size: 0.95rem;
}

.game-hud strong {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 400;
}

.game-area {
  position: relative;
  height: 280px;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.8rem;
  padding: 1rem;
  text-align: center;
}

.game-overlay[hidden] {
  display: none;
}

.game-overlay p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
}

.blob {
  position: absolute;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 6px rgb(255 154 118 / 22%);
  color: #211a34;
  cursor: pointer;
  font-size: 1.5rem;
  transition: left 220ms ease, top 220ms ease, transform 120ms ease;
}

.blob:active {
  transform: scale(0.88);
}

.blob[hidden] {
  display: none;
}

/* ---------- Stopka i status ---------- */

.footer {
  display: flex;
  min-height: 90px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.footer p {
  margin: 0;
}

.footer a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.toast {
  position: fixed;
  z-index: 10;
  bottom: 1.5rem;
  left: 50%;
  border-radius: 999px;
  background: #f3cf83;
  color: #211a34;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  padding: 0.6rem 1.2rem;
  pointer-events: none;
  transform: translate(-50%, 1rem);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes wobble {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .rank-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 9rem;
  }

  .topbar {
    flex-wrap: wrap;
    padding-block: 0.8rem;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.3rem;
  }

  .theme-toggle {
    margin-left: auto;
  }

  .nav-end {
    display: contents;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding-block: 4rem 3rem;
  }

  h1 {
    font-size: clamp(5rem, 19vw, 8rem);
  }

  .art {
    min-height: 310px;
  }

  .flower {
    transform: scale(0.82);
  }

  .manifesto-inner {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-block: 4rem;
  }

  .manifesto h2 {
    max-width: 470px;
  }

  .manifesto-copy {
    padding-top: 0;
  }

  .principles {
    padding-block: 4rem;
  }

  .block {
    padding-block: 4rem 1rem;
  }

  .book-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 560px) {
  .wrap {
    width: min(100% - 2rem, 1120px);
  }

  .nav {
    gap: 1rem;
    font-size: 0.8rem;
  }

  .hero {
    padding-top: 3.5rem;
  }

  .art {
    min-height: 270px;
  }

  .sun {
    width: 58px;
  }

  .flower {
    transform: scale(0.7);
  }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 1rem;
  }

  .principle-grid,
  .rank-grid {
    grid-template-columns: 1fr;
  }

  .principle {
    min-height: auto;
    padding: 1.4rem 0;
  }

  .principle + .principle {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-left: 0;
  }

  .principle-number {
    margin-bottom: 0.8rem;
  }

  .interlude:last-of-type,
  .block:last-of-type {
    padding-bottom: 4rem;
  }

  .interlude-card {
    min-height: 300px;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 1.5rem;
    padding: 2rem;
  }

  .interlude-card::after {
    right: -120px;
  }

  .card-buttons {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    justify-self: start;
  }

  .footer {
    min-height: 80px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Strona z linkami ---------- */

.intro { padding-block: 4.5rem 2.5rem; }

.intro h1 {
  margin: 1rem 0 1rem;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.lead {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.section { padding-block: 2rem 1.5rem; }

.section h2 {
  margin: 0 0 1.2rem;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400;
  letter-spacing: -0.05em;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-card {
  position: relative;
  display: flex;
  height: 100%;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.3rem;
  text-decoration: none;
  transition: transform 200ms ease, border-color 200ms ease;
}

.link-card:hover {
  border-color: var(--green);
  transform: translateY(-3px) rotate(-0.5deg);
}

.link-emoji { font-size: 2rem; line-height: 1; }

.link-card h3 {
  margin: 0.5rem 0 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.link-card p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.link-host {
  margin-top: 0.5rem;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
}

.user-link { position: relative; }

.remove {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.2rem 0.45rem;
}

.remove:hover { color: var(--orange); }

.add-form {
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  align-items: end;
  gap: 0.8rem;
}

.add-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.add-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  padding: 0.7rem 0.9rem;
}

.add-form input:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }

.form-note {
  min-height: 1.5em;
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.disclaimer {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- Podstrony ---------- */

.nav a[aria-current="page"] {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.block.page-top,
.interlude.page-top { padding-top: 3.5rem; }

@media (max-width: 900px) {
  .link-grid { grid-template-columns: repeat(2, 1fr); }
  .add-form { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .link-grid { grid-template-columns: 1fr; }
}

/* ---------- Filozofia ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.idea-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.4rem;
  transition: transform 200ms ease, border-color 200ms ease;
}

.idea-card:hover {
  border-color: var(--green);
  transform: translateY(-3px) rotate(-0.5deg);
}

.idea-emoji { font-size: 2rem; line-height: 1; }

.idea-card h3,
.thinker h3 {
  margin: 0.3rem 0 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.idea-card blockquote,
.thinker blockquote {
  margin: 0;
  color: var(--green);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.4;
}

.idea-card p,
.thinker p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.thinker-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.thinker {
  display: flex;
  gap: 1.2rem;
  border-top: 1px solid var(--line);
  padding-block: 1.4rem;
}

.thinker > div {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.thinker-portrait {
  display: grid;
  width: 64px;
  height: 64px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--yellow) 18%, transparent);
  font-size: 1.8rem;
}

.thinker p.thinker-dates {
  margin-top: -0.3rem;
  font-family: var(--serif);
  font-size: 0.85rem;
  font-style: italic;
}

.interlude.page-bottom { padding-top: 3rem; padding-bottom: 6rem; }

.oracle-card { grid-template-columns: 1fr; }

.oracle-form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.oracle-form input {
  min-width: 0;
  flex: 1 1 280px;
  border: 1px solid #4a4568;
  border-radius: 999px;
  background: #0f0e20;
  color: #f4f1ff;
  font: inherit;
  padding: 0.75rem 1.2rem;
}

.oracle-form input:focus-visible { outline: 3px solid #ff9a76; outline-offset: 3px; }

.oracle-answer {
  position: relative;
  z-index: 1;
  max-width: 640px;
  min-height: 1.5em;
  margin: 1.5rem 0 0;
  color: #f3cf83;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  line-height: 1.35;
}

.oracle-answer.fade-in { animation: fadeUp 420ms ease both; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Easter eggi ---------- */

.egg-count {
  color: var(--green);
  font-size: 0.78rem;
}

.wordmark.spin .wordmark-mark { animation: spin 900ms ease; }

.rain {
  position: fixed;
  z-index: 40;
  top: -3rem;
  font-size: 1.8rem;
  pointer-events: none;
  animation: fall linear forwards;
}

@keyframes spin {
  to { transform: rotate(720deg) scale(1.2); }
}

@keyframes fall {
  to { transform: translateY(110vh) rotate(360deg); }
}

@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .thinker-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
  .thinker-portrait { width: 52px; height: 52px; font-size: 1.5rem; }
}

/* ---------- Matrix ---------- */

.matrix-card {
  margin-bottom: 1.5rem;
  border-color: #1f4d33;
  background: linear-gradient(125deg, #0b1a12 0%, #10261a 100%);
}

.matrix-card::after {
  border-color: rgb(80 220 140 / 18%);
  box-shadow: 0 0 0 28px rgb(80 220 140 / 5%), 0 0 0 56px rgb(80 220 140 / 5%);
}

.matrix-card .eyebrow { color: #7ff0a8; }

.pill-buttons {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.pill {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.7rem 1.3rem;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.pill:hover {
  transform: translateY(-2px) rotate(-2deg);
}

.pill:focus-visible { outline: 3px solid #f3cf83; outline-offset: 4px; }

.pill-red { background: #ff6b6b; color: #2a0d0d; box-shadow: 0 0 18px rgb(255 107 107 / 35%); }
.pill-blue { background: #6ba8ff; color: #0b1a33; box-shadow: 0 0 18px rgb(107 168 255 / 35%); }
.pill-green { background: transparent; color: #7ff0a8; box-shadow: inset 0 0 0 1px #7ff0a8; }

.pill-result {
  position: relative;
  z-index: 1;
  max-width: 640px;
  min-height: 1.5em;
  margin: 1.5rem 0 0;
  color: #b9f5cf;
  font-family: "Courier New", monospace;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.5;
}

.pill-result.fade-in { animation: fadeUp 420ms ease both; }

.matrix-grid { margin-top: 0; }

.rain-matrix {
  color: #4cff8f;
  font-family: "Courier New", monospace;
  font-size: 1.3rem;
  text-shadow: 0 0 8px rgb(76 255 143 / 70%);
}

/* ---------- Stopka: bzdura dnia ---------- */

.daily-bzdura {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
}

.footer { padding-block: 1rem; }

/* ---------- Paradoks dnia ---------- */

.paradox {
  max-width: 640px;
  margin-top: 2rem;
  border-left: 3px solid var(--orange);
  padding: 0.3rem 0 0.3rem 1.2rem;
}

.paradox-label {
  margin: 0 0 0.3rem;
  color: var(--orange);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.paradox-text {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.8vw, 1.7rem);
  line-height: 1.3;
}

/* ---------- Słownik ---------- */

.dict { padding-top: 0; }

.dict-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.5rem;
}

.dict-search {
  min-width: 0;
  flex: 1 1 320px;
  max-width: 560px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  padding: 0.75rem 1.2rem;
}

.dict-search:focus-visible,
.cert-tools input:focus-visible,
.calc-card input:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.dict-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.alpha-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.5rem 0 1rem;
}

.alpha-index a {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--serif);
  text-decoration: none;
}

.alpha-index a:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.dict-group {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-block: 1.4rem;
}

.dict-letter {
  margin: 0;
  color: var(--green);
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 400;
  line-height: 1;
}

.dict-group dl { margin: 0; }

.dict-group dt {
  font-family: var(--serif);
  font-size: 1.3rem;
}

.dict-group dd {
  max-width: 680px;
  margin: 0.2rem 0 1.1rem;
  color: var(--muted);
}

.dict-group dd:last-child { margin-bottom: 0; }

/* ---------- Test ---------- */

.quiz-form {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
}

#quiz-fields {
  display: grid;
  width: 100%;
  gap: 1.2rem;
}

.quiz-question {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.3rem 1.4rem 1.4rem;
}

.quiz-question legend {
  padding-inline: 0.4rem;
  font-family: var(--serif);
  font-size: 1.3rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  padding: 0.45rem 0.6rem;
  transition: background-color 150ms ease;
}

.quiz-option:hover { background: color-mix(in srgb, var(--green) 12%, transparent); }

.quiz-option input {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  accent-color: var(--green);
}

.quiz-option:has(input:checked) {
  background: color-mix(in srgb, var(--green) 20%, transparent);
}

.result-card { grid-template-columns: 1fr; }

.result-emoji {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 1rem;
  font-size: 3.5rem;
  line-height: 1;
}

.result-card h2:focus { outline: none; }

.result-text {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 1rem 0 0;
  color: #d3d0e4;
  font-size: 1.05rem;
}

.cert-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.cert-tools label {
  font-size: 0.85rem;
  font-weight: 700;
}

.cert-tools input {
  min-width: 0;
  flex: 1 1 240px;
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  padding: 0.7rem 1.1rem;
}

.certificate {
  display: block;
  width: 100%;
  max-width: 900px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgb(0 0 0 / 30%);
}

/* ---------- Wróżby ---------- */

.horo-born {
  margin-top: -0.3rem !important;
  font-family: var(--serif);
  font-style: italic;
}

.horo-card p:not(.horo-born):not(.horo-meta) { color: var(--ink); }

.horo-meta {
  margin-top: 0.4rem !important;
  border-top: 1px dashed var(--line);
  padding-top: 0.7rem;
  font-size: 0.8rem !important;
}

.sky-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.sky-card {
  display: grid;
  align-content: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* Nocne niebo jest ciemne w obu motywach. */
.sky-view {
  background: radial-gradient(circle at 30% 20%, #23204a, #07081a 75%);
}

.sky-view svg {
  display: block;
  width: 100%;
  height: auto;
}

.sky-body {
  display: grid;
  gap: 0.55rem;
  padding: 1.4rem;
}

.sky-body h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
}

.sky-body p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.sky-body .sky-meta {
  color: var(--green);
  font-size: 0.85rem;
}

.twinkle {
  animation: twinkle 2.6s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 1; }
  to { opacity: 0.4; }
}

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

.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.calc-card {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.4rem;
}

.calc-card h3 {
  margin: 0 0 0.3rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
}

.calc-card label,
.calc-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.calc-row {
  display: flex;
  gap: 0.6rem;
}

.calc-card input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  padding: 0.5rem 1rem;
}

.calc-result {
  min-height: 1.5em;
  margin: 0.4rem 0 0;
  color: var(--green);
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.4;
}

/* ---------- 404 ---------- */

.not-found { padding-bottom: 6rem; }

.not-found-cat {
  display: block;
  width: min(100%, 375px);
  height: auto;
  margin: 2rem 0;
  border-radius: 8px;
}

@media (max-width: 900px) {
  .calc-grid,
  .sky-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .dict-group { grid-template-columns: 1fr; gap: 0.4rem; }
  .quiz-question { padding: 1rem; }
}

/* ---------- Menu przewijane na telefonie ---------- */

@media (max-width: 760px) {
  .nav {
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    mask-image: linear-gradient(to right, #000 85%, transparent);
    padding-right: 2rem;
  }

  .nav::-webkit-scrollbar { display: none; }
}
