:root {
  --bg: #0a1628;
  --card: #0f2740;
  --ice: #bfe6ff;
  --accent: #f472b6;
  --glass: rgba(255, 255, 255, 0.08);
  --muted: rgba(255, 255, 255, 0.7);
  --gold: #ffd166;
}

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

html, body {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Montserrat', -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: #eaf6ff;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Simple gradient overlay - no images */
.bg1, .bg2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, 
    rgba(15, 23, 42, 0.95) 0%, 
    rgba(30, 41, 59, 0.9) 50%,
    rgba(15, 23, 42, 0.95) 100%);
  z-index: -1;
}

.bg2 { display: none; } /* Disable second background entirely */

/* Back button - simplified */
.back-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--ice);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}

/* Main title - mobile first */
.main-title {
  text-align: center;
  margin: 50px 0 20px;
  z-index: 10;
  position: relative;
  padding: 0 40px;
}

.main-title h1 {
  margin: 0;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--ice);
  line-height: 1.3;
}

/* Scene container - simplified */
.scene {
  width: 100%;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 30px;
}

/* Calendar grid - mobile optimized */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.weekday {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  padding: 6px 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Day cells - fast loading */
.day {
  aspect-ratio: 1;
  min-height: 42px;
  background: linear-gradient(180deg, rgba(100, 150, 200, 0.3), rgba(50, 80, 120, 0.3));
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  padding: 6px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-user-select: none;
  user-select: none;
}

.day:active {
  opacity: 0.8;
  transform: scale(0.96);
}

.day.has-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 7px;
  z-index: 0;
}

.day .num,
.day .note,
.day .tag {
  position: relative;
  z-index: 1;
}

.day .num {
  font-weight: 700;
  font-size: 14px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  color: var(--ice);
}

.day .note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  display: none; /* Hide notes on mobile for cleaner look */
}

.day .tag {
  font-size: 9px;
  font-weight: 600;
  color: var(--ice);
  margin-top: 2px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Empty day */
.day.empty {
  background: transparent;
  border: none;
  cursor: default;
}

/* Special days - simplified */
.christmas,
.newyears,
.january.newyear,
.cny,
.valentine {
  border: 2px solid rgba(255, 215, 0, 0.4);
  background: linear-gradient(135deg, rgba(255, 200, 100, 0.2), rgba(100, 150, 200, 0.3));
}

/* Modal - simplified */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 40;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 12px;
  padding: 20px;
  min-width: 260px;
  max-width: 90%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.close {
  margin-top: 14px;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--accent);
  cursor: pointer;
  color: white;
  border: none;
  font-size: 14px;
  font-weight: 600;
}

/* Lightbox - mobile optimized */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

.lightbox.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 10px 30px;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 4px;
  object-fit: contain;
}

.close-lightbox {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-caption {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* Navigation buttons */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 28px;
  width: 44px;
  height: 60px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-prev { left: 5px; }
.lightbox-next { right: 5px; }

.lightbox-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Hide unused elements */
.sleigh,
.snowflake,
.wrap,
.legend,
.controls-container,
.controls,
.christmas-card {
  display: none !important;
}

/* Tablet */
@media (min-width: 480px) {
  .calendar {
    gap: 8px;
  }
  
  .day {
    min-height: 60px;
    padding: 8px;
  }
  
  .day .num {
    font-size: 16px;
  }
  
  .main-title h1 {
    font-size: 1.8rem;
  }
  
  .weekday {
    font-size: 11px;
  }
}

/* Larger tablets/desktop */
@media (min-width: 768px) {
  body {
    padding: 24px;
  }
  
  .scene {
    max-width: 700px;
    padding: 20px;
  }
  
  .calendar {
    gap: 10px;
  }
  
  .day {
    min-height: 80px;
    padding: 10px;
  }
  
  .day .num {
    font-size: 18px;
  }
  
  .day .note {
    display: block;
    font-size: 12px;
  }
  
  .main-title h1 {
    font-size: 2.2rem;
  }
  
  .lightbox-nav {
    width: 60px;
    height: 80px;
    font-size: 40px;
  }
  
  .lightbox-prev { left: 20px; }
  .lightbox-next { right: 20px; }
}