* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Sora', sans-serif;
}

:root {
  --bg: #FFF3DA;
  --ink: #1f2937;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

body {
  min-height: 90vh;
  background: var(--bg);
}

.game-screen {
  position: relative;
  min-height: 90vh;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
  padding: 20px;
}

/* Faint colosseum */
.game-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('./assets/colosseum-bg.png') center/contain no-repeat;
  opacity: 1;
  z-index: -1;
}

/* Top HUD */
.hud {
  width: min(1200px, 94vw);
  margin: 20px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fffaf0;
  border-radius: 999px;
  /* padding: 10px 16px 10px 0px; */
}

.coin-mini {
  /* width: 52px;
  height: 52px; */

  /* background: #F6C453;
  border: 3px solid #111; */
  /* display: grid;
 place-items: center; 
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.5px; */
  place-items: center;
}

.coin-mini img {
  width: 72px;
  height: 72px;
}

/* .score-value {
  font-size: clamp(1.1rem, 2.8vw, 1.8rem);
  font-weight: 800;
  color: var(--ink);
  min-width: 72px;
  text-align: right;
} */

.score-value {
    font-size: clamp(1.1rem, 2.8vw, 1.8rem);
    font-weight: 800;
    color: var(--ink);
    /* min-width: 72px; */
    /* text-align: right; */
    padding-right: 2rem;
}
.lives {
  display: flex;
  gap: 8px;
  align-items: center;
}

.heart-icon {
  width: clamp(24px, 3.5vw, 34px);
  height: clamp(24px, 3.5vw, 34px);
  display: block;
}

/* Coins */
.coins-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.coin {
  position: absolute;
  width: clamp(64px, 8vw, 110px);
  height: auto;
}

.c1 { top: 26%; left: 16%; transform: rotate(-14deg); }
.c2 { top: 18%; left: 38%; transform: rotate(8deg); }
.c3 { top: 35%; left: 57%; transform: rotate(-9deg); }
.c4 { top: 24%; right: 14%; transform: rotate(13deg); }
.c5 { top: 46%; left: 28%; transform: rotate(-6deg); }
.c6 { top: 50%; right: 30%; transform: rotate(10deg); }

.falling-coin {
  position: absolute;
  left: 0;
  top: 0;
  height: auto;
  will-change: transform;
  pointer-events: none;
}

/* Character */
.character-wrap {
  position: absolute;
  bottom: max(0px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  z-index: 2;
}

.character {
  width: 6rem;
}

.pop {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #f59e0b;
  font-size: 22px;
  animation: popUp 350ms ease-out forwards;
  pointer-events: none;
}

@keyframes popUp {
  from { opacity: 1; transform: translate(-50%, -50%) scale(0.6); }
  to   { opacity: 0; transform: translate(-50%, -90%) scale(1.3); }
}

.game-over {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 243, 218, 0.58);
  text-align: center;
  z-index: 5;
  padding: 2rem;
}

.game-over-card {
  width: min(100%, 486px);
  min-height: min(88vh, 604px);
  background: #ffffff;
  border-radius: 16px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1.5rem;
  padding: 48px 48px;
}

.game-over h2 {
    font-size: 1.5rem;
    font-weight: 500;
    color: #121212;
}

.confetti-burst {
  width: 190px;
  height: 190px;
  background: url('./assets/confetti.svg') center/contain no-repeat;
}

.final-score-value {
  font-size: clamp(2.8rem, 9vw, 4.1rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #0b0b0b;
  line-height: 1;
}

.final-score-copy {
  max-width: 36ch;
  font-size: 1rem;
  line-height: 1.5;
  color: #171717;
}

.cta-btn {
  border: 0;
  border-radius: 4px;
  background: #0e0e0e;
  color: #fff;
  padding: clamp(10px, 2.8vw, 16px) clamp(18px, 6vw, 48px);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease;
}


.cta-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.play-again-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: #0e0e0e;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
}

.play-again-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: grid;
  place-items: center;
  z-index: 10;
  padding: 20px;
}

.claim-modal {
  width: min(560px, 92vw);
  background: #fffaf0;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-copy {
  margin-top: 8px;
  margin-bottom: 14px;
  color: #374151;
}

.claim-form {
  display: grid;
  gap: 10px;
}

.claim-form label {
  font-weight: 700;
}

.claim-form input {
  border: 2px solid #d1d5db;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
}

.form-message {
  min-height: 20px;
  font-size: 0.9rem;
  color: #1f2937;
}

.hidden { display: none; }

@media (max-width: 768px) {
  .game-screen::before {
    background-position: center bottom;
    background-size: cover;
  }

  .game-over-card {
    min-height: auto;
    padding: 48px 48px;
    gap: 1.5rem;
  }

  .confetti-burst {
    width: 152px;
    height: 152px;
  }

  .cta-btn {
    width: 100%;
    max-width: 250px;
  }
}