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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(180deg, #1a1a2e 0%, #00fbff 50%, #0f3460 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  user-select: none;
}

.game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 500px;
  padding: 20px;
}

/* Header */
.header {
  display: flex;
  justify-content: center;
  gap: 40px;
  width: 100%;
}

.score-display, .per-click-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 12px 28px;
  backdrop-filter: blur(8px);
}

.score-label, .per-click-label {
  font-size: 12px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.score-value {
  font-size: 42px;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  transition: transform 0.15s;
}

.score-value.bump {
  transform: scale(1.3);
}

.per-click-value {
  font-size: 28px;
  font-weight: 700;
  color: #7ec8e3;
  text-shadow: 0 0 12px rgba(126, 200, 227, 0.3);
}

/* Rock Area */
.rock-area {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.rock {
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease;
  outline: none;
  z-index: 2;
}

.rock:hover {
  transform: scale(1.05);
}

.rock:active, .rock.pressed {
  transform: scale(0.92);
}

.rock-body {
  width: 180px;
  height: 150px;
  background: linear-gradient(135deg, #8a8a8a 0%, #6b6b6b 30%, #4a4a4a 70%, #3a3a3a 100%);
  border-radius: 45% 55% 50% 48% / 50% 45% 55% 50%;
  position: relative;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.15),
    inset 0 -4px 8px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.15s;
}

.rock:hover .rock-body {
  box-shadow:
    0 8px 40px rgba(255, 215, 0, 0.25),
    0 12px 50px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.15),
    inset 0 -4px 8px rgba(0, 0, 0, 0.3);
}

.rock-highlight {
  position: absolute;
  top: 12px;
  left: 25px;
  width: 50px;
  height: 30px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  transform: rotate(-20deg);
}

.rock-face {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 60px;
}

.rock-eye {
  position: absolute;
  top: 5px;
  width: 16px;
  height: 18px;
  background: #1a1a1a;
  border-radius: 50%;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.1);
}

.rock-eye::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 4px;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

.rock-eye.left {
  left: 8px;
}

.rock-eye.right {
  right: 8px;
}

.rock-mouth {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 10px;
  border-bottom: 3px solid #1a1a1a;
  border-radius: 0 0 12px 12px;
}

.rock-shadow {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 16px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  filter: blur(6px);
  z-index: 1;
}

/* Float texts */
#floatTexts {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.float-text {
  position: absolute;
  font-size: 24px;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  pointer-events: none;
  animation: floatUp 0.9s ease-out forwards;
  white-space: nowrap;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-40px) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translateY(-90px) scale(0.8);
  }
}

/* Upgrade Panel */
.upgrade-panel {
  width: 100%;
}

.upgrade-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s;
  color: #ccc;
}

.upgrade-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.upgrade-btn:not(:disabled):hover {
  background: rgba(76, 175, 80, 0.15);
  border-color: rgba(76, 175, 80, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.2);
}

.upgrade-btn:not(:disabled):active {
  transform: scale(0.97);
}

.upgrade-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.upgrade-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.upgrade-cost {
  font-size: 13px;
  color: #aaa;
}

.upgrade-level {
  font-size: 12px;
  color: #4caf50;
  font-weight: 600;
}

.upgrade-arrow {
  font-size: 28px;
  color: #4caf50;
  transition: transform 0.2s;
}

.upgrade-btn:not(:disabled):hover .upgrade-arrow {
  transform: translateY(-4px);
}

/* Stats */
.stats-bar {
  display: flex;
  gap: 24px;
  font-size: 12px;
  color: #666;
}

/* Particles */
.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
}

@keyframes particleBurst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0);
  }
}

/* Level-up flash */
.rock.flash .rock-body {
  animation: rockFlash 0.4s ease;
}

@keyframes rockFlash {
  0% { filter: brightness(1); }
  50% { filter: brightness(2) drop-shadow(0 0 20px rgba(255, 215, 0, 0.8)); }
  100% { filter: brightness(1); }
}

/* Shine effect for upgraded rocks */
.rock-body.shine::after {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.8), transparent);
  border-radius: 50%;
  animation: sparkle 1.5s infinite;
}

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