/* The Great Leaders — 포인트 상자(미션 성공 뒤 축하 창) · reward.js가 만든다
   차례: 어두워짐 → 상자가 통통 떨어짐(흔들흔들) → 누르면(또는 잠시 뒤) 뚜껑이 튕겨 나감 → +점수 → 별 동전이 위 '내 포인트'로 날아감 → '좋아요'.
   크기는 px로 고정(기사 글자 크기 Aa를 따라 커지지 않게). 움직임은 늘 켜짐(사이트 결정 11-26). */

.prize {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px calc(18px + env(safe-area-inset-bottom, 0px));
  overflow: hidden; isolation: isolate;
  overscroll-behavior: contain; touch-action: none;
  color: #F6F8F4; text-align: center;
  font-family: "Anybody", "Pretendard Variable", Pretendard, system-ui, sans-serif; font-size: 16px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  cursor: pointer;
  --bw: 184px;                                           /* 상자 폭(키 큰 폰에서는 조금 크게) */
}
.prize.is-done { cursor: default; }
@media (min-height: 760px) { .prize { --bw: 212px; } }
body > .prize { z-index: 95; }
/* 뒤 화면을 솔숲 초록으로 덮고 살짝 흐리게 */
.prize::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(90% 60% at 50% 44%, rgba(48, 104, 80, .5), rgba(48, 104, 80, 0) 70%),
    rgba(23, 58, 45, .74);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: prize-dim .2s ease-out both;
}
@keyframes prize-dim { from { opacity: 0; } }
.prize__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; }
.prize [hidden] { display: none !important; }
.prize [lang="ko"] { font-family: "Pretendard Variable", Pretendard, system-ui, sans-serif; word-break: keep-all; }

/* ---------- 위: 내 포인트 ---------- */
.prize__top { position: relative; z-index: 4; flex: none; height: 46px; display: flex; align-items: center; justify-content: center; }
.prize__pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 44px; margin: 0; padding: 0 17px 0 7px; border-radius: 999px;
  background: linear-gradient(180deg, #FFFEF6, #FFF3C4);
  box-shadow: inset 0 0 0 1.5px #E2B300, inset 0 -3px 0 rgba(201, 154, 18, .22), 0 10px 22px -10px rgba(0, 0, 0, .55);
  color: #173A2D; white-space: nowrap;
  animation: prize-down .5s .12s cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes prize-down { from { opacity: 0; transform: translateY(-18px) scale(.9); } }
.prize__star { display: grid; width: 30px; height: 30px; flex: none; }
.prize__star svg { width: 30px; height: 30px; }
.prize__mine { font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: -.01em; color: #22503F; }
.prize__total {
  min-width: 1.6em; text-align: left;
  font-family: "Anybody", system-ui, sans-serif; font-size: 22px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums; color: #173A2D;
}

/* ---------- 가운데: 상자 ---------- */
.prize__stage {
  position: relative; z-index: 2; isolation: isolate;
  flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.prize__gain {
  position: relative; z-index: 2;
  height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  opacity: 0; pointer-events: none;
}
.prize.is-open .prize__gain { opacity: 1; }
.prize__plus {
  display: flex; align-items: center; gap: 6px; margin: 0;
  font-family: "Anybody", system-ui, sans-serif; font-size: 58px; font-weight: 800; line-height: .9; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums; color: #FFD43B;
  text-shadow: 0 2px 0 #C99A12, 0 4px 0 rgba(130, 92, 0, .55), 0 12px 26px rgba(0, 0, 0, .35);
}
.prize__plus svg { width: 42px; height: 42px; flex: none; margin-right: 2px; filter: drop-shadow(0 3px 0 rgba(130, 92, 0, .5)); }
.prize__pl { margin-right: -5px; font-family: "Pretendard Variable", Pretendard, system-ui, sans-serif; font-size: .74em; font-weight: 700; }   /* Anybody의 +는 너무 작다 */
.prize__lbl { margin: 8px 0 0; font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: .04em; color: rgba(246, 248, 244, .86); }

.prize__spot { position: relative; width: var(--bw); height: calc(var(--bw) * 176 / 184); flex: none; margin-top: 6px; }
/* 상자 뒤 따뜻한 빛줄기(바깥은 커지고, 안은 천천히 돈다) */
.prize__rays {
  position: absolute; left: 50%; top: 36%; z-index: 0; width: 460px; height: 460px; margin: -230px 0 0 -230px;
  opacity: 0; transform: scale(.3);
  transition: opacity .45s ease, transform .9s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none;
}
.prize__rays i {
  position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(from 4deg, rgba(255, 236, 160, .34) 0deg 7deg, rgba(255, 236, 160, 0) 7deg 22.5deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 14%, rgba(0, 0, 0, .55) 45%, transparent 98%);
  mask-image: radial-gradient(closest-side, #000 14%, rgba(0, 0, 0, .55) 45%, transparent 98%);
  animation: prize-spin 16s linear infinite;
}
@keyframes prize-spin { to { transform: rotate(360deg); } }
.prize__glow {
  position: absolute; left: 50%; top: 34%; z-index: 1; width: 280px; height: 220px; margin: -110px 0 0 -140px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 236, 150, .8), rgba(255, 212, 59, .32) 45%, rgba(255, 212, 59, 0));
  opacity: 0; transform: scale(.4);
  transition: opacity .35s ease, transform .6s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none;
}
.prize.is-open .prize__rays { opacity: 1; transform: none; }
.prize.is-soft.is-open .prize__rays { opacity: .6; }
.prize.is-open .prize__glow { opacity: 1; transform: none; }

.prize__shadow {
  position: absolute; left: 7.5%; bottom: -4px; z-index: 1; width: 85%; height: 26px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(4, 18, 12, .5), rgba(4, 18, 12, 0));
  pointer-events: none;
}
.prize__box {
  position: absolute; inset: 0; z-index: 3;
  width: 100%; height: 100%; margin: 0; padding: 0;
  border: 0; border-radius: 24px; background: none; color: inherit;
  overflow: visible; cursor: pointer; touch-action: manipulation;
  transform-origin: 50% 96%;
  -webkit-tap-highlight-color: transparent;
}
.prize__box svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.prize__lid { transform-origin: 50% 37.5%; }
.prize__box:focus, .prize__box:focus-visible { outline: none; box-shadow: none; border-radius: 24px; }
.prize.is-kbd .prize__box:focus-visible { outline: 3px dashed #FFD43B; outline-offset: 6px; }
.prize .pz-glow { opacity: 0; transition: opacity .35s ease .05s; }
.prize .pz-under { transition: opacity .2s ease; }
.prize.is-open .pz-glow { opacity: 1; }
.prize.is-open .pz-under { opacity: 0; }
.prize.is-open .prize__box { cursor: default; }

/* 반짝이(열리면 둘레에서 깜박) */
.prize__spark { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.prize__spark i {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  opacity: 0; transform: scale(0);
}
.prize__spark svg { display: block; width: 100%; height: 100%; }
.prize.is-open .prize__spark i { animation: prize-twinkle 1.5s var(--d) ease-in-out infinite; }
@keyframes prize-twinkle {
  0%, 100% { opacity: 0; transform: scale(0) rotate(0); }
  35% { opacity: 1; transform: scale(1) rotate(25deg); }
  60% { opacity: .9; transform: scale(.7) rotate(45deg); }
}

/* ---------- 상자 밑 한 줄 · 맨 아래 단추 ---------- */
.prize__msg { position: relative; z-index: 4; display: grid; width: 100%; max-width: 340px; min-height: 26px; margin-top: 20px; }
.prize__foot {
  position: relative; z-index: 4; flex: none;
  width: 100%; max-width: 340px; min-height: 54px; margin-top: 10px;
  display: flex; justify-content: center;
}
.prize__hint, .prize__line { grid-area: 1 / 1; margin: 0; font-size: 16px; font-weight: 600; line-height: 1.5; letter-spacing: -.01em; }
.prize__hint { color: rgba(246, 248, 244, .92); opacity: 0; transition: opacity .3s ease; }
.prize.is-ready .prize__hint { opacity: 1; animation: prize-nudge 1.2s .4s ease-in-out infinite; }
.prize.is-open .prize__hint { opacity: 0; animation: none; transition-duration: .15s; }
@keyframes prize-nudge { 50% { transform: translateY(-3px); } }
.prize__line { color: #FFF3C4; font-size: 17px; font-weight: 700; animation: prize-rise .4s cubic-bezier(.2, .8, .3, 1) both; }
.prize__line b { color: #FFD43B; font-weight: 700; }
@keyframes prize-rise { from { opacity: 0; transform: translateY(8px); } }
.prize__go {
  width: 100%; max-width: 300px; height: 54px; margin: 0; padding: 0 24px;
  border: 1px solid #C99A12; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #FFE27A, #FFD43B); color: #2B2000;
  font-family: "Pretendard Variable", Pretendard, system-ui, sans-serif; font-size: 17px; font-weight: 700; letter-spacing: -.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 10px 20px -10px rgba(0, 0, 0, .6);
  animation: prize-rise .35s cubic-bezier(.2, .8, .3, 1) both;
  transition: transform .14s cubic-bezier(.3, 1.6, .5, 1), box-shadow .14s;
  touch-action: manipulation;
}
.prize__go:active { transform: translateY(2px) scale(.97); box-shadow: inset 0 3px 6px rgba(140, 100, 0, .4); }
.prize__go:focus, .prize__go:focus-visible {
  outline: none; border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 10px 20px -10px rgba(0, 0, 0, .6);
}
.prize.is-kbd .prize__go:focus-visible { outline: 3px solid #F6F8F4; outline-offset: 3px; box-shadow: 0 0 0 7px rgba(255, 212, 59, .5); }

/* ---------- 날아가는 것들(동전·꽃가루) ---------- */
.prize__fx { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.prize__coin { position: absolute; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; will-change: transform; }
.prize__coin svg { display: block; width: 30px; height: 30px; filter: drop-shadow(0 2px 2px rgba(60, 40, 0, .35)); }
.prize__bit { position: absolute; display: block; will-change: transform; }

/* 좁고 낮은 화면 */
@media (max-height: 680px) {
  .prize { --bw: 168px; }
  .prize__gain { height: 84px; }
  .prize__plus { font-size: 50px; }
  .prize__plus svg { width: 36px; height: 36px; }
  .prize__msg { margin-top: 14px; }
}

/* ---------- 작은 '+10 ★' (맞힌 문제·처음 뒤집은 카드 옆에서 떠오름) ---------- */
.prize-float {
  position: fixed; z-index: 96; left: 0; top: 0;
  display: inline-flex; align-items: center; gap: 3px;
  height: 26px; padding: 0 9px 0 10px; border-radius: 999px;
  background: linear-gradient(180deg, #FFE68A, #FFD43B);
  box-shadow: inset 0 0 0 1px #C99A12, 0 6px 12px -6px rgba(60, 40, 0, .55);
  color: #3B2A00; white-space: nowrap; pointer-events: none;
  font-family: "Anybody", system-ui, sans-serif; font-size: 14px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
}
.prize-float svg { width: 14px; height: 14px; flex: none; }
.prize-float__pl { margin-right: -2px; font-family: "Pretendard Variable", Pretendard, system-ui, sans-serif; font-size: 16px; font-weight: 700; }
.prize-float.is-soft { background: linear-gradient(180deg, #FFF6D2, #FFE98F); }
