/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ── */
body {
  min-height: 100vh;
  background: #0e0a04;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
}

/* ─────────────────────────────
   OVERLAY & POPUP
───────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.4s ease both;
}

.overlay.hide {
  animation: fadeOut 0.35s ease forwards;
  pointer-events: none;
}

.popup {
  position: relative;
  width: min(380px, 90vw);
  background: #1a1200;
  border-radius: 24px;
  border: 1.5px solid #c8920a55;
  padding: 2rem 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  animation: popIn 0.45s cubic-bezier(0.17, 0.67, 0.35, 1.3) both;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px #f5d06022;
}

.popup-ring {
  position: absolute;
  inset: -10px;
  border-radius: 32px;
  border: 1.5px solid transparent;
  background: linear-gradient(135deg, #f5d06044, transparent 60%, #c8920a44) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  pointer-events: none;
}

.popup-icon {
  font-size: 58px;
  animation: bob 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px #c8920a66);
}

.popup-stars {
  display: flex;
  gap: 6px;
  font-size: 18px;
  letter-spacing: 2px;
  color: #f5d060;
}

.popup-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff8e7;
  line-height: 1.3;
}

.popup-title span {
  display: block;
  background: linear-gradient(90deg, #c8920a, #f5d060, #c8920a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.popup-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c8920a, transparent);
  border-radius: 2px;
}

.popup-body {
  font-size: 14px;
  color: #c9a96e;
  line-height: 1.7;
  letter-spacing: 0.5px;
  max-width: 280px;
}

.popup-btn {
  margin-top: 4px;
  padding: 13px 40px;
  font-family: 'Cinzel Decorative', serif;
  font-size: 13px;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #f5d060 0%, #c8920a 100%);
  color: #3a1f00;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 20px #c8920a55;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.popup-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 28px #c8920a77;
}

.popup-btn:active {
  transform: scale(0.97);
}

.popup-skip {
  font-size: 11px;
  color: #6b5a3a;
  cursor: pointer;
  letter-spacing: 1px;
  border: none;
  background: none;
  font-family: 'Cinzel', serif;
  transition: color 0.15s;
}

.popup-skip:hover {
  color: #c9a96e;
}

/* ─────────────────────────────
   GAME SCENE
───────────────────────────── */
.scene {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 2rem 1rem;
}

.title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 22px;
  color: #f5d060;
  letter-spacing: 3px;
  text-align: center;
  text-shadow: 0 0 30px #c8920a88;
}

.subtitle {
  font-size: 13px;
  color: #8a7045;
  letter-spacing: 1px;
  text-align: center;
  margin-top: -18px;
}

/* ─────────────────────────────
   BOX
───────────────────────────── */
.box-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  cursor: pointer;
  user-select: none;
}

.box-wrap:active {
  transform: scale(0.97);
}

.box-main {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  border: 2.5px solid #b8860b;
  background: linear-gradient(145deg, #f5d060 0%, #c8920a 60%, #8b5e03 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, box-shadow 0.2s;
  box-shadow: 0 8px 32px #c8920a55, 0 2px 8px #0003;
  overflow: hidden;
  position: relative;
}

.box-main:hover {
  box-shadow: 0 12px 40px #f5d06077, 0 2px 12px #0004;
  transform: scale(1.03);
}

.box-icon {
  font-size: 64px;
  filter: drop-shadow(0 2px 6px #0005);
  transition: transform 0.2s;
  pointer-events: none;
}

.box-wrap:hover .box-icon {
  transform: scale(1.1) rotate(-5deg);
}

/* ─────────────────────────────
   CRACK LAYER
───────────────────────────── */
.crack-layer {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  overflow: hidden;
}

.crack-layer svg {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.crack-layer svg.visible {
  opacity: 1;
}

/* ─────────────────────────────
   PIPS
───────────────────────────── */
.pips {
  display: flex;
  gap: 10px;
  margin-top: -12px;
}

.pip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #b8860b;
  background: transparent;
  transition: background 0.2s, transform 0.15s;
}

.pip.filled {
  background: #f5d060;
  transform: scale(1.2);
  box-shadow: 0 0 6px #f5d06099;
}

.pip.filled.last {
  background: #ff4d1c;
  box-shadow: 0 0 10px #ff4d1c99;
}

/* ─────────────────────────────
   CLICK COUNTER
───────────────────────────── */
.click-counter {
  font-size: 13px;
  color: #7a6540;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ─────────────────────────────
   REWARD PANEL
───────────────────────────── */
.reward-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: popIn 0.5s cubic-bezier(0.17, 0.67, 0.35, 1.3) both;
}

.reward-panel.show {
  display: flex;
}

.reward-label {
  font-family: 'Cinzel Decorative', serif;
  font-size: 13px;
  color: #c8920a;
  letter-spacing: 3px;
}

.reward-number {
  font-family: 'Cinzel Decorative', serif;
  font-size: 56px;
  font-weight: 700;
  color: #f5d060;
  line-height: 1;
  text-shadow: 0 0 40px #c8920a99;
}

.reward-bonus {
  font-size: 13px;
  color: #7a6540;
  letter-spacing: 2px;
}

/* ZONE 2 button — the main monetization CTA */
.claim-btn {
  margin-top: 4px;
  padding: 13px 40px;
  font-family: 'Cinzel Decorative', serif;
  font-size: 13px;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #f5d060 0%, #c8920a 100%);
  color: #3a1f00;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 20px #c8920a55;
  transition: transform 0.15s, box-shadow 0.15s;
}

.claim-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 28px #c8920a77;
}

.claim-btn:active {
  transform: scale(0.97);
}

.reset-btn {
  padding: 10px 28px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 2px;
  border: 1.5px solid #5a4520;
  border-radius: 8px;
  background: transparent;
  color: #c9a96e;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.reset-btn:hover {
  background: #1f1608;
}

.reset-btn:active {
  transform: scale(0.97);
}

/* ─────────────────────────────
   PARTICLES
───────────────────────────── */
.particle {
  position: absolute;
  border-radius: 2px;
  animation: fly 0.7s ease-out forwards;
  opacity: 0;
}

/* ─────────────────────────────
   KEYFRAMES
───────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.7) translateY(24px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%       { transform: translateY(-8px) rotate(3deg); }
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  20%       { transform: rotate(-4deg) scale(1.06); }
  40%       { transform: rotate(4deg) scale(1.08); }
  60%       { transform: rotate(-3deg) scale(1.05); }
  80%       { transform: rotate(2deg); }
}

@keyframes explode {
  0%   { transform: scale(1) rotate(0deg); opacity: 1; }
  30%  { transform: scale(1.2) rotate(-6deg); }
  60%  { transform: scale(0.8) rotate(8deg); opacity: 0.7; }
  100% { transform: scale(0) rotate(20deg); opacity: 0; }
}

@keyframes fly {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: var(--tx) rotate(360deg) scale(0.3); }
}

.shake   { animation: shake 0.35s ease; }
.explode { animation: explode 0.5s ease forwards; }
