/* Page sections: video background, hero, landing/products/contact, auth, quiz. */
/* Background video layer */
.bg-video-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}
.bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
body.video-bg {
  background: transparent !important;
}
body.video-bg main,
body.video-bg main .section-padding,
body.video-bg main [style*="background-color: var(--section-bg)"] {
  background-color: transparent !important;
}

.main-over-video {
  position: relative;
  z-index: 0;
  /* Height from body flex (main fills to footer); padding for fixed navbar */
  padding-top: var(--navbar-height);
}

/* Hero: canvas, SVG overlay, section layout */
#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
#hero-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
/* Index page: hero container fills main so footer stays at viewport bottom */
.hero-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

#home .container-tight {
  position: relative;
  z-index: 2;
}
#home {
  position: relative;
  overflow: hidden;
  /* Fill available space (main = 100vh - footer) so footer stays at bottom of viewport */
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 0;
}
#home.primary-bg {
  background-color: #FFB74D;
}

/* Products, Contact (and About, Token): fill main so footer at viewport bottom; content centered */
#products,
#about,
#token,
#contact {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
}

/* Landing cards (products, contact) */
.products-content,
.contact-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 768px) {
  .products-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: stretch;
  }
  .products-content .landing-card:nth-child(3) {
    grid-column: 1 / -1;
  }
  .contact-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: stretch;
  }
}

.landing-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1.75rem;
  border-radius: 0.75rem;
  background-color: #3d3d3f !important;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  text-align: center;
  overflow: hidden;
}
.theme-light .landing-card {
  background-color: #f5f5f7 !important;
  color: #333333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.landing-card-info {
  flex: 0 0 auto;
  margin-bottom: 0;
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}
.landing-card-info + .landing-card-actions {
  margin-top: 1.25rem;
}
.landing-card-info + .landing-card-board {
  margin-top: 1rem;
}

.landing-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}
.landing-card-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
}
.landing-card-text:last-child {
  margin-bottom: 0;
}

.landing-card-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}
.landing-card-board {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.landing-card-board-inner {
  overflow-x: auto;
  border-radius: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
}

.landing-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  background-color: var(--card-bg);
  color: var(--card-text);
  min-width: 6rem;
}
.landing-card-text-with-buttons {
  line-height: 2.2;
}
.landing-card-button-inline {
  margin: 0 0.25em;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  min-width: auto;
  vertical-align: middle;
}

.landing-table {
  border-collapse: collapse;
  font-size: 0.875rem;
  width: 100%;
  min-width: 280px;
}
.landing-table th,
.landing-table td {
  padding: 0.5rem 0.75rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.landing-card .landing-table th {
  background-color: rgba(0, 0, 0, 0.2);
  font-weight: 600;
}
.theme-light .landing-card .landing-table th,
.theme-light .landing-card .landing-table td {
  border-color: rgba(0, 0, 0, 0.12);
}
.theme-light .landing-card .landing-table th {
  background-color: rgba(0, 0, 0, 0.06);
}
.landing-table-empty {
  text-align: center;
  font-style: italic;
  opacity: 0.9;
  padding: 1rem;
}

.landing-card .leaderboard-medal-gold { color: #ffd700 !important; }
.landing-card .leaderboard-medal-silver { color: #c0c0c0 !important; }
.landing-card .leaderboard-medal-bronze { color: #cd7f32 !important; }
.theme-light .landing-card .leaderboard-medal-gold { color: #daa520 !important; }
.theme-light .landing-card .leaderboard-medal-silver { color: #a8a8a8 !important; }
.theme-light .landing-card .leaderboard-medal-bronze { color: #b87333 !important; }

/* Quiz pages */
.quiz-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}
.quiz-section .quiz-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.quiz-section .quiz-form {
  width: 100%;
  max-width: 900px;
}
.quiz-actions {
  text-align: center;
  margin-top: 1.5rem;
}
.quiz-actions .card-button {
  margin-left: auto;
  margin-right: auto;
}

/* Game: visible selected-answer highlight (click and touch).
   Tailwind 2 CDN does not support has-[:checked], so we use plain CSS :has(). */
.game-options .game-option {
  position: relative;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.game-options .game-option:has(input:checked) {
  border-color: var(--card-bg) !important;
  background-color: rgba(255, 183, 77, 0.2) !important;
  box-shadow: 0 0 0 2px var(--card-bg);
}
.game-options .game-option:has(input:checked)::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background-color: var(--card-bg);
}

/* Auth card form controls */
.auth-card input,
.auth-card select,
.auth-card textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background-color: #FFFFFF;
  color: #333333;
}
.auth-card .errorlist {
  margin-top: 0.25rem;
  color: #7f1d1d;
  font-size: 0.875rem;
}

/* Light theme button overrides on primary-bg */
.theme-light .primary-bg .custom-button,
.theme-light .primary-bg .card-button,
.theme-light .card .card-button {
  background-color: #FFFFFF;
  color: #F47C00 !important;
}

/* Mobile overrides */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem 1.5rem;
  }
  .navbar img {
    height: 3rem;
    width: 3rem;
  }
  .logo-text {
    font-size: 1.5rem;
  }
  .text-5xl {
    font-size: 2.5rem;
  }
  .text-4xl {
    font-size: 2rem;
  }
  .text-2xl {
    font-size: 1.5rem;
  }
  .theme-toggle {
    margin-left: 1rem;
  }
  .center-cards-section,
  .center-cards-section.section-padding {
    padding-top: 8rem;
    padding-bottom: 1.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
