* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0d0b1a;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
  cursor: none;
}

/* ===== HUD ===== */
#hud {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  text-align: center;
  font-size: 22px;
  letter-spacing: 2px;
  z-index: 5;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
#lives.fiado {
  font-size: 15px;
  letter-spacing: 1px;
  color: #ff9bbf;
  font-weight: 700;
}

#util-btns {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  right: 8px;
  z-index: 6;
}
#util-btns button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.4);
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}
#util-btns button.off { opacity: 0.4; text-decoration: line-through; }

#start-hint {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 0; right: 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
#start-hint.gone { opacity: 0; }

/* ===== Tela de vitória ===== */
#win {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 24px;
  background: radial-gradient(circle at 50% 40%, rgba(70,12,45,0.30), rgba(13,11,26,0.62));
  opacity: 0;
  transition: opacity 1.2s ease;
}
#win.show { display: flex; opacity: 1; }

#win-phrase {
  font-size: clamp(28px, 8vw, 64px);
  font-weight: 800;
  text-align: center;
  letter-spacing: 1px;
  color: #ffe0ec;
  text-shadow: 0 0 24px rgba(255,77,141,0.7), 0 4px 16px rgba(0,0,0,0.5);
  animation: pulseGlow 2.2s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

#win-buttons {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
  height: 90px;
}
#btn-sim {
  font-family: inherit;
  font-size: clamp(22px, 6vw, 34px);
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ff2e63, #ff7eb3);
  border: none;
  border-radius: 999px;
  padding: 16px 44px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(255,46,99,0.6);
  transition: transform 0.12s ease;
}
#btn-sim:active { transform: scale(0.94); }
#btn-nao {
  position: absolute;
  font-family: inherit;
  font-size: 18px;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1);
  left: calc(50% + 110px);
}

/* ===== Mensagem final ===== */
#win-final {
  display: none;
  text-align: center;
  animation: fadeUp 1s ease both;
}
#win-final.show { display: block; }
#final-msg {
  font-size: clamp(26px, 7vw, 52px);
  font-weight: 800;
  color: #ffd1e3;
  text-shadow: 0 0 20px rgba(255,77,141,0.8);
}
#final-sub {
  margin-top: 12px;
  font-size: clamp(14px, 4vw, 22px);
  color: rgba(255,255,255,0.8);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
