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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: all 0.5s ease;
  position: relative;
  overflow: hidden;
}

.app.day {
  background: linear-gradient(to bottom, #87CEEB 0%, #98D8E8 50%, #90C695 100%);
}

.app.night {
  background: linear-gradient(to bottom, #0B1929 0%, #1A2942 50%, #2C3E50 100%);
}

/* Celestial elements */
.celestial-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.sun {
  position: absolute;
  top: 50px;
  right: 80px;
  font-size: 4rem;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
}

.moon {
  position: absolute;
  top: 50px;
  right: 80px;
  font-size: 4rem;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(200, 200, 255, 0.8));
}

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

.cloud {
  position: absolute;
  font-size: 2.5rem;
  opacity: 0.8;
  animation: drift linear infinite;
}

.cloud:nth-child(1) {
  top: 100px;
  left: -100px;
  animation-duration: 45s;
  animation-delay: 0s;
}

.cloud:nth-child(2) {
  top: 180px;
  left: -150px;
  animation-duration: 60s;
  animation-delay: 5s;
  font-size: 2rem;
}

.cloud:nth-child(3) {
  top: 140px;
  left: -120px;
  animation-duration: 50s;
  animation-delay: 10s;
  font-size: 3rem;
}

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 200px)); }
}

.star {
  position: absolute;
  color: white;
  font-size: 1rem;
  animation: twinkle 3s ease-in-out infinite;
}

.star:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.star:nth-child(2) { top: 20%; left: 30%; animation-delay: 0.5s; font-size: 0.8rem; }
.star:nth-child(3) { top: 15%; left: 50%; animation-delay: 1s; font-size: 1.2rem; }
.star:nth-child(4) { top: 25%; left: 70%; animation-delay: 1.5s; }
.star:nth-child(5) { top: 8%; left: 85%; animation-delay: 2s; font-size: 0.9rem; }
.star:nth-child(6) { top: 30%; left: 20%; animation-delay: 2.5s; }
.star:nth-child(7) { top: 12%; left: 40%; animation-delay: 0.8s; font-size: 1.1rem; }
.star:nth-child(8) { top: 18%; left: 60%; animation-delay: 1.8s; }
.star:nth-child(9) { top: 28%; left: 80%; animation-delay: 1.2s; font-size: 0.7rem; }
.star:nth-child(10) { top: 22%; left: 10%; animation-delay: 2.2s; }

@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  padding: 20px 0;
  border-bottom: 3px solid rgba(139, 69, 19, 0.5);
  position: relative;
  z-index: 1;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.game-title {
  font-size: 2.5rem;
  font-weight: 900;
  color: #8B4513;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.night .game-title {
  color: #D4A574;
  text-shadow: 2px 2px 8px rgba(212, 165, 116, 0.5);
}

.points-display {
  text-align: center;
}

.points-main {
  font-size: 3rem;
  font-weight: 900;
  color: #FFD700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  line-height: 1;
}

.points-per-second {
  font-size: 1.2rem;
  color: #8B4513;
  margin-top: 5px;
}

.night .points-per-second {
  color: #D4A574;
}

.day-night-toggle {
  font-size: 2.5rem;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(139, 69, 19, 0.5);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.day-night-toggle:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.3);
}

/* Main content */
.main-content {
  display: flex;
  flex: 1;
  gap: 20px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Stats panel */
.stats-panel {
  width: 250px;
  background: rgba(139, 69, 19, 0.2);
  border: 3px solid #8B4513;
  border-radius: 15px;
  padding: 20px;
  height: fit-content;
}

.night .stats-panel {
  background: rgba(212, 165, 116, 0.15);
  border-color: #D4A574;
}

.panel-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #8B4513;
  margin-bottom: 15px;
  text-align: center;
}

.night .panel-title {
  color: #D4A574;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  font-size: 0.9rem;
}

.night .stat-item {
  background: rgba(0, 0, 0, 0.3);
  color: #E5E5E5;
}

.stat-value {
  font-weight: 700;
  color: #8B4513;
}

.night .stat-value {
  color: #FFD700;
}

.stat-value.combo {
  color: #FF4500;
  text-shadow: 0 0 5px rgba(255, 69, 0, 0.5);
}

/* Arena */
.arena {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 500px;
}

.target-container {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.target-container.shake {
  animation: shake 0.2s ease;
}

@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-5px, 5px); }
  75% { transform: translate(5px, -5px); }
}

.target {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.target-ring {
  position: absolute;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ring-1 {
  width: 100%;
  height: 100%;
  background: #DC143C;
  border: 5px solid #8B0000;
}

.ring-2 {
  width: 66%;
  height: 66%;
  background: white;
  border: 5px solid #CCC;
}

.ring-3 {
  width: 33%;
  height: 33%;
  background: #DC143C;
  border: 5px solid #8B0000;
}

.target-bullseye {
  position: absolute;
  width: 10%;
  height: 10%;
  background: #FFD700;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.combo-display {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  font-weight: 900;
  color: #FF4500;
  text-shadow: 0 0 10px rgba(255, 69, 0, 0.8);
  animation: pulse 0.5s ease infinite;
  white-space: nowrap;
}

@keyframes pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.1); }
}

.flying-axe {
  position: fixed;
  font-size: 2.5rem;
  pointer-events: none;
  z-index: 100;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.floating-number {
  position: fixed;
  font-size: 1.8rem;
  font-weight: 900;
  color: #FFD700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 101;
  transition: all 0.8s ease;
}

.floating-number.critical {
  font-size: 2.5rem;
  color: #FF4500;
  text-shadow: 0 0 10px rgba(255, 69, 0, 0.8);
}

.particle {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #FFD700;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99;
  box-shadow: 0 0 5px rgba(255, 215, 0, 0.8);
}

/* Upgrades panel */
.upgrades-panel {
  width: 320px;
  background: rgba(139, 69, 19, 0.2);
  border: 3px solid #8B4513;
  border-radius: 15px;
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.night .upgrades-panel {
  background: rgba(212, 165, 116, 0.15);
  border-color: #D4A574;
}

.upgrades-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upgrade-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #8B4513;
  margin-top: 20px;
  margin-bottom: 10px;
  text-align: center;
  border-top: 2px solid rgba(139, 69, 19, 0.3);
  padding-top: 10px;
}

.upgrade-section-title:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.night .upgrade-section-title {
  color: #D4A574;
  border-color: rgba(212, 165, 116, 0.3);
}

.upgrade-card {
  background: rgba(255, 255, 255, 0.4);
  border: 2px solid #8B4513;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 12px;
  transition: all 0.3s ease;
}

.night .upgrade-card {
  background: rgba(0, 0, 0, 0.4);
  border-color: #D4A574;
}

.upgrade-card.affordable {
  border-color: #32CD32;
  box-shadow: 0 0 15px rgba(50, 205, 50, 0.4);
  animation: glow 1.5s ease infinite;
}

.upgrade-card.max-level {
  border-color: #FFD700;
  background: rgba(255, 215, 0, 0.2);
  animation: none;
}

.night .upgrade-card.max-level {
  background: rgba(255, 215, 0, 0.15);
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 15px rgba(50, 205, 50, 0.4); }
  50% { box-shadow: 0 0 25px rgba(50, 205, 50, 0.6); }
}

.upgrade-icon {
  font-size: 2.5rem;
  min-width: 50px;
  text-align: center;
}

.upgrade-info {
  flex: 1;
  min-width: 0;
}

.upgrade-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #8B4513;
  margin-bottom: 3px;
}

.night .upgrade-name {
  color: #D4A574;
}

.upgrade-description {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 5px;
}

.night .upgrade-description {
  color: #AAA;
}

.upgrade-level {
  font-size: 0.8rem;
  color: #8B4513;
  margin-bottom: 3px;
}

.night .upgrade-level {
  color: #D4A574;
}

.upgrade-effect {
  font-size: 0.85rem;
  font-weight: 600;
  color: #32CD32;
}

.upgrade-button {
  background: #32CD32;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  align-self: center;
}

.upgrade-button:hover:not(.disabled) {
  background: #28A428;
  transform: scale(1.05);
}

.upgrade-button.disabled {
  background: #999;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Footer */
.footer {
  padding: 20px;
  text-align: center;
  border-top: 3px solid rgba(139, 69, 19, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.footer-link {
  color: #8B4513;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #D2691E;
}

.night .footer-link {
  color: #D4A574;
}

.night .footer-link:hover {
  color: #FFD700;
}

.reset-button {
  background: #DC143C;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.reset-button:hover {
  background: #B22222;
  transform: scale(1.05);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: white;
  padding: 30px;
  border-radius: 15px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.night .modal {
  background: #2C3E50;
  color: white;
}

/* Responsive */
@media (max-width: 1200px) {
  .main-content {
    flex-direction: column;
  }
  
  .stats-panel,
  .upgrades-panel {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
  }
  
  .upgrades-panel {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .game-title {
    font-size: 1.8rem;
  }
  
  .points-main {
    font-size: 2rem;
  }
  
  .target {
    width: 250px;
    height: 250px;
  }
  
  .upgrade-card {
    flex-direction: column;
    text-align: center;
  }
  
  .upgrade-button {
    width: 100%;
  }
  
  .sun, .moon {
    font-size: 3rem;
    top: 30px;
    right: 30px;
  }
  
  .cloud {
    font-size: 2rem;
  }
}