/* Base Reset & Global Styles */
* {
  box-sizing: inherit;
  max-width: 100vw;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  background-color: #020617; /* BG */
  color: #e2e8f0;
  line-height: 1.6;
}

main {
  flex: 1;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

img,
canvas,
iframe,
video,
svg {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  box-sizing: border-box;
}

/* Container */
.cabecd-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Theme Colors */
:root {
  --body-bg-color: #020617;
  --primary-color: #14b8a6; /* Teal */
  --accent-color: #8b5cf6; /* Violet */
  --text-color: #e2e8f0;
  --card-bg-color: rgba(255, 255, 255, 0.05);
  --footer-bg-color: rgba(0, 0, 0, 0.1);
  --header-bg-color: rgba(2, 6, 23, 0.7); /* Slightly transparent dark */
  --glass-overlay: rgba(0, 0, 0, 0.6);
  --frosted-glass: rgba(2, 6, 23, 0.4);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  margin-bottom: 1em;
  color: #ffffff;
}

h1 {
  font-size: 3rem;
  line-height: 1.2;
}

h2 {
  font-size: 2.5rem;
}

h3 {
  font-size: 2rem;
}

p {
  margin-bottom: 1em;
  font-size: 1.1rem;
  opacity: 0.9;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #ffffff;
}

/* Buttons */
.cabecd-btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  background-color: var(--primary-color);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cabecd-btn:hover {
  background-color: #ffffff;
  color: var(--primary-color);
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.4);
  transform: translateY(-2px);
}

/* Header */
.cabecd-header-l-c-r {
  background: var(--header-bg-color);
  backdrop-filter: blur(10px);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cabecd-logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.cabecd-logo svg {
  margin-right: 10px;
  fill: var(--primary-color);
}

.cabecd-logo span {
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cabecd-desktop-nav ul {
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.cabecd-desktop-nav a {
  color: #e2e8f0;
  font-weight: 700;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.cabecd-desktop-nav a:hover {
  color: var(--primary-color);
}

.cabecd-header-right {
  display: flex;
  align-items: center;
}

.cabecd-age-flag {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-right: 20px;
}

.cabecd-age-flag img {
  width: 20px !important; /* Override global img style */
  margin-right: 8px;
}

.cabecd-hamburger {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  font-size: 2rem;
  color: #ffffff;
  cursor: pointer;
}

.cabecd-mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.95);
  z-index: 2000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  backdrop-filter: blur(20px);
}

.cabecd-mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
}

.cabecd-mobile-menu li {
  margin-bottom: 20px;
}

.cabecd-mobile-menu a {
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
  transition: color 0.3s ease;
}

.cabecd-mobile-menu a:hover {
  color: var(--primary-color);
}

.cabecd-close-menu {
  position: absolute;
  top: 30px;
  right: 30px;
  background: none;
  border: none;
  font-size: 2.5rem;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.cabecd-close-menu:hover {
  transform: rotate(90deg);
}

/* Footer */
.cabecd-footer {
  padding: 40px 20px;
  background: var(--footer-bg-color);
  margin-top: auto; /* Pushes footer to bottom */
  width: 100%;
}

.cabecd-footer ul {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.cabecd-footer a {
  color: #e2e8f0;
  font-size: 0.95em;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.cabecd-footer a:hover {
  opacity: 1;
  color: var(--primary-color);
}

.cabecd-footer-contact {
  margin-top: 20px;
  font-size: 0.85em;
  text-align: center;
  opacity: 0.85;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #ffffff;
}

.cabecd-footer h4 {
  margin: 0 0 8px 0;
  color: #ffcc00;
  font-size: 1.2em;
  font-weight: 700;
}

.cabecd-footer p {
  margin: 0;
  opacity: 0.9;
  font-size: 1em;
}

.cabecd-footer a[href*="gambleaware.org"] {
  text-decoration: underline;
  color: var(--primary-color); /* Match link color */
  font-weight: 700;
}

.cabecd-copyright {
  margin-top: 15px;
  text-align: center;
  font-size: 0.85em;
  opacity: 0.7;
}

.cabecd-copyright a {
  color: inherit;
  opacity: 0.8;
}

.cabecd-copyright a:hover {
  opacity: 1;
  color: var(--primary-color);
}

/* Content Section Styling */
.cabecd-content-section {
  padding: 80px 20px;
  line-height: 1.8;
  font-size: 1.1rem;
  text-align: justify;
  position: relative;
  z-index: 10;
}

.cabecd-content-section h2,
.cabecd-content-section h3 {
  text-align: center;
  color: var(--primary-color);
}

.cabecd-content-section p {
  max-width: 800px;
  margin: 20px auto;
}

/* Modular Containers */
.cabecd-section-container {
  background-color: var(--card-bg-color);
  border-radius: 24px;
  padding: 60px 30px;
  margin: 40px auto;
  max-width: 1200px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 1;
}

/* Hero Section: REVERSE-STACKED */
.cabecd-hero {
  display: flex;
  flex-wrap: wrap-reverse; /* Image below text on small screens, reverses on larger */
  justify-content: center;
  padding: 120px 5%;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  align-items: center; /* Vertically center content */
}

.cabecd-hero-image-container {
  flex: 1;
  min-width: 350px;
  max-width: 600px;
  z-index: 1;
  position: relative; /* For absolute positioning of overlay if needed */
  aspect-ratio: 1/1; /* Square aspect ratio */
  border-radius: 50%;
  border: 15px solid var(--body-bg-color);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
  margin-top: 40px; /* Add some space between text and image when reversed */
  overflow: hidden; /* Ensures image stays within rounded borders */
}

.cabecd-hero-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures image covers the area without distortion */
}

.cabecd-hero-text {
  flex: 1.5;
  min-width: 350px;
  padding-left: 50px;
  z-index: 2;
  text-align: left; /* Default text alignment */
}

.cabecd-hero-text h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cabecd-hero-text p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.95;
}

.cabecd-hero-text .cabecd-btn {
  font-size: 1.2rem;
  padding: 15px 30px;
}

/* Games Grid: BENTO-BOX-GRID */
.cabecd-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-auto-rows: 350px; /* Fixed height for rows */
  gap: 30px;
  margin: 60px auto;
  max-width: 1400px;
  padding: 0 20px;
}

.cabecd-game-card {
  background-color: var(--card-bg-color);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Align content to bottom */
  padding: 20px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.cabecd-game-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 35px 50px rgba(0, 0, 0, 0.25);
}

.cabecd-game-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%; /* Image covers the entire card */
  object-fit: cover; /* Ensure image fills the container */
  z-index: 1;
  border-radius: 24px; /* Match card radius */
}

.cabecd-game-card-overlay {
  position: relative;
  z-index: 2;
  padding: 15px;
  background: var(--glass-overlay); /* Semi-transparent dark background */
  backdrop-filter: blur(15px);
  border-radius: 15px; /* Slightly smaller radius than card */
  color: #ffffff;
  text-align: center;
  transition: background 0.3s ease;
}

.cabecd-game-card:hover .cabecd-game-card-overlay {
  background: var(--primary-color); /* Highlight on hover */
}

.cabecd-game-card-overlay h3 {
  margin-bottom: 5px;
  font-size: 1.3rem;
  color: #ffffff;
}

.cabecd-game-card-overlay p {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* Responsive adjustments for the Bento Grid */
@media (min-width: 768px) {
  .cabecd-game-card:first-child {
    grid-column: span 2;
    grid-row: span 2;
  }

  .cabecd-game-card:first-child .cabecd-game-card-overlay {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 30px;
  }

  .cabecd-game-card:first-child h3 {
    font-size: 2rem;
  }

  .cabecd-game-card:first-child p {
    font-size: 1.1rem;
  }

  /* Make the first image span correctly */
  .cabecd-game-card:first-child img {
    height: 100%;
  }
}

/* Responsive Header Adjustments */
@media (max-width: 992px) {
  .cabecd-desktop-nav {
    display: none; /* Hide desktop nav on smaller screens */
  }

  .cabecd-hamburger {
    display: block; /* Show hamburger icon */
  }

  .cabecd-hero-text {
    padding-left: 0;
    text-align: center;
    margin-bottom: 40px;
  }

  .cabecd-hero-image-container {
    margin-top: 0; /* Adjust spacing when text is above */
  }
}

/* General Responsive Adjustments */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .cabecd-hero {
    padding: 80px 5%;
    flex-direction: column; /* Stack elements vertically */
    text-align: center;
  }

  .cabecd-hero-image-container {
    max-width: 400px;
    width: 90%;
    margin: 20px auto 0 auto; /* Center image and adjust spacing */
  }

  .cabecd-hero-text {
    padding-left: 0;
  }

  .cabecd-game-grid {
    grid-template-columns: 1fr; /* Single column on small screens */
    grid-auto-rows: 300px; /* Adjust row height for single column */
  }

  .cabecd-game-card:first-child {
    grid-column: span 1;
    grid-row: span 1;
  }

  .cabecd-game-card:first-child .cabecd-game-card-overlay {
    padding: 15px;
  }

  .cabecd-game-card:first-child h3 {
    font-size: 1.5rem;
  }

  .cabecd-game-card:first-child p {
    font-size: 0.9rem;
  }

  .cabecd-footer ul {
    flex-direction: column;
    gap: 10px;
  }
}

/* Trust Signals Styling */
.cabecd-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  margin: 5px;
}

.cabecd-trust-badge svg {
  width: 18px;
  height: 18px;
  fill: var(--primary-color);
}

/* Added for specific footer elements to ensure layout */
.cabecd-footer > div > div:nth-of-type(2) {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 15px;
  margin-top: 15px;
  width: 100%;
}

.cabecd-footer > div > div:nth-of-type(3) {
  padding: 20px 0;
  margin-bottom: 15px;
  text-align: center;
  border-bottom: 2px dashed rgba(255,255,255,0.2);
  border-top: 2px dashed rgba(255,255,255,0.2);
}