/* Czy leci Znachor? */

:root {
  --wall: #2c6e9e;
  --wall-dark: #1f5680;
  --wall-light: #3b80b2;
  --paper: #f4f0e2;
  --paper-under: #ebe4cf;
  --paper-deep: #ddd4ba;
  --ink: #141414;
  --ink-soft: #4d483c;
  --red: #c81e2b;
  --red-deep: #9e1520;
  --board: #e9d36a;
  --board-deep: #c89b3a;
  --steel: #a9aeb3;
  --steel-dark: #6c7177;
  --marker: #ee5a78;        /* różowy zakreślacz na linijce emisji */
  --marker-deep: #e2405f;   /* drugie, cieńsze przeciągnięcie zakreślacza */
  --wallpaper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cg fill='none' stroke='%233b80b2' stroke-width='1.4'%3E%3Cpath d='M18 4 30 18 18 32 6 18Z'/%3E%3Cpath d='M18 11 23 18 18 25 13 18Z' stroke='%231f5680'/%3E%3C/g%3E%3Ccircle cx='0' cy='0' r='2' fill='%231f5680'/%3E%3Ccircle cx='36' cy='0' r='2' fill='%231f5680'/%3E%3Ccircle cx='0' cy='36' r='2' fill='%231f5680'/%3E%3Ccircle cx='36' cy='36' r='2' fill='%231f5680'/%3E%3C/svg%3E");
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .26 0 0 0 0 .18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --narrow: "Archivo Narrow", "Archivo", "Arial Narrow", sans-serif;
  --text: "PT Serif", Georgia, serif;
  --hand: "Caveat", "Bradley Hand", cursive;

  /* Skala pisma. Każdy rozmiar w arkuszu pochodzi stąd. */
  --fs-label: .72rem;      /* etykiety wersalikami z rozstrzeleniem */
  --fs-footer: .75rem;     /* stopka: 12 px */
  --fs-small: .9rem;       /* drobny tekst, przypisy, mały przycisk */
  --fs-button: .95rem;     /* przyciski i wezwania do działania */
  --fs-body: 1.0625rem;    /* tekst główny */
  --fs-lead: 1.2rem;       /* wyróżnione zdanie, pozycja listy */
  --fs-title: 1.4rem;      /* nagłówki sekcji, miesiąc, dopiski długopisem */
  --fs-title-l: 1.9rem;    /* tytuł odwrotu kartki */
  --fs-numeral-stub: 1.6rem;   /* cyfra na zdartej kartce */
  --fs-numeral-peek: 2.6rem;   /* cyfra na krawędzi następnej kartki */
  --fs-numeral-leaf: 3.1rem;   /* cyfra na kartce w liście */
  --fs-answer: clamp(2.1rem, 10.5vw, 3rem);
  --fs-headline: clamp(2.35rem, 11vw, 3.2rem);
  --fs-countdown: clamp(3.6rem, 19vw, 5.4rem);
  --fs-display: clamp(7rem, 36vw, 13.5rem);   /* cyfra dnia: dzisiejsza kartka i kartki zdzierane */

  --pad-w: min(100vw - 28px, 520px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--wall-dark) var(--wall); }
body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--wall);
  /* Tapeta: drobny geometryczny wzór w dwóch odcieniach błękitu. */
  background-image: var(--wallpaper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--fs-body);
  line-height: 1.5;
  font-variant-numeric: tabular-nums lining-nums;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--red); color: var(--paper); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 2px; }
a { color: inherit; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: .18em; }
a:hover { color: var(--red-deep); }
input, button { caret-color: var(--red); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--paper); color: var(--ink); padding: .6rem .9rem; font-family: var(--display); font-weight: 800; }
.skip:focus { top: 12px; }

/* ---------- ściana i bloczek ---------- */

.wall { padding: 18px 14px 56px; }
.pad {
  position: relative;
  width: var(--pad-w);
  margin: 0 auto;
  filter: drop-shadow(0 22px 26px rgba(8, 28, 48, .42)) drop-shadow(0 3px 4px rgba(8, 28, 48, .3));
}

/* Tekturowa główka kalendarza z nadrukiem w dwóch kolorach. */
.board {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 41%;
  align-items: end;
  min-height: 158px;
  padding: 24px 0 0 18px;
  background: var(--board);
  /* Tektura u dołu lekko ciemnieje. Sam druk Kosiby nie wtapia się w tło. */
  background: linear-gradient(180deg, var(--board) 0%, color-mix(in oklab, var(--board) 70%, var(--board-deep)) 100%);
  border-radius: 3px 3px 0 0;
  overflow: hidden;
}
.board__nail {
  position: absolute; top: 9px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: var(--steel-dark);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.board__text { grid-column: 1; grid-row: 1; align-self: center; padding: 4px 0 18px; position: relative; z-index: 1; }
.board__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--fs-headline);
  line-height: .9;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.board__sub {
  margin: .8rem 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--fs-label);
  letter-spacing: .16em;
  text-transform: uppercase;
  line-height: 1.55;
  color: #3b2f12;
}
.board__print { grid-column: 2; grid-row: 1; margin: 0; }
/* Druk wypełnia prawą stronę główki: włosy zaczynają się 10 px pod górną krawędzią, dół postaci chowa się
   pod spinką, tył głowy dochodzi do prawej krawędzi, a prawy bark wychodzi za nią. Z lewej druk kończy się
   obrysem barku, bez wtapiania w tło. Wysokość liczy się od wysokości główki (100%):
   - telefony: widać postać do 700/804 wysokości źródła (dolne 12.94% pod spinką);
   - od 480 px: zbliżenie, widać do 620/804 (dolne 22.89% pod spinką).
   Poniżej ok. 390 px druk ogranicza szerokość ekranu (111.5vw − 217px), żeby bark nie wchodził pod
   „reż. Jerzy Hoffman”, a włosy pod „?” (odstęp ok. 10 px); podtytuł ma tam mniejsze rozstrzelenie. */
.board__druk {
  position: absolute; right: 0; bottom: 0; width: auto; max-width: none;
  height: min((100% - 10px) * 1.1486, 111.5vw - 217px);
  transform: translate(15.85%, 12.94%);
}
@media (max-width: 389px) {
  .board__sub { letter-spacing: .12em; }
}
@media (min-width: 480px) {
  .board__druk { height: calc((100% - 10px) * 1.2968); transform: translate(15.85%, 22.89%); }
}

/* Stalowa spinka i resztki zdartych kartek pod nią. */
.clip {
  position: relative;
  height: 24px;
  background: var(--steel);
  border-top: 1px solid #c4c8cc;
  border-bottom: 2px solid var(--steel-dark);
  box-shadow: 0 3px 5px rgba(0, 0, 0, .22);
  z-index: 2;
}
.clip::before, .clip::after {
  content: ""; position: absolute; top: 7px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--steel-dark);
}
.clip::before { left: 16px; }
.clip::after { right: 16px; }
.clip__stubs {
  position: absolute; left: 0; right: 0; top: 100%; height: 9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 9' preserveAspectRatio='none'%3E%3Cpath d='M0 0h400v3l-6 4-9-3-7 5-11-4-8 3-13-2-6 3-10-4-9 4-12-3-7 4-10-2-8 3-12-4-9 3-6-2-11 4-9-3-10 3-7-4-12 4-8-2-10 3-9-4-7 3-11-2-10 4-8-3-12 3-9-4-6 3-10-2-9 4-12-3-8 3-7-3-10 4-11-3-9 2-8-3-11 4-6-3-10 3-9-2-12 4-8-3-7 3-10-4-9 3-11-2-8 3-6-2v-3z' fill='%23ddd4ba'/%3E%3C/svg%3E") top / 100% 100% no-repeat;
}

/* ---------- kartka ---------- */

.sheet { display: grid; perspective: 1600px; position: relative; }
.face {
  grid-area: 1 / 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform .7s var(--ease-out);
  transform-origin: 50% 0;
}
.face--back { transform: rotateX(-180deg); }
.sheet.is-flipped .face--front { transform: rotateX(180deg); }
.sheet.is-flipped .face--back { transform: rotateX(0); }

.page {
  position: relative;
  background-color: var(--paper);
  background-image: var(--noise);
  padding: 26px 22px 24px;
  outline: none;
}
.page--today { padding-top: 24px; padding-bottom: 18px; }
.page--today::before {
  /* perforacja, wzdłuż której zdziera się kartkę */
  content: ""; position: absolute; left: 14px; right: 14px; top: 13px; height: 2px;
  background: radial-gradient(circle, var(--paper-deep) 1px, transparent 1.4px) 0 0 / 7px 2px repeat-x;
}

.page__meta {
  margin: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem .5rem;
  font-family: var(--display); font-weight: 600; font-size: var(--fs-label); letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-soft);
}
.page__weekday {
  margin: .55rem 0 0; text-align: center;
  font-family: var(--display); font-weight: 800; font-size: var(--fs-body); letter-spacing: .3em; text-transform: uppercase;
}
.page--today.is-red .page__weekday { color: var(--red); }
.page__day {
  margin: .1rem 0 0;
  text-align: center;
  font-family: var(--display); font-weight: 900;
  font-size: var(--fs-display);
  line-height: .8;
  letter-spacing: -.04em;
  color: var(--ink);
}
.page--today.is-red .page__day { color: var(--red); }
.page__month {
  margin: .5rem 0 0;
  text-align: center;
  font-family: var(--display); font-weight: 800; font-size: var(--fs-title); letter-spacing: .24em; text-transform: uppercase;
  color: var(--red);
}
.page__almanac {
  margin: .45rem 0 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .1rem .55rem;
  font-style: italic; font-size: var(--fs-small); color: var(--ink-soft);
}
/* Na telefonie almanach to tylko wschód i zachód słońca: sama ikona księżyca bez nazwy nic by nie mówiła. */
@media (max-width: 759px) {
  .page__almanac .moon-wrap { display: none; }
}
.page__almanac .holiday { font-style: normal; font-family: var(--display); font-weight: 800; color: var(--red); letter-spacing: .04em; }
.moon { width: 1em; height: 1em; vertical-align: -.12em; }

/* odpowiedź */
.answer { margin-top: .9rem; padding-top: .85rem; border-top: 2px solid var(--ink); text-align: center; }
.answer__head {
  margin: 0;
  font-family: var(--display); font-weight: 900;
  font-size: var(--fs-answer);
  line-height: .98; letter-spacing: -.03em;
  color: var(--red);
  text-wrap: balance;
}
.answer__detail { margin: .55rem auto 0; max-width: 30ch; font-size: var(--fs-lead); line-height: 1.4; text-wrap: balance; }
/* Druga emisja tego samego dnia: zwykłym tekstem, bez długopisu, żeby kółko zostało przy najbliższej. */
.answer__also { margin: .7rem auto 0; max-width: 34ch; font-size: var(--fs-body); line-height: 1.4; color: var(--ink-soft); text-wrap: balance; }
/* Wskazówka pod odpowiedzią „nie leci”: drobniej i osobno, jak przypis. */
.answer__hint { margin: .6rem auto 0; max-width: 36ch; font-size: var(--fs-small); font-style: italic; line-height: 1.45; color: var(--ink-soft); text-wrap: balance; }

/* czerwony długopis */
.pen { position: relative; display: inline-block; white-space: nowrap; font-weight: 700; margin-top: .55rem; padding: 0 .15em; }
.pen__ring {
  /* Pętla wychodzi nad wiersz tylko o włos, żeby nie przekreślać daty nad nią. */
  position: absolute; left: -12%; top: -12%; width: 124%; height: 128%;
  overflow: visible; pointer-events: none;
}
.pen__ring path {
  /* Bez vector-effect: z pathLength Chrome liczy kreski w pikselach ekranu i pętla się nie domyka. */
  fill: none; stroke: var(--red); stroke-width: 1.7; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 0;
}
.pen__note {
  position: absolute; left: calc(100% + .45em); top: -.55em;
  font-family: var(--hand); font-weight: 700; font-size: var(--fs-title); line-height: 1;
  color: var(--red); transform: rotate(-8deg); white-space: nowrap;
}
.draw .pen__ring path { animation: draw 1.1s var(--ease-out) .25s both; }
.draw .pen__note { animation: ink .5s ease-out 1s both; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ink { from { opacity: 0; transform: rotate(-8deg) translateY(4px); } }

/* odliczanie */
.countdown { margin-top: 1rem; }
.countdown__digits {
  margin: 0; display: flex; justify-content: center; align-items: flex-start; gap: .15rem;
  font-family: var(--narrow); font-weight: 700; color: var(--ink);
}
.cd { display: grid; justify-items: center; }
.cd b { font-weight: 700; font-size: var(--fs-countdown); line-height: .9; letter-spacing: -.02em; }
.cd small { font-family: var(--display); font-weight: 700; font-size: var(--fs-label); letter-spacing: .2em; text-transform: uppercase; color: var(--red); margin-top: .3rem; }
.cd__sep { font-size: calc(var(--fs-countdown) * .8); line-height: .95; color: var(--red); }


/* linijka trwającej emisji */
/* Postęp to zmienna --postep (0–100%), ustawiana przez app.js. Zarejestrowana, żeby dało się ją animować:
   przy pokazaniu linijki zakreślacz przeciąga się od lewej, a potem przesuwa płynnie co sekundę. */
@property --postep { syntax: '<percentage>'; inherits: true; initial-value: 0%; }
.ruler { margin-top: 1.1rem; --postep: 0%; transition: --postep .7s cubic-bezier(.45, 0, .2, 1); }
/* !important: skrypt ustawia --postep w atrybucie style, który inaczej wygrałby ze stanem startowym. */
@starting-style { .ruler { --postep: 0% !important; } }
.ruler__track { position: relative; height: 30px; border: 2px solid var(--ink); background: var(--paper); }
/* Minioną część filmu zaznacza zakreślacz: różowy, półprzezroczysty pas przeciągnięty dwa razy, ze smugami
   farby i ściętym końcem w miejscu „teraz”. Pas jest narysowany na całą długość linijki (SVG w index.html);
   clip-path odsłania go do --postep, a multiply zostawia podziałkę i papier widoczne przez farbę. */
.ruler__fill {
  position: absolute; inset: 0;
  clip-path: polygon(0 0, var(--postep) 0, calc(var(--postep) - 5px) 100%, 0 100%);
  mix-blend-mode: multiply;
}
.ruler__marker { display: block; width: 100%; height: 100%; }
.ruler__marker .pas { fill: var(--marker); opacity: .8; }
.ruler__marker .pas--2 { fill: var(--marker-deep); opacity: .34; }
.ruler__ticks {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--ink) 1px, transparent 1px) 0 100% / calc(100% / 10) 9px repeat-x;
}
.ruler__ends { margin: .3rem 0 0; display: flex; justify-content: space-between; font-family: var(--display); font-weight: 800; font-size: var(--fs-small); }
.ruler__text { margin: .4rem 0 0; text-align: center; font-size: var(--fs-body); }

/* przyciski */
.actions { margin-top: 1.1rem; display: grid; gap: .55rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .7rem 1rem;
  font: 800 var(--fs-button)/1.15 var(--display); letter-spacing: .02em;
  color: var(--ink); background: transparent;
  border: 2px solid var(--ink); border-radius: 2px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(20, 20, 20, .18);
  transition: transform .12s ease-out, box-shadow .12s ease-out, background-color .2s;
}
.btn:hover { background: rgba(20, 20, 20, .05); }
.btn:active { transform: translateY(1px); box-shadow: 0 0 1px rgba(20, 20, 20, .3); }
.btn--primary { color: var(--paper); background: var(--red); border-color: var(--red-deep); }
.btn--primary:hover { background: var(--red-deep); }
.btn--small { min-height: 40px; padding: .45rem .75rem; font-size: var(--fs-small); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.stale { margin: 1rem 0 0; padding: .6rem .75rem; border: 2px dashed var(--red); font-size: var(--fs-body); color: var(--ink); }

/* odwrocie */
/* Odwrót ma wysokość przedniej strony, a na nim tylko ocena: treść stoi na środku kartki. */
.page--back { display: flex; flex-direction: column; justify-content: center; gap: 1.2rem; }
.back__title { margin: 0; text-align: center; font-family: var(--display); font-weight: 900; font-size: var(--fs-title-l); letter-spacing: -.02em; }
.rate { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.rate li { border-bottom: 1px solid var(--paper-deep); }
.rate a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 52px; padding: .4rem .1rem;
  font-family: var(--display); font-weight: 800; font-size: var(--fs-lead); text-decoration: none;
}
.rate a span { font-family: var(--text); font-weight: 400; font-size: var(--fs-small); color: var(--ink-soft); }
.rate a:hover { color: var(--red); }
.rate .ico { color: var(--red); }

/* ---------- kolejne emisje ---------- */

.stack, .torn, .related {
  position: relative;
  background: var(--paper-under);
  padding: 22px 18px 20px;
  border-top: 1px solid var(--paper-deep);
}
.stack h2, .torn h2, .related h2 {
  margin: 0;
  font-family: var(--display); font-weight: 900; font-size: var(--fs-title); letter-spacing: -.02em; line-height: 1.1;
}
.stack__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem 1rem; }
.leaves, .stubs { list-style: none; margin: 1rem 0 0; padding: 0; }
.leaf {
  position: relative;
  display: grid; grid-template-columns: 4.1rem 1fr auto; align-items: center; gap: .2rem .9rem;
  padding: .85rem .9rem .85rem .6rem;
  background: var(--paper);
  box-shadow: 0 1px 0 var(--paper-deep), 0 4px 8px rgba(40, 30, 10, .08);
}
.leaf + .leaf { margin-top: 6px; }
/* Druga emisja tego samego dnia: przyklejona do poprzedniej kartki, bez powtórzonej liczby i daty. */
.leaf + .leaf--same-day { margin-top: 2px; }
.leaf--same-day .leaf__num { visibility: hidden; }
.leaf--same-day .leaf__date { display: none; }
.leaf__num { font-family: var(--display); font-weight: 900; font-size: var(--fs-numeral-leaf); line-height: .85; letter-spacing: -.04em; text-align: center; }
.leaf.is-red .leaf__num { color: var(--red); }
.leaf__date { display: block; white-space: nowrap; font-family: var(--display); font-weight: 700; font-size: var(--fs-label); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.leaf__what { display: block; font-size: var(--fs-body); line-height: 1.3; margin-top: .1rem; }
.leaf__what b { font-family: var(--display); font-weight: 900; }
/* Nazwa kanału nie łamie się w środku („Novela / TV”): w razie potrzeby cała schodzi do nowego wiersza. */
.leaf__channel { white-space: nowrap; }
.leaf__src { display: block; font-size: var(--fs-small); font-style: italic; color: var(--ink-soft); margin-top: .1rem; }
.leaf__side { display: grid; justify-items: end; gap: .35rem; }
.leaf__rel { font-family: var(--hand); font-weight: 700; font-size: var(--fs-title); color: var(--red); line-height: 1; white-space: nowrap; }
.leaf__ics {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 2px;
  background: transparent; color: var(--ink); cursor: pointer;
}
.leaf__ics:hover { background: var(--red); border-color: var(--red-deep); color: var(--paper); }
.leaf.is-live { outline: 3px solid var(--red); outline-offset: -3px; }

.note { margin: .7rem 0 0; font-size: var(--fs-body); color: var(--ink-soft); }

/* ---------- ostatnie emisje ---------- */
.torn { background: var(--paper-deep); }
.stub {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem;
  margin-top: 12px; padding: .9rem .9rem .7rem;
  background: var(--paper);
  color: color-mix(in oklab, var(--ink) calc(100% - var(--age, 0) * 45%), var(--paper));
  transform: rotate(var(--tilt, 0deg));
  box-shadow: 0 3px 6px rgba(40, 30, 10, .12);
}
.stub::before {
  content: ""; position: absolute; left: 0; right: 0; top: -7px; height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 8' preserveAspectRatio='none'%3E%3Cpath d='M0 8V5l7-3 6 4 9-5 8 4 10-3 7 3 11-4 6 3 9-2 10 4 8-5 9 3 12-2 6 4 10-4 9 3 7-3 11 4 8-3 10 2 9-4 6 4 12-3 8 3 9-4 10 3 7-2 11 4 6-3 10 2 9-3 8 4 10-4 6 3 11-2 9 3 10-4 7 3 9-1v5z' fill='%23f4f0e2'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}
.stub__num { font-family: var(--display); font-weight: 900; font-size: var(--fs-numeral-stub); letter-spacing: -.03em; }
.stub__rest { font-size: var(--fs-body); }
.stub__rel { margin-left: auto; font-family: var(--hand); font-weight: 700; font-size: var(--fs-lead); }

/* ---------- przy okazji ---------- */
.related ul { margin: .7rem 0 0; padding: 0; list-style: none; }
.related li { padding: .55rem 0; border-top: 1px solid var(--paper-deep); font-size: var(--fs-body); }
.related li b { font-family: var(--display); font-weight: 800; }

/* ---------- stopka na tekturze ---------- */
.colophon {
  padding: 22px 18px 26px;
  background: linear-gradient(180deg, var(--board-deep), #a97f2c);
  color: #22190a;
  font-size: var(--fs-footer); line-height: 1.5;
  border-radius: 0 0 3px 3px;
}
.colophon__title { margin: 0 0 .5rem; font-family: var(--display); font-weight: 800; font-size: var(--fs-label); letter-spacing: .22em; text-transform: uppercase; }
.colophon p { margin: 0 0 .5rem; }
.colophon a { text-decoration-color: #22190a; }

.noscript { max-width: 520px; margin: 0 auto 40px; padding: 1rem; background: var(--paper); font-size: var(--fs-body); }

/* Krawędź następnej kartki ze Znachorem pod dzisiejszą: zarazem przycisk „zdzieraj”. */
.peek {
  position: relative;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .2rem .9rem;
  width: 100%; min-height: 64px; margin: 0; padding: 14px 22px 12px;
  border: 0; border-radius: 0; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink);
  background-color: var(--paper-under);
  background-image: var(--noise);
  box-shadow: inset 0 7px 7px -7px rgba(40, 30, 10, .35);
  transition: background-color .15s;
}
.peek::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: 5px; height: 2px;
  background: radial-gradient(circle, var(--paper-deep) 1px, transparent 1.4px) 0 0 / 7px 2px repeat-x;
}
.peek__num { font-family: var(--display); font-weight: 900; font-size: var(--fs-numeral-peek); line-height: .85; letter-spacing: -.04em; }
.peek.is-red .peek__num { color: var(--red); }
.peek__body { display: grid; gap: .15rem; min-width: 0; }
.peek__date { font-family: var(--display); font-weight: 700; font-size: var(--fs-label); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peek__cta { display: inline-flex; align-items: center; gap: .35rem; font-family: var(--display); font-weight: 800; font-size: var(--fs-button); color: var(--red); }
.peek__cta .ico { width: 18px; height: 18px; }
.peek:hover { background-color: var(--paper); }
.peek:hover .peek__cta { text-decoration: underline; text-underline-offset: 3px; }
.peek:focus-visible { outline: 3px solid var(--red); outline-offset: -3px; }

/* ---------- zdzieranie kartek ---------- */
.tear-layer { position: absolute; inset: 0; z-index: 5; }
.tear-page {
  position: absolute; inset: 0;
  background-color: var(--paper);
  background-image: var(--noise);
  display: grid; place-content: center; justify-items: center;
  box-shadow: 0 1px 0 var(--paper-deep);
  transform-origin: 8% 0;
}
.tear-page::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: 13px; height: 2px;
  background: radial-gradient(circle, var(--paper-deep) 1px, transparent 1.4px) 0 0 / 7px 2px repeat-x;
}
.tear-page b { font-family: var(--display); font-weight: 900; font-size: var(--fs-display); line-height: .8; letter-spacing: -.04em; }
.tear-page span { font-family: var(--display); font-weight: 800; font-size: var(--fs-title); letter-spacing: .24em; text-transform: uppercase; color: var(--red); margin-top: .6rem; }
.tear-page.is-red b { color: var(--red); }
.tear-page.is-off { animation: tear .55s cubic-bezier(.5, 0, .75, 0) forwards; }
@keyframes tear {
  0% { transform: none; opacity: 1; }
  35% { transform: rotate(-4deg) translate(-2%, -3%); }
  100% { transform: rotate(-24deg) translate(-40%, -70%); opacity: 0; }
}
.tear-target { position: absolute; inset: 0; z-index: 4; overflow: auto; }

@media (min-width: 760px) {
  .wall { padding: 28px 24px 96px; }
  :root { --pad-w: 540px; --fs-display: 11rem; }
  .board { min-height: 228px; padding-left: 26px; }
  .page { padding: 26px 34px 30px; }
  .actions { grid-template-columns: 1fr 1fr; }
  /* W dniu emisji są trzy przyciski: trzeci („Odwróć i oceń film”) idzie pod nimi na całą szerokość. */
  .actions:not(:has(> [hidden])) > :nth-child(3) { grid-column: 1 / -1; }
  .peek { padding: 16px 34px 14px; }
  .stack, .torn, .related { padding: 26px 30px; }
  .colophon { padding: 26px 30px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .face { transition: none; }
  .draw .pen__ring path, .draw .pen__note { animation: none; }
  .ruler { transition: none; }
  .tear-page.is-off { animation: none; opacity: 0; }
  .btn { transition: none; }
}
