/* 축하 화면 (js/celebrate.js) — 레벨 상자 · 메달 · 이번 달 등급. transform · opacity 만 움직여 휴대폰에서도 부드럽게 */
.cel { position: fixed; inset: 0; z-index: 3000; display: none; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 42%, rgba(18, 24, 40, .9), rgba(3, 5, 10, .96) 70%); color: #fff;
  font-family: var(--font, "Pretendard Variable", Pretendard, system-ui, sans-serif); cursor: pointer; -webkit-tap-highlight-color: transparent;
  animation: cel-fade .35s ease-out both; overscroll-behavior: contain; touch-action: manipulation; }
.cel.on { display: flex; }
.cel-cv { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.cel-stage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(460px, 100%); text-align: center; }
.cel-x { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06); color: #e6e9f0; display: grid; place-items: center; cursor: pointer; padding: 0; }
.cel-x:hover { background: rgba(255, 255, 255, .14); }
.cel-x:focus-visible { outline: 2px solid #5b7bff; outline-offset: 2px; }
.cel-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

/* 글 */
.cel-txt { --td: 1.35s; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cel-txt > * { animation: cel-up .5s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: var(--td); margin: 0; }
.cel-txt small { font-size: 14px; font-weight: 600; letter-spacing: .02em; color: #ffd76a; }
.cel-txt h2 { font-size: 34px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 0 24px color-mix(in srgb, var(--hc, #ffd76a) 55%, transparent); animation-delay: calc(var(--td) + .08s); word-break: keep-all; }
.cel-l2 { font-size: 16px; font-weight: 600; color: #f1f3f8; line-height: 1.45; animation-delay: calc(var(--td) + .3s) !important; word-break: keep-all; }
.cel-sm { font-size: 13px; color: #a9b1c0; line-height: 1.4; animation-delay: calc(var(--td) + .45s) !important; word-break: keep-all; }
.cel-tap { margin-top: 14px !important; font-size: 12px; color: #7d8699; animation: cel-up .5s calc(var(--td) + .8s) both, cel-pulse 1.8s calc(var(--td) + 1.3s) ease-in-out infinite !important; }
.cel-medal ~ .cel-txt, .cel-medal + .cel-txt { --td: 1s; }
.cel-grade + .cel-txt { --td: .65s; }

/* ---------- 레벨 상자 ---------- */
.cel-box { --bc: #8b95a7; --s: 1; position: relative; width: calc(150px * var(--s)); height: calc(170px * var(--s)); animation: cel-drop .75s cubic-bezier(.33, 0, .3, 1) both; }
.cel.big .cel-box { --s: 1.2; }
.cel.is-level .cel-txt h2 { --hc: var(--bc); }
.cel-boxwrap { position: absolute; left: 50%; bottom: 14px; width: calc(130px * var(--s)); height: calc(128px * var(--s)); margin-left: calc(-65px * var(--s)); transform-origin: 50% 100%;
  animation: cel-shake .5s .8s ease-in-out both; }
.cel-body { position: absolute; left: 0; right: 0; bottom: 0; height: 74%; border-radius: 8px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--bc) 100%, #fff 18%), var(--bc) 45%, color-mix(in srgb, var(--bc) 55%, #000));
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, .28), inset 0 2px 0 rgba(255, 255, 255, .35); }
.cel-body i, .cel-lid i { position: absolute; top: 0; bottom: 0; left: 50%; width: 18%; margin-left: -9%; background: linear-gradient(90deg, #ff5a6e, #f6465d 50%, #c12c41); }
.cel-lid { position: absolute; left: -6%; right: -6%; top: 10%; height: 24%; border-radius: 6px; z-index: 2;
  background: linear-gradient(170deg, color-mix(in srgb, var(--bc) 100%, #fff 30%), var(--bc) 60%, color-mix(in srgb, var(--bc) 70%, #000));
  box-shadow: 0 4px 8px rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .4);
  transform: translate(-14%, -95%) rotate(-24deg); animation: cel-lid .55s 1.25s cubic-bezier(.2, 1.4, .4, 1) both; }
.cel-lid::before, .cel-lid::after { content: ""; position: absolute; bottom: 92%; left: 50%; width: 30%; height: 70%; border: 5px solid #f6465d; border-radius: 50% 50% 10% 50%; }
.cel-lid::before { margin-left: -30%; transform: rotate(-20deg); }
.cel-lid::after { transform: scaleX(-1) rotate(-20deg); }
.cel-shadow { position: absolute; left: 50%; bottom: 2px; width: calc(120px * var(--s)); height: 14px; margin-left: calc(-60px * var(--s)); border-radius: 50%; background: rgba(0, 0, 0, .55); filter: blur(4px); animation: cel-shadow .75s both; }
.cel-burst { position: absolute; left: 50%; top: 42%; width: 420px; height: 420px; margin: -210px 0 0 -210px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .95) 0, color-mix(in srgb, var(--bc) 70%, #fff) 12%, transparent 46%),
    repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--bc) 45%, transparent) 0 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%); mask: radial-gradient(circle, #000 25%, transparent 68%);
  animation: cel-burst .7s 1.25s cubic-bezier(.2, .9, .3, 1) both, cel-spin 14s 1.95s linear infinite; }
.cel.big .cel-burst { width: 560px; height: 560px; margin: -280px 0 0 -280px;
  background: radial-gradient(circle, #fff 0, #ffe7a0 12%, transparent 48%), repeating-conic-gradient(from 0deg, rgba(255, 215, 106, .55) 0 5deg, transparent 5deg 14deg); }
.cel.big .cel-txt h2 { font-size: 40px; background: linear-gradient(180deg, #fff, #ffd76a); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- 메달 ---------- */
.cel-medal { position: relative; width: 170px; height: 178px; perspective: 700px; }
.cel-spin { position: absolute; inset: 0; animation: cel-mdrop 1.1s cubic-bezier(.2, .7, .25, 1) both; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .5)); }
.cel-spin .xp-medal, .cel-spin svg { width: 100%; height: 100%; display: block; }
.cel-medal-fb { font-size: 120px; line-height: 178px; }
.cel-gleam { position: absolute; left: 12%; top: 18%; width: 76%; height: 76%; border-radius: 50%; overflow: hidden; pointer-events: none; }
.cel-gleam::before { content: ""; position: absolute; top: -20%; bottom: -20%; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent); transform: skewX(-18deg);
  animation: cel-gleam 1.1s 1.05s ease-in-out both, cel-gleam 1.1s 3.4s ease-in-out both; }
.cel-rays { position: absolute; left: 50%; top: 50%; width: 380px; height: 380px; margin: -190px 0 0 -190px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .35) 0, transparent 40%), repeating-conic-gradient(rgba(255, 255, 255, .14) 0 7deg, transparent 7deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%);
  animation: cel-burst .7s .95s ease-out both, cel-spin 18s 1.6s linear infinite; }
.cel.gold .cel-rays { background: radial-gradient(circle, rgba(255, 236, 160, .7) 0, transparent 42%), repeating-conic-gradient(rgba(255, 210, 90, .38) 0 6deg, transparent 6deg 16deg); }
.cel.gold .cel-spin { filter: drop-shadow(0 0 22px rgba(255, 205, 80, .55)) drop-shadow(0 8px 18px rgba(0, 0, 0, .45)); }
.cel-medal + .cel-txt small { color: #cdd6e2; }
.cel.gold .cel-medal + .cel-txt small { color: #ffd76a; }

/* ---------- 이번 달 등급 ---------- */
.cel-grade { --gc: #8b95a7; position: relative; width: 170px; height: 170px; display: grid; place-items: center; }
.cel-grade .cel-rays { width: 420px; height: 420px; margin: -210px 0 0 -210px;
  background: radial-gradient(circle, color-mix(in srgb, var(--gc) 60%, transparent) 0, transparent 42%), repeating-conic-gradient(color-mix(in srgb, var(--gc) 40%, transparent) 0 6deg, transparent 6deg 18deg);
  animation: cel-burst .8s .25s ease-out both, cel-spin 16s 1s linear infinite; }
.cel-badge { position: relative; width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--gc) 50%, #fff), var(--gc) 48%, color-mix(in srgb, var(--gc) 45%, #000));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--gc) 35%, transparent), 0 0 40px color-mix(in srgb, var(--gc) 60%, transparent), inset 0 -8px 16px rgba(0, 0, 0, .3);
  animation: cel-grow .8s .1s cubic-bezier(.2, 1.5, .4, 1) both; }
.cel-badge b { font-size: 24px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); letter-spacing: -.01em; }
.cel-grade + .cel-txt h2 { --hc: var(--gc); }

/* ---------- 움직임 ---------- */
@keyframes cel-fade { from { opacity: 0; } }
@keyframes cel-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes cel-pulse { 50% { opacity: .45; } }
@keyframes cel-spin { to { transform: rotate(360deg); } }
@keyframes cel-drop { 0% { transform: translateY(-75vh); } 55% { transform: translateY(0) scale(1.06, .9); } 70% { transform: translateY(-26px) scale(.97, 1.04); } 85% { transform: translateY(0) scale(1.02, .97); } 100% { transform: none; } }
@keyframes cel-shadow { 0% { opacity: 0; transform: scale(.3); } 55% { opacity: 1; transform: scale(1.1); } 70% { transform: scale(.8); } 100% { opacity: 1; transform: none; } }
@keyframes cel-shake { 0%, 100% { transform: none; } 15% { transform: rotate(-7deg); } 35% { transform: rotate(6deg); } 55% { transform: rotate(-5deg); } 75% { transform: rotate(3deg) scale(1.03); } }
@keyframes cel-lid { from { transform: none; } }
@keyframes cel-burst { from { opacity: 0; transform: scale(.2); } }
@keyframes cel-mdrop { 0% { opacity: 0; transform: translateY(-55vh) rotateY(0); } 15% { opacity: 1; } 100% { transform: translateY(0) rotateY(1080deg); } }
@keyframes cel-gleam { from { left: -60%; } to { left: 130%; } }
@keyframes cel-grow { 0% { opacity: 0; transform: scale(.2); } 100% { opacity: 1; transform: none; } }

@media (max-width: 480px) {
  .cel-txt h2 { font-size: 28px; }
  .cel.big .cel-txt h2 { font-size: 32px; }
  .cel-l2 { font-size: 15px; }
  .cel-burst { width: 340px; height: 340px; margin: -170px 0 0 -170px; }
  .cel.big .cel-burst { width: 420px; height: 420px; margin: -210px 0 0 -210px; }
}
/* 움직임 줄이기: 서서히 나타나기만 (꽃가루 · 회전 없음, 상자는 열린 모습) */
.cel.rm .cel-stage *, .cel.rm .cel-stage *::before, .cel.rm .cel-stage *::after { animation: none !important; }
.cel.rm .cel-stage { animation: cel-fade .4s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .cel .cel-stage *, .cel .cel-stage *::before, .cel .cel-stage *::after { animation: none !important; }
}

/* 11/27 매니저가 보내는 선물: '매니저에게 받기' (축하 화면 · 레벨 상자) */
.cel-ask { display: inline-block; margin-top: 10px; padding: 8px 16px; border-radius: 999px; background: #2aabee; color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; position: relative; z-index: 2; }
.cel-ask:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.xp-ask { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: rgba(42, 171, 238, .16); color: #5cc3f5; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.xp-ask:hover { background: rgba(42, 171, 238, .26); }

/* 11/27 메달 수집 (메달 수집가 · 코바 올스타 · 명예의 전당): 금 배지 */
.cel-col .cel-badge { flex-direction: column; gap: 2px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 35% 28%, #fff4bf, #eab43c 48%, #8a5c0c); }
.cel-col .cel-badge span { font-size: 40px; line-height: 1; }
.cel-col .cel-badge b { font-size: 17px; padding: 0 8px; text-align: center; word-break: keep-all; }
.cel.is-collection .cel-txt small { color: #ffd76a; }
