/* Аниме-кликер — стили */
:root {
  --ink: #6b4a6f;
  --muted: #a77fa8;
  --pink: #ff6fa5;
  --pink-soft: #ffd3e5;
  --green: #2fbf8f;
  --card: rgba(255, 255, 255, .75);
  --line: rgba(255, 111, 165, .28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(160deg, #ffe3f0 0%, #f0e4ff 48%, #ffecf4 100%) fixed;
  color: var(--ink);
  font-family: "Segoe UI", "Trebuchet MS", system-ui, -apple-system, Roboto, Arial, sans-serif;
  display: flex;
  justify-content: center;
  padding: 26px 12px 46px;
  overflow-x: hidden;
}

/* Лепестки сакуры */
.petals {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.petal {
  position: absolute;
  top: -24px;
  background: linear-gradient(135deg, #ffc2dd, #ff9ecb);
  border-radius: 90% 8% 90% 8%;
  opacity: .75;
  animation: fall var(--dur) linear var(--delay) infinite;
}
@keyframes fall {
  to { transform: translate3d(var(--sway), 112vh, 0) rotate(560deg); }
}

.wrap { position: relative; z-index: 1; width: 100%; max-width: 720px; }

.head { text-align: center; }
h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 6vw, 40px);
  letter-spacing: .5px;
  background: linear-gradient(90deg, #ff6fa5, #a78bfa 60%, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub { margin: 0; color: var(--muted); font-weight: 600; }

/* Карточки гемов */
.gems-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0 8px;
}
.gem-card {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 9px 15px;
  box-shadow: 0 6px 18px rgba(255, 111, 165, .14);
  backdrop-filter: blur(4px);
  transition: border-color .25s, box-shadow .25s;
}
.gem-card .icon { display: flex; }
.gem-card .num {
  font-size: 17px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.gem-card .num b { color: var(--ink); font-size: 19px; }
.gem-card .check {
  display: none;
  color: var(--green);
  font-weight: 900;
  font-size: 18px;
  text-shadow: 0 0 10px rgba(47, 191, 143, .5);
}
.gem-card.done {
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(47, 191, 143, .35);
}
.gem-card.done .check { display: inline; }
.gem-card.bump { animation: bump .35s ease; }
@keyframes bump {
  40% { transform: scale(1.14); }
}

/* Сцена с девочкой */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.bubble {
  position: relative;
  background: #fff;
  border: 2px solid var(--pink-soft);
  border-radius: 20px;
  padding: 12px 20px;
  max-width: min(360px, 86vw);
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.35;
  color: #7a4b7f;
  box-shadow: 0 8px 22px rgba(255, 111, 165, .18);
  transition: opacity .4s;
}
.bubble::after {
  content: "";
  position: absolute;
  bottom: -11px;
  left: 50%;
  margin-left: -9px;
  border: 11px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
  filter: drop-shadow(0 2px 0 var(--pink-soft));
}
.bubble.fade { opacity: 0; }
.bubble.pop { animation: bubble-pop .25s ease; }
@keyframes bubble-pop {
  from { transform: scale(.6) translateY(10px); opacity: .2; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.girl-btn {
  margin-top: 14px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
}
.girl-img {
  display: block;
  width: min(330px, 76vw);
  pointer-events: none;
  filter: drop-shadow(0 16px 26px rgba(255, 111, 165, .32));
  transform-origin: 50% 100%;
  animation: float 3.2s ease-in-out infinite alternate;
}
@keyframes float {
  from { transform: translateY(0); }
  to   { transform: translateY(-9px); }
}

.girl-img.react-bounce { animation: react-bounce .45s ease; }
@keyframes react-bounce {
  0%   { transform: scale(1, 1); }
  30%  { transform: scale(1.07, .9); }
  55%  { transform: scale(.95, 1.07); }
  75%  { transform: scale(1.03, .97); }
  100% { transform: scale(1, 1); }
}
.girl-img.react-wiggle { animation: react-wiggle .5s ease; }
@keyframes react-wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-6deg); }
  60% { transform: rotate(5deg); }
}
.girl-img.react-happy { animation: react-happy .55s ease; }
@keyframes react-happy {
  0%   { transform: translateY(0) rotate(0); }
  35%  { transform: translateY(-22px) rotate(-4deg); }
  70%  { transform: translateY(0) rotate(3deg); }
  100% { transform: translateY(0) rotate(0); }
}

/* Летящие частицы */
.spark, .fly {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  will-change: transform, opacity;
}
.spark { font-size: var(--fs, 16px); }

/* Статистика и кнопки */
.stats-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 18px;
}
.stat-chip {
  background: var(--card);
  border: 1.5px solid var(--pink-soft);
  border-radius: 14px;
  padding: 9px 15px;
  font-weight: 700;
  color: #8a5a8f;
  font-variant-numeric: tabular-nums;
}

.btn {
  background: linear-gradient(135deg, #ff6fa5, #a78bfa);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 11px 22px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 111, 165, .35);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255, 111, 165, .45); }

.icon-btn {
  background: var(--card);
  border: 1.5px solid var(--pink-soft);
  border-radius: 14px;
  padding: 9px 12px;
  font-size: 17px;
  cursor: pointer;
}

.help {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* Модальное окно победы */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(90, 40, 80, .35);
  backdrop-filter: blur(3px);
}
.modal.hidden { display: none; }
.modal-card {
  background: rgba(255, 250, 253, .96);
  border: 2px solid var(--pink-soft);
  border-radius: 24px;
  padding: 30px 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 70px rgba(255, 111, 165, .4);
  animation: rise .28s ease;
}
.modal-card h2 { margin: 0 0 14px; font-size: 24px; color: #7a4b7f; }
.modal-card p { margin: 0 0 20px; color: #9b6f9e; line-height: 1.55; font-weight: 600; }

.win-gems {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 16px;
}
.win-gems .wg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.win-gems .wg .lbl { font-size: 12px; color: var(--muted); }

@keyframes rise {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.confetti {
  position: fixed;
  z-index: 59;
  top: -30px;
  pointer-events: none;
  font-size: var(--fs, 18px);
  will-change: transform, opacity;
}

@media (max-width: 560px) {
  .gem-card { padding: 8px 11px; }
  .stats-row { gap: 8px; }
  .stat-chip { padding: 8px 12px; }
}
