/* Core theme variables */
:root {
  --bg: #271A1A;
  --panel: #1b1516;
  --panel-2: #221a1c;
  --text: #ffffff;
  --muted: #cfc7c7;
  --accent: #f6c343;
  --accent-2: #f47e2d;
  --success: #5fd27b;
  --shadow: rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-lg: 22px;
  --gap: 20px;
  --maxw: 1180px;
}

/* Resets */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: Inter, Segoe UI, system-ui, -apple-system, Helvetica, Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  max-width: 1280px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  font-weight: 700;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px var(--shadow);
}
.btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: #d64d43;
  color: #ffffff;
}

#signupBtn {
  background: var(--accent) !important;
  color: #2a1b12;
}
.btn-secondary {
  background: #d64d43;
  border-color: #d64d43;
  color: #ffffff;
}
.btn.ghost {
  background: #d64d43;
  border-color: #d64d43;
  color: #ffffff;
}

/* Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}
.nav-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
  justify-content: space-between;
}
.logo img {
  width: 120px;
  height: auto;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.9;
}
.site-nav .auth {
  display: flex;
  gap: 10px;
  margin-left: 6px;
  align-items: center;
}

.nav-toggle {
  display: none;
}

@media (max-width: 768px) {
  .nav-wrap {
    flex-wrap: wrap;
    gap: 16px;
  }
  .nav-toggle {
    display: inline-block;
    background: transparent;
    border: 0;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
  }
  .nav-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  .site-nav {
    order: 3;
    width: 100%;
    flex-direction: column;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
  }
  .site-nav[aria-expanded='true'],
  .site-nav.open {
    display: flex;
  }
  .site-nav a {
    display: block;
    padding: 12px 0;
    font-size: 1.1rem;
    border-radius: 8px;
    transition: background 0.2s ease;
  }
  .site-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 16px;
  }
  .site-nav .auth {
    flex-direction: column;
    gap: 12px;
    margin: 16px 0 0 0;
    width: 100%;
  }
  .site-nav .auth .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 14px 16px;
    font-size: 1rem;
  }
}

/* Hero */
.hero {
  background: url('assets/img/hero-bg.jpg') center/cover no-repeat;
  position: relative;
  color: var(--text);
  padding: 80px 0 0 0;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.55),
    rgba(0, 0, 0, 0.15)
  );
}
.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 40px;
}
.hero-text {
  flex: 1;
}
.hero-text h1 {
  font-size: 3rem;
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: 0.04em;
}
.hero-text p {
  color: var(--muted);
  max-width: 46ch;
}
.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
}
.hero-image img {
  width: min(520px, 100%);
  height: auto;
}

@media (max-width: 992px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
  }
}

/* Sections */
.section-title {
  font-size: 1.8rem;
  color: var(--accent);
  margin: 0 0 6px;
  text-align: center;
}
.section-subtitle {
  color: var(--muted);
  text-align: center;
  margin: 0 0 26px;
}

/* Games grid */
.games {
  padding: 50px 0;
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
@media (max-width: 992px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
}

.game-card {
  background: var(--panel-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.game-card:hover,
.game-card:focus {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px var(--shadow);
  outline: none;
}
.game-card img {
  width: 100%;
  object-fit: cover;
}
.game-card__meta {
  background: var(--accent);
  padding: 12px 14px;
  text-align: center;
}
.game-card__meta h3 {
  margin: 0;
  font-size: 1rem;
  color: #2a1b12;
  font-weight: 600;
}

/* Games grid overlay for 4+ games */
.games-grid {
  position: relative;
}

.games-overlay {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(39, 26, 26, 0.90);
  z-index: 10;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
}

.overlay-content {
  color: white;
  font-size: 2rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Games page overlay - covers more area since there are more games */
.games-page-overlay {
  top: 33.33%; /* Start after first 4 games (4/12 = 33.33%) */
}

/* Locked games styling */
.game-card.locked {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Leaderboard */
.leaderboard {
  background: url('assets/img/winners-bg.jpg') center/cover no-repeat;
  position: relative;
  padding: 60px 0;
  color: var(--text);
}
.leaderboard::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.leaderboard-content {
  position: relative;
  z-index: 1;
  text-align: center;
}
.leaderboard h2 {
  font-size: 1.8rem;
  margin: 0 0 10px;
  color: var(--accent);
}
.leaderboard p {
  margin: 0 0 32px;
  color: var(--muted);
}
.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 760px;
}
.leaderboard-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  padding: 14px 20px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  gap: 12px;
}
.leaderboard-list .badge {
  width: 40px;
  height: auto;
  flex-shrink: 0;
}
.username,
.game,
.points {
  flex: 1;
  text-align: center;
}
.username {
  font-weight: 700;
}
.points {
  font-weight: 700;
  color: var(--accent);
}

/* Features */
.features {
  padding: 60px 0;
  text-align: center;
}

.features h2 {
  color: var(--accent);
  font-size: 1.8rem;
  margin: 0 0 10px;
}
.features > .features-inner > p {
  color: var(--muted);
  margin: 0 0 40px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
.feature-item img {
  max-width: 60px;
  margin: 0 auto 12px;
}
.feature-item p {
  font-size: 0.95rem;
  color: var(--text);
  margin: 0;
}

@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* No Purchase */
.no-purchase {
  position: relative;
  background: url('assets/img/no-purchase-bg.jpg') center/cover no-repeat;
  padding: 64px 0;
  color: var(--text);
  overflow: hidden;
}
.no-purchase::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.no-purchase__inner {
  position: relative;
  z-index: 1;
  text-align: center;
}
.no-purchase h2 {
  margin: 0 0 10px;
  font-size: 1.9rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.no-purchase p {
  margin: 0 auto 22px;
  max-width: 720px;
  color: var(--muted);
}

/* Footer */
.site-footer {
  padding: 28px 0;
}

/* Footer top section with bordered links */
.footer-top {
  margin-bottom: 30px;
}

.footer-logo {
  text-align: center;
  margin-bottom: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-logo img {
  width: 120px;
  height: auto;
  object-fit: contain;
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0;
  padding: 20px;
  justify-content: center;
  border: 1px solid #cfc7c7;
  border-radius: 20px;
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.footer-links a {
  color: #cfc7c7;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-description {
  text-align: center;
  color: #cfc7c7;
  font-size: 0.8rem;
  margin: 30px auto 0 auto;
  max-width: 600px;
  padding: 0 20px;
  opacity: 0.8;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #2a2224;
  flex-wrap: wrap;
}

.footer-left .copyright {
  color: #cfc7c7;
  font-size: 0.9rem;
}

.footer-center .gamble-aware {
  display: flex;
  align-items: center;
  gap: 15px;
}

.age-icon {
  width: 35px;
  height: 35px;
  object-fit: contain;
}

.gaware-logo {
  max-height: 35px;
  width: auto;
  object-fit: contain;
}

.gamble-aware a {
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.gamble-aware a:hover {
  opacity: 0.8;
}

.footer-right .no-money {
  color: #cfc7c7;
  font-size: 0.9rem;
}

/* Responsive footer */
@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .footer-links {
    gap: 15px;
  }

  .footer-links li a {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

/* About Us section */
.about-us {
  padding: 60px 0;
}

@media (min-width: 769px) {
  .about-us {
    padding: 60px 0 0 0;
  }
}

.about-content {
  display: flex;
  align-items: center;
  gap: 60px;
}

.about-image {
  flex: 1;
  display: flex;
  justify-content: center;
}

.about-image img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.about-text {
  flex: 1;
}

.about-text h2 {
  color: var(--accent);
  font-size: 2.5rem;
  margin: 0 0 20px;
  font-weight: bold;
}

.about-text p {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0 0 16px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* Responsive about section */
@media (max-width: 768px) {
  .about-content {
    flex-direction: column;
    gap: 40px;
    text-align: center;
  }

  .about-text h2 {
    font-size: 2rem;
  }

  .about-text p {
    font-size: 1rem;
  }
}

/* Contact Form */
.contact-form {
  padding: 60px 0;
  text-align: center;
}

.contact-form h2 {
  color: var(--accent);
  font-size: 2.5rem;
  margin: 0 0 16px;
  font-weight: bold;
}

.contact-subtitle {
  color: var(--text);
  font-size: 1.1rem;
  margin: 0 0 40px;
}

.contact-form-container {
  max-width: 600px;
  margin: 0 auto;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  flex: 1;
  text-align: left;
}

.form-group label {
  display: block;
  color: #000;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: #ffffff !important;
  color: #000000 !important;
  font-size: 1rem;
  box-sizing: border-box;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form-container .btn {
  margin-top: 20px;
  padding: 14px 32px;
  font-size: 1.1rem;
}

.confirmation-message {
  margin-top: 30px;
  padding: 30px;
  background: rgba(95, 214, 123, 0.1);
  border: 1px solid #5fd67b;
  border-radius: 12px;
  color: var(--text);
}

.confirmation-message h3 {
  color: #5fd67b;
  margin: 0 0 12px;
  font-size: 1.5rem;
}

.confirmation-message p {
  margin: 0;
  color: var(--muted);
}

/* Responsive contact form */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .contact-form h2 {
    font-size: 2rem;
  }

  .contact-form-container .btn {
    width: 100%;
  }
}

/* Terms and Privacy Content */
.terms-content,
.privacy-content {
  padding: 60px 0;
}

.terms-content h2,
.privacy-content h2 {
  color: var(--accent);
  font-size: 2.5rem;
  margin: 0 0 30px;
  text-align: center;
  font-weight: bold;
}

.terms-text,
.privacy-text {
  max-width: 800px;
  margin: 0 auto;
}

.terms-text h3,
.privacy-text h3 {
  color: var(--text);
  font-size: 1.4rem;
  margin: 30px 0 15px;
  font-weight: 600;
}

.terms-text p,
.privacy-text p {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0 0 20px;
}

.terms-text p:first-of-type,
.privacy-text p:first-of-type {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 25px;
}

/* Responsive terms and privacy */
@media (max-width: 768px) {
  .terms-content h2,
  .privacy-content h2 {
    font-size: 2rem;
  }

  .terms-text h3,
  .privacy-text h3 {
    font-size: 1.2rem;
  }

  .terms-text p,
  .privacy-text p {
    font-size: 1rem;
  }
}

/* Game page */
.game-page .game-main {
  padding: 30px 0 60px;
}

.game-container {
  padding: 0 20px;
  box-sizing: border-box;
}

.game-title {
  margin: 6px 0 16px;
}
.game-container .iframe-wrap {
  position: relative;
  width: 100%;
  max-width: 1024px;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px var(--shadow);
  margin: 0 auto;
}
.game-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.error {
  color: #ff6b6b;
  text-align: center;
  padding: 20px;
  font-size: 18px;
}

#loading {
  color: var(--text);
  text-align: center;
  padding: 20px;
  font-size: 18px;
}


/* Popup Styles */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.popup.active {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.popup.active .popup-content {
  transform: translateY(0);
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.popup-header h2 {
  margin: 0;
  color: var(--accent);
  font-size: 1.5rem;
}

.popup-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.popup-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #3a2d2f;
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input::placeholder {
  color: var(--muted);
}

.popup form .btn {
  width: 100%;
  margin-top: 8px;
}

.popup-switch {
  text-align: center;
  margin-top: 24px;
  color: var(--muted);
}

.popup-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.popup-switch a:hover {
  text-decoration: underline;
}

/* Checkbox styling */
.checkbox-group {
  margin-bottom: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #fff;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  width: fit-content;
}

.checkbox-label a {
  color: #fff;
  text-decoration: underline;
  transition: opacity 0.2s ease;
}

.checkbox-label a:hover {
  opacity: 0.8;
}

.checkbox-label a:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 2px;
}
