/* Scratch card page */
.sc-page {
  max-width: 390px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px;
  background: #421862;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.sc-header {
  text-align: center;
  padding: 16px 0;
}
.sc-wordmark {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--nextory-pink);
  letter-spacing: -0.01em;
}
.sc-subline {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 700;
  color: #E55176;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.sc-subline::before,
.sc-subline::after {
  content: "";
  flex: 1;
  height: 2px;
  background: #E55176;
  border-radius: 1px;
}

/* Stamp card */
.sc-card {
  position: relative;
  background: transparent;
  border-radius: 16px;
  padding: 8px 0 0;
  max-width: 340px;
  width: 100%;
  margin: 8px auto 0;
}

.sc-sub {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  line-height: 1.4;
}
.sc-sub .accent { color: #7DC734; font-weight: 600; }

.sc-grid {
  display: grid;
  grid-template-columns: repeat(2, 106px);
  grid-auto-rows: 106px;
  gap: 16px;
  justify-content: center;
}

.sc-cell {
  position: relative;
  box-sizing: border-box;
  width: 106px;
  height: 106px;
  background: #E2A9F2;
  border: 9px solid #F4CDFF;
  border-radius: 10px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.sc-cell .reveal-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.sc-cell .reveal-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
.sc-cell canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity .35s ease;
}
.sc-cell.revealed canvas { opacity: 0; pointer-events: none; }

/* Coin scratch cursor */
#coin-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 52px;
  height: 52px;
  background: url("Coin_Large.png") center/contain no-repeat;
  pointer-events: none;
  z-index: 9999;
  display: none;
  transform: translate3d(0, 0, 0);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.25));
}
#coin-cursor.is-active { display: block; }

/* ----- Win banner (below card, post-popup) ----- */
@keyframes wb-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
#win-banner {
  max-width: 340px;
  width: 100%;
  margin: 20px auto 0;
  padding-bottom: 24px;
  text-align: center;
  opacity: 0;
}
#win-banner.is-in {
  animation: wb-slide-up 400ms ease-out forwards;
}
.wb-prompt {
  margin: 0 0 12px;
  font-size: 15px;
  color: #4C4846;
}
.wb-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 340px;
  height: 52px;
  margin: 0 auto;
  background: #D7355B;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(215, 53, 91, 0.35);
  transition: background-color .15s ease, transform .1s ease;
}
.wb-cta:hover { background: #A40035; }
.wb-cta:active { transform: scale(0.98); }
.wb-trust {
  margin: 8px 0 0;
  font-size: 13px;
  color: #4C4846;
}

/* ----- Win popup overlay ----- */
@keyframes ov-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes ov-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
#win-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: ov-fade-in 300ms ease-out forwards;
  padding: 16px;
}
#win-overlay.is-out { animation: ov-fade-out 250ms ease-out forwards; }

.win-popup {
  position: relative;
  background: #F9F5F2;
  border-radius: 20px;
  padding: 32px 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  opacity: 0;
  animation: pop-in 400ms ease-out 150ms both;
}
.win-popup .close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  color: #4C4846;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.win-popup h2 {
  margin: 0 0 4px;
  font-size: 32px;
  font-weight: 700;
  color: #32302D;
  line-height: 1.15;
}
.win-popup .prize {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: #32302D;
}
.win-popup .prize em {
  font-style: normal;
  font-weight: 700;
  color: #7DC734;
}
.win-popup img {
  width: 120px;
  height: 120px;
  display: block;
  margin: 16px auto;
  object-fit: contain;
}
.win-popup .copy {
  margin: 0 auto 16px;
  max-width: 260px;
  font-size: 15px;
  font-weight: 400;
  color: #4C4846;
  line-height: 1.45;
}
.win-popup .wb-trust { margin-top: 8px; }

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1001;
}

/* ----- Star divider (mockup footer) ----- */
.sc-stars {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 340px;
  width: 100%;
  margin: 28px auto 20px;
  padding: 0 4px;
}
.sc-stars::before,
.sc-stars::after {
  content: "";
  flex: 1;
  height: 2px;
  background: #E55176;
  border-radius: 1px;
}
.sc-stars span {
  font-size: 17px;
  line-height: 1;
  color: #E55176;
}
.sc-stars span:nth-child(even) { color: #C9A0E8; }
