/* BASE / RESET */
body {
  margin: 0;
  background: #090909;
  color: #f6f4ef;
  font-family: 'Courier New', monospace;
}

/* NAVIGATION */
/* Top nav buttons and link styling for the SPA header */
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 18px 20px 8px;
  margin: 0 auto;
  max-width: 1000px;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #f6f4ef;
  text-decoration: none;
  font-family: 'Courier New', monospace;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.nav-button:hover,
.nav-button:focus,
.nav-button.active {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
  border-color: #1585c2;
}

/* HEADER */
header {
  text-align: center;
  padding: 24px 20px 10px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.04em;
}

.title {
  font-family: 'Courier New', monospace;
  color: #f6f4ef;
  letter-spacing: 0.04em;
  text-align: center;
}

header p {
  margin: 0 auto;
  max-width: 860px;
  color: #c9c2b7;
  line-height: 1.75;
}

.header-wrapper {
  max-width: 950px;
  margin: 0 auto 40px;
  padding: 20px;
  border-radius: 18px;
  background-color: rgba(90, 133, 183, 0.104);
  backdrop-filter: blur(10px);
}

/* SEARCH BAR */
/* Search field inside the Home section */
.search-wrapper {
  display: flex;
  justify-content: center;
  margin: 16px auto 4px;
}


/* Games loaded text */
.games-loaded {
  margin: 20px auto 20px;
  max-width: 420px;
  color: #c9c2b7;
  font-size: 0.95rem;
  text-align: center;
  letter-spacing: 0.02em;
  opacity: 0.88;
}

#searchBar {
  width: 100%;
  max-width: 420px;
  padding: 10px 18px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 999px;
  color: #f6f4ef;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

#searchBar::placeholder {
  color: #555;
}

#searchBar:focus {
  border-color: #1585c2;
}

/* PAGE SECTION SHOW/HIDE */
/* Only the active section is visible at any time */
.page-section {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page-section.active {
  display: block;
}

/* SETTINGS / PARTNERS PANELS */
.settings-panel,
.partners-panel {
  max-width: 900px;
  margin: 0 auto 40px;
  padding: 24px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-panel h2,
.partners-panel h2 {
  margin-top: 0;
  color: #f6f4ef;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: #c9c2b7;
}

.partner-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.partner-list li {
  margin-bottom: 10px;
}

.partner-list a {
  color: #f6f4ef;
  text-decoration: none;
  border-bottom: 1px dashed rgba(246, 244, 239, 0.4);
}

.partner-list a:hover {
  color: #90caff;
}

/* GAME CARDS GRID */

/* Container and layout for the game cards on the Home section */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.cards-wrapper {
  max-width: 950px;
  margin: 0 auto 40px;
  padding: 20px;
  border-radius: 18px;
  background-color: rgba(90, 133, 183, 0.104);
  backdrop-filter: blur(10px);
}

/* INDIVIDUAL CARD */
.lesson-card {
  flex: 0 0 382px;
  min-width: 220px;
  max-width: 300px;
  aspect-ratio: 382 / 220;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.lesson-card:hover {
  box-shadow: 0 14px 30px rgba(21, 133, 194, 0.22);
}

.lesson-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.lesson-card:hover img {
  transform: scale(1.15);
}

/* CARD HOVER OVERLAY */
.card-overlay {
  position: absolute;
  inset: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.lesson-card:hover .card-overlay {
  opacity: 1;
}

.lesson-title {
  margin: 0;
  color: white;
  font-size: 1.2rem;
  text-align: center;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 20px;
  background: #090909;
  color: #c9c2b7;
  font-size: 0.9rem;
}

/* RESPONSIVE / MEDIA QUERIES */

/* Tablet: 2 cards per row */
@media (max-width: 940px) {
  .lesson-card {
    flex: 1 1 calc(50% - 20px);
  }
}

/* Mobile: 1 card per row */
@media (max-width: 620px) {
  .lesson-card {
    flex: 1 1 100%;
  }
}

/* Game Cards Animation */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}