/* ==========================================================================
   Mega888 Casino — static rebuild of the "dltheme" layout
   Palette taken from the theme's own :root vars in index.html
   (--bg-header-block #211c24, --main_color #e03843).
   ========================================================================== */

:root {
  --bg-page: #17131a;
  --bg-surface: #211c24;
  --bg-surface-2: #2b2530;
  --bg-surface-3: #362f3c;
  --line: rgba(255, 255, 255, 0.08);
  --text: #ecebee;
  --text-muted: #a9a3ae;
  --accent: var(--main_color, #e03843);
  --accent-hover: #f0525c;
  --gold: #f5c04a;
  --radius: 12px;
  --radius-sm: 8px;
  --wrap: 1240px;
}

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

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

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text);
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }

.wrapper {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}

.d-link { cursor: pointer; }

/* ---------- Header ---------- */
.section-header { background: var(--bg-header-block, var(--bg-surface)); }

.container-menu {
  border-bottom: 1px solid var(--line);
  background: var(--bg-mobile-menu, var(--bg-surface));
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}

.header-logotype { height: 44px; width: auto; }

.container-banner {
  background:
    radial-gradient(900px 400px at 85% 50%, rgba(224, 56, 67, 0.28), transparent 70%),
    radial-gradient(600px 300px at 10% 0%, rgba(245, 192, 74, 0.08), transparent 70%),
    var(--bg-header-block, var(--bg-surface));
}

.header-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 32px;
  padding-top: 48px;
  padding-bottom: 48px;
}

.product-info { display: flex; flex-direction: column; gap: 16px; }

.product-name {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 900;
  line-height: 1.12;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.product-description {
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 500;
  color: var(--text-muted);
}

.button-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.btn-header-template {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.btn-log {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 8px 24px rgba(224, 56, 67, 0.35);
}
.btn-log:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); }

.btn-reg {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.35);
}
.btn-reg:hover { border-color: #fff; transform: translateY(-1px); }

.product-media { display: flex; justify-content: center; }
.product-media img { width: 100%; max-width: 520px; height: auto; }

/* ---------- Game catalogue ---------- */
.section-catalogue { padding: 48px 0 24px; }

.entry-title {
  margin: 0 0 20px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
}

.game-sort-and-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.sort-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.sort__game {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--bg-surface-2);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.2s, color 0.2s;
}
.sort__game:hover { color: #fff; background: var(--bg-surface-3); }
.sort__game.is-active { background: var(--accent); color: #fff; }

.sort__icon {
  width: 16px;
  height: 16px;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}
.star-ico { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 21 12 17.77 5.82 21 7 14.14l-5-4.87 6.91-1.01z'/%3E%3C/svg%3E"); }
.add-ico { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4z'/%3E%3C/svg%3E"); }
.game-ico { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16a1 1 0 011 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1zm3.5 3a1.5 1.5 0 100 3 1.5 1.5 0 000-3zm9 0a1.5 1.5 0 100 3 1.5 1.5 0 000-3zM12 10.5a1.5 1.5 0 100 3 1.5 1.5 0 000-3zM7.5 15a1.5 1.5 0 100 3 1.5 1.5 0 000-3zm9 0a1.5 1.5 0 100 3 1.5 1.5 0 000-3z'/%3E%3C/svg%3E"); }
.win-ico { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 3V2H6v1H2v4a4 4 0 004 4h.29A6 6 0 0011 14.9V18H8v2h8v-2h-3v-3.1A6 6 0 0017.71 11H18a4 4 0 004-4V3zM4 7V5h2v4a2 2 0 01-2-2zm16 0a2 2 0 01-2 2V5h2z'/%3E%3C/svg%3E"); }

.form_search { flex: 0 1 300px; margin: 0; }

.box_input_text { position: relative; }

.box_input_text input {
  width: 100%;
  height: 44px;
  padding: 0 48px 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-surface-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.box_input_text input::placeholder { color: var(--text-muted); }
.box_input_text input:focus { border-color: var(--accent); }
.box_input_text input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search_submit {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.input-suggestion { display: none; }

.slots {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
}

.slots > li {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-surface-2);
  isolation: isolate;
}
.slots > li[hidden] { display: none; }

.slots picture,
.slots img {
  width: 100%;
  height: 100%;
}
.slots img { object-fit: cover; transition: transform 0.35s ease; }
.slots > li:hover img { transform: scale(1.06); }

/* Card art used when a slot thumbnail file is missing */
.slots > li.no-img picture { display: none; }
.slots > li.no-img {
  background:
    radial-gradient(120% 80% at 50% 0%, hsl(var(--hue, 350) 70% 45% / 0.9), transparent 70%),
    linear-gradient(160deg, hsl(var(--hue, 350) 45% 22%), #120e14);
}
.slots > li.no-img::before {
  content: attr(data-title);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  text-align: center;
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.slots-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  background: rgba(23, 19, 26, 0.82);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.slots > li:hover .slots-overlay,
.slots > li:focus-within .slots-overlay { opacity: 1; }

.slot__name { font-size: 15px; font-weight: 800; line-height: 1.2; }

.game__info { font-size: 12px; font-weight: 600; color: var(--gold); }

.play__btn {
  width: 52px;
  height: 52px;
  margin: 6px 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") 55% 50% / 22px no-repeat;
  box-shadow: 0 6px 20px rgba(224, 56, 67, 0.45);
  transition: transform 0.2s;
}
.play__btn:hover { transform: scale(1.08); }

.slot__provider { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.slots-empty {
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- Article ---------- */
.container-main { padding-top: 24px; padding-bottom: 24px; }

.content {
  padding: clamp(20px, 4vw, 48px);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

/* The generated article wraps every text node in <code>; render it as normal text */
.content code {
  font: inherit;
  color: inherit;
  background: none;
  padding: 0;
  white-space: normal;
}

.content .row { margin: 0; }
.content section { scroll-margin-top: 24px; }

.content h1,
.content h2,
.content h3 { margin: 32px 0 16px; line-height: 1.25; font-weight: 800; }
.content h1 { margin-top: 0; font-size: clamp(28px, 4vw, 40px); }
.content h2 { font-size: clamp(22px, 3vw, 30px); }
.content h3 { font-size: clamp(18px, 2.2vw, 22px); color: #fff; }
.content h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 12px;
  border-radius: 2px;
  background: var(--accent);
}

.content p { margin: 0 0 16px; color: #d6d3d9; }

.figure { margin: 24px 0; }
.figure img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
.figure-caption { margin-top: 10px; font-size: 14px; color: var(--text-muted); text-align: center; }

.list-group {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  counter-reset: item;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}
.list-group-item {
  position: relative;
  padding: 12px 16px 12px 48px;
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--line);
}
.list-group-item:last-child { border-bottom: 0; }
ul.list-group .list-group-item::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 21px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
ol.list-group .list-group-item { counter-increment: item; }
ol.list-group .list-group-item::before {
  content: counter(item);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
}

.table {
  display: block;
  width: 100%;
  margin: 0 0 20px;
  overflow-x: auto;
  border-collapse: collapse;
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}
.table tbody { display: table; width: 100%; min-width: 520px; border-collapse: collapse; }
.table th,
.table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: var(--accent); color: #fff; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.table td { background: var(--bg-surface-2); }
.table-hover tr:hover td { background: var(--bg-surface-3); }

blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-surface-2);
  font-style: italic;
  color: #e4e1e7;
}

/* Table of contents */
.toc-container {
  margin: 32px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-surface-2);
}
.toc { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 32px; }
.toc-item { break-inside: avoid; }
.toc-link {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}
.toc-link:hover { color: var(--accent); }
.toc-number { color: var(--accent); font-weight: 800; min-width: 28px; }

/* ---------- Promo banner ---------- */
.banner-cef {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 280px;
  padding: clamp(24px, 5vw, 56px);
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--bg-surface);
  background-size: cover;
  background-position: center right;
}

.cef-info { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; max-width: 520px; }
.cef-info p { margin: 0; }
.cef-title { font-size: 18px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.cef-promo { font-size: clamp(28px, 4vw, 44px); font-weight: 900; line-height: 1.1; color: #fff; }

.cef-btn {
  margin-top: 8px;
  padding: 14px 32px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 24px rgba(224, 56, 67, 0.35);
  transition: background-color 0.2s, transform 0.2s;
}
.cef-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ---------- Footer ---------- */
.section-footer {
  margin-top: 48px;
  padding-top: 48px;
  background: var(--bg-surface);
  border-top: 1px solid var(--line);
}

.foot-menu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }

.menu-name {
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
}

.menu-collumn ul { margin: 0; padding: 0; list-style: none; }
.menu-collumn li {
  padding: 5px 0;
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.menu-collumn li:hover { color: #fff; }
.menu-collumn li a { color: inherit; text-decoration: none; }

.container-producer,
.container-payments {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.producer-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
}

.producer-image__wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-2);
  transition: background-color 0.2s;
}
.producer-image__wrapper:hover { background: var(--bg-surface-3); }

.producer-image__name {
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  color: #cfcad3;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.payments-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.payment__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 56px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-2);
}
.payment__icon img { max-height: 32px; width: auto; }

.container-footer { margin-top: 40px; border-top: 1px solid var(--line); }

.copyright {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .slots { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .header-block { grid-template-columns: 1fr; text-align: center; padding-top: 32px; padding-bottom: 32px; }
  .product-info { align-items: center; }
  .button-group { justify-content: center; }
  .product-media { order: -1; }
  .product-media img { max-width: 380px; }
  .slots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .foot-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc { columns: 1; }
}

@media (max-width: 640px) {
  .game-sort-and-filter { flex-direction: column; align-items: stretch; }
  .sort-list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sort-list::-webkit-scrollbar { display: none; }
  .sort__game { flex: none; }
  .form_search { flex-basis: auto; }
  .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .slots-overlay { opacity: 1; background: linear-gradient(to top, rgba(23, 19, 26, 0.95) 0%, rgba(23, 19, 26, 0) 60%); justify-content: flex-end; }
  .slots-overlay .play__btn,
  .slots-overlay .game__info { display: none; }
  .slot__name { font-size: 12px; }
  .btn-header-template { min-width: 0; flex: 1 1 140px; }
  .banner-cef { min-height: 240px; background-position: center; }
  .copyright { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 420px) {
  .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-menu { grid-template-columns: 1fr; }
}

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

/* ==========================================================================
   Fixes for the HTML as it is (no extra classes / ids / JS needed)
   ========================================================================== */

/* Active chip: first sort button ("Popular") without an .is-active class */
.sort-list .sort__game:first-child { background: var(--accent); color: #fff; }

/* Slot cards: colour art + always-visible title, so cards still look right
   when a thumbnail is missing or still loading */
.slots > li {
  background:
    radial-gradient(120% 80% at 50% 0%, hsl(var(--hue, 350) 70% 45% / 0.9), transparent 70%),
    linear-gradient(160deg, hsl(var(--hue, 350) 45% 22%), #120e14);
}
.slots > li:nth-child(8n+1) { --hue: 350; }
.slots > li:nth-child(8n+2) { --hue: 265; }
.slots > li:nth-child(8n+3) { --hue: 28; }
.slots > li:nth-child(8n+4) { --hue: 195; }
.slots > li:nth-child(8n+5) { --hue: 145; }
.slots > li:nth-child(8n+6) { --hue: 315; }
.slots > li:nth-child(8n+7) { --hue: 48; }
.slots > li:nth-child(8n+8) { --hue: 225; }

/* Broken image: hide alt text/icon by painting over it (pseudo-elements only
   render on a failed <img>, never on a loaded one) */
.slots img { position: relative; color: transparent; font-size: 0; }
.slots img::after { content: ""; position: absolute; inset: 0; background: inherit; }

.slots-overlay {
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(18, 14, 20, 0.95) 0%, rgba(18, 14, 20, 0) 62%);
  backdrop-filter: none;
  opacity: 1;
}
.slots-overlay .play__btn,
.slots-overlay .game__info,
.slots-overlay .slot__provider { display: none; }
.slots > li:hover .slots-overlay,
.slots > li:focus-within .slots-overlay {
  justify-content: center;
  background: rgba(23, 19, 26, 0.84);
  backdrop-filter: blur(2px);
}
.slots > li:hover .play__btn,
.slots > li:hover .game__info,
.slots > li:hover .slot__provider,
.slots > li:focus-within .play__btn,
.slots > li:focus-within .game__info,
.slots > li:focus-within .slot__provider { display: block; }
.slots > li:hover .play__btn,
.slots > li:focus-within .play__btn { display: inline-block; }

/* Hero art / article figures: keep their space if the file fails to load */
.product-media img { aspect-ratio: 321 / 122; object-fit: contain; }
.figure img { min-height: 200px; background: var(--bg-surface-2); }

/* Footer logos: readable name when the sprite/icon file is not available */
.producer-image__image,
.payment__icon img {
  color: #cfcad3;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.producer-image__image { width: 100%; height: 100%; object-fit: contain; }
.payment__icon img { max-height: none; height: auto; max-width: 100%; }

/* Bootstrap-style helpers used in the article markup */
.text-center { text-align: center; }
.fw-bold { font-weight: 800; }
.list-unstyled { list-style: none; padding-left: 0; }

/* Footer lists: the <li> carry the .d-link click target, give them a hand cursor */
.menu-collumn li { cursor: pointer; }

@media (max-width: 640px) {
  .slots-overlay { justify-content: flex-end; }
}
