/* Розваги для кожного · «Стара газета + комікс» (палітра: червоний, синій, фіолетовий — без жовтого): шпальта видання, колонки з буквицею, комікс-панелі, растр Ben-Day */
:root {
  --paper: #F3EBD8;
  --paper-alt: #EADFC3;
  --card: #FBF6E8;
  --ink: #1A1814;
  --on-ink: #F3EBD8;
  --on-ink-muted: #D8CFBB;
  --accent: #C9302C;      /* комікс-червоний: кнопки, вставки, номери, зірка-вибух */
  --on-accent: #FFFFFF;
  --marker: #F4A79F;      /* лососевий маркер під словами в заголовках */
  --violet-light: #DCD0F5;
  --violet: #6A45C2;
  --on-ink-accent: #F4A79F; /* акцент на темному: підзаголовки футера й меню */
  --focus-on-ink: #9CC2F0;
  --blue: #2F6DB5;
  --blue-text: #24589A; /* темніший синій для текстових посилань — контраст AA на папері */
  --blue-light: #CFE0F2;
  --pink-light: #F2B8BF;
  --line: 3px solid var(--ink);
  --radius: 5px;
  --wrap: 1100px;
  --header-h: 66px;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --hand: "Pangolin", cursive;
  --dots: radial-gradient(rgba(26, 24, 20, .18) 1.6px, transparent 1.8px) 0 0 / 8px 8px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 18px/1.6 var(--serif); overflow-x: hidden; }
/* газетний папір: шум і м'яка віньєтка */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; }
body::before {
  opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body::after { background: radial-gradient(ellipse at center, transparent 58%, rgba(26, 24, 20, .13) 100%); }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-text); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2.5px; }
a[href^="tel:"] { white-space: nowrap; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

h1, h2 { font-family: var(--display); font-weight: 900; color: var(--ink); line-height: 1.12; margin: 0 0 .45em; overflow-wrap: anywhere; }
h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-family: var(--display); font-weight: 900; font-size: 22px; line-height: 1.2; margin: 0 0 .4em; }
@media (min-width: 761px) { h1 { font-size: 50px; } h2 { font-size: 40px; } }
p { margin: 0 0 1em; }
/* маркер під словом: жовта смуга знизу на 45% висоти */
.mark { background: linear-gradient(transparent 55%, var(--marker) 55%); padding: 0 .08em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--card); border: var(--line); padding: 8px 12px; border-radius: var(--radius); }
.skip:focus { left: 8px; }

/* ---------- кнопки ---------- */
.btn {
  display: block; width: fit-content; margin: 0 auto;
  padding: 10px; border: var(--line); border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent);
  font: 700 17px/1.2 var(--serif); text-decoration: none; cursor: pointer;
  transition: filter .12s;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); }
.site-header .btn-ghost, .site-footer .btn-ghost { color: var(--on-ink); border-color: var(--on-ink); }
.btn-lg { font-size: 20px; padding: 14px; }
.btn:disabled { cursor: default; filter: grayscale(.4); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 24px; }
.actions .btn { margin: 0; }

/* ---------- хедер-шапка видання ---------- */
.site-header { position: sticky; top: 0; z-index: 60; background: var(--ink); color: var(--on-ink); border-bottom: 4px double rgba(243, 235, 216, .6); }
.site-header .bar { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); padding: 0 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--on-ink); text-decoration: none; font-family: var(--display); font-weight: 900; font-size: 22px; line-height: 1.05; }
.logo img { width: 36px; height: 36px; flex: 0 0 auto; }
.top-nav { display: none; }
.top-nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.top-nav a { color: var(--on-ink); text-decoration: none; font-size: 16px; }
.top-nav a:hover { text-decoration: underline; text-decoration-color: var(--on-ink-accent); }
.header-right { display: flex; align-items: center; gap: 10px; }
.header-right .btn { white-space: nowrap; font-size: 15px; }
.site-header :focus-visible, .site-footer :focus-visible, .side :focus-visible { outline-color: var(--focus-on-ink); }
.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: transparent; color: var(--on-ink); border: 2px solid rgba(243, 235, 216, .6); border-radius: var(--radius); cursor: pointer;
}
.menu-toggle svg { width: 22px; height: 22px; }
@media (min-width: 1100px) {
  .top-nav { display: block; }
  .menu-toggle { display: none; }
}
@media (max-width: 480px) {
  .logo { font-size: 17px; max-width: 150px; }
  .logo img { width: 30px; height: 30px; }
  .header-right .btn { font-size: 14px; padding: 8px; }
}

/* рядок «дата видання» */
.issue { position: relative; z-index: 1; background: var(--paper-alt); border-bottom: 1px solid var(--ink); text-align: center; font: 400 15px/1.4 var(--hand); padding: 7px 16px; }

/* ---------- виїзне меню — лише на мобільному ---------- */
.side {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 80;
  width: min(290px, 84vw); padding: 18px 18px 24px;
  background: var(--ink); color: var(--on-ink); border-right: 4px double rgba(243, 235, 216, .6);
  overflow-y: auto; transform: translateX(-100%); transition: transform .25s ease; visibility: hidden;
}
.side.open { transform: none; visibility: visible; }
.side-close {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; margin: 0 0 14px auto; padding: 0;
  background: var(--accent); color: var(--on-accent); font-size: 22px; line-height: 1;
  border: 2px solid var(--on-ink); border-radius: var(--radius); cursor: pointer;
}
.side p { margin: 18px 0 6px; font: 400 16px/1.3 var(--hand); color: var(--on-ink-accent); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 8px 0; color: var(--on-ink); text-decoration: none; font-size: 17px; }
.side a:hover, .side a[aria-current] { text-decoration: underline; text-decoration-color: var(--on-ink-accent); }
.side-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(26, 24, 20, .5); }
body.menu-open { overflow: hidden; }
@media (min-width: 1100px) { .side, .side-backdrop { display: none !important; } body.menu-open { overflow: auto; } }

/* ---------- сітка сторінки ---------- */
main { position: relative; z-index: 1; }
.container { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.section { padding: 56px 0; }
.section.alt { background: var(--paper-alt); }
.narrow { max-width: 820px; margin: 0 auto; }
.section-head { text-align: center; max-width: 800px; margin: 0 auto 30px; }
.caption { font-style: italic; font-size: 19px; }
/* роздільник: подвійна лінія з зіркою ✦ по центру */
.rule { position: relative; z-index: 1; height: 0; border-top: 4px double var(--ink); margin: 0 24px; }
.rule::after {
  content: "✦"; position: absolute; left: 50%; top: 0;
  transform: translate(-50%, -54%);
  padding: 0 12px; background: var(--paper); font-size: 20px; line-height: 1;
}
/* растр Ben-Day у кутку */
.dotted { position: relative; isolation: isolate; }
.dotted::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--dots);
  -webkit-mask-image: linear-gradient(135deg, #000, transparent 60%);
  mask-image: linear-gradient(135deg, #000, transparent 60%);
}

/* ---------- hero: перша шпальта ---------- */
.hero { padding: 54px 0 60px; }
.hero-grid { display: grid; gap: 26px; align-items: center; }
.hero-text { text-align: center; }
.hero .caption { max-width: 720px; margin: 0 auto 0; }
.burst {
  width: 150px; height: 150px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--accent); color: var(--on-accent);
  font: 400 28px/1.05 var(--hand);
  clip-path: polygon(50% 0%, 59% 18%, 79% 7%, 77% 29%, 98% 27%, 86% 45%, 100% 59%, 80% 66%, 87% 87%, 66% 81%, 59% 100%, 47% 84%, 32% 98%, 28% 77%, 7% 82%, 16% 62%, 0% 50%, 17% 38%, 5% 18%, 26% 20%, 30% 0%, 42% 15%);
}
.burst span { display: block; padding: 0 30px; }
.burst small { display: block; font-size: 15px; margin-top: 4px; }
@media (max-width: 899px) { .burst span { padding: 0 18px; } }
/* кольоровий растр: червоний на першій шпальті, синій на панелях */
.hero.dotted::before { background: radial-gradient(rgba(201, 48, 44, .22) 1.6px, transparent 1.8px) 0 0 / 8px 8px; }
.panel.dotted::before { background: radial-gradient(rgba(47, 109, 181, .22) 1.6px, transparent 1.8px) 0 0 / 8px 8px; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 34px; }
  .burst { width: 250px; height: 250px; transform: rotate(-8deg); font-size: 34px; }
  .burst small { font-size: 18px; }
}

/* малі звукові вибухи біля заголовків — лише на широких екранах */
.section-head { position: relative; }
.pow { display: none; }
@media (min-width: 1150px) {
  .burst.pow { display: flex; position: absolute; top: -24px; right: -116px; width: 96px; height: 96px; font-size: 18px; transform: rotate(10deg); }
  .burst.pow.left { right: auto; left: -116px; transform: rotate(-9deg); }
  .burst.pow.blue { background: var(--blue); }
  .burst.pow.violet { background: var(--violet); }
  .burst.pow span { padding: 0 8px; }
}
/* ---------- колонки з буквицею ---------- */
.columns { column-count: 1; }
.columns p { margin: 0 0 .9em; }
.columns .drop::first-letter {
  float: left; font-family: var(--display); font-weight: 900; font-size: 86px; line-height: .8;
  margin: .06em .1em 0 0; color: var(--ink);
}
@media (min-width: 761px) { .columns { column-count: 2; column-gap: 44px; column-rule: 1px solid var(--ink); } .columns p { text-align: justify; hyphens: auto; } }
.columns-head { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 10px 0 6px; margin-bottom: 22px; text-align: center; }
.columns-head h2 { margin-bottom: .15em; }
.columns-head p { margin: 0 0 6px; font-style: italic; }

/* ---------- комікс-панелі ---------- */
.panels { list-style: none; margin: 0; padding: 0; }
.panel { position: relative; border: var(--line); border-radius: var(--radius); padding: 46px 16px 18px; background: var(--card); overflow: hidden; }
.panels > .panel:nth-child(4n+1) { background: var(--card); }
.panels > .panel:nth-child(4n+2) { background: var(--blue-light); }
.panels > .panel:nth-child(4n+3) { background: var(--violet-light); }
.panels > .panel:nth-child(4n+4) { background: var(--pink-light); }
.inset {
  position: absolute; top: 0; left: 0; z-index: 2;
  padding: 4px 10px; background: var(--accent); color: var(--on-accent); border-right: var(--line); border-bottom: var(--line);
  font: 400 15px/1.3 var(--hand); text-transform: uppercase; letter-spacing: .02em;
}
.panel h3 { margin: 4px 0 12px; }
.bubble {
  position: relative; background: var(--card); border: 2px solid var(--ink); border-radius: 18px;
  padding: 12px 14px; margin: 0 0 18px; font: 400 17px/1.45 var(--hand);
}
.bubble::before, .bubble::after { content: ""; position: absolute; left: 26px; width: 0; height: 0; border-style: solid; }
.bubble::before { bottom: -16px; border-width: 16px 14px 0 0; border-color: var(--ink) transparent transparent transparent; }
.bubble::after { bottom: -12px; left: 28px; border-width: 12px 10px 0 0; border-color: var(--card) transparent transparent transparent; }
.panel .bubble:last-child { margin-bottom: 14px; }
@media (max-width: 760px) {
  .panels { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -24px; padding: 4px 24px 16px; scrollbar-width: thin; }
  .panels > .panel { flex: 0 0 84%; scroll-snap-align: center; }
  .swipe-hint { display: block; }
}
@media (min-width: 761px) { .panels { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); } .swipe-hint { display: none; } }
@media (min-width: 1000px) { .panels { grid-template-columns: repeat(3, 1fr); } }
.swipe-hint { display: none; text-align: center; font: 400 16px var(--hand); margin: 6px 0 0; }

/* ---------- списки ---------- */
.steps { list-style: none; counter-reset: s; margin: 0 0 1em; padding: 0; }
.steps > li { counter-increment: s; position: relative; padding: 4px 0 18px 56px; min-height: 52px; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent); color: var(--on-accent); border: 2px solid var(--ink);
  font: 900 17px/1 var(--display);
}
.marks { list-style: none; margin: 0 0 1em; padding: 0; }
.marks > li { position: relative; padding: 0 0 14px 30px; }
.marks > li::before { position: absolute; left: 0; top: 0; font-size: 17px; line-height: 1.75; }
.marks > li:nth-child(odd)::before { content: "■"; color: var(--ink); }
.marks > li:nth-child(even)::before { content: "★"; color: var(--blue); }

/* ---------- вирізка з газети: спільна картка результату ---------- */
.clip {
  position: relative; width: 100%; max-width: 460px;
  background: var(--card); border: 2px dashed var(--ink); border-radius: var(--radius);
  padding: 34px 20px 22px; text-align: center;
}
.clip::before { content: "✂"; position: absolute; top: -15px; right: 18px; padding: 0 6px; background: var(--paper); font-size: 22px; line-height: 1; }
.section.alt .clip::before { background: var(--paper-alt); }
.clip .inset { left: 50%; transform: translateX(-50%); border: 2px solid var(--ink); top: -14px; white-space: nowrap; }
.clip .ach { font: 400 17px/1.3 var(--hand); margin: 0 0 6px; }
.clip h3 { font-size: 24px; }
@media (min-width: 761px) { .clip { transform: rotate(-1.2deg); } }

/* ---------- колесо ---------- */
.wheel-box { display: grid; gap: 34px; align-items: center; justify-items: center; }
@media (min-width: 900px) { .wheel-box { grid-template-columns: 1fr 1fr; } }
.wheel-col { width: min(420px, 100%); }
.wheel-wrap { position: relative; width: 100%; aspect-ratio: 1; }
.wheel { width: 100%; height: 100%; transition: transform 4s cubic-bezier(.15, .7, .2, 1); }
.wheel text { font: 400 9.4px var(--hand); fill: var(--ink); }
.wheel-pointer { position: absolute; top: -10px; left: 50%; z-index: 3; width: 40px; height: 44px; margin-left: -20px; }
.wheel-spin {
  position: absolute; z-index: 3; top: 50%; left: 50%;
  width: 23%; height: 23%; transform: translate(-50%, -50%); padding: 0;
  border-radius: 50%; border: var(--line); background: var(--accent);
  font: 400 15px/1 var(--hand); color: var(--on-accent); cursor: pointer; transition: filter .12s;
}
.wheel-spin:hover { filter: brightness(1.08); }
.wheel-spin:disabled { cursor: default; }

/* ---------- скретч-картка ---------- */
.scratch-box { display: grid; gap: 22px; justify-items: center; }
.scratch {
  position: relative; width: 320px; max-width: 100%; height: 200px;
  border: var(--line); border-radius: var(--radius); background: var(--card);
  overflow: hidden; touch-action: none; user-select: none;
}
.scratch-under { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 10px 14px; text-align: center; }
.scratch-under h3 { font-size: 18px; margin-bottom: 5px; }
.scratch-under p { font-size: 14px; line-height: 1.4; margin: 0; }
.scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; transition: opacity .35s; }
.scratch canvas.gone { opacity: 0; pointer-events: none; }

/* ---------- кубик ---------- */
.dice-box { display: grid; gap: 34px; justify-items: center; align-items: center; }
@media (min-width: 900px) { .dice-box { grid-template-columns: auto 1fr; } }
.dice-controls { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.die {
  width: 80px; height: 80px; padding: 10px;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  background: var(--card); border: var(--line); border-radius: 12px; cursor: pointer;
}
.die i { width: 13px; height: 13px; border-radius: 50%; background: var(--ink); align-self: center; justify-self: center; visibility: hidden; }
.die[data-v="1"] i:nth-child(5),
.die[data-v="2"] i:nth-child(1), .die[data-v="2"] i:nth-child(9),
.die[data-v="3"] i:nth-child(1), .die[data-v="3"] i:nth-child(5), .die[data-v="3"] i:nth-child(9),
.die[data-v="4"] i:nth-child(1), .die[data-v="4"] i:nth-child(3), .die[data-v="4"] i:nth-child(7), .die[data-v="4"] i:nth-child(9),
.die[data-v="5"] i:nth-child(1), .die[data-v="5"] i:nth-child(3), .die[data-v="5"] i:nth-child(5), .die[data-v="5"] i:nth-child(7), .die[data-v="5"] i:nth-child(9),
.die[data-v="6"] i:nth-child(1), .die[data-v="6"] i:nth-child(3), .die[data-v="6"] i:nth-child(4), .die[data-v="6"] i:nth-child(6), .die[data-v="6"] i:nth-child(7), .die[data-v="6"] i:nth-child(9) { visibility: visible; }

/* ---------- FAQ «Листи читачів» ---------- */
.faq { counter-reset: q; max-width: 860px; margin: 0 auto; display: grid; gap: 22px; }
.faq-item { counter-increment: q; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.faq-item::before {
  content: counter(q); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--card); border: 2px solid var(--blue); color: var(--blue);
  font: 900 18px/1 var(--display); margin-top: 6px;
}
.faq-q {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 16px; background: var(--card); border: 2px solid var(--ink); border-radius: 18px;
  color: var(--ink); font: 400 18px/1.35 var(--hand); text-align: left; cursor: pointer;
}
.faq-q::before { content: ""; position: absolute; left: -12px; top: 15px; border-style: solid; border-width: 7px 12px 7px 0; border-color: transparent var(--ink) transparent transparent; }
.faq-q::after { content: "+"; margin-left: auto; font: 900 24px/1 var(--display); transition: transform .2s; }
.faq-q[aria-expanded="true"]::after { transform: rotate(45deg); }
.faq-a { grid-column: 2; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .3s ease, opacity .3s ease; }
.faq-a > div { padding: 14px 4px 0 18px; border-left: 3px solid var(--accent); margin-top: 10px; }
.faq-a p { margin: 0; }
.faq-item.open .faq-a { opacity: 1; }

/* ---------- CTA ---------- */
.cta { max-width: 820px; margin: 0 auto; padding: 46px 22px 26px; background: var(--blue-light); text-align: center; }
.cta .bubble { text-align: left; margin: 0 0 28px; background: var(--card); }
.cta .bubble::after { border-color: var(--card) transparent transparent transparent; }

/* ---------- внутрішні сторінки ---------- */
.page-hero { padding: 50px 0 34px; text-align: center; }
.page-hero .inner { max-width: 800px; margin: 0 auto; }
.prose { max-width: 820px; margin: 0 auto; }
.prose h2 { margin-top: 1.3em; }
.prose h2:first-child { margin-top: 0; }
.key-grid { display: grid; gap: 14px; margin: 24px 0; }
@media (min-width: 761px) { .key-grid { grid-template-columns: repeat(2, 1fr); } }
.updated { font-style: italic; font-size: 15px; }
.nf { text-align: center; padding: 70px 0; }
.nf .burst { margin-bottom: 24px; }

/* ---------- футер ---------- */
.site-footer { position: relative; z-index: 1; background: var(--ink); color: var(--on-ink); border-top: 4px double rgba(243, 235, 216, .6); padding: 44px 24px 0; font-size: 16px; }
.footer-cols { max-width: var(--wrap); margin: 0 auto; display: grid; gap: 28px; }
@media (min-width: 761px) { .footer-cols { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { font-size: 20px; color: var(--on-ink-accent); margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 6px; }
.site-footer a { color: var(--on-ink); }
.site-footer a:hover { text-decoration-color: var(--on-ink-accent); }
.press { max-width: var(--wrap); margin: 30px auto 0; padding: 12px 0; border-top: 4px double rgba(243, 235, 216, .45); font: 400 16px/1.4 var(--hand); text-align: center; }
.footnote { max-width: var(--wrap); margin: 0 auto; padding: 0 0 22px; color: var(--on-ink-muted); font-size: 12.5px; line-height: 1.5; }
.footnote p { margin: 0 0 6px; }

/* ---------- cookies ---------- */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
  max-width: 560px; margin: 0 auto; padding: 14px 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: var(--line); border-radius: var(--radius); font-size: 16px;
}
.cookie p { margin: 0; flex: 1 1 240px; }
.cookie .btn { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wheel { transition: none; }
  .side, .faq-a, .faq-q::after, .scratch canvas { transition: none; }
}
