* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', 'Arial Rounded MT Bold', Arial, sans-serif;
}

#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

/* HUD */
#ui {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 10;
}

#score {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 48px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 0 #000, 0 0 20px rgba(255,100,0,0.5);
  letter-spacing: 2px;
  transition: transform 0.1s;
}

#score.bump {
  transform: translateX(-50%) scale(1.3);
}

#combo {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  font-weight: 900;
  color: #FFD700;
  text-shadow: 0 2px 0 #000;
  transition: transform 0.15s;
}

#combo.bump {
  transform: translateX(-50%) scale(1.5);
}

#muteBtn {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  z-index: 15;
}

#height-bar {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 60vh;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.2);
}

#height-fill {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(to top, #4CAF50, #8BC34A, #FFEB3B, #FF9800, #F44336);
  border-radius: 8px;
  transition: height 0.3s;
}

#height-label {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
}

/* Floating texts */
#floatingTexts {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

.float-text {
  position: absolute;
  font-weight: 900;
  font-size: 32px;
  color: #fff;
  text-shadow: 0 3px 0 #000, 2px 2px 0 #000, -2px 2px 0 #000;
  animation: floatUp 1s ease-out forwards;
  pointer-events: none;
  white-space: nowrap;
}

.float-text.meow {
  font-size: 56px;
  color: #FF6B6B;
}

.float-text.close {
  font-size: 36px;
  color: #FFD700;
}

.float-text.fart {
  font-size: 44px;
  color: #7CFC00;
}

.float-text.coin {
  font-size: 28px;
  color: #FFD700;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.5) rotate(-5deg);
  }
  30% {
    opacity: 1;
    transform: translateY(-30px) scale(1.2) rotate(3deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-120px) scale(0.8) rotate(-2deg);
  }
}

/* Overlays */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

#startScreen {
  background: url('start-bg.jpeg') center/cover no-repeat;
}

.loading-text {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 0 #000;
  z-index: 3;
}

#startScreen .overlay-content {
  background: rgba(0, 0, 0, 0.45);
  border-radius: 20px;
  padding: 40px 36px;
  position: relative;
  z-index: 2;
}

.overlay.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.overlay-content {
  text-align: center;
  color: #fff;
  max-width: 400px;
  padding: 20px;
}

.overlay-content h1 {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 16px;
  text-shadow: 0 4px 0 #000, 0 0 40px rgba(255,100,0,0.6);
  color: #FF6B35;
}

.death-title {
  font-size: 80px !important;
  color: #FF4444 !important;
  animation: deathShake 0.5s ease-out;
}

@keyframes deathShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-15px) rotate(-5deg); }
  40% { transform: translateX(15px) rotate(5deg); }
  60% { transform: translateX(-10px) rotate(-3deg); }
  80% { transform: translateX(10px) rotate(3deg); }
}

.subtitle {
  font-size: 20px;
  color: #ccc;
  margin-bottom: 30px;
}

#finalScore {
  font-size: 56px;
  font-weight: 900;
  color: #FFD700;
  text-shadow: 0 3px 0 #000;
  margin-bottom: 8px;
}

#bestScore {
  font-size: 18px;
  color: #aaa;
  margin-bottom: 24px;
}

/* Shop */
#shopSection {
  margin-bottom: 20px;
}

#shopSection h2 {
  font-size: 22px;
  color: #FF6B35;
  margin-bottom: 12px;
  text-shadow: 0 2px 0 #000;
}

#shopItems {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.15s;
}

.shop-item:hover {
  background: rgba(255,255,255,0.2);
  border-color: #FFD700;
}

.shop-item:active {
  transform: scale(0.95);
}

.shop-item.maxed {
  opacity: 0.5;
  pointer-events: none;
}

.shop-item.too-expensive {
  opacity: 0.6;
}

.shop-item-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.shop-item-level {
  font-size: 12px;
  color: #aaa;
}

.shop-item-cost {
  font-size: 18px;
  font-weight: 900;
  color: #FFD700;
}

#coinDisplay {
  font-size: 24px;
  font-weight: 900;
  color: #FFD700;
  text-shadow: 0 2px 0 #000;
  margin-bottom: 16px;
}

#coinDisplay::before {
  content: "COINS: ";
  color: #aaa;
  font-size: 16px;
}

.tap-prompt {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 0 #000;
}

.pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
