/* ==========================================
   MATCH POINT v4.0 - Premium Design System
   Pretendard 폰트 + 다크모드 + 시니어 UX
   ========================================== */

/* --- Pretendard 웹폰트 (시니어 최적화) --- */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

*, *::before, *::after {
  font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
}

/* --- 득점 파티클 애니메이션 --- */
@keyframes particle-burst {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--px), var(--py)) scale(0); opacity: 0; }
}
@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes score-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.3); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1); }
}
@keyframes score-glow {
  0%, 100% { text-shadow: 0 0 10px rgba(255,255,255,0.3); }
  50% { text-shadow: 0 0 30px rgba(255,255,255,0.6), 0 0 60px rgba(59,130,246,0.4); }
}
@keyframes match-point-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 15px rgba(239,68,68,0); }
}
@keyframes winner-celebration {
  0% { transform: scale(0.5) rotate(-10deg); opacity: 0; }
  50% { transform: scale(1.1) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes firework {
  0% { transform: translate(0, 0); opacity: 1; box-shadow: 0 0 0 0 var(--fw-color); }
  100% { transform: translate(var(--fw-x), var(--fw-y)); opacity: 0; box-shadow: 0 0 20px 4px var(--fw-color); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes banner-slide {
  0% { opacity: 0; transform: translateY(6px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-6px); }
}

/* 점수 플래시 */
.score-flash {
  animation: score-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 점수 숫자 glow (경기 막판) */
.score-glow { animation: score-glow 2s infinite; }

/* 매치포인트 펄스 */
.match-point-pulse { animation: match-point-pulse 1.5s infinite; }

/* 승리 축하 */
.winner-celebration { animation: winner-celebration 0.6s ease-out forwards; }

/* 파티클 컨테이너 */
.particle-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  animation: particle-burst 0.8s ease-out forwards;
}
.confetti {
  position: absolute;
  top: -20px;
  width: 8px; height: 8px;
  animation: confetti-fall 2s ease-in forwards;
}

/* --- LIVE 인디케이터 --- */
.pulse-live {
  position: relative;
}
.pulse-live::before {
  content: '';
  position: absolute;
  top: 50%; left: -2px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
  transform: translateY(-50%);
  animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.5; transform: translateY(-50%) scale(1.5); }
}

/* --- 스폰서 배너 --- */
.sponsor-banner {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.sponsor-banner-item {
  animation: banner-slide 6s ease-in-out;
}
.sponsor-banner img {
  max-height: 100%;
  object-fit: contain;
  filter: brightness(0.9) contrast(1.1);
  transition: filter 0.3s;
}
.sponsor-banner img:hover {
  filter: brightness(1) contrast(1);
}

/* --- 글래스모피즘 카드 --- */
.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
}

/* --- fade-in --- */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 글래스 네비게이션 --- */
.glass-nav {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- 히어로 배경 --- */
.hero-bg {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  position: relative;
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 30% 40%, rgba(59,130,246,0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(99,102,241,0.06) 0%, transparent 50%);
}

/* --- float animation --- */
.float-anim {
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* --- glow 이펙트 --- */
.glow-blue { box-shadow: 0 0 40px rgba(59, 130, 246, 0.3); }
.glow-emerald { box-shadow: 0 0 40px rgba(16, 185, 129, 0.3); }

/* --- 타임라인 바 --- */
.timeline-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.timeline-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  position: relative;
}
.timeline-bar-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  border-radius: 0 3px 3px 0;
}

/* --- 코트 점수판 점수 숫자 크기 --- */
.score-num {
  font-size: clamp(80px, 20vw, 200px);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* --- 시니어 UX: 터치 영역 & 접근성 --- */
.touch-area {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.touch-area:active {
  background: rgba(255,255,255,0.05) !important;
  transition: background 0.1s;
}

/* --- 스크롤바 커스텀 --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* --- 모달 오버레이 --- */
.modal-overlay {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

/* --- winner glow --- */
.winner-glow-left {
  box-shadow: inset -30px 0 60px rgba(59,130,246,0.1);
}
.winner-glow-right {
  box-shadow: inset 30px 0 60px rgba(249,115,22,0.1);
}

/* --- Shimmer 로딩 --- */
.shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}
