/* ==========================================================================
   Crazy Monkey — main.css (modern)
   ========================================================================== */

:root {
  --green: #419c23;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-900: #14532d;
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --red-500: #f43f5e;
  --red-600: #e11d48;
  --ink: #1f2a1c;
  --muted: #5b6757;
  --line: rgba(20, 83, 45, .12);
  --surface: rgba(255, 253, 245, .96);
  --card: #ffffff;
  --radius-lg: 24px;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 16, .06), 0 2px 8px rgba(16, 24, 16, .06);
  --shadow: 0 4px 12px rgba(16, 24, 16, .08), 0 16px 40px rgba(16, 24, 16, .12);
  --shadow-lg: 0 30px 80px rgba(6, 40, 2, .35);
  --font: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font: 400 17px/1.7 var(--font);
  color: var(--ink);
  background-color: var(--green);
  background-image:
    url("../img/bg-top.webp"),
    url("../img/bg-footer.webp");
  background-repeat: no-repeat, no-repeat;
  background-position: center top, center bottom;
  background-size: max(1920px, 100%) auto, max(1920px, 100%) auto;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }

a { color: var(--green-700); }
a:hover { color: var(--green-600); }

:focus-visible { outline: 3px solid var(--amber-400); outline-offset: 3px; border-radius: 6px; }

/* --- Header ------------------------------------------------------------- */

.site-header {
  display: flex;
  justify-content: center;
  padding: 20px 16px 4px;
}

.site-logo { display: block; line-height: 0; transition: transform .25s ease; }
.site-logo:hover { transform: scale(1.03); }
.site-logo img {
  width: 360px;
  max-width: 72vw;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .3));
}

/* --- Page / panel ------------------------------------------------------- */

.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 20px 48px;
}

.panel {
  position: relative;
  background:
    radial-gradient(ellipse at top, rgba(255, 255, 255, .6), transparent 60%),
    linear-gradient(#ffefbb, #ffe5a0);
  background-clip: padding-box;
  border: 16px solid #9aae38;
  border-image: url("../img/frame-bamboo.webp") 16 round;
  box-shadow: var(--shadow-lg);
  padding: 0 40px 42px;
  --pad-x: 40px;
}
/* внутренняя тень пергамента */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(64, 84, 16, .35), inset 0 0 40px rgba(180, 141, 64, .35);
}

.panel--narrow { max-width: 860px; margin: 0 auto; }

.panel > * + * { margin-top: 44px; }

/* --- Page title (H1 наверху) ------------------------------------------ */

.page-title {
  margin: 30px 0 0;
  font-family: var(--font);
  font-weight: 900;
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.15;
  letter-spacing: -.02em;
  text-align: center;
  color: var(--green-900);
  text-wrap: balance;
}
.panel > .page-title + .game { margin-top: 0; padding-top: 22px; }

/* --- Screens strip ------------------------------------------------------ */

.screens { text-align: center; line-height: 0; }
.screens img {
  width: 100%;
  max-width: 980px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* --- Demo game ---------------------------------------------------------- */

.game { scroll-margin-top: 24px; padding-top: 34px; }
.panel > .game + .screens { margin-top: 24px; }

.game__frame {
  position: relative;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  background: #0f140e;
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, .08);
  overflow: hidden;
}
.game__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* --- Block titles ------------------------------------------------------- */

.block-title {
  margin: 0 0 24px;
  font-family: var(--font);
  font-weight: 900;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.2;
  letter-spacing: -.01em;
  text-align: center;
  color: var(--green-900);
}
/* --- Offers ------------------------------------------------------------- */

.offers__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: 14px;
}

.offer { display: flex; }

.offer__link {
  flex: 1;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 10px 10px;
  background: var(--card);
  border: 1px solid rgba(154, 174, 56, .45);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.offer__link:hover {
  color: var(--ink);
  transform: translateY(-2px);
  border-color: var(--green-500);
  box-shadow: var(--shadow);
}

.offer__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 76px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f3f7ee, #e4ecd9);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
}
/* фирменные подложки под логотипы */
.offer__logo:has(img[src*="million"]) {
  background:
    radial-gradient(ellipse at 28% 45%, rgba(170, 220, 60, .38), transparent 60%),
    radial-gradient(circle at 80% 0%, rgba(120, 200, 60, .18), transparent 50%),
    linear-gradient(160deg, #164a14 0%, #0e3510 55%, #0a2a0c 100%);
  box-shadow: inset 0 0 0 1px rgba(140, 200, 60, .3);
}
.offer__logo:has(img[src*="crystal"]) {
  background:
    radial-gradient(circle at 70% 20%, rgba(80, 120, 255, .35), transparent 60%),
    linear-gradient(135deg, #0f1733, #1f1145);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 120, .25);
}
.offer__logo:has(img[src*="crystal"]) img { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.offer__logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform .3s ease;
}
.offer__link:hover .offer__logo img { transform: scale(1.05); }

.offer__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.offer__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.offer__value {
  font-weight: 900;
  font-size: 21px;
  white-space: nowrap;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--red-600);
}

.offer__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, .3);
  transition: box-shadow .2s ease, filter .2s ease;
}
.offer__btn::after { content: "→"; transition: transform .2s ease; }
.offer__link:hover .offer__btn { filter: brightness(1.06); box-shadow: 0 6px 16px rgba(22, 163, 74, .45); }
.offer__link:hover .offer__btn::after { transform: translateX(3px); }

/* --- Games navigation --------------------------------------------------- */

.games-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding-top: 10px;
}
.games-nav li { flex: 0 0 122px; }
@media (min-width: 1000px) {
  .games-nav ul { gap: 10px; flex-wrap: nowrap; }
  .games-nav li { flex: 0 1 116px; min-width: 0; }
}

.game-card {
  position: relative;
  display: block;
  line-height: 0;
  text-decoration: none;
  border-radius: 14px;
  transition: transform .2s ease;
}
.game-card img {
  width: 100%;
  aspect-ratio: 300 / 172;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(40, 60, 10, .35));
  transition: filter .25s ease;
}
.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .6) 48%, transparent 66%) no-repeat;
  background-size: 250% 100%;
  background-position: 150% 0;
  opacity: 0;
}
.game-card:hover { transform: scale(1.06); }
.game-card:hover img { filter: drop-shadow(0 0 10px rgba(255, 210, 70, .9)) drop-shadow(0 6px 12px rgba(40, 60, 10, .4)); }
.game-card:hover::after { opacity: 1; animation: card-shine .8s ease-out forwards; }
@keyframes card-shine { from { background-position: 150% 0; } to { background-position: -60% 0; } }

/* метка «Вы здесь» у текущего автомата */
.game-card__play { display: none; }
.game-card[aria-current="page"] .game-card__play {
  display: block;
  position: absolute;
  left: 50%;
  top: -9px;
  transform: translateX(-50%);
  padding: 3px 10px;
  font: 700 10px/1.3 var(--font);
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #15803d);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(20, 50, 10, .35);
  z-index: 2;
}
.game-card[aria-current="page"] img { filter: drop-shadow(0 0 7px rgba(251, 191, 36, .95)) drop-shadow(0 4px 8px rgba(40, 60, 10, .35)); }
.game-card[aria-current="page"]:hover { transform: none; }
.game-card[aria-current="page"]:hover::after { animation: none; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .game-card:hover { transform: none; }
  .game-card:hover::after { animation: none; opacity: 0; }
}

/* --- Content ------------------------------------------------------------ */

.content {
  font-size: 17px;
  line-height: 1.75;
  color: #2b3528;
}
.content::after { content: ""; display: block; clear: both; }

.content h1 {
  margin: 0 0 22px;
  font-family: var(--font);
  font-weight: 900;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--green-900);
}

.content h2,
.content h3 {
  margin: 36px 0 12px;
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(21px, 2.3vw, 26px);
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--green-900);
}

.content h3 { font-size: 19px; margin: 22px 0 6px; color: #2b3528; }
.content h2 + h3 { margin-top: 14px; }
.content p { margin: 0 0 16px; }
.content strong { color: var(--green-900); }

.content a {
  font-weight: 700;
  color: var(--green-700);
  text-decoration: underline;
  text-decoration-color: rgba(21, 128, 61, .35);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: text-decoration-color .2s;
}
.content a:hover { text-decoration-color: currentColor; }

.content img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.float-left  { float: left;  margin: 6px 28px 16px 0; }
.float-right { float: right; margin: 6px 0 16px 28px; }

.content .screens { clear: both; margin: 28px 0; text-align: center; line-height: 0; }
.content .screens img { max-width: 100%; }

/* --- CTA buttons -------------------------------------------------------- */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 28px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(34, 197, 94, .1), rgba(251, 191, 36, .14));
  border: 1px solid var(--line);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 250px;
  padding: 18px 32px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.btn--gold {
  color: var(--green-900);
  background: linear-gradient(135deg, var(--amber-300), var(--amber-500));
  box-shadow: 0 8px 22px rgba(245, 158, 11, .4), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn--gold::before { content: "▶"; font-size: 13px; }

.btn--bonus {
  color: #fff;
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  box-shadow: 0 8px 22px rgba(225, 29, 72, .4), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn--bonus::before { content: "₽"; font-weight: 900; }

.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn--gold:hover { color: var(--green-900); box-shadow: 0 12px 28px rgba(245, 158, 11, .5); }
.btn--bonus:hover { color: #fff; box-shadow: 0 12px 28px rgba(225, 29, 72, .5); }
.btn:active { transform: translateY(0); }

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  flex-shrink: 0;
  padding: 28px 16px 36px;
  color: #e9f7df;
  text-align: center;
  background: linear-gradient(180deg, rgba(10, 50, 4, 0), rgba(10, 50, 4, .8) 45%);
}

.footer-nav ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1100px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.footer-nav a {
  display: inline-block;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background .2s, color .2s, border-color .2s;
}
.footer-nav a:hover { background: #fff; color: var(--green-900); border-color: #fff; }

.site-footer__note {
  margin: 20px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, .75);
}
.age {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  font-weight: 900;
  font-size: 11px;
  color: #fff;
  background: var(--red-600);
  border-radius: 50%;
  vertical-align: middle;
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 760px) {
  body { font-size: 16px; background-size: 1200px auto, 1200px auto; }
  .page { padding: 4px 12px 32px; }
  .panel { padding: 0 14px 24px; border-width: 10px; --pad-x: 14px; }
  .game { padding-top: 16px; }
  .page-title { margin-top: 18px; }
  .panel > * + * { margin-top: 32px; }

  .offer__link {
    grid-template-columns: 110px 1fr;
    gap: 6px 14px;
    padding: 10px;
  }
  .offer__logo { grid-row: span 2; height: 64px; padding: 6px; }
  .offer__value { font-size: 19px; }
  .offer__btn { justify-self: start; padding: 7px 14px; font-size: 13px; }

  .games-nav ul { gap: 10px; }
  .games-nav li { flex-basis: calc((100% - 20px) / 3); }

  .float-left,
  .float-right { float: none; display: block; margin: 8px auto 18px; }

  .content .screens { overflow-x: auto; -webkit-overflow-scrolling: touch; text-align: left; margin: 22px -14px; padding: 4px 14px 10px; scrollbar-width: thin; }
  .content .screens img { width: 700px; max-width: none; height: auto; }
  .cta-row { padding: 16px; }
  .btn { width: 100%; min-width: 0; }
}

@media (max-width: 330px) {
  .games-nav li { flex-basis: calc((100% - 10px) / 2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* --- Кнопка «Наверх» ---------------------------------------------------- */

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(6, 40, 2, .35);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s, box-shadow .2s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(6, 40, 2, .45); }
.to-top:active { transform: translateY(0); }

@media (max-width: 760px) {
  .to-top { right: 14px; bottom: 14px; width: 46px; height: 46px; }
}
