/* =============================================== */
/* game_effects.css - 완전 리팩토링 버전           */
/* =============================================== */

/* =============================================== */
/* 1. Google Fonts & CSS Variables                */
/* =============================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Noto+Sans+KR:wght@300;400;500;600;700;800;900&family=Noto+Sans+JP:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* Colors */
  --primary: #667eea;
  --primary-dark: #764ba2;
  --success: #00d4aa;
  --success-dark: #00b894;
  --warning: #fdcb6e;
  --warning-dark: #e17055;
  --danger: #fd79a8;
  --danger-dark: #e84393;
  --info: #74b9ff;
  --info-dark: #0984e3;
  
  /* Glass Effects */
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-blur: blur(20px);
  
  /* Gradients */
  --bg-gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  --success-gradient: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
  --warning-gradient: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
  --danger-gradient: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
  --info-gradient: linear-gradient(135deg, var(--info) 0%, var(--info-dark) 100%);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 12px 60px rgba(0, 0, 0, 0.16);
  
  /* Typography */
  --font-family: 'Inter', 'Noto Sans KR', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --system-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Border Radius */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  
  /* Animation */
  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Layout */
  --tab-bar-height: 52px;
  --safe-area-top: env(safe-area-inset-top, 0);
  --safe-area-bottom: env(safe-area-inset-bottom, 0);
  --safe-area-left: env(safe-area-inset-left, 0);
  --safe-area-right: env(safe-area-inset-right, 0);
  
  /* 실제 적용될 Safe Area 값 */
  --actual-safe-area-top: var(--safe-area-top);
  --actual-safe-area-bottom: max(var(--safe-area-bottom), 20px);
  --actual-safe-area-left: max(var(--safe-area-left), 0px);
  --actual-safe-area-right: max(var(--safe-area-right), 0px);
  
  /* 탭바 포함 실제 높이 계산 */
  --tab-bar-total-height: calc(var(--tab-bar-height) + var(--actual-safe-area-bottom));
  
  /* 콘텐츠 영역 높이 계산 */
  --content-area-height: calc(100vh - var(--tab-bar-total-height) - var(--actual-safe-area-top));
  --content-area-height-dvh: calc(100dvh - var(--tab-bar-total-height) - var(--actual-safe-area-top));
}

/* =============================================== */
/* 2. Base Styles                                 */
/* =============================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  width: 100%;
  background: var(--bg-gradient);
  font-family: var(--font-family);
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow: hidden;
  
  /* Safe Area 적용 */
  padding-top: var(--actual-safe-area-top);
  padding-left: var(--actual-safe-area-left);
  padding-right: var(--actual-safe-area-right);
}

/* =============================================== */
/* 3. 앱 컨테이너 및 탭 시스템 (핵심 수정)        */
/* =============================================== */

.app-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 🔧 탭 콘텐츠 - 수정된 부분 */
.tab-content {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--tab-bar-total-height);
  width: 100%;
  height: calc(100% - var(--tab-bar-total-height));
  overflow: hidden; /* 기본은 hidden 유지 */
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none; /* 🆕 비활성 탭은 클릭 불가 */
}

/* 🔧 활성 탭만 표시 */
.tab-content.active {
  display: block !important;
  opacity: 1;
  pointer-events: auto; /* 🆕 활성 탭만 클릭 가능 */
}

/* 🔧 각 탭의 내부 컨테이너 스타일 */
#homeTab.active {
  display: block !important;
  overflow-y: auto !important; /* 🔧 !important 추가 */
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain;
}

#learningTab.active {
  display: block !important;
  overflow-y: auto !important; /* 🔧 !important 추가 */
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain;
}

#vocabularyTab.active {
  display: flex !important;
  flex-direction: column;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch !important;
}

/* 메시지 탭 기본 설정 - 다른 탭들과 동일한 구조 적용 */
#messageTab.active {
  display: block !important;
  overflow: hidden !important; /* 전체 컨테이너는 hidden */
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain;
}

/* 메시지 콘텐츠 래퍼 */
#messageTab .message-tab-container {
  width: 100%;
  height: 100%;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important; /* 래퍼도 hidden */
  position: relative !important;
}

/* 메시지 메인 뷰 - 실제 스크롤 담당 */
#messageTab .message-main-view {
  flex: 1 1 auto !important;
  width: 100%;
  overflow-y: auto !important; /* 여기서만 스크롤 */
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 20px;
  min-height: 0; /* flexbox 스크롤을 위해 필수 */
}

#messageTab .message-main-view::-webkit-scrollbar {
  display: none;
}

/* 메시지 헤더 - 고정 */
#messageTab .message-header {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

/* 채팅방 뷰 */
#messageTab .chat-room-view {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 채팅 메시지 영역 */
#messageTab .chat-messages {
  flex: 1 1 auto;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain;
  padding: 16px;
  padding-bottom: 80px;
  min-height: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#messageTab .chat-messages::-webkit-scrollbar {
  display: none;
}

/* 채팅 입력 영역 - 하단 고정 */
#messageTab .chat-input-area {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  flex-shrink: 0;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  z-index: 10;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  #messageTab.active {
    position: relative;
    height: calc(100vh - var(--tab-bar-total-height));
    height: calc(100dvh - var(--tab-bar-total-height));
  }
  
  #messageTab .message-main-view {
    /* 모바일 터치 스크롤 최적화 */
    -webkit-overflow-scrolling: touch !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: scroll-position;
    padding-bottom: 30px;
  }
  
  #messageTab .chat-messages {
    -webkit-overflow-scrolling: touch !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  
  /* 채팅방 활성화 시 */
  .chat-room-active #messageTab .chat-input-area {
    bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* iOS Safari 특별 처리 */
@supports (-webkit-touch-callout: none) {
  #messageTab.active {
    position: relative;
    height: -webkit-fill-available;
  }
  
  #messageTab .message-main-view,
  #messageTab .chat-messages {
    /* iOS 모멘텀 스크롤 */
    -webkit-overflow-scrolling: touch !important;
    /* 3D 가속 */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000;
  }
}

/* Android 특별 처리 */
@media (max-width: 768px) and (hover: none) {
  #messageTab .message-main-view,
  #messageTab .chat-messages {
    /* Pull-to-refresh 방지 */
    overscroll-behavior-y: contain;
    /* 스크롤 성능 */
    will-change: scroll-position;
  }
}

/* =============================================== */
/* 4. 하단 탭바                                   */
/* =============================================== */

.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: var(--tab-bar-total-height);
  height: var(--tab-bar-total-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding-bottom: var(--actual-safe-area-bottom);
  padding-left: var(--actual-safe-area-left);
  padding-right: var(--actual-safe-area-right);
  padding-top: 8px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.bottom-tab-bar.hidden {
  transform: translateY(100%);
}

.tab-bar-content {
  display: flex;
  min-height: var(--tab-bar-height);
  align-items: center;
  justify-content: space-around;
  padding: 2px 8px;
  overflow: hidden;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
  transition: all var(--transition);
  cursor: pointer;
  flex: 1;
  max-width: 80px;
  text-decoration: none;
  color: #6c757d;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tab-item.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.tab-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.tab-label {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 20px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* =============================================== */
/* 5. 탭 콘텐츠별 스타일                          */
/* =============================================== */

/* 홈 탭 대시보드 */
.dashboard-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  padding-bottom: calc(var(--spacing-md) + 40px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dashboard-container::-webkit-scrollbar {
  display: none;
}

/* 학습 탭 */
.learning-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  padding-bottom: calc(var(--spacing-md) + 40px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.learning-content::-webkit-scrollbar {
  display: none;
}

/* 메시지 탭 */
.message-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  padding-bottom: calc(var(--spacing-md) + 40px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.message-content::-webkit-scrollbar {
  display: none;
}

/* 설정 탭 (있다면) */
.settings-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  padding-bottom: calc(var(--spacing-md) + 40px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.settings-content::-webkit-scrollbar {
  display: none;
}

/* =============================================== */
/* 6. 대시보드 컴포넌트                           */
/* =============================================== */

.dashboard-header {
  text-align: center;
  margin-bottom: var(--spacing-sm);
  flex-shrink: 0;
}

.dashboard-title {
  font-size: clamp(1.4rem, 3.8vw, 1.7rem);
  font-weight: 900;
  color: white;
  margin-bottom: var(--spacing-sm);
  background: linear-gradient(45deg, #ffffff, #f8f9fa, #e9ecef, #ffffff);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease-in-out infinite;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3.5vw, 18px);
  flex-wrap: nowrap;
  width: 100%;
  box-sizing: border-box;
}

.welcome-message {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  color: white;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
}

.welcome-text {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.welcome-greeting {
  color: var(--success);
  text-shadow: 0 0 10px rgba(0, 212, 170, 0.3);
}

/* 통계 카드 */
.stats-section {
  margin-bottom: var(--spacing-md);
  flex-shrink: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
  color: white;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--success);
  opacity: 0.8;
}

.stat-card.total-score::before { background: var(--warning); }
.stat-card.mastered-words::before { background: var(--success); }
.stat-card.study-streak::before { background: var(--danger); }
.stat-card.level-progress::before { background: var(--info); }

.stat-icon {
  font-size: 2em;
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-number {
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
  background: linear-gradient(45deg, #ffffff, #f8f9fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8em;
  opacity: 0.8;
  font-weight: 500;
}

/* 빠른 시작 섹션 */
.quick-start-section {
  margin-bottom: var(--spacing-md);
  flex-shrink: 0;
}

.section-title {
  font-size: 1.1em;
  font-weight: 600;
  color: white;
  margin-bottom: var(--spacing-md);
  text-align: center;
  opacity: 0.9;
}

.quick-start-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
}

.quick-start-btn {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  transition: all var(--transition);
  color: white;
  text-align: left;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.quick-start-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  transition: all var(--transition);
}

.quick-start-btn.beginner::before { background: var(--success); }
.quick-start-btn.intermediate::before { background: var(--warning); }
.quick-start-btn.vocabulary::before { background: var(--info); }
.quick-start-btn.hints::before { background: var(--danger); }

.quick-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.quick-btn-icon {
  font-size: 1.8em;
  flex-shrink: 0;
}

.quick-btn-content {
  flex: 1;
  min-width: 0;
}

.quick-btn-title {
  font-size: 0.9em;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 2px;
}

.quick-btn-desc {
  font-size: 0.75em;
  opacity: 0.8;
}

.quick-btn-arrow {
  font-size: 1.2em;
  opacity: 0.6;
  transition: all var(--transition);
}

.quick-start-btn:hover .quick-btn-arrow {
  transform: translateX(4px);
}

/* 진행 상황 카드 */
.progress-section {
  margin-bottom: var(--spacing-md);
  flex-shrink: 0;
}

.progress-cards {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.progress-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  color: white;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
}

.progress-title {
  font-weight: 600;
  font-size: 0.9em;
}

.progress-percentage {
  font-weight: 700;
  color: var(--success);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--spacing-xs);
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease-out;
  position: relative;
}

.progress-fill.beginner {
  background: linear-gradient(90deg, var(--success), var(--success-dark));
}

.progress-fill.intermediate {
  background: linear-gradient(90deg, var(--warning), var(--warning-dark));
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: progressShimmer 2s infinite;
}

.progress-details {
  font-size: 0.8em;
  opacity: 0.8;
  text-align: center;
}

/* 게스트 안내 */
.guest-dashboard-notice {
  background: linear-gradient(135deg, var(--info) 0%, var(--info-dark) 100%);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-top: var(--spacing-md);
  color: white;
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
}

.guest-notice-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.guest-notice-icon {
  font-size: 3em;
  margin-bottom: var(--spacing-sm);
}

.guest-notice-text h4 {
  font-size: 1.2em;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.guest-notice-text p {
  font-size: 0.9em;
  opacity: 0.9;
  line-height: 1.4;
  margin: 0;
}

.guest-notice-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-xl);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.9em;
}

.guest-notice-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* =============================================== */
/* 7. 학습 탭 컴포넌트                            */
/* =============================================== */

.learning-title,
.message-title,
.settings-title {
  font-size: 1.5em;
  margin-bottom: 20px;
  text-align: center;
  color: white;
  font-weight: 700;
}

.learning-loading {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1em;
}

.learning-modes {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.mode-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.mode-btn.active {
  background: var(--primary-gradient);
  color: white;
  border-color: var(--primary);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.category-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: white;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.category-icon {
  font-size: 2em;
  margin-bottom: 8px;
  display: block;
}

.category-name {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 1.1em;
}

.category-count {
  font-size: 0.8em;
  opacity: 0.8;
}

/* =============================================== */
/* 카테고리 카드 프로그레스바 스타일                */
/* =============================================== */

/* 카테고리 진행도 섹션 */
.category-progress {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 프로그레스바 컨테이너 */
.category-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 프로그레스바 채움 */
.category-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, var(--success) 0%, var(--success-dark) 100%);
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 212, 170, 0.3);
}

/* 프로그레스바 빛나는 효과 */
.category-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: categoryProgressShimmer 2s infinite;
}

@keyframes categoryProgressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 진행도 텍스트 */
.category-progress-text {
    text-align: center;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 6px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 호버 시 프로그레스바 강조 */
.category-card:hover .category-progress-fill {
    box-shadow: 0 2px 6px rgba(0, 212, 170, 0.5);
}

/* 카테고리별 색상 커스터마이징 (선택사항) */
.category-card[data-category="education"] .category-progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.category-card[data-category="body"] .category-progress-fill {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.category-card[data-category="food"] .category-progress-fill {
    background: linear-gradient(90deg, #fa709a 0%, #fee140 100%);
}

/* 모바일 반응형 스타일 */
@media (max-width: 768px) {
    .category-progress {
        margin-top: 8px;
        padding-top: 6px;
    }
    
    .category-progress-bar {
        height: 6px;
    }
    
    .category-progress-text {
        font-size: 0.7em;
        margin-top: 4px;
    }
}

@media (max-width: 480px) {
    /* 작은 화면에서 3컬럼 유지하면서 프로그레스바 조정 */
    .category-progress {
        margin-top: 6px;
        padding-top: 4px;
    }
    
    .category-progress-bar {
        height: 4px;
    }
    
    .category-progress-text {
        font-size: 0.65em;
        margin-top: 2px;
    }
}

/* 게스트 모드 스타일 */
.category-card.guest-mode .category-progress-fill {
    background: linear-gradient(90deg, #95a5a6 0%, #7f8c8d 100%);
    opacity: 0.7;
}

.category-card.guest-mode .category-progress-text {
    color: rgba(255, 255, 255, 0.6);
}

/* 애니메이션 감소 모드 대응 */
@media (prefers-reduced-motion: reduce) {
    .category-progress-fill {
        transition: none !important;
    }
    
    .category-progress-fill::after {
        animation: none !important;
    }
}

/* =============================================== */
/* 8. 메시지 탭 컴포넌트                          */
/* =============================================== */

.message-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.7);
}

.empty-icon {
  font-size: 4em;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-message {
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 8px;
  color: white;
}

.empty-description {
  font-size: 0.9em;
  opacity: 0.8;
}

/* =============================================== */
/* 9. 게임 모달 시스템                            */
/* =============================================== */

.game-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-gradient);
  z-index: 10000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-modal.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
}

.game-modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.game-modal-title {
  font-size: 1.3em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.game-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.8em;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
  line-height: 1;
}

.game-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.game-container {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.game-container::-webkit-scrollbar {
  display: none;
}

/* =============================================== */
/* 10. 게임 결과 모달                             */
/* =============================================== */

.game-result-modal {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.9) !important;
  z-index: 10001 !important;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-result-modal.show {
  display: flex !important;
  opacity: 1;
}

.game-result-content {
  background: rgba(255, 255, 255, 0.98) !important;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.4s ease-out;
  color: #333 !important;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.game-result-modal.show .game-result-content {
  transform: translateY(0);
}

.result-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  text-align: center;
  position: relative;
  flex-shrink: 0;
}

.result-header h2 {
  margin: 0;
  font-size: 1.5em;
  font-weight: 700;
  color: white !important;
  text-shadow: none !important;
}

.result-close-btn {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.result-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

/* =============================================== */
/* 11. 로그인/회원가입 모달                       */
/* =============================================== */

.login-modal,
.register-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
}

.login-modal-content,
.register-modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

.register-modal-content {
  max-width: 450px;
}

.login-modal-header,
.register-modal-header {
  color: white;
  padding: 20px;
  border-radius: 20px 20px 0 0;
  text-align: center;
  position: relative;
}

.login-modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.register-modal-header {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.login-modal-header h2,
.register-modal-header h2 {
  margin: 0;
  font-size: 1.5em;
  font-weight: 600;
  font-family: var(--font-family);
}

.login-modal-close {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  font-weight: bold;
  color: white;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
  background: none;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.login-modal-body {
  padding: 30px;
}

.login-form,
.register-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.register-form {
  gap: 18px;
}

.login-input-group {
  position: relative;
}

.login-input-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
  font-family: var(--font-family);
}

.login-input-group input {
  width: 100%;
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  box-sizing: border-box;
  font-family: var(--font-family);
}

.login-input-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-submit-btn,
.register-submit-btn {
  color: white;
  padding: 15px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  font-family: var(--font-family);
}

.login-submit-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.register-submit-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.login-submit-btn:hover,
.register-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.login-submit-btn:disabled,
.register-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-register-link {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  color: #666;
  font-family: var(--font-family);
}

.login-register-link a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.login-register-link a:hover {
  text-decoration: underline;
}

.login-error {
  background-color: #ffe6e6;
  color: #d32f2f;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid #ffcdd2;
  font-size: 14px;
  font-family: var(--font-family);
}

.login-success {
  background-color: #e8f5e8;
  color: #2e7d32;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid #c8e6c9;
  font-size: 14px;
  font-family: var(--font-family);
}

/* =============================================== */
/* 12. 게임 UI 컴포넌트                           */
/* =============================================== */

/* 게임 헤더 */
.game-header {
  text-align: center;
  margin-bottom: 0;
  flex-shrink: 0;
}

.game-title {
  font-size: clamp(1.4rem, 3.8vw, 1.7rem);
  font-weight: 900;
  color: white;
  margin-bottom: var(--spacing-md);
  background: linear-gradient(45deg, #ffffff, #f8f9fa, #e9ecef, #ffffff);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease-in-out infinite;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3.5vw, 18px);
  flex-wrap: nowrap;
  width: 100%;
  box-sizing: border-box;
}

.title-text {
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  text-align: center;
}

.title-decoration {
  height: 35px;
  width: auto;
  max-width: 50px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.9;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.title-left {
  transform: rotate(-8deg) scale(1.1);
  transform-origin: center center;
  animation: titleDecorationBounce 4s ease-in-out infinite, sparkle 2s ease-in-out infinite;
}

.title-right {
  transform: rotate(8deg) scale(1.1);
  transform-origin: center center;
  animation: titleDecorationBounceRight 4s ease-in-out infinite 0.7s, sparkle 2s ease-in-out infinite 1s;
}

/* 레벨 선택 */
.level-selection {
  text-align: center;
  margin-bottom: var(--spacing-md);
  flex-shrink: 0;
}

.level-selection-title {
  font-size: 1.1em;
  color: white;
  margin-bottom: var(--spacing-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.level-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.level-btn {
  position: relative;
  overflow: hidden;
  min-height: 120px;
  padding: 15px 20px 20px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  font-size: 0.8em;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 120px;
  max-width: 140px;
  flex: 0 0 auto;
  user-select: none;
}

.level-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.level-btn.beginner:not(.selected) {
  background: var(--success-gradient);
}

.level-btn.intermediate:not(.selected) {
  background: var(--warning-gradient);
}

.level-description {
  font-size: 0.7em;
  margin-top: var(--spacing-xs);
  opacity: 0.8;
  font-weight: 400;
}

/* =============================================== */
/* 13. 애니메이션                                 */
/* =============================================== */

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes modalSlideIn {
  0% { 
    opacity: 0; 
    transform: translateY(-50px) scale(0.9); 
  }
  100% { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

@keyframes titleDecorationBounce {
  0%, 100% { 
    transform: translateY(0px) rotate(-8deg) scale(1.1); 
  }
  25% { 
    transform: translateY(-8px) rotate(-10deg) scale(1.15); 
  }
  50% { 
    transform: translateY(-4px) rotate(-6deg) scale(1.12); 
  }
  75% { 
    transform: translateY(-12px) rotate(-12deg) scale(1.18); 
  }
}

@keyframes titleDecorationBounceRight {
  0%, 100% { 
    transform: translateY(0px) rotate(8deg) scale(1.1); 
  }
  25% { 
    transform: translateY(-8px) rotate(10deg) scale(1.15); 
  }
  50% { 
    transform: translateY(-4px) rotate(6deg) scale(1.12); 
  }
  75% { 
    transform: translateY(-12px) rotate(12deg) scale(1.18); 
  }
}

@keyframes sparkle {
  0%, 100% { 
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2)) brightness(1); 
  }
  50% { 
    filter: drop-shadow(0 6px 12px rgba(255, 255, 255, 0.4)) brightness(1.3); 
  }
}

/* =============================================== */
/* 14. Z-Index 계층 정리                          */
/* =============================================== */

.bottom-tab-bar { z-index: 1000; }
.login-modal, .register-modal { z-index: 10000; }
.game-modal { z-index: 10000; }
.game-result-modal { z-index: 10001; }
.notification { z-index: 10002; }

/* =============================================== */
/* 15. 반응형 디자인                              */
/* =============================================== */

@media (max-width: 768px) {
  .dashboard-container,
  .learning-content,
  .message-content,
  .settings-content {
    padding: var(--spacing-sm);
    padding-bottom: calc(var(--spacing-sm) + 50px);
    gap: var(--spacing-sm);
  }
  
  .stats-grid {
    gap: var(--spacing-xs);
  }
  
  .quick-start-grid {
    gap: var(--spacing-xs);
  }
  
  .category-grid {
    grid-template-columns: repeat(3, 1fr);  /* 2컬럼 → 3컬럼 변경 */
    gap: 10px;  /* 간격 조정 */
  }

  .category-name {
    font-size: 0.85em;  /* 텍스트 크기 조정 */
    line-height: 1.2;
    word-break: keep-all;  /* 단어 단위 줄바꿈 */
  }
  
  .category-count {
    font-size: 0.7em;  /* 카운트 크기 조정 */
  }
  
  .category-progress {
    margin-top: 6px;
  }
  
  .category-progress-bar {
    height: 4px;  /* 프로그레스 바 높이 축소 */
  }
  
  .category-progress-text {
    font-size: 0.65em;  /* 진행도 텍스트 크기 */
  }

  .learning-modes {
    justify-content: stretch;
  }
  
  .mode-btn {
    flex: 1;
    font-size: 0.75em;
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  .dashboard-container,
  .learning-content,
  .message-content,
  .settings-content {
    padding: var(--spacing-xs);
    padding-bottom: calc(var(--spacing-xs) + 60px);
    gap: var(--spacing-xs);
  }
  
  .dashboard-title {
    font-size: 1.3rem;
  }
  
  .stat-card {
    padding: 12px;
  }
  
  .stat-number {
    font-size: 1.3em;
  }
  
  .quick-start-btn {
    padding: 12px;
  }
  
  .quick-btn-icon {
    font-size: 1.5em;
  }
  
  .quick-btn-title {
    font-size: 0.85em;
  }
  
  .quick-btn-desc {
    font-size: 0.7em;
  }
  
  .category-grid {
    grid-template-columns: repeat(3, 1fr);  /* 1컬럼 → 3컬럼 변경 */
    gap: 6px;  /* 간격 더 축소 */
  }
  
  .category-card {
    padding: 10px 4px;  /* 패딩 더 축소 */
    border-radius: 12px;  /* 모서리 둥글기 축소 */
  }
  
  .category-icon {
    font-size: 1.4em;  /* 아이콘 더 작게 */
    margin-bottom: 4px;
  }
  
  .category-name {
    font-size: 0.75em;  /* 텍스트 더 작게 */
    font-weight: 500;
    line-height: 1.1;
  }
  
  .category-count {
    font-size: 0.65em;
    opacity: 0.7;
  }
  
  .category-progress-bar {
    height: 3px;
  }
  
  .category-progress-text {
    font-size: 0.6em;
    margin-top: 2px;
  }

  .tab-icon {
    font-size: 20px;
  }
  
  .tab-label {
    font-size: 9px;
  }
  
  .login-modal-content,
  .register-modal-content {
    width: 95%;
    margin: 10% auto;
  }
  
  .login-modal-body {
    padding: 20px;
  }
  
  .login-input-group input {
    padding: 12px;
    font-size: 14px;
  }
  
  .login-submit-btn,
  .register-submit-btn {
    padding: 12px;
    font-size: 14px;
  }
}

@media (hover: none) {
  .category-card {
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
  }
  
  .category-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
}

/* =============================================== */
/* 16. iOS Safari 특별 대응                       */
/* =============================================== */

@supports (-webkit-touch-callout: none) {
  body {
    height: -webkit-fill-available;
  }
  
  .app-container {
    height: -webkit-fill-available;
  }
  
  .tab-content {
    height: -webkit-fill-available;
  }
  
  .dashboard-container,
  .learning-content,
  .message-content,
  .settings-content {
    height: -webkit-fill-available;
  }
}

/* =============================================== */
/* 17. 접근성                                     */
/* =============================================== */

.tab-item:focus {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}

.quick-start-btn:focus,
.category-card:focus,
.stat-card:focus {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}

/* 고대비 모드 */
@media (prefers-contrast: high) {
  .tab-item {
    border: 2px solid transparent;
  }
  
  .tab-item.active {
    border-color: white;
  }
  
  .category-card,
  .stat-card {
    border-width: 2px;
  }
}

/* 애니메이션 감소 모드 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================== */
/* 18. 유틸리티 클래스 (확장 버전)                */
/* =============================================== */

/* 표시/숨김 */
.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden !important;
  opacity: 0 !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* 로딩 스피너 */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 상태 표시 */
.status-success {
  color: #00b894 !important;
  background: rgba(0, 184, 148, 0.1) !important;
}

.status-error {
  color: #e17055 !important;
  background: rgba(225, 112, 85, 0.1) !important;
}

.status-warning {
  color: #fdcb6e !important;
  background: rgba(253, 203, 110, 0.1) !important;
}

.status-info {
  color: #74b9ff !important;
  background: rgba(116, 185, 255, 0.1) !important;
}

/* 텍스트 유틸리티 */
.text-center {
  text-align: center !important;
}

.text-left {
  text-align: left !important;
}

.text-right {
  text-align: right !important;
}

.text-truncate {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.text-uppercase {
  text-transform: uppercase !important;
}

.text-lowercase {
  text-transform: lowercase !important;
}

.text-capitalize {
  text-transform: capitalize !important;
}

/* 간격 유틸리티 */
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.ml-0 { margin-left: 0 !important; }
.mr-0 { margin-right: 0 !important; }

.p-0 { padding: 0 !important; }
.pt-0 { padding-top: 0 !important; }
.pb-0 { padding-bottom: 0 !important; }
.pl-0 { padding-left: 0 !important; }
.pr-0 { padding-right: 0 !important; }

/* Flexbox 유틸리티 */
.d-flex {
  display: flex !important;
}

.d-inline-flex {
  display: inline-flex !important;
}

.flex-column {
  flex-direction: column !important;
}

.flex-row {
  flex-direction: row !important;
}

.justify-content-center {
  justify-content: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.align-items-center {
  align-items: center !important;
}

.flex-1 {
  flex: 1 !important;
}

/* 애니메이션 유틸리티 */
.no-transition {
  transition: none !important;
}

.no-animation {
  animation: none !important;
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.fade-out {
  animation: fadeOut 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* 스크롤 관련 */
.no-scroll {
  overflow: hidden !important;
}

.scroll-y {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.scroll-x {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* 포인터 이벤트 */
.pointer-events-none {
  pointer-events: none !important;
}

.pointer-events-auto {
  pointer-events: auto !important;
}

.cursor-pointer {
  cursor: pointer !important;
}

.cursor-not-allowed {
  cursor: not-allowed !important;
}

.user-select-none {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

/* 불투명도 */
.opacity-0 { opacity: 0 !important; }
.opacity-25 { opacity: 0.25 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }
.opacity-100 { opacity: 1 !important; }

/* z-index */
.z-0 { z-index: 0 !important; }
.z-10 { z-index: 10 !important; }
.z-100 { z-index: 100 !important; }
.z-1000 { z-index: 1000 !important; }
.z-10000 { z-index: 10000 !important; }

/* =============================================== */
/* 19. 게임 플레이 화면 컴포넌트                  */
/* =============================================== */

/* 점수 및 타이머 */
.score-time {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  gap: 12px;
  flex-wrap: wrap;
}

.score {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.8em;
  font-weight: 600;
  white-space: nowrap;
}

.timer-container {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  flex: 1;
  min-width: 120px;
  padding: var(--spacing-sm) var(--spacing-md);
  position: relative;
  overflow: hidden;
}

.timer-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--success-gradient);
  border-radius: var(--radius-sm);
  transition: width 0.1s linear;
  z-index: 1;
  width: 100%;
}

.timer-progress.warning {
  background: var(--warning-gradient);
}

.timer-progress.danger {
  background: var(--danger-gradient);
  animation: pulse 0.8s ease-in-out infinite alternate;
}

.timer-text {
  position: relative;
  z-index: 2;
  font-weight: 700;
  font-size: 1.1em;
}

/* =============================================== */
/* 20. 문제 섹션                                  */
/* =============================================== */

.problem-section {
  background: var(--warning-gradient);
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  text-align: center;
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: none;
}

.problem-text {
  font-size: clamp(1.4em, 6vw, 2em);
  color: white;
  display: block;
  width: 100%;
  margin-bottom: var(--spacing-xs);
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  word-break: keep-all;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 95%;
  transition: font-size 0.3s ease, line-height 0.3s ease;
  cursor: default;
  user-select: none;
}

.problem-text.multiline {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.3;
  font-size: clamp(1em, 5vw, 1.6em);
  margin-bottom: 8px;
  padding: 0 5px;
}

.problem-text.extra-long {
  font-size: clamp(0.9em, 4vw, 1.4em);
  line-height: 1.4;
  text-align: left;
  padding: 5px 10px;
  margin-top: 5px;
}

.problem-text.showing-hint-mode {
  color: #ffff00;
  text-shadow: 0 0 8px rgba(255, 255, 0, 0.5);
  animation: hintPulse 1.5s infinite alternate;
}

.problem-hanja {
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.2;
  font-weight: 500;
  display: block;
  margin-top: 4px;
}

.problem-hint-guide {
  text-align: center;
  font-size: 0.75em;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 8px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.floating-listen-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  background: rgba(116, 185, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  outline: none;
}

.floating-listen-btn:hover {
  transform: scale(1.1);
  background: rgba(116, 185, 255, 1);
}

.floating-listen-btn:active {
  transform: translateY(0) scale(0.95);
}

.floating-listen-btn.tts-audio-button {
  background: rgba(116, 185, 255, 0.9) !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* =============================================== */
/* 21. 조립 섹션                                  */
/* =============================================== */

.assembly-section {
  margin-bottom: var(--spacing-md);
  flex-shrink: 0;
}

.assembly-container {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: var(--spacing-sm);
  width: 100%;
  align-items: center;
}

.assembly-right {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

.assembly-center,
.assembly-center-wide {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.assembly-container-full {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.assembly-center-full {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  width: 100%;
}

.assembly-area {
  background: var(--danger-gradient);
  border-radius: var(--radius-md);
  padding: 20px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 400px;
  width: fit-content;
  margin: 0 auto;
  flex-wrap: wrap;
  transition: all 0.3s ease;
}

.char-slot {
  background: white;
  border: 2px dashed #e0e0e0;
  border-radius: var(--radius-sm);
  width: 60px;
  height: 60px;
  min-width: 60px;
  max-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8em;
  font-weight: 700;
  color: #333;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
  flex-grow: 0;
  flex-basis: 60px;
}

.char-slot.filled {
  border-style: solid;
  border-color: var(--success);
  background: linear-gradient(135deg, #d4ffec, #b3f5e0);
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
}

.char-slot.completed {
  background: var(--success-gradient);
  color: white;
  border-color: var(--success-dark);
  animation: completeGlow 1s ease-out;
  box-shadow: 0 8px 30px rgba(0, 212, 170, 0.5);
  transform: scale(1.1);
}

.assembly-control-btn {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  padding: var(--spacing-xs);
  font-size: 0.7em;
  font-weight: 600;
  cursor: pointer;
  width: 50px;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  text-align: center;
  user-select: none;
}

.assembly-control-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.assembly-control-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* =============================================== */
/* 22. 컨베이어 벨트 (자모 키패드)                 */
/* =============================================== */

.conveyor-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  max-height: 70vh;
}

.conveyor-title {
  text-align: center;
  font-weight: 600;
  color: white;
  margin-bottom: var(--spacing-sm);
  font-size: 0.8em;
  flex-shrink: 0;
  opacity: 0.9;
}

.conveyor-belt {
  background: var(--info-gradient);
  border-radius: var(--radius-md);
  padding: clamp(8px, 2vh, 16px);
  position: relative;
  overflow: visible;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: auto;
  height: fit-content;
  max-height: calc(100vh - 300px);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.jamo-items {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: var(--spacing-xs) !important;
  width: 100% !important;
  justify-content: center !important;
  align-content: center !important;
  align-items: center !important;
  min-height: 60px;
  max-height: 100%;
  overflow: visible;
}

.jamo-item {
  background: white;
  border: 2px solid var(--success);
  border-radius: var(--radius-sm);
  min-width: 45px !important;
  width: calc(25% - 6px) !important;
  height: 55px !important;
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.2em !important;
  font-weight: 700;
  color: #333;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.jamo-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.jamo-item.used {
  background: #e9ecef;
  border-color: #ced4da;
  color: #6c757d;
  cursor: not-allowed;
  transform: none !important;
}

.jamo-item.correct {
  background: var(--success-gradient);
  color: white;
  border-color: var(--success-dark);
  animation: correctPulse 0.6s ease-out;
}

.jamo-item.wrong {
  background: var(--danger-gradient);
  color: white;
  border-color: var(--danger-dark);
  animation: wrongShake 0.4s ease-in-out;
}

/* =============================================== */
/* 23. 알림 시스템                                */
/* =============================================== */

.notification {
  position: fixed !important;
  top: 20px !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(-100px) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  padding: 16px 24px !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12) !important;
  z-index: 10002 !important;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  max-width: 300px !important;
  text-align: center !important;
  font-weight: 500 !important;
}

.notification.show {
  transform: translateX(-50%) translateY(0) !important;
}

.notification.success {
  border-left: 4px solid #00d4aa !important;
}

.notification.warning {
  border-left: 4px solid #fdcb6e !important;
}

.notification.error {
  border-left: 4px solid #fd79a8 !important;
}

.notification.info {
  border-left: 4px solid #74b9ff !important;
}

/* =============================================== */
/* 24. 성공/실패 효과                             */
/* =============================================== */

.success-effect {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3.5em;
  color: var(--success);
  z-index: 1000;
  animation: successPop 1.2s ease-out;
  pointer-events: none;
  font-weight: 900;
  text-shadow: 0 0 20px rgba(0, 212, 170, 0.5);
}

.fail-effect {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3.5em;
  color: var(--danger);
  z-index: 1000;
  animation: failShake 1.2s ease-out;
  pointer-events: none;
  font-weight: 900;
  text-shadow: 0 0 20px rgba(253, 121, 168, 0.5);
}

/* =============================================== */
/* 25. 게임 관련 추가 애니메이션                   */
/* =============================================== */

@keyframes pulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

@keyframes hintPulse {
  from {
    opacity: 0.85;
    text-shadow: 0 0 8px rgba(255, 255, 0, 0.5);
  }
  to {
    opacity: 1;
    text-shadow: 0 0 12px rgba(255, 255, 0, 0.8);
  }
}

@keyframes completeGlow {
  0% {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 212, 170, 0.5);
  }
  50% {
    transform: scale(1.25);
    box-shadow: 0 12px 40px rgba(0, 212, 170, 0.7);
  }
  100% {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 212, 170, 0.5);
  }
}

@keyframes correctPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

@keyframes successPop {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

@keyframes failShake {
  0%, 100% {
    transform: translate(-50%, -50%) translateX(0);
    opacity: 1;
  }
  10% { transform: translate(-50%, -50%) translateX(-15px); }
  20% { transform: translate(-50%, -50%) translateX(15px); }
  30% { transform: translate(-50%, -50%) translateX(-12px); }
  40% { transform: translate(-50%, -50%) translateX(12px); }
  50% { transform: translate(-50%, -50%) translateX(-8px); }
  60% { transform: translate(-50%, -50%) translateX(8px); }
  70% { transform: translate(-50%, -50%) translateX(-4px); }
  80% { transform: translate(-50%, -50%) translateX(4px); }
  90% { transform: translate(-50%, -50%) translateX(-2px); }
  100% {
    transform: translate(-50%, -50%) translateX(0);
    opacity: 0;
  }
}

@keyframes scoreIncrease {
  0% {
    transform: scale(1);
    color: inherit;
  }
  50% {
    transform: scale(1.2);
    color: #00b894;
  }
  100% {
    transform: scale(1);
    color: inherit;
  }
}

@keyframes scoreDecrease {
  0% {
    transform: scale(1);
    color: inherit;
  }
  50% {
    transform: scale(0.9);
    color: #e17055;
  }
  100% {
    transform: scale(1);
    color: inherit;
  }
}

/* =============================================== */
/* 26. 게임 모달 내부 게임 화면 스타일             */
/* =============================================== */

/* 게임 모달 내부 정보 표시 */
.game-header-combined {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  padding: var(--spacing-xs) var(--spacing-md);
  margin-bottom: var(--spacing-md);
  font-size: 0.8em;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  min-height: 48px;
  width: 100%;
  flex-wrap: nowrap;
  overflow: hidden;
}

.level-info {
  background: var(--success-gradient);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-xl);
  font-weight: 600;
  font-size: 0.75em;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-info.category-mode {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.level-info.category-mode::before {
  content: '📂 ';
}

.game-screen-user-info {
  color: white;
  font-size: 0.7em;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-xs);
  white-space: nowrap;
  flex-shrink: 1;
  overflow: hidden;
}

.game-screen-user-info span {
  font-weight: 700;
  color: var(--success);
  text-shadow: 0 0 10px rgba(0, 212, 170, 0.3);
}

/* =============================================== */
/* 27. 게스트 안내                                */
/* =============================================== */

.guest-login-notice {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-md);
  font-size: 0.8em;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  min-height: 40px;
  text-align: center;
  max-width: 90%;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: auto;
  flex-direction: column;
}

.guest-info-text {
  font-size: 0.75em;
  opacity: 0.9;
  line-height: 1.3;
}

.guest-login-btn {
  background: var(--success-gradient);
  color: white;
  border: none;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-xl);
  font-weight: 600;
  font-size: 0.85em;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: var(--spacing-xs);
}

.guest-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* =============================================== */
/* 28. 레벨 진행 상황                             */
/* =============================================== */

.level-progress-info {
  margin-top: 12px;
  font-size: 0.85em;
}

.level-progress-bar {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00b894, #00cec9);
  border-radius: 4px;
  transition: width 0.8s ease-out;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 184, 148, 0.3);
}

.level-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: progressShimmer 2s infinite;
}

.level-progress-text {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2em;
  margin-top: 6px;
}

.level-progress-percent {
  display: none;
}

.level-progress-count {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.guest-progress {
  opacity: 0.8;
}

.guest-progress .level-progress-fill {
  background: linear-gradient(90deg, #74b9ff, #0984e3);
  box-shadow: 0 1px 3px rgba(116, 185, 255, 0.3);
}

.guest-progress .level-progress-percent {
  color: #74b9ff;
}

/* =============================================== */
/* 29. 게임 활성 상태 스타일                      */
/* =============================================== */

body.game-active {
  background: var(--bg-gradient) !important;
  overflow: hidden;
}

body.game-active .app-container {
  height: 100vh;
  height: 100dvh;
  padding-bottom: 0;
  overflow: auto;
}

body.game-active .bottom-tab-bar {
  display: none;
}

body.game-active .game-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border-radius: 0;
  padding: var(--spacing-md);
  z-index: 1001;
  height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: none;
  background: var(--bg-gradient) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}

body.game-active .game-title {
  margin-top: max(10px, env(safe-area-inset-top));
  margin-bottom: 10px;
}

body.game-active .game-header-combined,
body.game-active .game-screen-info,
body.game-active .score-time,
body.game-active .problem-section,
body.game-active .assembly-section {
  margin-bottom: 10px;
}

body.game-active .problem-section {
  height: 80px !important;
}

body.game-active .assembly-area {
  padding: 18px;
  min-height: 75px;
  gap: 10px;
}

body.game-active .char-slot {
  width: 55px;
  height: 55px;
  min-width: 55px;
  max-width: 55px;
  font-size: 1.7em;
  flex-basis: 55px;
}

/* =============================================== */
/* 30. 모바일 최적화 - 게임 화면                  */
/* =============================================== */

@media (max-width: 768px) {
  .problem-section {
    height: 80px;
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  .problem-text {
    font-size: clamp(1.2em, 5.5vw, 1.8em);
  }
  
  .assembly-area {
    padding: 16px;
    max-width: 95%;
    gap: 10px;
  }
  
  .char-slot {
    width: 55px;
    height: 55px;
    min-width: 55px;
    max-width: 55px;
    font-size: 1.6em;
  }
  
  .jamo-item {
    min-width: 42px !important;
    width: calc(25% - 5px) !important;
    height: 50px !important;
    font-size: 1.1em !important;
  }
  
  .conveyor-belt {
    padding: clamp(6px, 1.5vh, 12px);
  }
  
  .assembly-control-btn {
    width: 48px;
    height: 55px;
    font-size: 0.65em;
  }
}

@media (max-width: 480px) {
  .problem-section {
    height: 75px;
    padding: 10px 14px;
  }
  
  .problem-text {
    font-size: clamp(1.1em, 5vw, 1.6em);
  }
  
  .problem-text.multiline {
    font-size: clamp(0.9em, 4.5vw, 1.4em);
  }
  
  .problem-text.extra-long {
    font-size: clamp(0.85em, 4vw, 1.2em);
  }
  
  .assembly-area {
    padding: 14px;
    gap: 8px;
  }
  
  .char-slot {
    width: 50px;
    height: 50px;
    min-width: 50px;
    max-width: 50px;
    font-size: 1.5em;
    flex-basis: 50px;
  }
  
  .jamo-item {
    min-width: 38px !important;
    width: calc(25% - 4px) !important;
    height: 45px !important;
    font-size: 1em !important;
  }
  
  .assembly-control-btn {
    width: 44px;
    height: 52px;
    font-size: 0.6em;
    padding: var(--spacing-xs);
  }
  
  .level-buttons {
    flex-direction: column;
    gap: var(--spacing-sm);
    width: 100%;
  }
  
  .level-btn {
    width: 80%;
    max-width: none;
  }
}

@media (max-width: 360px) {
  .assembly-area {
    padding: 12px;
    gap: 6px;
  }
  
  .char-slot {
    width: 45px;
    height: 45px;
    min-width: 45px;
    max-width: 45px;
    font-size: 1.4em;
    flex-basis: 45px;
  }
  
  .jamo-item {
    min-width: 35px !important;
    width: calc(25% - 3px) !important;
    height: 40px !important;
    font-size: 0.9em !important;
  }
  
  .conveyor-belt {
    padding: clamp(4px, 1vh, 8px);
  }
  
  .assembly-control-btn {
    width: 42px;
    height: 50px;
    font-size: 0.55em;
  }
}

/* =============================================== */
/* 31. 가로 모드 대응                             */
/* =============================================== */

@media (orientation: landscape) and (max-height: 500px) {
  .conveyor-belt {
    max-height: calc(100vh - 200px);
  }
  
  body.game-active .game-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas: 
      "header header"
      "problem keypad";
    gap: 5px;
    padding: 5px;
  }
  
  body.game-active .game-header {
    grid-area: header;
    margin-bottom: 0;
  }
  
  body.game-active .game-screen-info {
    grid-area: header;
    margin-bottom: 5px;
  }
  
  body.game-active .problem-section {
    height: 65px !important;
    min-height: 65px !important;
    max-height: 65px !important;
  }
  
  body.game-active .assembly-section {
    grid-area: problem;
    margin-top: auto;
    margin-bottom: 0;
  }
  
  body.game-active .assembly-area {
    padding: 14px;
    min-height: 60px;
    max-width: 350px;
  }
  
  body.game-active .char-slot {
    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    font-size: 1.5em;
    flex-basis: 48px;
  }
  
  body.game-active .conveyor-section {
    grid-area: keypad;
    margin-bottom: 0;
  }
}

@media (orientation: landscape) and (max-height: 350px) {
  body.game-active .game-title {
    display: none;
  }
  
  body.game-active .game-header-combined {
    min-height: 30px;
  }
}

/* =============================================== */
/* 32. 작은 화면 높이 대응                        */
/* =============================================== */

@media screen and (max-height: 700px) {
  .dashboard-container {
    padding: var(--spacing-sm);
    gap: var(--spacing-sm);
  }
  
  .game-container {
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 12px;
    margin: 8px auto;
  }
  
  .game-title {
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
    margin-bottom: 12px;
  }
  
  .problem-section {
    height: 75px;
    min-height: 75px;
    max-height: 75px;
    padding: 10px 14px;
  }
  
  .problem-text {
    font-size: clamp(1.2em, 5vw, 1.8em);
  }
  
  .assembly-area {
    padding: 16px;
    min-height: 70px;
    max-width: 380px;
    gap: 10px;
  }
  
  .char-slot {
    width: 55px;
    height: 55px;
    min-width: 55px;
    max-width: 55px;
    font-size: 1.7em;
    flex-basis: 55px;
  }
  
  .conveyor-section {
    min-height: 100px;
  }
}

@media (max-height: 600px) {
  body.game-active .game-container {
    padding: 10px;
  }
  
  body.game-active .game-title {
    font-size: clamp(1.2rem, 3.5vw, 1.4rem);
    margin-top: max(5px, env(safe-area-inset-top));
    margin-bottom: 5px;
  }
  
  body.game-active .game-header-combined,
  body.game-active .game-screen-info,
  body.game-active .score-time,
  body.game-active .problem-section,
  body.game-active .assembly-section {
    margin-bottom: 5px;
  }
  
  body.game-active .problem-section {
    height: 70px !important;
    min-height: 70px !important;
    max-height: 70px !important;
    padding: 8px 12px !important;
  }
  
  body.game-active .assembly-area {
    padding: 15px;
    min-height: 65px;
    gap: 8px;
  }
  
  body.game-active .char-slot {
    width: 50px;
    height: 50px;
    min-width: 50px;
    max-width: 50px;
    font-size: 1.6em;
    flex-basis: 50px;
  }
  
  body.game-active .jamo-item {
    min-width: 60px !important;
    height: 50px !important;
  }
}

@media (max-height: 480px) {
  body.game-active .game-container {
    padding: 8px;
  }
  
  body.game-active .game-title {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-top: max(3px, env(safe-area-inset-top));
    margin-bottom: 3px;
  }
  
  body.game-active .game-header-combined,
  body.game-active .game-screen-info,
  body.game-active .score-time,
  body.game-active .problem-section,
  body.game-active .assembly-section {
    margin-bottom: 3px;
  }
  
  body.game-active .game-header-combined {
    min-height: 36px;
    padding: 4px 8px;
  }
  
  body.game-active .level-info,
  body.game-active .game-screen-user-info {
    font-size: 0.65em;
  }
  
  body.game-active .problem-section {
    height: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    padding: 6px 8px !important;
  }
  
  body.game-active .problem-text {
    font-size: clamp(1.2em, 7vw, 1.8em);
  }
  
  body.game-active .assembly-area {
    padding: 12px;
    min-height: 55px;
    gap: 6px;
  }
  
  body.game-active .char-slot {
    width: 45px;
    height: 45px;
    min-width: 45px;
    max-width: 45px;
    font-size: 1.5em;
    flex-basis: 45px;
  }
  
  body.game-active .jamo-item {
    min-width: 55px !important;
    height: 45px !important;
    font-size: 1.1em !important;
  }
}

/* =============================================== */
/* 33. 안전 영역 패딩                             */
/* =============================================== */

@supports (padding-top: env(safe-area-inset-top)) {
  body.game-active .game-container {
    padding-top: max(var(--spacing-md), env(safe-area-inset-top));
    padding-right: max(var(--spacing-md), env(safe-area-inset-right));
    padding-bottom: max(var(--spacing-md), env(safe-area-inset-bottom));
    padding-left: max(var(--spacing-md), env(safe-area-inset-left));
  }
  
  @media (max-height: 600px) {
    body.game-active .game-container {
      padding-top: max(10px, env(safe-area-inset-top));
      padding-right: max(10px, env(safe-area-inset-right));
      padding-bottom: max(10px, env(safe-area-inset-bottom));
      padding-left: max(10px, env(safe-area-inset-left));
    }
  }
  
  @media (max-height: 480px) {
    body.game-active .game-container {
      padding-top: max(5px, env(safe-area-inset-top));
      padding-right: max(5px, env(safe-area-inset-right));
      padding-bottom: max(5px, env(safe-area-inset-bottom));
      padding-left: max(5px, env(safe-area-inset-left));
    }
  }
}

/* =============================================== */
/* 34. 기타 모달 스타일                           */
/* =============================================== */

.modal {
  display: none;
  position: fixed;
  z-index: 1002;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 2px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
  color: #333 !important;
  font-family: var(--system-font) !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  margin: 5% auto;
  padding: var(--spacing-xl);
  width: 90%;
  max-width: 500px;
  border-radius: var(--radius-lg);
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  animation: modalSlideIn 0.4s ease-out;
}

.modal-content h2 {
  font-family: var(--system-font) !important;
  font-weight: 700 !important;
  color: #2d3436 !important;
  font-size: 1.5em !important;
  margin-bottom: 20px !important;
  text-shadow: none !important;
}

.close-button {
  font-family: var(--system-font) !important;
  font-weight: 900 !important;
  font-size: 32px !important;
  color: #636e72 !important;
  background: rgba(0, 0, 0, 0.05) !important;
  border-radius: 50% !important;
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  text-shadow: none !important;
  border: 2px solid rgba(0, 0, 0, 0.1) !important;
  position: absolute !important;
  top: 15px !important;
  right: 15px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
}

.close-button:hover {
  background: rgba(0, 0, 0, 0.1) !important;
  transform: scale(1.1);
}

/* =============================================== */
/* 35. 레벨별 학습 스타일 - 2컬럼 레이아웃        */
/* =============================================== */

/* 레벨 그리드 레이아웃 */
.level-learning-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

/* 레벨 카드 - 2컬럼 레이아웃 */
.level-learning-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 160px;
    box-shadow: var(--shadow-md);
    color: white;
    
    /* 🔥 Flexbox 2컬럼 레이아웃 */
    display: flex;
    flex-direction: row;
    gap: var(--spacing-md);
    align-items: stretch;
}

/* 레벨별 테마 색상 */
.level-learning-card.beginner {
    background: linear-gradient(135deg, 
        rgba(0, 212, 170, 0.15), 
        rgba(0, 184, 148, 0.08));
    border-color: rgba(0, 212, 170, 0.3);
}

.level-learning-card.beginner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--success-gradient);
}

.level-learning-card.intermediate {
    background: linear-gradient(135deg, 
        rgba(253, 203, 110, 0.15), 
        rgba(225, 112, 85, 0.08));
    border-color: rgba(253, 203, 110, 0.3);
}

.level-learning-card.intermediate::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--warning-gradient);
}

/* 🔥 왼쪽 컬럼: 정보 영역 */
.level-info-column {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding-right: var(--spacing-md);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* 레벨 헤더 (아이콘 + 제목) */
.level-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.level-learning-icon {
    font-size: 2.5em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    flex-shrink: 0;
}

.level-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.level-learning-name {
    font-size: 1.3em;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.level-learning-subtitle {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* 단어 수 */
.level-learning-count {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.95em;
}

.count-label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.count-value {
    font-weight: 700;
    color: white;
}

/* 설명 */
.level-learning-desc {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    margin-top: auto;
}

/* 🔥 오른쪽 컬럼: 달성도 영역 */
.level-progress-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    text-align: center;
    padding-left: var(--spacing-sm);
}

/* 달성도 제목 */
.level-achievement-title {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    margin-bottom: 4px;
}

/* 달성도 퍼센트 (큰 숫자) */
.level-achievement-percent {
    font-size: 2em;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

/* 프로그레스 바 */
.level-achievement-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.level-achievement-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.beginner-fill {
    background: var(--success-gradient);
    box-shadow: 0 0 10px rgba(0, 212, 170, 0.5);
}

.intermediate-fill {
    background: var(--warning-gradient);
    box-shadow: 0 0 10px rgba(253, 203, 110, 0.5);
}

/* 프로그레스 바 애니메이션 */
.level-achievement-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: shimmerProgress 2s infinite;
}

@keyframes shimmerProgress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 달성 개수 */
.level-achievement-count {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

/* 호버 효과 */
.level-learning-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.level-learning-card.beginner:hover {
    box-shadow: 0 8px 30px rgba(0, 212, 170, 0.3);
}

.level-learning-card.intermediate:hover {
    box-shadow: 0 8px 30px rgba(253, 203, 110, 0.3);
}

/* 🔥 모바일 반응형 - 768px 이하 */
@media (max-width: 768px) {
    .level-learning-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .level-learning-card {
        min-height: 140px;
        padding: var(--spacing-md);
        /* 모바일에서도 가로 유지, 더 컴팩트하게 */
        gap: var(--spacing-sm);
    }
    
    .level-info-column {
        padding-right: var(--spacing-sm);
    }
    
    .level-learning-icon {
        font-size: 2em;
    }
    
    .level-learning-name {
        font-size: 1.1em;
    }
    
    .level-learning-subtitle {
        font-size: 0.8em;
    }
    
    .level-learning-count {
        font-size: 0.9em;
    }
    
    .level-learning-desc {
        font-size: 0.8em;
    }
    
    .level-achievement-percent {
        font-size: 1.6em;
    }
    
    .level-achievement-bar {
        height: 6px;
    }
}

/* 🔥 모바일 반응형 - 480px 이하 */
@media (max-width: 480px) {
    .level-learning-card {
        /* 작은 화면에서는 세로 배치로 전환 */
        flex-direction: column;
        min-height: auto;
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }
    
    .level-info-column {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-right: 0;
        padding-bottom: var(--spacing-sm);
    }
    
    .level-progress-column {
        padding-left: 0;
        padding-top: var(--spacing-sm);
    }
    
    .level-header {
        justify-content: center;
    }
    
    .level-learning-icon {
        font-size: 1.8em;
    }
    
    .level-learning-name {
        font-size: 1em;
    }
    
    .level-learning-subtitle {
        font-size: 0.75em;
    }
    
    .level-learning-desc {
        text-align: center;
        font-size: 0.75em;
    }
    
    .level-achievement-percent {
        font-size: 1.5em;
    }
    
    .level-achievement-bar {
        max-width: 200px;
        margin: 0 auto;
    }
}

/* 작은 화면 - 360px 이하 */
@media (max-width: 360px) {
    .level-learning-card {
        padding: 10px;
    }
    
    .level-learning-icon {
        font-size: 1.5em;
    }
    
    .level-learning-name {
        font-size: 0.9em;
    }
    
    .level-learning-subtitle {
        font-size: 0.7em;
    }
    
    .level-achievement-percent {
        font-size: 1.3em;
    }
}

/* 클릭 피드백 */
.level-learning-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* 로딩 상태 */
.count-value.loading,
.level-achievement-percent.loading {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
    min-width: 80px;
    min-height: 1em;
}

/* 접근성 */
.level-learning-card:focus {
    outline: 2px solid var(--info);
    outline-offset: 2px;
}

.level-learning-card:focus:not(:focus-visible) {
    outline: none;
}

/* 애니메이션 감소 모드 */
@media (prefers-reduced-motion: reduce) {
    .level-achievement-fill,
    .level-learning-card {
        transition: none !important;
    }
    
    .level-achievement-fill::after {
        animation: none !important;
    }
}

/* =============================================== */
/* 36. 완료 - 파일 끝                             */
/* =============================================== */

/* 내부 컨테이너들도 스크롤 가능하게 */
.dashboard-container,
.learning-content,
.message-content {
  width: 100%;
  height: 100%;
  overflow-y: auto !important; /* 🔧 강제 스크롤 */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* 스크롤바 숨기기 (모바일) */
.dashboard-container::-webkit-scrollbar,
.learning-content::-webkit-scrollbar,
.message-content::-webkit-scrollbar {
  display: none;
}

/* z-index 정리로 클릭 이벤트 충돌 방지 */
.tab-content {
  z-index: 1;
}

.tab-content.active {
  z-index: 10;
}

/* 단어장 모달 z-index 명확히 */
.create-wordbook-modal {
  z-index: 1000 !important;
}

/* iOS Safari 특별 대응 */
@supports (-webkit-touch-callout: none) {
  #homeTab.active,
  #learningTab.active,
  #messageTab.active {
    position: relative;
    height: calc(100vh - var(--tab-bar-total-height));
    min-height: calc(100vh - var(--tab-bar-total-height));
    -webkit-overflow-scrolling: touch;
    overflow-y: scroll !important;
    overscroll-behavior-y: contain;
  }
}

/* 별점 표시 스타일 */
.stage-status.starred {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    font-weight: bold;
}

.stage-status.in-progress {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
}

/* =============================================== */
/* 별점 시스템 스타일 - game_effects.css에 추가    */
/* =============================================== */

/* 환영 메시지 컨테이너 재구성 */
.welcome-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    width: 100%;
    flex-wrap: wrap;
}

.welcome-text {
    font-size: 1.1em;
    font-weight: 600;
    flex-shrink: 0;
}

.welcome-actions {
    flex-shrink: 0;
}

/* 별점 섹션 메인 스타일 */
.star-rating-section {
    flex: 1;
    min-width: 200px;
    max-width: 350px;
    position: relative;
}

.star-rating-container {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 193, 7, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
}

.star-rating-container:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 193, 7, 0.08));
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

/* 메인 별점 표시 */
.star-rating-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.star-icon-large {
    font-size: 1.4em;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
    animation: starPulse 2s ease-in-out infinite;
}

.star-count-display {
    font-weight: 700;
    font-size: 1.1em;
    color: #FFD700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#currentStars {
    font-size: 1.2em;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#maxStars {
    opacity: 0.7;
    color: rgba(255, 255, 255, 0.8);
}

.star-progress-percent {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

/* 프로그레스 바 */
.star-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.star-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 100%;
    border-radius: 3px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: goldGradient 3s linear infinite;
}

.star-progress-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    animation: shimmerEffect 2s infinite;
}

/* 마일스톤 표시 */
.star-milestone {
    margin-top: 4px;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

#remainingStars {
    color: #FFD700;
    font-weight: 600;
}

/* 툴팁 스타일 */
.star-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    min-width: 250px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.star-rating-container:hover .star-tooltip {
    opacity: 1;
    visibility: visible;
}

.tooltip-arrow {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: rgba(30, 30, 30, 0.95);
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    border-left: 1px solid rgba(255, 215, 0, 0.3);
    transform: translateX(-50%) rotate(45deg);
}

.tooltip-content h4 {
    margin: 0 0 8px 0;
    color: #FFD700;
    font-size: 0.9em;
    text-align: center;
}

.star-breakdown {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
}

.breakdown-label {
    color: rgba(255, 255, 255, 0.7);
}

.breakdown-value {
    font-weight: 600;
    color: #FFD700;
}

.level-breakdown {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.level-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.level-name {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.level-stars {
    color: #FFD700;
    font-weight: 600;
}

/* 애니메이션 */
@keyframes starPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
    }
}

@keyframes goldGradient {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

@keyframes shimmerEffect {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

/* 별점 증가 애니메이션 */
@keyframes starIncrease {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
        color: #FFD700;
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
    100% {
        transform: scale(1);
    }
}

.star-animating {
    animation: starIncrease 0.6s ease-out;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .welcome-header-container {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }
    
    .star-rating-section {
        max-width: 100%;
        order: 2;
    }
    
    .welcome-text {
        order: 1;
        text-align: center;
    }
    
    .welcome-actions {
        order: 3;
        text-align: center;
    }
    
    .star-rating-main {
        justify-content: center;
    }
    
    .star-tooltip {
        left: 0;
        right: 0;
        transform: none;
        margin: 0 10px;
    }
    
    .tooltip-arrow {
        left: 50%;
    }
}

@media (max-width: 480px) {
    .star-rating-container {
        padding: 8px 12px;
    }
    
    .star-icon-large {
        font-size: 1.2em;
    }
    
    .star-count-display {
        font-size: 1em;
    }
    
    #currentStars {
        font-size: 1.1em;
    }
    
    .star-progress-percent {
        font-size: 0.85em;
    }
    
    .star-milestone {
        font-size: 0.7em;
    }
}

/* 게스트 모드 스타일 */
.guest-mode .star-rating-section {
    display: none !important;
}