/* 김담희 선거 사이트 - 공통 스타일시트 */

/* Google Fonts - 귀여운 한글 폰트 */
@import url('https://fonts.googleapis.com/css2?family=Jua&family=Black+Han+Sans&display=swap');

/* CSS 변수 정의 */
:root {
  /* 메인 컬러 - 포스터 기반 */
  --primary-blue: #0099FF;
  --primary-blue-dark: #0077CC;
  --primary-blue-light: #33ADFF;
  --accent-red: #E53935;
  --accent-red-dark: #C62828;
  --accent-yellow: #FFD700;
  --white: #FFFFFF;
  --text-dark: #333333;
  
  /* 그라데이션 */
  --gradient-blue: linear-gradient(135deg, #0099FF 0%, #00BFFF 100%);
  --gradient-red: linear-gradient(135deg, #E53935 0%, #FF6B6B 100%);
  --gradient-gold: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  
  /* 그림자 */
  --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 6px 20px rgba(0, 0, 0, 0.15);
  --shadow-strong: 0 10px 30px rgba(0, 0, 0, 0.2);
  
  /* 폰트 */
  --font-title: 'Black Han Sans', sans-serif;
  --font-body: 'Jua', sans-serif;
  
  /* 간격 */
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 20px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
  
  /* 둥근 모서리 */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --radius-full: 50px;
}

/* 리셋 & 기본 스타일 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--gradient-blue);
  min-height: 100vh;
  color: var(--white);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* 모바일 전용 컨테이너 */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--spacing-md);
  position: relative;
}

/* 반짝이는 별 배경 애니메이션 */
.sparkle-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent-yellow);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: sparkle-float 3s ease-in-out infinite;
  opacity: 0;
}

@keyframes sparkle-float {
  0%, 100% {
    opacity: 0;
    transform: translateY(0) scale(0.5) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: translateY(-20px) scale(1) rotate(180deg);
  }
}

/* 타이틀 스타일 */
.title-main {
  font-family: var(--font-title);
  font-size: 2.5rem;
  text-align: center;
  text-shadow: 3px 3px 0 var(--primary-blue-dark);
  margin-bottom: var(--spacing-sm);
  animation: bounce-in 0.8s ease-out;
}

.title-sub {
  font-family: var(--font-body);
  font-size: 1.3rem;
  text-align: center;
  color: var(--accent-yellow);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
  margin-bottom: var(--spacing-md);
}

/* 기호 배지 */
.badge-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-red);
  color: var(--white);
  font-family: var(--font-title);
  font-size: 1.8rem;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  box-shadow: var(--shadow-medium);
  animation: pulse 2s infinite;
}

.badge-number span {
  font-size: 2.5rem;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(229, 57, 53, 0);
  }
}

/* 카드 스타일 */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  box-shadow: var(--shadow-medium);
  color: var(--text-dark);
  position: relative;
  overflow: hidden;
  animation: slide-up 0.6s ease-out;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--gradient-red);
}

.card-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--accent-red);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.card-title::before {
  content: '⭐';
  font-size: 1.2rem;
}

.card-content {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-dark);
}

.card-content li {
  margin-bottom: var(--spacing-xs);
  list-style: none;
  padding-left: 1.5em;
  position: relative;
}

.card-content li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary-blue);
  font-weight: bold;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 포스터 이미지 */
.poster-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-strong);
  margin-bottom: var(--spacing-lg);
  animation: fade-in 1s ease-out;
}

.poster-container img {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 영상 플레이어 */
.video-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-strong);
  margin-bottom: var(--spacing-lg);
  background: #000;
}

.video-container video {
  width: 100%;
  height: auto;
  display: block;
}

/* 버튼 스타일 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-lg);
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: var(--shadow-medium);
}

.btn-primary {
  background: var(--gradient-red);
  color: var(--white);
}

.btn-primary:hover, .btn-primary:active {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-strong);
}

.btn-secondary {
  background: var(--white);
  color: var(--primary-blue);
}

.btn-secondary:hover, .btn-secondary:active {
  transform: translateY(-3px);
  background: var(--accent-yellow);
  color: var(--text-dark);
}

/* 플로팅 게임 버튼 */
.floating-btn {
  position: fixed;
  bottom: 30px;
  right: 20px;
  z-index: 100;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-15px);
  }
  60% {
    transform: translateY(-7px);
  }
}

/* 헤더 */
.header {
  text-align: center;
  padding: var(--spacing-lg) 0;
  position: relative;
  z-index: 1;
}

.header-badge {
  margin-bottom: var(--spacing-sm);
}

/* 섹션 제목 */
.section-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  text-align: center;
  margin: var(--spacing-lg) 0 var(--spacing-md);
  color: var(--white);
  text-shadow: 2px 2px 0 var(--primary-blue-dark);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent-yellow);
  margin: var(--spacing-xs) auto 0;
  border-radius: 2px;
}

/* 퍼즐 게임 스타일 */
.puzzle-container {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-strong);
  margin-bottom: var(--spacing-md);
}

.puzzle-board {
  display: grid;
  gap: 3px;
  background: var(--primary-blue-dark);
  padding: 3px;
  border-radius: var(--radius-sm);
  touch-action: none;
  user-select: none;
}

.puzzle-piece {
  background-size: cover;
  background-position: center;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 50px;
}

.puzzle-piece:active {
  transform: scale(0.95);
  box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

.puzzle-piece.empty {
  background: var(--primary-blue-light) !important;
  opacity: 0.5;
}

.puzzle-piece.complete-fill {
  opacity: 1 !important;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

@keyframes fill-complete {
  0% {
    opacity: 0;
    transform: scale(0.8);
    box-shadow: 0 0 0 rgba(255, 215, 0, 0);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 215, 0, 1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
  }
}

.puzzle-piece.correct {
  box-shadow: inset 0 0 0 3px var(--accent-yellow);
}

/* 게임 정보 */
.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm);
  background: var(--primary-blue-light);
  border-radius: var(--radius-sm);
  color: var(--white);
}

.game-stat {
  text-align: center;
}

.game-stat-value {
  font-family: var(--font-title);
  font-size: 1.5rem;
}

.game-stat-label {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* 난이도 선택 */
.difficulty-select {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  margin-bottom: var(--spacing-md);
}

.difficulty-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 3px solid var(--white);
  background: transparent;
  color: var(--white);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.difficulty-btn.active {
  background: var(--white);
  color: var(--primary-blue);
}

/* 축하 모달 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  text-align: center;
  max-width: 90%;
  transform: scale(0.8);
  transition: transform 0.3s ease;
  color: var(--text-dark);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
  animation: celebrate 0.5s ease-out;
}

@keyframes celebrate {
  0% { transform: scale(0.5) rotate(-5deg); }
  50% { transform: scale(1.1) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.modal-title {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--accent-red);
  margin-bottom: var(--spacing-sm);
}

.modal-emoji {
  font-size: 4rem;
  margin-bottom: var(--spacing-sm);
  animation: wiggle 0.5s ease infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

/* 축하 폭죽 효과 */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 1001;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

/* 네비게이션 */
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--white);
  text-decoration: none;
  font-size: 1rem;
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: background 0.3s ease;
}

.nav-back:hover, .nav-back:active {
  background: rgba(255,255,255,0.2);
}

/* 푸터 */
.footer {
  text-align: center;
  padding: var(--spacing-lg) 0;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
}

/* 슬로건 강조 */
.slogan {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: var(--font-title);
  font-size: 1.1rem;
}

/* 로딩 스피너 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 반짝이 효과 (호버/클릭) */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255,255,255,0.3) 50%,
    transparent 100%
  );
  transform: rotate(30deg);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(30deg); }
  100% { transform: translateX(100%) rotate(30deg); }
}

/* 애니메이션 딜레이 유틸리티 */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

@keyframes bounce-in {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 미디어 쿼리 - 작은 화면 */
@media (max-width: 360px) {
  :root {
    font-size: 14px;
  }
  
  .title-main {
    font-size: 2rem;
  }
  
  .badge-number {
    width: 60px;
    height: 60px;
    font-size: 1.4rem;
  }
  
  .badge-number span {
    font-size: 2rem;
  }
}

/* 다크모드 지원 (선택) */
@media (prefers-color-scheme: dark) {
  .card {
    background: #1a1a2e;
    color: var(--white);
  }
  
  .card-content {
    color: rgba(255,255,255,0.9);
  }
}
