/*
  Étoile Jeux — Golden Casino Theme (ej-* namespace)
  Fonts: 'Gloock' (headings) + 'Inter Tight' (body)
  Scope: complete redesign with new class names, gold-centric palette,
  revamped cards, animations, accessibility, and responsive behaviors.
*/

/* ============================
   1) Design Tokens
============================= */
:root {
  /* Backgrounds */
  --ej-bg: #0a0811; /* star night */
  --ej-bg-2: #0e0a18; /* deeper tone */
  --ej-surface: #131020; /* panels */
  --ej-surface-2: #19142b; /* alternate */

  /* Text */
  --ej-text: #f4f6ff; /* primary */
  --ej-text-dim: #d4d9ef; /* secondary */
  --ej-text-muted: #9aa3c6; /* muted */

  /* Gold / Accents */
  --ej-gold-1: #ffd77a;
  --ej-gold-2: #f5c24a;
  --ej-gold-3: #e6a93a;
  --ej-amber: #ffb347;
  --ej-ruby: #d05a5a;
  --ej-emerald: #29c487;

  /* Gradients */
  --ej-grad-gold: linear-gradient(
    135deg,
    #ffe8a8,
    #ffd77a 35%,
    #f5c24a 65%,
    #e6a93a
  );
  --ej-grad-panel: linear-gradient(
    180deg,
    rgba(22, 18, 38, 0.96),
    rgba(16, 12, 28, 0.94)
  );
  --ej-grad-shine: linear-gradient(
    90deg,
    rgba(255, 231, 168, 0.18),
    rgba(230, 169, 58, 0)
  );

  /* Shadows & Rings */
  --ej-shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.35);
  --ej-ring: 0 0 0 0.16rem rgba(255, 215, 122, 0.55),
    0 0 0 0.28rem rgba(230, 169, 58, 0.28);

  /* Radius */
  --ej-rad-1: 14px;
  --ej-rad-2: 18px;
  --ej-rad-3: 22px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================
   2) Base / Reset
============================= */
* {
  box-sizing: border-box;
}
html {
  color-scheme: dark;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: "Inter Tight", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--ej-text);
  background: radial-gradient(
      900px 600px at -10% 10%,
      rgba(245, 194, 74, 0.06),
      transparent 60%
    ),
    radial-gradient(
      800px 500px at 110% 0%,
      rgba(208, 90, 90, 0.05),
      transparent 65%
    ),
    var(--ej-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
img[loading="lazy"] {
  content-visibility: auto;
}
svg {
  display: block;
}

h1,
h2,
h3 {
  font-family: "Gloock", ui-serif, Georgia, serif;
  letter-spacing: 0.2px;
  margin: 0 0 0.5rem;
}

h1 {
  font-weight: 800;
  line-height: 1.08;
}
h2 {
  font-weight: 700;
  line-height: 1.12;
}
h3 {
  font-weight: 700;
  line-height: 1.2;
}

p {
  margin: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.a11y-skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.a11y-skip:focus {
  left: 12px;
  top: 12px;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: #000;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #000, 0 0 0 9px rgba(245, 194, 74, 0.8);
  z-index: 9999;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ej-ring);
  border-radius: 10px;
}

/* Links */
.a-link,
a {
  color: var(--ej-gold-2);
  text-decoration: none;
}
.a-link:hover,
a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Unstyled helper */
.unstyle {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ============================
   3) Hero
============================= */
.ej-hero {
  position: relative;
  padding: 84px 0 36px;
  background: radial-gradient(
      900px 520px at 25% -10%,
      rgba(230, 169, 58, 0.09),
      transparent 60%
    ),
    radial-gradient(
      820px 420px at 110% 8%,
      rgba(208, 90, 90, 0.08),
      transparent 65%
    ),
    linear-gradient(180deg, rgba(14, 10, 24, 0.5), rgba(14, 10, 24, 0));
}
.ej-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0 2px,
    transparent 2px 6px
  );
}
.ej-hero .container {
  text-align: center;
}
.ej-hero__title-wrap,
.ej-hero__intro {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}
.ej-hero__title-wrap {
  margin-bottom: 12px;
}

.main-heading {
  font-size: clamp(2.2rem, 3.6vw, 3.2rem);
  background: var(--ej-grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 14px rgba(229, 169, 58, 0.28),
    0 0 24px rgba(255, 215, 122, 0.2);
}
.ej-hero__intro {
  color: var(--ej-text-dim);
  font-size: clamp(1rem, 1.15vw, 1.0625rem);
  margin: 0 auto 22px;
}

/* Feature chips */
.ej-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 20px;
}
.ej-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  padding-left: 36px; /* room for pseudo marker */
  border-radius: 999px;
  position: relative;
  z-index: 0;
  color: var(--ej-text);
}
.ej-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  padding: 1px;
  background: var(--ej-grad-gold);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
/* decorative marker */
.ej-chip::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: var(--ej-grad-gold);
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 72%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  box-shadow: 0 0 8px rgba(245, 194, 74, 0.5);
  border-radius: 2px;
}
.ej-chip span {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
}

@media (max-width: 900px) {
  .ej-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .ej-chips {
    grid-template-columns: 1fr;
  }
}

/* ============================
   4) Offers Grid
============================= */
.ej-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 24px 20px 10px;
}
.ej-grid:has(.ej-card:nth-child(2)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 920px) {
  .ej-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Card */
.ej-card {
  --b: 1.4px;
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  background: var(--ej-surface);
  border-radius: var(--ej-rad-3);
  padding: 18px;
  box-shadow: var(--ej-shadow-soft);
  isolation: isolate;
  overflow: visible;
}
.ej-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: var(--b);
  background: linear-gradient(
    120deg,
    rgba(255, 231, 168, 0.55),
    rgba(245, 194, 74, 0.45),
    rgba(230, 169, 58, 0.35)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  filter: blur(0.4px);
}
.ej-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  z-index: -2;
  background: radial-gradient(
      820px 280px at 10% -40%,
      rgba(245, 194, 74, 0.13),
      transparent 60%
    ),
    radial-gradient(
      720px 240px at 110% 120%,
      rgba(208, 90, 90, 0.12),
      transparent 65%
    );
  opacity: 0.9;
}
.ej-card--prime {
  background: var(--ej-grad-panel);
}

/* Badge & order */
.ej-badge {
  position: absolute;
  left: 62px;
  top: 0;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--ej-bg);
  color: var(--ej-text);
  font-weight: 800;
  letter-spacing: 0.2px;
}
.ej-order {
  position: absolute;
  top: 0;
  left: 20px;
  z-index: 2;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Gloock", ui-serif, Georgia, serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--ej-bg-2);
  background: var(--ej-grad-gold);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 8px 18px rgba(245, 194, 74, 0.25);
}
.ej-grid:has(.ej-card:nth-child(2)) .ej-card:not(:first-child) .ej-badge {
  display: none;
}

/* Card layout */
.ej-card__aside {
  display: grid;
  align-content: start;
  gap: 14px;
}
.ej-card__main {
  display: grid;
  align-content: center;
  text-align: center;
  gap: 10px;
}

.ej-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--ej-rad-2);
  padding: 16px;
  min-height: 80px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.ej-logo-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(245, 194, 74, 0.3),
    0 0 24px rgba(245, 194, 74, 0.2);
  filter: saturate(1.05);
}
.ej-logo {
  width: clamp(150px, 18vw, 230px);
  height: auto;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.46));
}

/* Metrics */
.ej-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(auto, 1fr));
  gap: 12px;
  width: 100%;
}
.ej-metric {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--ej-rad-2);
  padding: 12px;
}
.ej-metric h3 span {
  font-size: 1.18rem;
  color: var(--ej-gold-1);
  text-shadow: 0 0 8px rgba(255, 231, 168, 0.32);
}
.ej-metric p {
  color: var(--ej-text-muted);
  margin-bottom: 6px;
}
/* metric icons (for Retrait/RTP) */
.ej-ico {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  background: var(--ej-grad-gold);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(245, 194, 74, 0.35);
}
.ej-ico--timer {
  position: relative;
}
.ej-ico--timer::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 2px;
  background: #0b0a10;
  top: 0;
  left: calc(50% - 3px);
  border-radius: 2px;
  opacity: 0.9;
}
.ej-ico--timer::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 6px;
  background: #0b0a10;
  top: 3px;
  left: calc(50% - 1px);
  transform: rotate(25deg);
  border-radius: 1px;
  opacity: 0.9;
}
.ej-ico--rtp {
  background: conic-gradient(from 270deg, #ffe8a8 0 60%, #e6a93a 60% 100%);
  position: relative;
}
.ej-ico--rtp::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--ej-bg);
  border-radius: 50%;
}

.ej-stars {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
}
.ej-star {
  position: relative;
  width: 14px;
  height: 14px;
  background: var(--ej-grad-gold);
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 72%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  box-shadow: 0 0 10px rgba(255, 231, 168, 0.4),
    0 0 18px rgba(230, 169, 58, 0.22);
}
.ej-star::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  top: 2px;
  left: 3px;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0) 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

/* Offer area */
.ej-subtitle {
  color: var(--ej-text-dim);
  font-weight: 800;
  letter-spacing: 0.25px;
  text-transform: uppercase;
  margin-bottom: 0;
}
.ej-offer {
  display: inline-block;
  font-weight: 900;
  font-size: clamp(1.1rem, 2.2vw, 1.65rem);
  color: var(--ej-text);
  padding: 6px 10px;
  text-decoration: none;
  background: var(--ej-grad-shine);
  border-radius: var(--ej-rad-1);
}

.ej-cta {
  --btn-pulse: drop-shadow(0 0 10px rgba(245, 194, 74, 0.45));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 900;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  color: #0b0a10;
  background: var(--ej-grad-gold);
  border: none;
  box-shadow: 0 8px 20px rgba(245, 194, 74, 0.18);
  transition: transform 0.16s ease, filter 0.2s ease, box-shadow 0.2s ease;
}
.ej-cta:hover {
  transform: translateY(-2px) scale(1.01);
  filter: var(--btn-pulse);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 24px rgba(245, 194, 74, 0.35);
  text-decoration: none;
}
.ej-cta:active {
  transform: translateY(0);
}

/* Responsive for cards */
@media (max-width: 920px) {
  .ej-grid:has(.ej-card:nth-child(2)) .ej-card {
    grid-template-columns: 1fr;
  }
  .ej-grid:has(.ej-card:nth-child(2)) .ej-card__aside {
    order: 1;
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }
  .ej-grid:has(.ej-card:nth-child(2)) .ej-card__main {
    order: 2;
    text-align: center;
    justify-items: center;
  }

  .ej-grid:not(:has(.ej-card:nth-child(2))) .ej-card {
    grid-template-columns: 1fr;
    padding: 30px 10px 10px 10px;
  }
  .ej-grid:not(:has(.ej-card:nth-child(2))) .ej-card__aside {
    order: 1;
    grid-column: auto;
    display: grid;
    align-content: start;
    gap: 8px;
  }
  .ej-grid:not(:has(.ej-card:nth-child(2))) .ej-card__main {
    order: 2;
    justify-self: center;
    width: 300px;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    justify-items: center;
    gap: 8px;
  }
}

@media (min-width: 921px) {
  /* single-card: aside items in one row */
  .ej-grid:not(:has(.ej-card:nth-child(2))) .ej-card {
    grid-template-columns: 1fr 320px;
    align-items: center;
  }
  .ej-grid:not(:has(.ej-card:nth-child(2))) .ej-card__aside {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 14px;
    flex-wrap: nowrap;
  }
  .ej-grid:not(:has(.ej-card:nth-child(2))) .ej-card__main {
    width: 320px;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
  }
}

/* ============================
   5) Info Sections
============================= */
.ej-section {
  padding: 18px 20px 64px;
}
.ej-section-heading {
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  margin: 18px 0 12px;
}
.ej-section-text {
  color: var(--ej-text-dim);
  max-width: 900px;
}

.ej-list li {
  margin: 10px 0;
  color: var(--ej-text);
}
.ej-list strong {
  color: var(--ej-gold-1);
  text-shadow: 0 0 10px rgba(255, 231, 168, 0.22);
}

.ej-link {
  color: var(--ej-amber);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(255, 215, 122, 0.5);
  text-underline-offset: 2px;
}

.ej-sep {
  height: 1px;
  margin: 28px 0;
  background: linear-gradient(
    90deg,
    rgba(255, 231, 168, 0.22),
    rgba(208, 90, 90, 0.22)
  );
}

/* ============================
   6) Footer
============================= */
.ej-footer {
  background: linear-gradient(
    180deg,
    rgba(14, 10, 24, 0.2),
    rgba(14, 10, 24, 0.7)
  );
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 28px 0;
}
.ej-footer__content {
  display: grid;
  gap: 16px;
}
.ej-footer__partners {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}
.ej-partner-logo {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--ej-rad-2);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}
.ej-partner-logo:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(245, 194, 74, 0.3),
    0 0 24px rgba(245, 194, 74, 0.22);
}
.ej-partner-logo img {
  max-height: 36px;
  width: auto;
}

.ej-footer__disclaimer {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--ej-rad-2);
  padding: 14px;
}
.ej-disclaimer-text {
  color: var(--ej-text-muted);
}

.ej-footer__nav {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 14px;
}
.ej-nav-link {
  color: var(--ej-text);
  opacity: 0.92;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.ej-nav-link[aria-current="page"] {
  outline: 2px solid rgba(245, 194, 74, 0.55);
  outline-offset: 2px;
}
.ej-nav-link:hover {
  opacity: 1;
  text-decoration: none;
  box-shadow: 0 0 0 1px rgba(245, 194, 74, 0.35),
    0 0 24px rgba(245, 194, 74, 0.2);
}

@media (max-width: 780px) {
  .ej-footer__partners {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ej-footer__nav {
    grid-auto-flow: row;
  }
}

/* ============================
   7) Micro-interactions / Animations
============================= */
@keyframes ej-glow-loop {
  0%,
  100% {
    box-shadow: 0 0 8px rgba(245, 194, 74, 0.25),
      0 0 18px rgba(208, 90, 90, 0.18);
  }
  50% {
    box-shadow: 0 0 14px rgba(245, 194, 74, 0.45),
      0 0 26px rgba(208, 90, 90, 0.26);
  }
}

/* Lift on hover */
.ej-card:hover {
  transform: translateY(-2px);
  transition: transform 0.18s ease;
}

/* Stars shimmer */
@keyframes ej-shimmer {
  0% {
    opacity: 0.78;
    filter: drop-shadow(0 0 3px rgba(255, 231, 168, 0.22));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 7px rgba(255, 231, 168, 0.45));
  }
  100% {
    opacity: 0.78;
    filter: drop-shadow(0 0 3px rgba(255, 231, 168, 0.22));
  }
}
.ej-stars .ej-star:nth-child(odd) {
  animation: ej-shimmer 2.6s ease-in-out infinite;
}
.ej-stars .ej-star:nth-child(even) {
  animation: ej-shimmer 3.1s ease-in-out infinite;
}

/* Button pulse attention utility */
.ej-cta[aria-describedby] {
  animation: ej-glow-loop 3.4s ease-in-out infinite;
}

/* ============================
   8) Utilities
============================= */
.ej-hidden {
  display: none !important;
}
.ej-visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Small viewport tweaks */
@media (max-width: 580px) {
  .ej-hero {
    padding: 24px 0;
  }
  .ej-card {
    padding: 24px 10px 10px 10px;
  }
  .ej-chips {
    display: none;
  }
  .ej-hero__intro {
    margin: 0 auto;
    font-size: 0.92rem;
  }
  .main-heading {
    font-size: 24px;
  }
}
