/* ============================================================
   HitnSpin Sverige — Layout & Components
   ============================================================ */

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

/* нет горизонтальной прокрутки на мобиле (страховка от случайного overflow) */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); overflow-x: hidden; }

body {
  margin: 0;
  max-width: 100%; overflow-x: hidden;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 85% -10%, rgba(0, 140, 69, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 15%, rgba(74, 0, 82, .10), transparent 55%),
    var(--bg-base);
  -webkit-font-smoothing: antialiased;
}
/* parole lunghe vanno a capo invece di sforare lo schermo */
h1, h2, h3, p, li, .banner__title, .crumbs { overflow-wrap: anywhere; }

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--brand-purple); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }

/* ---------- Header (fixed) ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 3px solid transparent;
  border-image: var(--grad-flag-h) 1;
  box-shadow: var(--shadow-sm);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 1rem; }

.logo { display: inline-flex; align-items: center; gap: .55rem; }
.logo-img { height: 62px; width: auto; display: block; }
.site-footer .logo-img { height: 44px; }

.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a { color: var(--text-muted); font-weight: 600; font-size: .98rem; position: relative; padding: 4px 0; }
.nav a:hover, .nav a.active { color: var(--brand-purple); }
.nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px;
  background: var(--grad-flag-h);
  border-radius: 3px;
}

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; font-family: var(--font-head);
  padding: .7rem 1.4rem; border-radius: 999px; border: none; cursor: pointer;
  background: var(--grad-fire); color: #fff;
  box-shadow: var(--shadow-accent); transition: transform .15s ease, filter .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-3px) scale(1.02); filter: brightness(1.1); color: #fff; }
.btn-gold { background: var(--grad-gold); color: #2e0033; box-shadow: var(--shadow-gold); }
.btn-gold:hover { color: #2e0033; }
.btn-ghost { background: transparent; border: 2px solid var(--flag-black); color: var(--text); box-shadow: none; }
.btn-ghost:hover { background: rgba(0, 140, 69, .08); border-color: var(--flag-red); color: var(--flag-red); }
/* CTA на огненном градиенте — всегда белый текст (кроме gold/ghost) */
.btn:not(.btn-gold):not(.btn-ghost),
.btn:not(.btn-gold):not(.btn-ghost):link,
.btn:not(.btn-gold):not(.btn-ghost):visited,
.btn:not(.btn-gold):not(.btn-ghost):hover,
.btn:not(.btn-gold):not(.btn-ghost):focus,
.btn:not(.btn-gold):not(.btn-ghost):active { color: #fff; }

.header-actions { display: flex; align-items: center; gap: .55rem; margin-left: auto; }
.site-header .btn { padding: .52rem 1.05rem; font-size: .92rem; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 26px; height: 3px; margin: 5px 0; background: var(--text); border-radius: 3px; transition: .25s; }

/* ---------- Layout shell ---------- */
main { padding-top: var(--header-h); }

.section { padding: clamp(1.6rem, 4vw, 2.7rem) 0; }
.section--alt1 { background: var(--bg-alt-1); }
.section--alt2 { background: var(--bg-alt-2); }
.section--edge { border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }

.section h2 {
  font-family: var(--font-head); font-size: var(--fs-h2); line-height: 1.2;
  margin: 0 0 1rem; display: flex; align-items: center; gap: .6rem;
}
/* ювелирная полоса перед H2 — золото→вино→фиолет, округлые концы */
.section h2::before {
  content: ""; width: 6px; align-self: stretch; min-height: 1.3em;
  background: var(--grad-jewel);
  border-radius: 6px;
}
.section h3 { font-family: var(--font-head); font-size: var(--fs-h3); color: var(--accent); margin: 1.8rem 0 .6rem; }
.section p { margin: 0 0 1rem; }
.section ul { padding-left: 0; list-style: none; }
.section ul li { position: relative; padding-left: 1.8rem; margin-bottom: .6rem; }
/* marcatore italiano: rombo-gemma (quadrato ruotato) con gradiente oro→smeraldo→rosso */
.section ul li::before {
  content: ""; position: absolute; left: .25rem; top: .55em;
  width: 11px; height: 11px; background: var(--grad-jewel);
  border-radius: 3px; transform: rotate(45deg);
  box-shadow: 0 1px 3px rgba(0, 104, 47, .35);
}

/* ---------- Hero (фоновая картинка + текст поверх) ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(3rem, 9vw, 6rem) 0 clamp(2.4rem, 6vw, 4rem);
  min-height: clamp(360px, 48vw, 540px);
  display: flex; align-items: center;
  /* статичный сплошной фон (не градиент); картинки генерятся с растворением краёв ровно в этот цвет */
  background: #180522;
  border-bottom: 4px solid transparent;
  border-image: var(--grad-flag-h) 1;
}
/* картинка вписывается целиком (по ширине/высоте), без обрезки; прижата вправо */
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: right center; z-index: -2; }
/* затемнение слева — под текст; справа картинка остаётся яркой */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(20, 5, 28, .82) 0%, rgba(20, 5, 28, .5) 42%, rgba(20, 5, 28, 0) 70%);
}
.hero { color: #fff; }
/* невысокая шапка для правовых/служебных страниц */
.hero--slim { min-height: auto; padding: clamp(2.2rem, 6vw, 3.6rem) 0; }
.hero .container { width: 100%; }
.hero-content { max-width: 600px; }
.hero .crumbs, .hero .crumbs a { color: rgba(255, 255, 255, .82); }
.hero .badge-18 { margin-bottom: 1rem; }
.hero h1 {
  font-family: var(--font-head); font-size: var(--fs-h1); line-height: 1.1; margin: 0 0 1rem;
  color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .5);
}
.hero h1 .hl { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.12rem; color: #fff; }
.hero p { color: rgba(255, 255, 255, .92); text-shadow: 0 1px 10px rgba(0, 0, 0, .45); }

.badge-18 {
  display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; font-size: .8rem;
  padding: .25rem .7rem; border-radius: 999px; border: 2px solid var(--flag-red); color: var(--flag-white);
  background: rgba(220, 31, 0, .15); letter-spacing: .5px;
}

/* ---------- Quick verdict / callout cards ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-asym); padding: clamp(1.2rem, 3vw, 1.8rem); box-shadow: var(--shadow-sm);
}
.card--gold { border-color: var(--gold-deep); box-shadow: var(--shadow-gold); }
.card--flag { border-left: 6px solid transparent; border-image: var(--grad-flag) 1; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; clear: both; border-radius: var(--radius-asym); border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin: 1.2rem 0 1.6rem; }
table { width: 100%; border-collapse: collapse; min-width: 520px; background: var(--bg-card); }
/* на ПК таблицы вписываются в контейнер; рамка и скругление видны на всех ширинах,
   скролл появляется только если таблица реально не помещается */
@media (min-width: 761px) {
  table { min-width: 0; }
  /* ссылки по центру между лого и кнопками, кнопки — справа
     (два auto-margin делят свободное место поровну) */
  .nav { flex: 1; }
  .nav > a:first-of-type { margin-left: auto; }
  .nav .header-actions { margin-left: auto; }
}
caption { caption-side: top; text-align: left; color: var(--text-muted); font-size: var(--fs-small); padding: .4rem 0; }
th, td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: top; font-size: .96rem; }
thead th { background: var(--grad-purple); color: var(--gold-soft); font-family: var(--font-head); border-bottom: 2px solid var(--gold-deep); letter-spacing: .2px; position: sticky; top: 0; vertical-align: middle; }
tbody tr:nth-child(even) { background: var(--bg-card-2); }
tbody tr:hover { background: rgba(0, 140, 69, .08); }
td:first-child { font-weight: 600; color: var(--emerald-deep); }

/* ---------- Pros / Cons ---------- */
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.proscons .col { border-radius: var(--radius-asym); padding: 1.3rem 1.4rem; border: 1px solid var(--border); background: var(--bg-card); }
.proscons .pros { border-top: 4px solid var(--pro); }
.proscons .cons { border-top: 4px solid var(--con); }
.proscons h3 { margin-top: 0; }
/* pros/cons — badge a squircle (quadrato arrotondato), distinti dal rombo delle liste */
.proscons ul li { padding-left: 2.2rem; }
.proscons ul li::before {
  content: "✔"; left: 0; top: .15em; width: 1.35rem; height: 1.35rem;
  background: var(--pro); color: #fff; transform: none; border-radius: 7px;
  display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.proscons .cons ul li::before { content: "✕"; background: var(--con); }

/* ---------- Banner (image placeholder) ---------- */
.banner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0; align-items: stretch;
  border-radius: var(--radius-asym); overflow: hidden; margin: 0;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.banner--bonus { background: linear-gradient(120deg, var(--brand-purple) 0%, var(--brand-purple-deep) 100%); }
.banner--app   { background: linear-gradient(120deg, #1a3a5e 0%, #0d1f33 100%); }
.banner__body { padding: clamp(1.4rem, 3vw, 2.2rem); display: flex; flex-direction: column; justify-content: center; gap: .7rem; }
.banner__kicker { font-size: .8rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.banner__title { font-family: var(--font-head); font-size: clamp(1.3rem, 2.6vw, 1.9rem); line-height: 1.15; margin: 0; }
.banner__sub { color: rgba(255, 255, 255, .82); margin: 0; }
.banner__cta { margin-top: .4rem; }
.banner__media {
  position: relative; min-height: 200px;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 12px, rgba(255,255,255,0) 12px 24px), rgba(255,255,255,.05);
  display: grid; place-items: center; text-align: center; padding: 0;
}
.banner .img-placeholder { color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.35); }
.banner__media[data-pos="left"] { order: -1; }
.img-placeholder {
  width: 100%; height: 100%; min-height: 180px;
  border: 2px dashed var(--border); border-radius: var(--radius);
  display: grid; place-items: center; gap: .4rem; color: var(--text-dim);
  font-size: .82rem; padding: 1rem; text-align: center;
}
.img-placeholder .ph-icon { font-size: 2rem; }
.img-placeholder .ph-alt { max-width: 32ch; }

/* standalone image placeholder inside content */
.shot { margin: 1.4rem 0; }
.shot--left { float: left; max-width: 340px; margin: .3rem 1.6rem 1rem 0; }
.shot--right { float: right; max-width: 340px; margin: .3rem 0 1rem 1.6rem; }
.shot--top { width: 100%; margin: .4rem 0 1.5rem; }
.shot--top .img-placeholder { min-height: 240px; }
.shot--left .img-placeholder, .shot--right .img-placeholder { min-height: 200px; }
/* сгенерированная картинка вместо плейсхолдера */
.ph-img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.shot .ph-img { height: auto; }
/* верхняя картинка во всю ширину — ограничить высоту, кадр по центру */
.shot--top .ph-img { width: 100%; height: auto; max-height: 450px; object-fit: cover; }
.banner__media .ph-img { border-radius: 0; box-shadow: none; }
.section .container::after { content: ""; display: block; clear: both; }

/* ---------- Slot cards grid ---------- */
.slot-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin: 1.4rem 0 1.6rem; }
.slot-grid > * { min-width: 0; }
.slot-card {
  width: calc((100% - 3rem) / 4); /* 4 per riga (3 gap da 1rem) */
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-asym); overflow: hidden; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.slot-card__media { aspect-ratio: 2 / 3; overflow: hidden; }
.slot-card__media .ph-img, .slot-card__media .img-placeholder { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; box-shadow: none; }
.slot-card__media .ph-img { transition: transform .35s ease; }
.slot-card__cap {
  padding: .7rem .85rem .85rem; display: flex; flex-direction: column; gap: .1rem;
  border-top: 3px solid transparent; border-image: var(--grad-flag-h) 1;
}
.slot-card__name { font-family: var(--font-head); font-weight: 700; color: var(--brand-purple); line-height: 1.2; }
.slot-card__prov { font-size: var(--fs-small); color: var(--text-muted); }
.slot-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold-deep); }
.slot-card:hover .slot-card__media .ph-img { transform: scale(1.08); }
/* passo intermedio: 4 per riga da 800px in su; 3 per riga sotto 800px; 2 sotto 600px (vedi sotto) */
@media (max-width: 800px) { .slot-card { width: calc((100% - 2rem) / 3); } /* 3 per riga (2 gap da 1rem) */ }

/* ---------- Rating bars ---------- */
.score { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--accent); }
.rating-overall { font-size: 1.4rem; font-family: var(--font-head); color: var(--accent); font-weight: 800; }

/* ---------- FAQ accordion ---------- */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-asym); margin-bottom: .8rem; overflow: hidden; background: var(--bg-card); }
.faq-q {
  width: 100%; text-align: left; cursor: pointer; border: 0; background: none; color: var(--text);
  font-family: var(--font-head); font-size: 1.05rem; font-weight: 700;
  padding: 1.05rem 1.2rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-q:hover { color: var(--flag-red); background: rgba(0, 140, 69, .06); }
.faq-q .chev { transition: transform .25s ease; color: var(--flag-red); flex: none; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.faq-a__inner { overflow: hidden; min-height: 0; }
.faq-a__inner p { margin: 0; padding: .35rem 1.2rem 1.1rem; }
.faq-item.open .faq-a { grid-template-rows: 1fr; }

/* ---------- Disclaimer / responsible blocks ---------- */
/* note — ювелирная градиентная полоса слева + асимметричные углы */
.note { position: relative; overflow: hidden; background: rgba(158, 27, 63, .05); padding: 1rem 1.2rem 1rem 1.45rem; border-radius: var(--radius-asym); color: var(--text-muted); font-size: .95rem; }
.note::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad-jewel); }
.signature { margin-top: 1.6rem; color: var(--text-muted); font-size: .95rem; border-top: 1px dashed var(--border); padding-top: 1rem; }
.signature b { color: var(--brand-purple); }

/* ---------- Steps ---------- */
ol.steps { counter-reset: s; list-style: none; padding-left: 0; }
ol.steps li { position: relative; padding-left: 3rem; margin-bottom: .9rem; }
ol.steps li::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 0; top: -2px; width: 2rem; height: 2rem;
  border-radius: 40% 12% 40% 12%; /* linea italiana: squircle (al posto del cerchio SV) */
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: var(--grad-jewel); box-shadow: 0 6px 16px rgba(0, 104, 47, .30);
}

/* ---------- Breadcrumbs ---------- */
.crumbs { font-size: var(--fs-small); color: var(--text-dim); padding: .6rem 0; }
.crumbs a { color: var(--text-muted); }
.crumbs span { color: var(--flag-red); padding: 0 .4rem; }

/* ---------- Scroll to top ---------- */
.scroll-top {
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); z-index: 90;
  width: 48px; height: 48px; border: none; border-radius: 50%; cursor: pointer;
  background: var(--grad-fire); color: #fff; font-size: 1.4rem; line-height: 1;
  display: grid; place-items: center; box-shadow: var(--shadow-accent);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease, filter .15s ease;
}
.scroll-top.visible { opacity: 1; visibility: visible; transform: none; }
.scroll-top:hover { filter: brightness(1.1); transform: translateY(-3px); }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-purple-deep); border-top: 4px solid transparent; border-image: var(--grad-flag-h) 1; padding: 2.6rem 0 1.4rem; margin-top: 2rem; color: #ece1f2; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--gap); }
.site-footer .logo { color: #fff; }
.site-footer h4 { font-family: var(--font-head); color: var(--gold-soft); margin: 0 0 .8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: .45rem; }
.site-footer .muted { color: #c7b6d4; }
.site-footer a { color: #cfbfdb; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 1.8rem; padding-top: 1.2rem; color: #b3a1c2; font-size: var(--fs-small); display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; justify-content: space-between; align-items: center; }
.help-line { color: var(--cream); font-weight: 600; }

/* ---------- Hero rating ---------- */
.hero-rating {
  display: inline-flex; flex-direction: column; gap: .35rem; margin-bottom: 1.2rem;
  padding: .75rem 1.15rem; border-radius: var(--radius);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(4px); box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.hero-rating__top { display: flex; align-items: center; gap: .55rem; }
.hero-rating .stars { color: var(--gold); font-size: 1.3rem; letter-spacing: 2px; text-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.hero-rating .rating-num { font-family: var(--font-head); font-weight: 800; font-size: 1.55rem; color: #fff; line-height: 1; }
.hero-rating .rating-num .rating-max { font-size: 1rem; color: rgba(255, 255, 255, .75); font-weight: 600; }
.hero-rating .rating-label { color: rgba(255, 255, 255, .85); font-size: .82rem; letter-spacing: .3px; text-transform: uppercase; }

/* ---------- Utilities ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
/* грид-ячейки могут сжиматься (min-width:auto иначе распирает их до min-width таблицы);
   нужно, чтобы вложенная .table-wrap скроллилась, а не обрезалась/вылезала за экран */
.grid-2 > *, .proscons > * { min-width: 0; }
.muted { color: var(--text-muted); }
.clearfix::after { content: ""; display: block; clear: both; }
.emoji { font-style: normal; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; gap: 0; background: rgba(255,255,255,.98); border-bottom: 3px solid transparent; border-image: var(--grad-flag-h) 1; box-shadow: var(--shadow); padding: .5rem 0; transform: translateY(-150%); transition: transform .3s ease; }
  .nav.open { transform: translateY(0); }
  .nav a { padding: .9rem 1.4rem; width: 100%; text-align: center; }
  .nav a.active::after { display: none; }
  .nav .header-actions { display: flex; flex-direction: column; align-items: center; gap: .6rem; width: 100%; margin: 0; padding: .4rem 1.4rem 1rem; }
  .nav .header-actions .btn { width: 100%; max-width: 200px; justify-content: center; }
  .nav-toggle { display: block; }
  .proscons, .grid-2 { grid-template-columns: 1fr; }
  /* 450–760px: 3 per riga, gap ridotto; altezza card limitata; immagine riempie lo spazio sopra la didascalia */
  .slot-grid { gap: .7rem; }
  .slot-card { width: calc((100% - 1.4rem) / 3); max-height: 450px; }
  .slot-card__media { aspect-ratio: auto; flex: 1; min-height: 0; }
  /* hero: на узком экране картинка снизу, текст сверху с вертикальным затемнением */
  .hero__bg { object-fit: cover; object-position: center bottom; }
  .hero::after { background: linear-gradient(180deg, rgba(20,5,28,.86) 0%, rgba(20,5,28,.55) 55%, rgba(20,5,28,.35) 100%); }
  .hero-content { max-width: none; }
  .banner { grid-template-columns: 1fr; }
  .banner__media { order: -1 !important; min-height: 160px; }
  .shot--left, .shot--right { float: none; max-width: 100%; margin: 1rem 0; }
  /* картинку в двухколоночной секции — наверх (сразу под h2) */
  .grid-2 .shot { order: -1; }
  /* во всю ширину — ограничить высоту, высокие кадрируем */
  .shot .ph-img { width: 100%; height: auto; max-height: 350px; object-fit: cover; }
}
@media (max-width: 600px) {
  /* <600px: 2 per riga (override del 3 per riga di ≤760px) */
  .slot-card { width: calc((100% - 0.7rem) / 2); }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 450px) {
  /* все кнопки по центру */
  .btn { display: flex; width: fit-content; margin-left: auto; margin-right: auto; }
}
