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

:root {
  --chiefs-red: #E31837;
  --chiefs-gold: #FFB81C;
  --dark-bg: #0A0A0A;
  --dark-card: #1a1a1a;
  --success: #22c55e;
  --warning: #f97316;
}

body {
  font-family: 'Oswald', sans-serif;
  background: var(--dark-bg);
  color: white;
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 50px,
      rgba(255, 255, 255, 0.02) 50px,
      rgba(255, 255, 255, 0.02) 51px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 50px,
      rgba(255, 255, 255, 0.02) 50px,
      rgba(255, 255, 255, 0.02) 51px
    ),
    linear-gradient(180deg, #0a0a0a 0%, #1a0a0a 100%);
}

.app-container.shake {
  animation: shake 0.5s ease-in-out;
}

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

.game-header {
  background: linear-gradient(135deg, var(--chiefs-red) 0%, #b8132c 100%);
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(227, 24, 55, 0.5);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.game-title {
  font-family: 'Russo One', sans-serif;
  font-size: clamp(1.2rem, 4vw, 2rem);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.title-icon {
  animation: bounce 1s ease-in-out infinite;
}

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

.points-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: rgba(0,0,0,0.3);
  padding: 0.5rem 1rem;
  border-radius: 10px;
}

.points-label {
  font-size: 0.8rem;
  opacity: 0.8;
  text-transform: uppercase;
}

.points-value {
  font-family: 'Russo One', sans-serif;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: var(--chiefs-gold);
  text-shadow: 0 0 20px var(--chiefs-gold);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 20px var(--chiefs-gold); }
  50% { text-shadow: 0 0 40px var(--chiefs-gold), 0 0 60px var(--chiefs-gold); }
}

.points-per-sec {
  font-size: 0.9rem;
  color: var(--success);
}

.game-main {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr 200px;
  gap: 1rem;
  padding: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1024px) {
  .game-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  
  .left-panel { order: 2; }
  .center-panel { order: 1; }
  .right-panel { order: 3; }
}

.panel-title {
  font-family: 'Russo One', sans-serif;
  font-size: 1.2rem;
  color: var(--chiefs-gold);
  margin-bottom: 1rem;
  text-align: center;
  text-transform: uppercase;
}

.left-panel, .right-panel {
  background: var(--dark-card);
  border-radius: 15px;
  padding: 1rem;
  border: 1px solid rgba(255, 184, 28, 0.2);
}

.upgrade-panel {
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--chiefs-red) var(--dark-card);
}

.upgrade-panel::-webkit-scrollbar {
  width: 8px;
}

.upgrade-panel::-webkit-scrollbar-track {
  background: var(--dark-card);
}

.upgrade-panel::-webkit-scrollbar-thumb {
  background: var(--chiefs-red);
  border-radius: 4px;
}

.upgrade-category {
  margin-bottom: 1.5rem;
}

.category-title {
  font-size: 0.9rem;
  color: var(--chiefs-gold);
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(255, 184, 28, 0.3);
}

.upgrade-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.upgrade-btn.affordable {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border: 1px solid var(--chiefs-gold);
}

.upgrade-btn.affordable:hover {
  background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
  transform: translateX(5px);
  box-shadow: 0 0 15px rgba(255, 184, 28, 0.3);
}

.upgrade-btn.expensive {
  background: #1a1a1a;
  border: 1px solid #333;
  opacity: 0.6;
  cursor: not-allowed;
}

.upgrade-icon {
  font-size: 1.5rem;
}

.upgrade-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.upgrade-name {
  font-size: 0.85rem;
  font-weight: bold;
  color: white;
}

.upgrade-desc {
  font-size: 0.7rem;
  color: #888;
}

.upgrade-cost {
  font-family: 'Russo One', sans-serif;
  color: var(--chiefs-gold);
  font-size: 0.9rem;
}

.center-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.stadium-level {
  background: var(--chiefs-red);
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  font-family: 'Russo One', sans-serif;
  font-size: 1rem;
}

.stadium-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 4/3;
  background: linear-gradient(180deg, #1a4d1a 0%, #0d260d 100%);
  border-radius: 20px;
  border: 4px solid var(--chiefs-red);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.1s ease;
  box-shadow: 
    0 0 30px rgba(227, 24, 55, 0.3),
    inset 0 0 50px rgba(0,0,0,0.5);
}

.stadium-container:active {
  transform: scale(0.98);
}

.stadium-container.mahomes-glow {
  box-shadow: 
    0 0 50px var(--chiefs-gold),
    0 0 100px var(--chiefs-gold),
    inset 0 0 50px rgba(255, 184, 28, 0.3);
}

.stadium-container.kelce-glow {
  box-shadow: 
    0 0 50px var(--chiefs-red),
    0 0 100px var(--chiefs-red),
    inset 0 0 50px rgba(227, 24, 55, 0.3);
}

.stadium-field {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  height: 50%;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 10%,
      rgba(255,255,255,0.1) 10%,
      rgba(255,255,255,0.1) 10.5%
    ),
    linear-gradient(180deg, #2d5a2d 0%, #1a3d1a 100%);
  border: 3px solid white;
  border-radius: 5px;
}

.field-lines {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: white;
  opacity: 0.5;
}

.arrowhead-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: var(--chiefs-red);
  text-shadow: 0 0 20px var(--chiefs-red);
  animation: pulse 2s ease-in-out infinite;
}

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

.jumbotron {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
  from { filter: brightness(1); }
  to { filter: brightness(1.5); }
}

.fireworks {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  animation: firework 1s ease-in-out infinite;
}

@keyframes firework {
  0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.5; transform: translateX(-50%) scale(1.2); }
}

.monument {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  animation: shine 2s linear infinite;
}

@keyframes shine {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.stadium-stands {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.6rem;
  padding: 5px;
  gap: 2px;
  max-width: 20%;
}

.left-stands {
  left: 0;
  top: 10%;
  height: 80%;
  flex-direction: column;
}

.right-stands {
  right: 0;
  top: 10%;
  height: 80%;
  flex-direction: column;
}

.fan {
  opacity: 0.8;
  animation: wave 2s ease-in-out infinite;
}

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

.stadium-lights {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
}

.light {
  font-size: 1.2rem;
  animation: flicker 3s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.flags {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2rem;
}

.flag {
  font-size: 1rem;
  animation: flagWave 1s ease-in-out infinite alternate;
}

@keyframes flagWave {
  from { transform: rotate(-10deg); }
  to { transform: rotate(10deg); }
}

.floating-point {
  position: absolute;
  font-family: 'Russo One', sans-serif;
  font-size: 1.2rem;
  color: var(--chiefs-gold);
  text-shadow: 0 0 10px var(--chiefs-gold);
  pointer-events: none;
  animation: float-up 1s ease-out forwards;
  z-index: 50;
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) scale(1.5);
  }
}

.combo-display {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Russo One', sans-serif;
  font-size: 1.5rem;
  color: var(--warning);
  text-shadow: 0 0 20px var(--warning);
  animation: combo-pulse 0.3s ease-in-out infinite;
}

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

.leaderboard-teaser {
  background: rgba(255, 184, 28, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 184, 28, 0.3);
}

.powerup-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.powerup-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.powerup-btn.mahomes-btn {
  background: linear-gradient(135deg, #b8860b 0%, #8b6914 100%);
  border: 2px solid var(--chiefs-gold);
}

.powerup-btn.kelce-btn {
  background: linear-gradient(135deg, var(--chiefs-red) 0%, #a01228 100%);
  border: 2px solid #ff4d4d;
}

.powerup-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 20px currentColor;
}

.powerup-btn.cooldown {
  opacity: 0.5;
  cursor: not-allowed;
}

.powerup-btn.active {
  animation: active-pulse 0.5s ease-in-out infinite;
}

@keyframes active-pulse {
  0%, 100% { box-shadow: 0 0 20px currentColor; }
  50% { box-shadow: 0 0 40px currentColor, 0 0 60px currentColor; }
}

.powerup-icon {
  font-size: 2rem;
}

.powerup-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.powerup-name {
  font-family: 'Russo One', sans-serif;
  font-size: 0.9rem;
  color: white;
}

.powerup-desc {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
}

.powerup-active-indicator {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 1rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.raid-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: 1000;
  cursor: pointer;
  animation: raid-flash 0.5s ease-in-out infinite;
}

@keyframes raid-flash {
  0%, 100% { background: rgba(0,0,0,0.8); }
  50% { background: rgba(255, 0, 0, 0.3); }
}

.raid-content {
  text-align: center;
  padding: 2rem;
  background: var(--dark-card);
  border-radius: 20px;
  border: 3px solid var(--warning);
  animation: raid-shake 0.3s ease-in-out infinite;
}

@keyframes raid-shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}

.raid-alert {
  font-family: 'Russo One', sans-serif;
  font-size: 1.5rem;
  color: var(--warning);
  margin-bottom: 1rem;
  animation: blink 0.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.raid-enemy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.raid-emoji {
  font-size: 4rem;
  animation: raid-approach 0.5s ease-in-out infinite alternate;
}

@keyframes raid-approach {
  from { transform: scale(1); }
  to { transform: scale(1.2); }
}

.raid-name {
  font-family: 'Russo One', sans-serif;
  font-size: 1.5rem;
}

.raid-health-bar {
  width: 200px;
  height: 20px;
  background: #333;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto 1rem;
}

.raid-health-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--chiefs-red), var(--warning));
  transition: width 0.2s ease;
}

.raid-instruction {
  font-size: 1.2rem;
  color: white;
  animation: pulse 0.5s ease-in-out infinite;
}

.stats-panel {
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  background: var(--dark-card);
  border-top: 2px solid var(--chiefs-gold);
  transition: transform 0.3s ease;
  transform: translateY(100%);
  z-index: 90;
  max-height: 50vh;
  overflow-y: auto;
}

.stats-panel.open {
  transform: translateY(0);
}

.stats-toggle {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark-card);
  border: 2px solid var(--chiefs-gold);
  border-bottom: none;
  color: var(--chiefs-gold);
  padding: 0.5rem 1.5rem;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
}

.stats-content {
  padding: 1rem;
}

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

.stat-item {
  background: rgba(255,255,255,0.05);
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 0.25rem;
}

.stat-value {
  display: block;
  font-family: 'Russo One', sans-serif;
  font-size: 1.2rem;
  color: var(--chiefs-gold);
}

.achievements-section h3 {
  color: var(--chiefs-gold);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem;
}

.achievement {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  text-align: center;
}

.achievement.unlocked {
  background: linear-gradient(135deg, rgba(255, 184, 28, 0.2), rgba(227, 24, 55, 0.2));
  border: 1px solid var(--chiefs-gold);
}

.achievement.locked {
  background: rgba(255,255,255,0.05);
  opacity: 0.5;
  filter: grayscale(100%);
}

.achievement-icon {
  font-size: 1.5rem;
}

.achievement-name {
  color: white;
}

.reset-btn {
  display: block;
  margin: 1rem auto 0;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 2px solid var(--chiefs-red);
  color: var(--chiefs-red);
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  transition: all 0.3s ease;
}

.reset-btn:hover {
  background: var(--chiefs-red);
  color: white;
}

.game-footer {
  background: var(--chiefs-red);
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.game-footer a {
  color: var(--chiefs-gold);
  text-decoration: none;
}

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

.save-status {
  opacity: 0.7;
}

.touchdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(227, 24, 55, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: touchdown-in 0.3s ease-out;
}

@keyframes touchdown-in {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.touchdown-text {
  font-family: 'Russo One', sans-serif;
  font-size: clamp(2rem, 10vw, 5rem);
  color: white;
  text-shadow: 0 0 30px var(--chiefs-gold);
  animation: touchdown-bounce 0.5s ease-in-out infinite;
}

@keyframes touchdown-bounce {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.1) rotate(2deg); }
}

.touchdown-bonus {
  font-family: 'Russo One', sans-serif;
  font-size: clamp(1.5rem, 6vw, 3rem);
  color: var(--chiefs-gold);
  margin-top: 1rem;
}

.offline-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.offline-content {
  background: var(--dark-card);
  padding: 2rem;
  border-radius: 20px;
  border: 2px solid var(--chiefs-gold);
  text-align: center;
  max-width: 90%;
  animation: pop-in 0.3s ease-out;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.offline-content h2 {
  font-family: 'Russo One', sans-serif;
  color: var(--chiefs-gold);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.offline-content p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.offline-content button {
  background: linear-gradient(135deg, var(--chiefs-red), #a01228);
  border: none;
  color: white;
  padding: 1rem 2rem;
  font-family: 'Russo One', sans-serif;
  font-size: 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.offline-content button:hover {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .game-main {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .left-panel, .right-panel {
    padding: 0.75rem;
  }
  
  .upgrade-panel {
    max-height: 40vh;
  }
  
  .stadium-container {
    max-width: 100%;
  }
  
  .powerup-panel {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .powerup-btn {
    flex: 1;
    min-width: 120px;
    max-width: 150px;
  }
  
  .stats-panel {
    bottom: 50px;
  }
}