/* ===== CSS Variables / Theme ===== */
:root {
  --green-dark: #1a3a0a;
  --green-mid: #2d5016;
  --green-light: #4a8c1c;
  --green-pale: #e8f5e0;
  --yellow: #f5d442;
  --yellow-light: #fff8dc;
  --orange: #ff6b35;
  --pink: #ff69b4;
  --purple: #9b59b6;
  --white: #ffffff;
  --off-white: #fafafa;
  --gray-light: #f0f0f0;
  --gray: #666;
  --gray-dark: #333;
  --black: #111;
  --font: 'Outfit', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--gray-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== Utility ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.loading {
  text-align: center;
  color: var(--gray);
  font-style: italic;
  padding: 40px;
}

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 30px;
  background: rgba(26, 58, 10, 0.95);
  backdrop-filter: blur(10px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.snake-icon {
  font-size: 1.5rem;
}

.brand-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: 2px;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-link {
  color: var(--white);
  font-weight: 400;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--yellow);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--yellow);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 50%, var(--green-light) 100%);
  position: relative;
  overflow: hidden;
  padding: 80px 20px;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245, 212, 66, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 15px;
}

.title-line {
  display: block;
}

.title-line.accent {
  color: var(--yellow);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
  font-weight: 300;
}

.hero-tagline {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 30px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.1rem;
}

.btn-primary {
  background: var(--yellow);
  color: var(--green-dark);
}

.btn-primary:hover {
  background: #e6c53a;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-accent {
  background: var(--orange);
  color: var(--white);
}

.btn-accent:hover {
  background: #e55a2b;
  transform: translateY(-2px);
}

.btn-white {
  background: var(--white);
  color: var(--green-dark);
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ===== Sections ===== */
.section {
  padding: 80px 0;
}

.section-light {
  background: var(--off-white);
}

.section-dark {
  background: var(--green-dark);
  color: var(--white);
}

.section-accent {
  background: linear-gradient(135deg, var(--green-light), var(--green-mid));
  color: var(--white);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 15px;
}

.section-dark .section-title {
  color: var(--yellow);
}

.section-desc {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 40px;
  opacity: 0.85;
  font-size: 1.05rem;
}

/* ===== Event Card ===== */
.event-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.event-card h3 {
  font-size: 1.5rem;
  color: var(--green-mid);
  margin-bottom: 15px;
}

.event-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
  font-size: 1.1rem;
}

.event-detail .icon {
  font-size: 1.3rem;
}

/* ===== Forms ===== */
.form {
  max-width: 700px;
  margin: 0 auto;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.9;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  transition: var(--transition);
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--yellow);
  background: rgba(255, 255, 255, 0.15);
}

.form-group select option {
  background: var(--green-dark);
  color: var(--white);
}

.section-light .form-group input,
.section-light .form-group select {
  background: var(--white);
  border-color: #ddd;
  color: var(--gray-dark);
}

.section-light .form-group input::placeholder {
  color: var(--gray);
}

.section-light .form-group input:focus,
.section-light .form-group select:focus {
  border-color: var(--green-light);
}

.form-message {
  margin-top: 15px;
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
  display: none;
}

.form-message.success {
  display: block;
  background: rgba(74, 140, 28, 0.2);
  color: #4a8c1c;
  border: 1px solid rgba(74, 140, 28, 0.3);
}

.form-message.error {
  display: block;
  background: rgba(255, 107, 53, 0.2);
  color: var(--orange);
  border: 1px solid rgba(255, 107, 53, 0.3);
}

.form-section-title {
  color: var(--yellow);
  font-size: 1.1rem;
  margin: 25px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.form-section-title:first-of-type {
  margin-top: 0;
}

/* Registration Toggle */
.reg-toggle {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 30px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.toggle-btn {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid var(--yellow);
  background: transparent;
  color: var(--yellow);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.toggle-btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.toggle-btn.active {
  background: var(--yellow);
  color: var(--green-dark);
}

.section-dark .form-message.success {
  color: var(--yellow);
}

/* ===== Score Submit Card ===== */
.score-submit-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}

.score-submit-card h3 {
  text-align: center;
  color: var(--green-mid);
  margin-bottom: 20px;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.form-inline .form-group {
  flex: 1;
  min-width: 150px;
}

.form-inline .btn {
  align-self: flex-end;
  margin-bottom: 0;
}

.scores-controls {
  text-align: center;
  margin-bottom: 30px;
}

.year-select {
  padding: 10px 20px;
  border: 2px solid var(--green-light);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  background: var(--white);
  cursor: pointer;
}

/* ===== Leaderboard ===== */
.leaderboard {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.leaderboard table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard th {
  background: var(--green-mid);
  color: var(--white);
  padding: 15px 20px;
  text-align: left;
  font-weight: 600;
}

.leaderboard td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--gray-light);
  color: var(--gray-dark);
}

.leaderboard tr:hover td {
  background: var(--green-pale);
}

.leaderboard .rank {
  font-weight: 800;
  color: var(--green-mid);
}

.leaderboard .rank-1 { color: var(--orange); font-size: 1.2rem; }
.leaderboard .rank-2 { color: var(--purple); }
.leaderboard .rank-3 { color: var(--pink); }

.leaderboard .empty {
  text-align: center;
  padding: 40px;
  color: var(--gray);
  font-style: italic;
}

/* ===== Photo Gallery ===== */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.photo-card {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.photo-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.photo-card .photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: var(--white);
  font-size: 0.9rem;
}

.photo-empty {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.6);
}

.photo-empty .emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 15px;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 2000;
  padding: 20px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: var(--radius-sm);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.lightbox-close:hover {
  color: var(--yellow);
}

.lightbox-caption {
  color: var(--white);
  margin-top: 15px;
  font-size: 1rem;
  opacity: 0.8;
}

/* ===== Contact ===== */
.contact-card {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.contact-card p {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.contact-note {
  font-size: 0.9rem !important;
  opacity: 0.7;
  margin-top: 20px !important;
}

.link-accent {
  color: var(--yellow);
  text-decoration: underline;
}

/* ===== Footer ===== */
.footer {
  background: var(--black);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 25px;
  font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--green-dark);
    flex-direction: column;
    padding: 20px 30px;
    gap: 15px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-inline {
    flex-direction: column;
  }

  .hero-title {
    font-size: 3rem;
  }

  .section {
    padding: 60px 0;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard {
    overflow-x: auto;
  }
}
