/* ============================================
   Jacado Games - Main Stylesheet
   Casual puzzle-game look & feel inspired by
   Capybara Games: happy, rounded, organic shapes,
   wavy section edges, sticker cards, playful motion.
   ============================================ */

/* --- CSS Variables --- */
:root {
  --color-blue: #2C9CF0;
  --color-blue-dark: #1C7FD6;
  --color-yellow: #FFC83D;
  --color-yellow-dark: #F2B417;
  --color-coral: #FF8FA3;
  --color-mint: #46D6C3;
  --color-purple: #9C8CF6;

  --color-primary: #2C9CF0;
  --color-primary-dark: #1C7FD6;
  --color-secondary: #FFC83D;
  --color-secondary-dark: #F2B417;
  --color-accent-yellow: #FFC83D;

  --color-dark: #243049;
  --color-text: #2C3A4F;
  --color-text-light: #6B7A8D;
  --color-bg: #FFFFFF;
  --color-bg-sky: #E9F4FE;
  --color-bg-warm: #FFF6E6;
  --color-border: #E3ECF5;
  --color-footer-bg: #1C7FD6;
  --color-footer-text: #FFFFFF;

  --font-primary: 'Montserrat', 'Segoe UI', Tahoma, sans-serif;
  --font-heading: 'Fredoka', 'Segoe UI', sans-serif;

  --shadow-card: 0 16px 34px rgba(28, 90, 160, 0.16);
  --shadow-card-hover: 0 24px 46px rgba(28, 90, 160, 0.24);
  --shadow-pop: 0 18px 40px rgba(28, 90, 160, 0.28);

  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 34px;
  --radius-pill: 999px;

  --max-width: 1200px;
  --header-height: 78px;
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background-color: var(--color-bg-sky);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

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

ul {
  list-style: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1;
  letter-spacing: 0.3px;
  color: var(--color-blue-dark);
}

/* --- Header / Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-bg);
  height: var(--header-height);
}

/* Wavy organic bottom edge */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201440%2060'%20preserveAspectRatio='none'%3E%3Cpath%20fill='%23FFFFFF'%20d='M0,0%20H1440%20V28%20C1200,58%20960,58%20720,33%20C480,8%20240,8%200,33%20Z'/%3E%3C/svg%3E") center top / 100% 100% no-repeat;
  filter: drop-shadow(0 8px 7px rgba(28, 90, 160, 0.10));
  pointer-events: none;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-area img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  transition: transform 0.3s var(--ease-bounce);
}

.logo-area:hover img {
  transform: rotate(-10deg) scale(1.1);
}

.logo-area .site-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-blue);
  letter-spacing: 0.3px;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  display: inline-block;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1rem;
  color: var(--color-text);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease-bounce);
}

.main-nav a:hover {
  color: var(--color-blue-dark);
  background: var(--color-bg-sky);
  transform: translateY(-2px) rotate(-2deg);
}

.main-nav a.active {
  color: #fff;
  background: var(--color-blue);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--color-blue);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.3s ease;
}

/* --- Main Content --- */
main {
  flex: 1;
  position: relative;
  z-index: 1;
}

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

/* --- Page Hero Section --- */
.page-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 76px 24px 60px;
}

.page-hero::before,
.page-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.page-hero::before {
  width: 260px;
  height: 260px;
  background: var(--color-yellow);
  opacity: 0.35;
  top: -110px;
  left: -70px;
}

.page-hero::after {
  width: 300px;
  height: 300px;
  background: var(--color-mint);
  opacity: 0.28;
  bottom: -150px;
  right: -90px;
}

.page-hero h1 {
  position: relative;
  z-index: 1;
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--color-blue-dark);
  margin-bottom: 22px;
  display: inline-block;
}

.page-hero h1::after {
  content: "";
  display: block;
  width: 64%;
  height: 10px;
  margin: 14px auto 0;
  border-radius: var(--radius-pill);
  background: var(--color-yellow);
}

.page-hero p {
  position: relative;
  z-index: 1;
  font-size: 1.12rem;
  color: var(--color-text-light);
  max-width: 620px;
  margin: 0 auto;
}

/* --- Game Cards Grid --- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  padding: 20px 0 60px;
}

.game-card {
  position: relative;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.3s ease, transform 0.3s var(--ease-bounce), border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.game-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-8px) rotate(-1deg);
  border-color: var(--color-yellow);
}

.game-card img {
  width: 92px;
  height: 92px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  transition: transform 0.3s var(--ease-bounce);
}

.game-card:hover img {
  transform: rotate(8deg) scale(1.08);
}

.game-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-blue-dark);
  margin-bottom: 10px;
}

.game-card p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.game-card .btn {
  margin-top: auto;
}

.game-card-platforms {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.platform-badge {
  display: inline-block;
  background: var(--color-bg-sky);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--color-blue-dark);
}

.game-card--coming-soon {
  border-style: dashed;
  border-color: #C7D7E6;
  background: rgba(255, 255, 255, 0.6);
  opacity: 0.85;
}

.coming-soon-icon {
  width: 92px;
  height: 92px;
  border-radius: var(--radius-md);
  background: var(--color-bg-sky);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-blue);
  margin-bottom: 18px;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  transition: transform 0.18s var(--ease-bounce), box-shadow 0.18s ease, background 0.2s ease;
}

.btn-primary {
  background: var(--color-blue);
  color: #fff;
  box-shadow: 0 6px 0 var(--color-blue-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--color-blue-dark);
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--color-blue-dark);
}

.btn-secondary {
  background: var(--color-yellow);
  color: var(--color-dark);
  box-shadow: 0 6px 0 var(--color-yellow-dark);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--color-yellow-dark);
}

.btn-secondary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--color-yellow-dark);
}

.btn-outline {
  background: #fff;
  color: var(--color-blue-dark);
  box-shadow: 0 0 0 2px var(--color-blue) inset;
}

.btn-outline:hover {
  background: var(--color-blue);
  color: #fff;
  transform: translateY(-2px);
}

/* --- Hall of Fame --- */
.hof-game-selector {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px 0 30px;
}

.hof-game-btn {
  padding: 10px 24px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: #fff;
  font-family: var(--font-heading);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease-bounce);
}

.hof-game-btn:hover,
.hof-game-btn.active {
  border-color: var(--color-blue);
  background: var(--color-blue);
  color: #fff;
  transform: translateY(-2px) rotate(-1.5deg);
}

.hof-table {
  width: 100%;
  max-width: 720px;
  margin: 0 auto 60px;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: #fff;
}

.hof-table thead {
  background: var(--color-blue);
  color: #fff;
}

.hof-table th,
.hof-table td {
  padding: 15px 22px;
  text-align: left;
}

.hof-table th {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.4px;
}

.hof-table tbody tr {
  transition: background 0.2s ease;
}

.hof-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--color-border);
}

.hof-table tbody tr:hover {
  background: var(--color-bg-warm);
}

.hof-table tbody tr:nth-child(even) {
  background: var(--color-bg-sky);
}

.hof-table tbody tr:nth-child(even):hover {
  background: var(--color-bg-warm);
}

.hof-rank {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-yellow-dark);
}

/* --- Featured Game (Home) --- */
.featured-game {
  position: relative;
  overflow: hidden;
  padding: 80px 0 96px;
}

.featured-game::before,
.featured-game::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.featured-game::before {
  width: 300px;
  height: 300px;
  background: var(--color-yellow);
  opacity: 0.4;
  top: -90px;
  left: -80px;
}

.featured-game::after {
  width: 340px;
  height: 340px;
  background: var(--color-coral);
  opacity: 0.32;
  bottom: -120px;
  right: -90px;
}

.featured-game .container {
  position: relative;
  z-index: 1;
}

.featured-game-card {
  position: relative;
  max-width: 660px;
  margin: 0 auto;
  background: linear-gradient(150deg, var(--color-blue) 0%, var(--color-blue-dark) 100%);
  border: 6px solid #fff;
  border-radius: var(--radius-lg);
  padding: 54px 46px;
  box-shadow: var(--shadow-pop);
  color: #fff;
  text-align: center;
}

.featured-game-card img {
  width: 132px;
  height: 132px;
  margin: 0 auto 26px;
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  animation: float 4s ease-in-out infinite;
}

.featured-game-card h2 {
  font-size: 2.6rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
}

.featured-game-card p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 28px;
  font-size: 1.06rem;
  line-height: 1.7;
}

.featured-game-card .btn-primary {
  background: var(--color-yellow);
  color: var(--color-dark);
  box-shadow: 0 6px 0 var(--color-yellow-dark);
}

.featured-game-card .btn-primary:hover {
  background: var(--color-yellow);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--color-yellow-dark);
}

.featured-badge {
  display: inline-block;
  background: var(--color-yellow);
  color: var(--color-dark);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  margin-bottom: 22px;
  letter-spacing: 0.4px;
  transform: rotate(-3deg);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* --- Footer --- */
.site-footer {
  position: relative;
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 64px 24px 30px;
  margin-top: auto;
  z-index: 1;
}

/* Wavy organic top edge */
.site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -22px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201440%2060'%20preserveAspectRatio='none'%3E%3Cpath%20fill='%231C7FD6'%20d='M0,60%20H1440%20V32%20C1200,2%20960,2%20720,27%20C480,52%20240,52%200,27%20Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
  pointer-events: none;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}

.footer-links a {
  color: var(--color-footer-text);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 400;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  transition: color 0.2s ease, background 0.2s ease;
}

.footer-links a:hover {
  color: var(--color-blue-dark);
  background: var(--color-yellow);
}

.footer-links .separator {
  color: rgba(255, 255, 255, 0.5);
  user-select: none;
}

.footer-credit {
  font-size: 0.9rem;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: var(--color-footer-text);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s var(--ease-bounce);
}

.footer-social a:hover {
  background: var(--color-yellow);
  color: var(--color-dark);
  transform: rotate(10deg) scale(1.2);
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-copyright {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
}

/* --- Motion preferences --- */
@media (prefers-reduced-motion: reduce) {
  .featured-game-card img {
    animation: none;
  }
  * {
    scroll-behavior: auto;
  }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 260px;
    height: calc(100vh - var(--header-height));
    background: #fff;
    box-shadow: -8px 0 30px rgba(28, 90, 160, 0.18);
    transition: right 0.3s ease;
    padding: 24px;
    z-index: 999;
  }

  .main-nav.open {
    right: 0;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
  }

  .main-nav a {
    display: block;
    padding: 12px 16px;
    text-align: center;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .page-hero h1 {
    font-size: 2.2rem;
  }

  .featured-game-card {
    padding: 38px 26px;
  }

  .featured-game-card h2 {
    font-size: 1.9rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 4px;
  }

  .footer-links .separator {
    display: none;
  }
}
