/* ==========================================================================
   왕립 마법 동물 농장 (Royal Pet Farm) - Main CSS
   파스텔 동화풍 2000년대 감성 + 모던 UI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@400;700&family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

:root {
  /* 색상 팔레트 */
  --bg-sky: #e0f2fe;
  --bg-gradient: linear-gradient(180deg, #bae6fd 0%, #e0f2fe 40%, #fef3c7 75%, #bbf7d0 100%);
  --panel-bg: rgba(255, 255, 255, 0.92);
  --panel-border: #fbcfe8;
  --panel-shadow: 0 10px 25px -5px rgba(236, 72, 153, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  --text-main: #334155;
  --text-muted: #64748b;
  --text-point: #be185d;

  /* 스탯 컬러 */
  --stat-love: #ec4899;
  --stat-love-bg: #fce7f3;
  --stat-charm: #a855f7;
  --stat-charm-bg: #f3e8ff;
  --stat-knowledge: #3b82f6;
  --stat-knowledge-bg: #dbeafe;
  --stat-health: #10b981;
  --stat-health-bg: #d1fae5;

  /* 버튼 컬러 */
  --btn-primary: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
  --btn-primary-shadow: 0 4px 12px rgba(236, 72, 153, 0.35);
  --btn-gold: linear-gradient(135deg, #fde047 0%, #f59e0b 100%);
  --btn-gold-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);

  --font-title: 'Gaegu', cursive, sans-serif;
  --font-body: 'Noto Sans KR', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background: var(--bg-gradient);
  display: flex;
  justify-content: center;
  align-items: stretch;
  user-select: none;
}

/* 앱 전체 컨테이너 (모바일 뷰 비율 고정 또는 유연한 반응형) */
#app {
  width: 100%;
  min-width: 320px;
  max-width: 540px;
  height: 100%;
  max-height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
  border-left: 2px solid rgba(255, 255, 255, 0.6);
  border-right: 2px solid rgba(255, 255, 255, 0.6);
}

/* 상단 정보 바 */
.top-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 2px dashed #fbcfe8;
  z-index: 10;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #f472b6;
  font-size: 13px;
  font-weight: 700;
  color: #db2777;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.currency-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  border: 1px solid #fde047;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #b45309;
}

/* 하단 탭 내비게이션 (1단계: 농장 활성, 타 탭 비활성 표시) */
.bottom-nav {
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  padding: 8px 12px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 2px dashed #fbcfe8;
  position: relative;
  z-index: 10;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.nav-item .icon {
  font-size: 20px;
}

.nav-item.active {
  color: #db2777;
  background: #fdf2f8;
  transform: translateY(-2px);
}

.nav-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 공통 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--btn-primary);
  color: #ffffff;
  box-shadow: var(--btn-primary-shadow);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-gold {
  background: var(--btn-gold);
  color: #78350f;
  box-shadow: var(--btn-gold-shadow);
}

.btn-gold:hover {
  filter: brightness(1.05);
}

.btn-disabled {
  background: #e2e8f0 !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* 상단바 데이터 초기화 버튼 */
.btn-top-reset {
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #cbd5e1;
  color: #64748b;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.btn-top-reset:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #ef4444;
  transform: rotate(45deg);
}

.btn-top-reset:active {
  transform: scale(0.92);
}

/* 모달 레이아웃 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

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

.modal-card {
  background: #ffffff;
  border-radius: 28px;
  border: 3px solid #fbcfe8;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 24px;
  position: relative;
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  color: #db2777;
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 18px;
  line-height: 1.5;
}

/* 토스트 알림 메시지 */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}
