/* 타이틀·로딩·결과 화면 연출 다듬기(Claude fb1106c, 2026-11-06, 사용자 "사이트 전체 시각 연출 보강, 고급스럽게"). 움직임은 js/ui-polish33.js.
   모두 한 번만 도는 애니메이션이다(캔버스 위 무한 CSS 애니메이션 금지, docs/ARCHITECTURE.md §8). 동작 줄이기면 끈다. */

/* ---------- 캐릭터 카드: 고르면 빨간 빛 고리가 퍼지고 체크 배지가 튀어나온다, 빼면 얼굴이 천천히 흑백으로 ---------- */
.card { transition: transform 0.14s cubic-bezier(0.3, 1.6, 0.5, 1), border-color 0.2s, opacity 0.28s ease, box-shadow 0.25s; }
.card img { transition: filter 0.3s ease; }
.card::before { content: ''; position: absolute; inset: -3px; border-radius: 13px; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 2.5px var(--red), 0 0 26px 7px rgba(255, 59, 48, 0.62); }
body.casino .card::before { box-shadow: 0 0 0 2.5px var(--gold), 0 0 26px 7px rgba(242, 193, 78, 0.62); }
.card.on { box-shadow: 0 0 0 1px rgba(255, 59, 48, 0.28), 0 10px 26px -10px rgba(255, 59, 48, 0.7); }
.card.on:hover { box-shadow: 0 0 0 1px rgba(255, 59, 48, 0.4), 0 14px 30px -8px rgba(255, 59, 48, 0.6); }
.card.on::after { width: 20px; height: 20px; top: 9px; right: 9px; box-shadow: 0 0 0 2.5px rgba(10, 12, 18, 0.75), 0 2px 8px rgba(0, 0, 0, 0.45);
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.2 10.4l3.1 3.1 6.5-6.8' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }

/* ---------- '게임 시작' → 로딩: 타이틀 위로 로딩 화면이 녹아 들어온다(검은 화면으로 툭 끊기지 않게) ---------- */
#setup.go33 .menu-side, #setup.go33 .menu-cards, #setup.go33 .import-wrap { opacity: 0; transform: translateY(12px) scale(0.985); pointer-events: none;
  transition: opacity 0.3s ease-in, transform 0.36s ease-in; }
#loading.in33 { animation: ld33In 0.42s ease-out both; }
#loading.in33 .ld-bg { animation: ld33Bg 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both, ldPan29 9s ease-out 0.9s both; }
#loading.in33 .ld-kicker { animation: ld33Up 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.16s both; }
#loading.in33 .ld-map { animation: ld33Up 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.24s both; }
#loading.in33 .ld-t, #loading.in33 .ld-bar, #loading.in33 .ld-p { animation: ld33Up 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.34s both; }
@keyframes ld33In { from { opacity: 0; } }
@keyframes ld33Bg { from { transform: scale(1.16); } to { transform: scale(1.1); } }
@keyframes ld33Up { from { opacity: 0; translate: 0 14px; } }
/* 로딩 → 경기: hidden 은 바로 켜고(인트로가 그 값을 본다) 0.5초 동안만 그려 둔 채 녹여 없앤다. 밑의 #fade 도 같이 걷혀 경기 화면으로 바로 넘어간다 */
#loading.loading.out33[hidden] { display: flex !important; pointer-events: none; animation: ld33Out 0.5s ease-in both; }
#loading.out33 .ld { animation: ld33Lift 0.5s ease-in both; }
@keyframes ld33Out { to { opacity: 0; } }
@keyframes ld33Lift { to { translate: 0 -14px; opacity: 0; } }

/* ---------- 로딩 진행: 굵은 숫자, 막대 끝의 밝은 머리(움직임은 JS 가 프레임마다 너비만 바꾼다) ---------- */
#loading .ld { row-gap: 12px; }
#loading .ld-t { font: 600 14px/1.2 'S-Core Dream', var(--font-body); color: rgba(235, 238, 245, 0.72); letter-spacing: 0.01em; }
#loading .ld-bar { height: 8px; background: rgba(255, 255, 255, 0.09); }
#loading .ld-bar i { position: relative; transition: none; min-width: 8px; }
#loading .ld-bar i::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 26px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 240, 200, 0), rgba(255, 248, 225, 0.95)); }
#loading .ld-p { min-width: 3.6ch; color: #fff; font: 400 30px/1 var(--font-title); letter-spacing: 0.02em; font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
/* 11-17 T13 로딩 팁 한 줄(js/tips16.js): 막대 아래 가는 선 + 작은 TIP 꼬리표 + 한두 줄 문장. 두 줄 높이를 늘 잡아 둬서 글 길이가 바뀌어도 위 칸이 움직이지 않는다.
   로딩마다 한 번 떠오른다(T12 토큰: opacity·translate 만) */
#loading .ld-tip { grid-column: 1 / -1; margin: 6px 0 0; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: start; min-height: calc(14px + 2 * 1.55em); opacity: 0; }
#loading .ld-tip.on { animation: ldTip16 var(--m-slow, 360ms) var(--m-ease-out, ease-out) 0.5s both; }
#loading .ld-tip b { margin-top: 0.2em; padding: 3px 7px 2px; border-radius: 3px; background: rgba(242, 193, 78, 0.14); color: var(--gold, #f2c14e);
  font: 700 11px/1 var(--font-mono); letter-spacing: 0.22em; }
#loading .ld-tip-t { font: 500 15px/1.55 'S-Core Dream', var(--font-body); color: rgba(240, 242, 248, 0.86); word-break: keep-all; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes ldTip16 { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 700px) { #loading .ld-tip-t { font-size: 14px; } #loading .ld-tip { column-gap: 10px; } }
@media (prefers-reduced-motion: reduce) { #loading .ld-tip.on { animation: none; opacity: 1; } }

/* ---------- 결과: 우승자 위로 떨어지는 빛줄기와 발밑 빛 ---------- */
.wl33 { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.wl33 .beam { position: absolute; left: var(--lx, 50%); top: 0; width: calc(var(--lw, 300px) * 1.5); height: var(--lb, 70%); translate: -50% 0;
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(255, 236, 180, 0.02) 0%, rgba(255, 226, 150, 0.16) 55%, rgba(255, 214, 120, 0.26) 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); }
.wl33 .floor { position: absolute; left: var(--lx, 50%); top: var(--lb, 70%); width: calc(var(--lw, 300px) * 1.3); height: 46px; translate: -50% -60%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 220, 140, 0.5), rgba(255, 190, 80, 0.16) 60%, transparent); }
#result.team-win28 .wl33 .beam { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--wtc) 22%, transparent) 60%, color-mix(in srgb, var(--wtc) 34%, transparent)); }
#result.team-win28 .wl33 .floor { background: radial-gradient(closest-side, color-mix(in srgb, var(--wtc) 55%, transparent), transparent); }
.winner.lost .wl33 .beam { opacity: 0.45; filter: saturate(0); }
.winner.lost .wl33 .floor { opacity: 0.5; filter: saturate(0); }
.wl33.on33 .beam { animation: wl33Beam 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.22s both; transform-origin: 50% 0; }
.wl33.on33 .floor { animation: wl33Floor 0.6s ease-out 0.42s both; }
@keyframes wl33Beam { from { opacity: 0; transform: scaleY(0.2); } 55% { opacity: 1; } }
@keyframes wl33Floor { from { opacity: 0; scale: 0.4; } }

/* ---------- 결과: 우승 카드 숫자 칸(처치·피해·체력/생존). 숫자는 0 에서 올라간다 ---------- */
#result .wstat { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; margin: 6px 0 0; color: var(--muted); }
.wstat .ws33-tr { flex-basis: 100%; margin-bottom: 2px; font: 600 13px/1.3 'S-Core Dream', var(--font-body); color: var(--gold); }
.wstat .ws33 { display: inline-flex; flex-direction: column; align-items: center; min-width: 74px; padding: 7px 12px 6px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09); }
.wstat .ws33 b { font: 400 26px/1 var(--font-title); color: #fff; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.wstat .ws33 small { margin-top: 4px; font: 600 11px/1 'S-Core Dream', var(--font-body); color: rgba(225, 228, 238, 0.62); letter-spacing: 0.04em; }
.winner:not(.lost) .wstat .ws33:nth-child(2) b { color: #ffd76a; }
#result .winner.burst32 .wstat .ws33 { animation: ws33In 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
#result .winner.burst32 .wstat .ws33:nth-child(2) { animation-delay: 0.58s; }
#result .winner.burst32 .wstat .ws33:nth-child(3) { animation-delay: 0.66s; }
#result .winner.burst32 .wstat .ws33:nth-child(4) { animation-delay: 0.74s; }
@keyframes ws33In { from { opacity: 0; transform: translateY(10px) scale(0.86); } }
.ranking .st i.n33 { font-style: normal; }

/* ---------- 결과: 1~3위 줄은 들어온 뒤 빛이 한 번 쓸고 지나간다 ---------- */
.ranking li.row { position: relative; }
.ranking li.p1::after, .ranking li.p2::after, .ranking li.p3::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.6) 50%, transparent 60%) no-repeat; background-size: 260% 100%; background-position: 130% 0;
  animation: rk33Sheen 0.95s cubic-bezier(0.3, 0.6, 0.3, 1) var(--sd, 0.8s) both; }
.ranking li.p1 { animation-name: rk33Pop; }
@keyframes rk33Sheen { from { background-position: 130% 0; } to { background-position: -30% 0; } }
@keyframes rk33Pop { from { opacity: 0; transform: translateX(28px) scale(0.96); } 70% { transform: translateX(-2px) scale(1.01); } }

@media (prefers-reduced-motion: reduce) {
  #loading.in33, #loading.in33 *, #loading.out33, #loading.out33 *, .wl33 *, .wstat .ws33, .ranking li.row::after { animation: none !important; }
  #loading.loading.out33[hidden] { display: none !important; }
  #setup.go33 .menu-side, #setup.go33 .menu-cards, #setup.go33 .import-wrap { transition: none; }
}
