@import url('css2?family=Comfortaa:wght@400;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: none;
  font-family: 'Comfortaa', sans-serif;
  background: #1a0a2e;
  position: fixed;
  top: 0;
  left: 0;
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#ui-root {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}


.btn {
  padding: 14px 32px;
  border: none;
  border-radius: 50px;
  font-family: 'Comfortaa', sans-serif;
  font-size: clamp(14px, 3.5vw, 20px);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 48px;
  min-width: min(200px, 80vw);
  text-align: center;
  pointer-events: auto;
  max-width: 90vw;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background: linear-gradient(135deg, #ff6bb5, #c84bfa);
  color: #fff;
  box-shadow: 0 4px 25px rgba(255, 107, 181, 0.4), 0 0 40px rgba(200, 75, 250, 0.2);
}

.btn-primary:active {
  box-shadow: 0 2px 15px rgba(255, 107, 181, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

/* Gameplay UI */
.gameplay-overlay {
  pointer-events: none !important;
  justify-content: flex-start;
  padding: 0;
}

.gameplay-overlay.active {
  pointer-events: none !important;
}

.top-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 70%, transparent 100%);
  gap: 8px;
  flex-wrap: wrap;
}

.step-indicator {
  display: flex;
  gap: 6px;
  align-items: center;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.step-dot.active {
  background: #ff6bb5;
  box-shadow: 0 0 10px rgba(255, 107, 181, 0.5);
  width: 12px;
  height: 12px;
}

.step-dot.done {
  background: #7cff6b;
}

.step-name {
  color: #fff;
  font-size: clamp(13px, 3.2vw, 18px);
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

/* Bottom tool panel */
.tool-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 45vh;
  padding: 12px 8px 20px;
  pointer-events: auto;
  background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 70%, transparent 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.color-palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 400px;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.color-swatch.selected {
  border-color: #fff;
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.sticker-palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 400px;
}

.sticker-item {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, border-color 0.15s;
}

.sticker-item.selected {
  border-color: #ff6bb5;
  background: rgba(255, 107, 181, 0.2);
  transform: scale(1.1);
}

.hint-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(11px, 2.8vw, 15px);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

.sticker-controls {
  display: flex;
  gap: 6px;
}

.size-btn, .rot-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: 'Comfortaa', sans-serif;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.size-btn.selected, .rot-btn.selected {
  border-color: #ff6bb5;
  background: rgba(255, 107, 181, 0.25);
  transform: scale(1.1);
}

.rot-btn span {
  font-size: 14px;
  line-height: 1;
}

.btn-next {
  padding: 12px 36px;
  pointer-events: auto;
}

/* Progress bar for filing */
.nail-progress {
  width: 80%;
  max-width: 300px;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  overflow: hidden;
}

.nail-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6bb5, #c84bfa);
  border-radius: 4px;
  transition: width 0.1s ease;
  width: 0%;
}

/* Result Screen */
.result-screen {
  background: linear-gradient(180deg, rgba(45,27,105,0.92) 0%, rgba(26,10,46,0.95) 60%, rgba(13,5,32,0.97) 100%);
  gap: 20px;
}

.result-title {
  font-size: clamp(24px, 6vw, 40px);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 130, 200, 0.5);
}

.stars-container {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

.star {
  width: clamp(40px, 10vw, 60px);
  height: clamp(40px, 10vw, 60px);
  position: relative;
}

.result-score {
  font-size: clamp(16px, 4vw, 24px);
  color: #fff;
  margin-bottom: 10px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.result-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Rewarded ad button */
.btn-rewarded {
  background: linear-gradient(135deg, #ffd700, #ff9500);
  color: #1a0a2e;
  font-size: clamp(13px, 3vw, 17px);
  padding: 12px 24px;
  min-width: 160px;
}

.ad-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  vertical-align: middle;
}

/* Shop screen */
.shop-item {
  transition: transform 0.15s, border-color 0.15s;
}

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

.shop-rewarded {
  animation: rewardPulse 2s ease-in-out infinite;
}

@keyframes rewardPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255,215,0,0); }
  50% { box-shadow: 0 0 12px rgba(255,215,0,0.3); }
}

/* Scrollable shop container */
.screen[style*="overflow-y:auto"] {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Gradient swatch smaller */
.grad-swatch {
  width: 28px !important;
  height: 28px !important;
}
