/* ===== HOME PAGE STYLES ===== */

:root {
  --ocean-blue: #1a6b8a;
  --deep-ocean: #0d3b4f;
  --sand: #f4e4c1;
  --gold: #ffd700;
  --pirate-brown: #5c3a21;
  --red-flag: #c0392b;
  --green-island: #27ae60;
  --white: #ffffff;
  --shadow: rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(180deg, var(--ocean-blue) 0%, var(--deep-ocean) 100%);
  min-height: 100vh;
  color: var(--white);
  overflow-x: hidden;
}

/* Header */
.home-header {
  text-align: center;
  padding: 50px 20px 30px;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, transparent 100%);
}

.header-content h1 {
  font-size: 3rem;
  color: var(--gold);
  text-shadow: 3px 3px 6px var(--shadow), 0 0 20px rgba(255, 215, 0, 0.3);
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 1.15rem;
  color: var(--sand);
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Top Navigation */
.top-nav {
  display: flex;
  justify-content: center;
  gap: 25px;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-link {
  color: var(--sand);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  color: var(--gold);
  background: rgba(255, 215, 0, 0.15);
}

/* Section Titles */
.section-title {
  text-align: center;
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px var(--shadow);
}

/* Games Section */
.games-section {
  padding: 40px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.game-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

/* Game Cards */
.game-card {
  background: rgba(92, 58, 33, 0.75);
  border-radius: 24px;
  padding: 35px 30px;
  box-shadow: 0 10px 40px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 215, 0, 0.2);
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-color: var(--gold);
}

.treasure-card {
  background: linear-gradient(135deg, rgba(92, 58, 33, 0.85), rgba(13, 59, 79, 0.6));
}

.direction-card {
  background: linear-gradient(135deg, rgba(26, 107, 138, 0.6), rgba(92, 58, 33, 0.75));
}

.learning-card {
  background: linear-gradient(135deg, rgba(45, 138, 78, 0.6), rgba(92, 58, 33, 0.75));
}

.card-icon {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 15px;
}

.game-card h3 {
  color: var(--gold);
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 12px;
}

.card-description {
  color: var(--sand);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 20px;
}

.card-features {
  list-style: none;
  margin-bottom: 25px;
  flex-grow: 1;
}

.card-features li {
  color: var(--white);
  font-size: 0.9rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.card-features li:last-child {
  border-bottom: none;
}

.play-btn {
  display: block;
  text-align: center;
  background: linear-gradient(135deg, var(--gold), #ffaa00);
  color: var(--pirate-brown);
  padding: 16px;
  border-radius: 14px;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
}

/* Instructions Section */
.instructions-section {
  padding: 50px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.instructions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.instruction-card {
  background: rgba(92, 58, 33, 0.7);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 8px 30px var(--shadow);
  border: 2px solid rgba(255, 215, 0, 0.15);
}

.instruction-card h3 {
  color: var(--gold);
  font-size: 1.4rem;
  margin-bottom: 18px;
  text-align: center;
}

.steps-list {
  list-style: none;
  counter-reset: step-counter;
}

.steps-list li {
  counter-increment: step-counter;
  padding: 10px 0 10px 45px;
  position: relative;
  color: var(--sand);
  font-size: 0.92rem;
  line-height: 1.5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.steps-list li:last-child {
  border-bottom: none;
}

.steps-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 8px;
  top: 10px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--gold), #ffaa00);
  color: var(--pirate-brown);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.steps-list li strong {
  color: var(--white);
}

.tip-box {
  background: rgba(255, 215, 0, 0.12);
  border-left: 4px solid var(--gold);
  padding: 14px 18px;
  margin-top: 18px;
  border-radius: 0 10px 10px 0;
  font-size: 0.9rem;
  color: var(--sand);
}

.tip-box strong {
  color: var(--gold);
}

/* Leaderboard Section */
.leaderboard-section {
  padding: 50px 20px;
  max-width: 700px;
  margin: 0 auto;
}

.leaderboard-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  justify-content: center;
}

.tab-btn {
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--sand);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  border-color: rgba(255, 215, 0, 0.4);
  color: var(--gold);
}

.tab-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(255, 215, 0, 0.15);
}

/* Recent Scores & Top Scores */
.recent-scores, .top-scores {
  background: rgba(92, 58, 33, 0.75);
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 8px 30px var(--shadow);
  border: 2px solid rgba(255, 215, 0, 0.15);
  margin-bottom: 25px;
}

.recent-scores h3, .top-scores h3 {
  color: var(--gold);
  text-align: center;
  margin-bottom: 18px;
  font-size: 1.2rem;
}

.leaderboard-list {
  list-style: none;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.leaderboard-entry:hover {
  background: rgba(0, 0, 0, 0.35);
}

.leaderboard-entry:nth-child(1) {
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid rgba(255, 215, 0, 0.4);
}

.leaderboard-entry:nth-child(2) {
  background: rgba(192, 192, 192, 0.15);
  border: 1px solid rgba(192, 192, 192, 0.3);
}

.leaderboard-entry:nth-child(3) {
  background: rgba(205, 127, 50, 0.15);
  border: 1px solid rgba(205, 127, 50, 0.3);
}

.rank {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--gold);
  font-size: 0.9rem;
}

.leaderboard-entry:nth-child(1) .rank {
  background: var(--gold);
  color: var(--pirate-brown);
}

.player-info {
  flex: 1;
}

.player-name {
  font-weight: 600;
  color: var(--white);
}

.player-details {
  font-size: 0.8rem;
  color: var(--sand);
  opacity: 0.7;
}

.player-score {
  font-weight: 700;
  color: var(--gold);
  font-size: 1.1rem;
}

/* Footer */
.home-footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--sand);
  opacity: 0.6;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 800px) {
  .header-content h1 {
    font-size: 2.2rem;
  }

  .game-cards-grid,
  .instructions-grid {
    grid-template-columns: 1fr;
  }

  .top-nav {
    gap: 10px;
    flex-wrap: wrap;
  }

  .nav-link {
    font-size: 0.9rem;
    padding: 6px 12px;
  }

  .leaderboard-tabs {
    flex-direction: column;
  }

  .tab-btn {
    width: 100%;
  }
}

@media (max-width: 500px) {
  .header-content h1 {
    font-size: 1.8rem;
  }

  .game-card {
    padding: 25px 20px;
  }

  .instruction-card {
    padding: 20px;
  }

  .recent-scores, .top-scores {
    padding: 18px;
  }
}
