/*
 * Geo-Date Advent Calendar Styles
 * 
 * THEME CUSTOMIZATION GUIDE:
 * ===========================
 * Adapted from the original advent calendar template for the geo-date guessing game.
 * 
 * COLOR PALETTE:
 * Updated for a travel/geography theme:
 * - Primary: Ocean Blue (#2563eb) - Main accent color
 * - Secondary: Adventure Orange (#f97316) - Secondary accent
 * - Light Blue: (#60a5fa) - Success/positive states
 * - Cream: (#fef3c7) - Background highlights
 * - Dark: (#1e293b) - Text and dark elements
 */

:root {
  /* Minimal Christmas Theme Colors */
  --christmas-red: #D42426;
  /* Classic Santa Red */
  --christmas-red-dark: #A61B1D;
  /* Deeper Red */
  --christmas-green: #2F5233;
  /* Deep Pine Green */
  --christmas-green-light: #4A7C59;
  /* Lighter Pine */
  --christmas-gold: #F1D302;
  /* Bright Gold */

  /* Neutral / Glass Palette */
  --snow-white: #F8F9FA;
  --ice-blue: #E8F4F8;
  --cream: #FDFAF6;

  /* Theme Mappings */
  --color-primary: var(--christmas-red);
  --color-primary-dark: var(--christmas-red-dark);
  --color-secondary: var(--christmas-green);
  --color-secondary-dark: var(--christmas-green-light);
  --color-accent: var(--christmas-gold);

  --color-background: #F0F4F8;
  /* Soft Ice Blue/Gray Background */
  --color-text: #2C3E50;
  /* Dark Slate */
  --color-text-light: #546E7A;

  --color-white: #ffffff;
  --color-gray-light: #E9ECEF;
  --color-gray: #DEE2E6;
  --color-gray-dark: #ADB5BD;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   RESET & BASE STYLES
   =========================== */

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

body {
  font-family: 'Outfit', 'Segoe UI', sans-serif;
  /* Cleaner modern font */
  background-color: var(--color-background);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.8) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.8) 0%, transparent 20%);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

/* ===========================
   CONTAINER & LAYOUT
   =========================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  min-height: 90vh;
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: filter 0.3s ease;
}

.container.blur-active {
  filter: blur(5px);
}

/* ===========================
   HEADER
   =========================== */

header {
  text-align: center;
  margin-bottom: 50px;
  padding: 40px 20px;
  background: transparent;
  border-bottom: none;
  position: relative;
}

h1 {
  color: var(--color-primary);
  font-size: 3.5em;
  margin-bottom: 15px;
  font-weight: 800;
  letter-spacing: -1px;
  text-shadow: none;
}

h1::before {
  content: "🌍";
  margin-right: 15px;
  font-size: 0.8em;
  vertical-align: middle;
}

h1::after {
  content: "📸";
  margin-left: 15px;
  font-size: 0.8em;
  vertical-align: middle;
}

.subtitle {
  color: var(--color-text-light);
  font-size: 1.3em;
  font-weight: 500;
  max-width: 600px;
  margin: 0 auto;
}

/* ===========================
   NAVIGATION
   =========================== */

nav {
  text-align: center;
  margin-bottom: 80px;
  /* Increased spacing for mascot */
}

nav a {
  display: inline-block;
  margin: 0 40px;
  /* Increased separation */
  padding: 12px 24px;
  background: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
  font-weight: 600;
}

nav a:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ===========================
   CONTENT
   =========================== */

.content {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
   FOOTER
   =========================== */

footer {
  text-align: center;
  margin-top: 50px;
  padding: 20px;
  border-top: 4px solid var(--christmas-gold);
  color: var(--color-text-light);
  background: var(--snow-white);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.footer-logout {
  background: none;
  border: none;
  color: var(--color-text-light);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85em;
  margin-top: 15px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.footer-logout:hover {
  opacity: 1;
  color: var(--christmas-red);
}

/* ===========================
   BUTTONS
   =========================== */

.btn {
  display: inline-block;
  padding: 12px 30px;
  background: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
  border-radius: var(--radius-full);
  border: none;
  font-size: 1em;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-weight: 600;
}

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

.btn:disabled {
  background: var(--color-gray-dark);
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--color-secondary);
}

.btn-secondary:hover {
  background: var(--color-secondary-dark);
}

.btn-success {
  background: var(--color-secondary);
  color: var(--color-white);
  border: 3px solid var(--color-secondary-dark);
}

.btn-success:hover {
  background: var(--color-secondary-dark);
  transform: translateY(-2px);
  border-color: var(--christmas-gold);
}

/* ===========================
   FORMS
   =========================== */

input[type="text"],
input[type="number"],
input[type="month"],
textarea,
select {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 2px solid var(--color-gray);
  border-radius: var(--radius-sm);
  font-size: 1em;
  transition: border-color var(--transition-fast);
  font-family: inherit;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="month"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.date-picker-wrapper {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  margin: 10px 0;
}

.date-select {
  padding: 12px;
  border: 2px solid var(--color-gray);
  border-radius: var(--radius-sm);
  font-size: 1em;
  transition: border-color var(--transition-fast);
  font-family: inherit;
  background: var(--color-white);
  cursor: pointer;
}

.date-select:focus {
  outline: none;
  border-color: var(--color-primary);
}

@media (max-width: 480px) {
  .date-picker-wrapper {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   ALERTS
   =========================== */

.alert {
  padding: 15px;
  margin: 15px 0;
  border-radius: var(--radius-sm);
  animation: slideIn 0.3s ease;
}

.alert-success {
  background: var(--color-accent-light);
  color: var(--color-primary-dark);
  border: 2px solid var(--color-accent);
}

.alert-error {
  background: #fdecea;
  color: #8b1e1e;
  border: 2px solid #da2c38;
}

.alert-info {
  background: #e0f2fe;
  color: #075985;
  border: 2px solid #0ea5e9;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===========================
   CALENDAR GRID
   =========================== */

/* ===========================
   PREMIUM UI & GLASSMORPHISM
   =========================== */

.glass-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  border-radius: var(--radius-lg);
}

.challenge-workspace {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-bottom: 40px;
}

.photo-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.map-container,
.guess-controls {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: transform var(--transition-normal);
}

.photo-display {
  box-shadow: var(--shadow-md);
  border: 4px solid var(--color-white);
  border-radius: var(--radius-md);
  width: 100%;
  overflow: hidden;
}

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

/* ===========================
   CALENDAR GRID (ADVENT DOORS)
   =========================== */

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 25px;
  margin-top: 40px;
  perspective: 1000px;
}

.day-card {
  position: relative;
  aspect-ratio: 1;
  background: var(--christmas-red);
  /* Christmas Red Background */
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-white);
  /* White text for contrast */
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.1),
    0 2px 6px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  overflow: hidden;
}

.day-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
  opacity: 1;
  z-index: 0;
}

/* Snowflake Background Animation */
body::before {
  content: "❄️ ❅ ❆ ❄️ ❅ ❆";
  position: fixed;
  top: -10px;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  font-size: 2em;
  color: rgba(255, 255, 255, 0.3);
  animation: snowFall 20s linear infinite;
  text-shadow:
    10vw 10vh 2px rgba(255, 255, 255, 0.2),
    30vw 40vh 2px rgba(255, 255, 255, 0.2),
    70vw 20vh 2px rgba(255, 255, 255, 0.2),
    50vw 80vh 2px rgba(255, 255, 255, 0.2),
    90vw 60vh 2px rgba(255, 255, 255, 0.2);
}

@keyframes snowFall {
  0% {
    transform: translateY(-100%);
  }

  100% {
    transform: translateY(100%);
  }
}

.day-card:hover {
  transform: translateY(-8px) rotateX(10deg);
  box-shadow:
    0 15px 30px rgba(212, 36, 38, 0.2),
    0 5px 15px rgba(0, 0, 0, 0.05);
  background: var(--color-white);
  border-color: var(--christmas-red);
}

.day-card:hover .day-number {
  color: var(--christmas-red);
  transform: scale(1.1);
  text-shadow: none;
}

.day-card:hover .day-label {
  color: var(--christmas-red);
  font-weight: 700;
}

.day-card.locked {
  background: #F8F9FA;
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px dashed var(--color-gray);
  color: var(--color-text);
}

.day-card.locked .day-number {
  color: var(--color-text-light);
}

.day-card.locked:hover {
  transform: none;
  box-shadow: none;
}

.day-number {
  font-size: 3.5em;
  font-weight: 800;
  margin-bottom: 5px;
  color: var(--color-white);
  z-index: 1;
  transition: all 0.3s ease;
  font-family: 'Outfit', sans-serif;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.day-label {
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.9);
  z-index: 1;
  font-weight: 600;
  transition: all 0.3s ease;
}

.lock-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.2em;
  opacity: 0.4;
}

.star-icon {
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 1.2em;
  color: var(--christmas-gold);
  filter: drop-shadow(0 2px 4px rgba(241, 211, 2, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

/* ===========================
   INTRO SECTION
   =========================== */

.intro {
  text-align: center;
  margin-bottom: 30px;
  padding: 25px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 3px solid var(--color-secondary);
  border-top: 5px solid var(--christmas-red);
  box-shadow: var(--shadow-sm);
  position: relative;
  margin-top: 80px;
  /* Space for the mascot */
}

.intro-mascot {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid var(--color-white);
  box-shadow:
    0 0 0 4px var(--christmas-red),
    0 10px 20px rgba(0, 0, 0, 0.15);
  background: var(--color-white);
  transition: transform 0.3s ease;
  z-index: 10;
}

.intro-mascot:hover {
  transform: translateX(-50%) scale(1.05) rotate(5deg);
}

.intro h2 {
  color: var(--christmas-red);
  margin-bottom: 15px;
  margin-top: 40px;
  /* Added space for the mascot */
  padding-bottom: 15px;
  border-bottom: 2px solid var(--color-gray-light);
  /* Divider */
  display: inline-block;
  width: 100%;
}

.intro p {
  color: var(--color-text-light);
  line-height: 1.6;
}

/* ===========================
   USERNAME DISPLAY
   =========================== */

.username-display {
  text-align: center;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--snow-white);
  border-radius: var(--radius-md);
  border: 3px solid var(--color-secondary);
  border-top: 5px solid var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.username-display strong {
  color: var(--color-primary);
}

.change-name {
  margin-left: 15px;
  padding: 8px 16px;
  background: var(--color-secondary);
  color: var(--color-white);
  border: 2px solid var(--color-secondary-dark);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.9em;
  transition: all var(--transition-fast);
}

.change-name:hover {
  background: var(--color-secondary-dark);
  transform: scale(1.05);
}

/* ===========================
   LEADERBOARD
   =========================== */

.leaderboard-container {
  max-width: 800px;
  margin: 0 auto;
}

.leaderboard-header {
  text-align: center;
  padding: 30px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-md);
  margin-bottom: 30px;
  border: 4px solid var(--christmas-gold);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.leaderboard-header::before {
  content: "🎁";
  position: absolute;
  top: 15px;
  left: 25px;
  font-size: 2em;
  opacity: 0.6;
}

.leaderboard-header::after {
  content: "🎁";
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 2em;
  opacity: 0.6;
}

.leaderboard-header h2 {
  font-size: 2.5em;
  margin-bottom: 10px;
  color: var(--color-white);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

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

.tab {
  padding: 12px 25px;
  background: var(--color-gray-light);
  border: 2px solid var(--color-gray);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-fast);
  color: var(--color-text);
}

.tab:hover {
  background: var(--color-gray);
}

.tab.active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.leaderboard-table {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--color-gray);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 80px 1fr 120px;
  padding: 20px;
  border-bottom: 1px solid var(--color-gray);
  align-items: center;
  transition: background var(--transition-fast);
}

.leaderboard-row:has(.days-played) {
  grid-template-columns: 80px 1fr 120px 100px;
}

.leaderboard-row:hover {
  background: var(--color-gray-light);
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-header-row {
  background: var(--color-secondary);
  color: var(--color-white);
  font-weight: bold;
}

.leaderboard-header-row:hover {
  background: var(--color-secondary);
}

.rank {
  font-size: 1.5em;
  font-weight: bold;
  text-align: center;
}

.rank-1 {
  color: var(--christmas-gold);
  text-shadow: 1px 1px 3px rgba(212, 175, 55, 0.5);
}

/* Gold */
.rank-2 {
  color: #c0c0c0;
  text-shadow: 1px 1px 3px rgba(192, 192, 192, 0.5);
}

/* Silver */
.rank-3 {
  color: #cd7f32;
  text-shadow: 1px 1px 3px rgba(205, 127, 50, 0.5);
}

/* Bronze */

.rank-medal {
  font-size: 2em;
}

.username {
  font-size: 1.1em;
  font-weight: 500;
}

.score {
  text-align: right;
  font-size: 1.3em;
  font-weight: bold;
  color: var(--color-primary);
}

.days-played {
  text-align: center;
  font-size: 1em;
  font-weight: 600;
  color: var(--color-text-light);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-light);
}

.empty-state-icon {
  font-size: 4em;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* ===========================
   FLIP CARDS (PRIZES)
   =========================== */

.roadmap-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  padding: 20px 0;
}

.roadmap-line {
  position: absolute;
  left: 29px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-gray);
  z-index: 0;
}

.roadmap-progress {
  position: absolute;
  left: 29px;
  top: 0;
  width: 4px;
  background: var(--color-primary);
  z-index: 0;
  transition: height 1s ease-out;
}

.roadmap-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.roadmap-node {
  width: 60px;
  height: 60px;
  background: var(--color-white);
  border: 4px solid var(--color-gray);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  flex-shrink: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.roadmap-item.unlocked .roadmap-node {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-white);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(212, 36, 38, 0.4);
}

/* Flip Card Structure */
.flip-card {
  background-color: transparent;
  width: 100%;
  height: 200px;
  /* Fixed height for flip effect */
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.flip-card-front {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.flip-card-back {
  background: linear-gradient(135deg, var(--color-white) 0%, #f0f9ff 100%);
  border: 2px solid var(--christmas-gold);
  transform: rotateY(180deg);
}

.roadmap-item.locked .flip-card {
  cursor: not-allowed;
}

.roadmap-item.locked .flip-card-front {
  background: rgba(240, 240, 240, 0.6);
  opacity: 0.8;
}

.prize-points {
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 5px;
}

.prize-title {
  font-size: 1.2em;
  font-weight: 800;
  margin-bottom: 5px;
}

.prize-desc {
  font-size: 0.9em;
  color: var(--color-text-light);
}

.click-hint {
  margin-top: 10px;
  font-size: 0.8em;
  color: var(--color-secondary);
  font-weight: bold;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.6;
  }
}



.loading {
  text-align: center;
  padding: 40px;
  color: var(--color-secondary);
  font-size: 1.2em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--color-white);
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--color-gray);
}

.stat-value {
  font-size: 2.5em;
  font-weight: bold;
  color: var(--color-primary);
}

.stat-label {
  color: var(--color-text-light);
  margin-top: 5px;
}

/* ===========================
   CHALLENGE PAGES
   =========================== */

.challenge-header {
  text-align: center;
  padding: 30px;
  background: var(--color-secondary);
  color: var(--color-white);
  border-radius: var(--radius-md);
  margin-bottom: 30px;
  border: 4px solid var(--christmas-gold);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.challenge-header::before {
  content: "🌟";
  position: absolute;
  top: 15px;
  left: 25px;
  font-size: 1.8em;
  animation: twinkle 3s ease-in-out infinite;
}

.challenge-header::after {
  content: "🌟";
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 1.8em;
  animation: twinkle 3s ease-in-out infinite 1.5s;
}

.challenge-header h2 {
  font-size: 2.5em;
  margin-bottom: 10px;
  color: var(--christmas-red);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.challenge-description {
  background: var(--color-white);
  padding: 25px;
  border-radius: var(--radius-md);
  margin-bottom: 30px;
  line-height: 1.8;
  border: 3px solid var(--color-secondary);
  border-top: 5px solid var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.challenge-description h3 {
  color: var(--color-primary);
  margin-bottom: 15px;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.leaderboard-preview {
  margin-top: 30px;
  padding: 20px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 3px solid var(--color-secondary);
  border-top: 5px solid var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.leaderboard-preview h3 {
  color: var(--color-primary);
  margin-bottom: 15px;
}

.leaderboard-preview ul {
  list-style: none;
  padding: 0;
}

.leaderboard-preview li {
  padding: 12px 15px;
  margin-bottom: 8px;
  background: var(--color-gray-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-gray);
  transition: all var(--transition-fast);
}

.leaderboard-preview li:hover {
  background: var(--color-white);
  transform: translateX(4px);
}

.leaderboard-preview .rank {
  font-weight: bold;
  color: var(--color-primary);
  margin-right: 10px;
  font-size: 1em;
}

/* ===========================
   GEO-DATE CHALLENGE STYLES
   =========================== */

/* Removed conflicting grid layout */

.photo-container {
  background: var(--color-white);
  padding: 25px;
  border-radius: var(--radius-md);
  border: 3px solid var(--color-secondary);
  box-shadow: var(--shadow-md);
}

.photo-container h3 {
  margin-bottom: 15px;
  color: var(--color-secondary);
  font-weight: 700;
  font-size: 1.3em;
}

.photo-display {
  width: 100%;
  min-height: 300px;
  max-height: 500px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--color-gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.photo-display img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 500px;
  display: block;
}

.photo-placeholder {
  color: var(--color-text-light);
  font-size: 3em;
}

/* Ensure photo container is responsive */
@media (max-width: 768px) {
  .photo-display {
    min-height: 250px;
    max-height: 400px;
  }

  .photo-display img {
    max-height: 400px;
  }
}

@media (max-width: 480px) {
  .photo-display {
    min-height: 200px;
    max-height: 300px;
  }

  .photo-display img {
    max-height: 300px;
  }
}

.map-container {
  background: var(--color-white);
  padding: 25px;
  border-radius: var(--radius-md);
  border: 3px solid var(--color-secondary);
  box-shadow: var(--shadow-md);
}

.map-container h3 {
  margin-bottom: 15px;
  color: var(--color-secondary);
  font-weight: 700;
  font-size: 1.3em;
}

#map {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-gray);
}

.guess-controls {
  background: var(--color-white);
  padding: 25px;
  border-radius: var(--radius-md);
  border: 3px solid var(--color-secondary);
  box-shadow: var(--shadow-md);
  grid-column: 1 / -1;
}

.guess-controls h3 {
  margin-bottom: 15px;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.3em;
}




.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--color-text);
}

.selected-location {
  padding: 15px;
  background: var(--color-gray-light);
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-gray);
  margin: 10px 0;
  font-size: 0.95em;
  color: var(--color-text);
}

.score-display {
  text-align: center;
  padding: 30px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-md);
  margin: 20px 0;
  box-shadow: var(--shadow-md);
  border: 4px solid var(--christmas-gold);
  position: relative;
}

.score-display::before {
  content: "🎊";
  position: absolute;
  top: 10px;
  left: 15px;
  font-size: 2em;
  opacity: 0.6;
}

.score-display::after {
  content: "🎊";
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2em;
  opacity: 0.6;
}

.score-display h3 {
  font-size: 1.5em;
  margin-bottom: 10px;
  color: var(--color-white);
}

.score-value {
  font-size: 4em;
  font-weight: bold;
  margin: 10px 0;
}

.score-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 20px;
  text-align: left;
}

.score-item {
  background: rgba(255, 255, 255, 0.2);
  padding: 12px;
  border-radius: var(--radius-sm);
}

.score-item-label {
  font-size: 0.9em;
  opacity: 0.9;
}

.score-item-value {
  font-size: 1.3em;
  font-weight: bold;
  margin-top: 5px;
}

.celebration {
  display: none;
  text-align: center;
  padding: 25px;
  background: var(--christmas-gold);
  color: var(--color-text);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  animation: celebrate 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
  border: 4px solid var(--color-primary);
  position: relative;
}

.celebration::before {
  content: "🎄";
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  font-size: 2.5em;
  opacity: 0.5;
}

.celebration::after {
  content: "🎄";
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  font-size: 2.5em;
  opacity: 0.5;
}

.celebration.visible {
  display: block;
}

@keyframes celebrate {
  0% {
    transform: scale(0.8) rotate(-5deg);
    opacity: 0;
  }

  50% {
    transform: scale(1.1) rotate(2deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  h1 {
    font-size: 2em;
  }

  .calendar-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
  }

  .leaderboard-row {
    grid-template-columns: 60px 1fr 100px;
    padding: 15px;
  }

  .leaderboard-row:has(.days-played) {
    grid-template-columns: 50px 1fr 80px 60px;
    font-size: 0.9em;
  }

  nav a {
    margin: 5px;
    padding: 10px 20px;
  }

  .score-breakdown {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   LOGIN MODAL
   =========================== */

.login-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.login-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.login-modal {
  background: var(--color-white);
  width: 90%;
  max-width: 450px;
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  text-align: center;
  border: 4px solid var(--color-primary);
  position: relative;
}

.login-modal h2 {
  color: var(--color-primary);
  margin-bottom: 10px;
  font-size: 2em;
}

.login-modal p {
  color: var(--color-text-light);
  margin-bottom: 30px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-form input {
  padding: 15px;
  font-size: 1.1em;
  border: 2px solid var(--color-gray);
  border-radius: var(--radius-md);
}

.login-form input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.login-btn {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 15px;
  font-size: 1.1em;
  font-weight: bold;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 10px;
}

.login-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.login-error {
  color: #dc2626;
  margin-top: 15px;
  font-size: 0.9em;
  min-height: 1.4em;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.login-error.visible {
  opacity: 1;
}

/* ===========================
   PREMIUM UI & GLASSMORPHISM
   =========================== */

.glass-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  border-radius: var(--radius-lg);
}

/* Removed duplicate challenge-workspace rule */

.photo-container,
.map-container,
.guess-controls {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: transform var(--transition-normal);
}

.photo-container:hover,
.map-container:hover {
  transform: translateY(-5px);
}

.photo-display {
  box-shadow: var(--shadow-md);
  border: 4px solid var(--color-white);
  border-radius: var(--radius-md);
}

.btn-glow {
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.5);
  transition: all 0.3s ease;
}

.btn-glow:hover {
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.8);
  transform: scale(1.05);
}

/* Floating Action Button for Submit */
.floating-submit {
  position: sticky;
  bottom: 20px;
  z-index: 100;
  text-align: center;
  pointer-events: none;
  /* Wrapper doesn't block clicks */
}

.floating-submit .btn {
  pointer-events: auto;
  padding: 15px 40px;
  font-size: 1.2em;
  border-radius: 50px;
}

/* Animations */
@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }

  70% {
    transform: scale(1.05);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.pop-in {
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Score Result Premium */
.score-display.premium {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.score-display.premium .score-value {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===========================
   CELEBRATION & COMPLETED UI
   =========================== */

.day-card.completed {
  background: linear-gradient(135deg, var(--christmas-green) 0%, var(--christmas-green-light) 100%);
  border-color: var(--christmas-gold);
  box-shadow: 0 0 15px rgba(47, 82, 51, 0.3);
}

.day-card.completed .day-number {
  opacity: 0.3;
}

.day-card.completed .day-label {
  opacity: 0.5;
}

.completed-sticker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: auto;
  z-index: 10;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
  animation: stickerFloat 4s ease-in-out infinite;
}

@keyframes stickerFloat {

  0%,
  100% {
    transform: translate(-50%, -50%) rotate(-5deg);
  }

  50% {
    transform: translate(-50%, -55%) rotate(5deg);
  }
}

.celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
}

.celebration-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.login-modal {
  background: var(--color-white);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 400px;
  width: 90%;
  position: relative;
  margin-top: 40px;
  /* Space for the mascot */
}

.login-mascot {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--color-white);
  box-shadow:
    0 0 0 3px var(--christmas-red),
    0 5px 15px rgba(0, 0, 0, 0.15);
  background: var(--color-white);
  z-index: 10;
}

.login-modal h2 {
  margin-top: 10px;
  margin-bottom: 20px;
  color: var(--color-text-dark);
}

.footer-logout {
  color: var(--color-text-light);
  font-size: 0.9em;
  margin-top: 20px;
}

.footer-logout a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: bold;
}

.footer-logout a:hover {
  text-decoration: underline;
}

.celebration-popup {
  background: var(--color-white);
  padding: 20px;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 400px;
  width: 90%;
  /* Removed max-height/overflow as we aim to fit content naturally now */
  transform: scale(0.8);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 4px solid var(--christmas-gold);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  position: relative;
}

.celebration-overlay.visible .celebration-popup {
  transform: scale(1);
}

.celebration-sticker {
  width: 180px;
  height: auto;
  margin: 10px auto;
  display: block;
  animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s backwards, float 3s ease-in-out infinite 1s;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
}

.celebration-score {
  font-size: 2.5em;
  font-weight: 800;
  color: var(--christmas-red);
  margin: 0;
  line-height: 1;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9em;
}

.celebration-confetti {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* ===========================
   PRIZE POPUP
   =========================== */

.prize-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.prize-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.prize-popup-content {
  background: white;
  padding: 40px;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 500px;
  width: 90%;
  transform: scale(0.8);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 4px solid var(--christmas-gold);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.prize-popup-overlay.active .prize-popup-content {
  transform: scale(1);
}

.prize-header {
  color: var(--christmas-red);
  font-size: 2em;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: pulse 2s infinite;
}

.prize-image-container {
  margin: 20px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 4px solid var(--color-white);
  transform: rotate(-2deg);
  transition: transform 0.3s ease;
}

.prize-image-container:hover {
  transform: rotate(0deg) scale(1.02);
}

.prize-popup-img {
  width: 100%;
  height: auto;
  display: block;
}

.prize-title-text {
  font-size: 1.8em;
  color: var(--color-primary);
  margin: 15px 0 5px;
}

.prize-message {
  font-size: 1.2em;
  color: var(--color-text-light);
  margin-bottom: 25px;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}