/**
 * MiniMümin — Bölge Sandığı stilleri (Dalga 4 / 4.3)
 * Yalnız .rchest-* sınıfları: haritadaki küçük gösterge + tam ekran açılış.
 * Harita dosyasından SONRA yüklenir (index.html sırası); sınıf adları yeni
 * olduğu için özgüllük çakışması yok. Hover yalnız dokunmatik olmayan
 * cihazlarda, animasyon prefers-reduced-motion'da kapalı.
 */

/* ── Haritadaki gösterge (durak <button> içinde <span>) ── */
.rchest-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;                 /* 2-3 yaş dokunma hedefi (durak içinde) */
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1;
  color: #1F2937;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
  align-self: flex-start;
}

/* Sandık hazır: parlayan gösterge (çocuk fark etsin) */
.rchest-badge--ready {
  color: #7C2D12;
  background: linear-gradient(135deg, #FDE68A 0%, #FBBF24 100%);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.5), 0 0 18px rgba(251, 191, 36, 0.75);
  animation: rchest-pulse 1.6s ease-in-out infinite;
}
.rchest-badge-text {
  font-size: 14px;
  font-weight: 900;
}

@keyframes rchest-pulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.45), 0 0 14px rgba(251, 191, 36, 0.6); }
  50%      { transform: scale(1.06); box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.62), 0 0 26px rgba(251, 191, 36, 0.9); }
}

/* ── Tam ekran açılış katmanı ── */
.rchest-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.72);
  -webkit-tap-highlight-color: transparent;
}

.rchest-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(420px, 100%);
  max-height: calc(100vh - 40px);
  padding: 26px 22px 22px;
  border-radius: 28px;
  text-align: center;
  background: linear-gradient(160deg, #FFFDF5 0%, #FEF3C7 100%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.4);
  animation: rchest-in 0.24s ease-out;
}

/* Kapalı sandık: 0.8 sn sallanır, sonra açılır (JS .rchest-open ekler) */
.rchest-chest {
  font-size: 72px;
  line-height: 1;
  animation: rchest-shake 0.8s ease-in-out 1;
}
.rchest-open .rchest-chest {
  animation: none;
  transform: scale(1.08);
}

@keyframes rchest-shake {
  0%   { transform: rotate(0deg)   scale(1); }
  15%  { transform: rotate(-9deg)  scale(1.04); }
  30%  { transform: rotate(8deg)   scale(1.06); }
  45%  { transform: rotate(-7deg)  scale(1.08); }
  60%  { transform: rotate(6deg)   scale(1.1); }
  75%  { transform: rotate(-4deg)  scale(1.12); }
  100% { transform: rotate(0deg)   scale(1.14); }
}

/* Açılan ödül: büyük emoji */
.rchest-prize {
  font-size: 92px;
  line-height: 1;
  animation: rchest-pop 0.36s ease-out;
}

@keyframes rchest-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes rchest-pop {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

.rchest-title {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  color: #7C2D12;
}

.rchest-prize-name {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: #1F2937;
}

/* "Harika!" — dokunma hedefi ≥56px */
.rchest-go {
  width: 100%;
  min-height: 56px;
  margin-top: 4px;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 20px;
  font-weight: 900;
  color: #FFFFFF;
  cursor: pointer;
  touch-action: manipulation;
  background: linear-gradient(135deg, #0E9F6E 0%, #4ADE80 100%);
  box-shadow: 0 5px 0 rgba(15, 23, 42, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rchest-go:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(15, 23, 42, 0.2);
}
.rchest-go:focus-visible {
  outline: 4px solid #FFFFFF;
  outline-offset: 3px;
}
@media (hover: hover) {
  .rchest-go:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 rgba(15, 23, 42, 0.2);
  }
}

/* ── Hareket azaltma: animasyon ve geçiş yok ── */
@media (prefers-reduced-motion: reduce) {
  .rchest-badge--ready,
  .rchest-card,
  .rchest-chest,
  .rchest-prize,
  .rchest-go {
    animation: none;
    transition: none;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) and (hover: hover) {
  .rchest-go:hover {
    transform: none;
  }
}
