/* UI Components Styling */

/* --- Top Player Header Bar --- */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.player-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-avatar-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #EDE7F6, #F3E5F5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  border: 2px solid var(--accent-purple);
  box-shadow: var(--shadow-sm);
}

.player-meta {
  display: flex;
  flex-direction: column;
}

.player-name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}

.player-level-badge {
  font-size: 0.78rem;
  color: var(--accent-purple);
  font-weight: 700;
}

.currency-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.currency-chip {
  background: #F1F5F9;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
}

.currency-chip.coins { color: #D97706; background: #FEF3C7; }
.currency-chip.tickets { color: #DC2626; background: #FEE2E2; }
.currency-chip.crystals { color: #0284C7; background: #E0F2FE; }

.settings-btn {
  background: #F1F5F9;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}

.settings-btn:active { transform: scale(0.9); background: #E2E8F0; }

/* EXP Bar Component */
.exp-bar-container {
  width: 100%;
  height: 14px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7C4DFF, #FF4081);
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.exp-bar-text {
  position: absolute;
  width: 100%;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* --- Bottom Navigation Bar --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 999;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

@media (min-width: 768px) {
  .bottom-nav {
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  width: 20%;
  height: 100%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-icon {
  font-size: 1.45rem;
  transition: transform 0.2s;
}

.nav-item.active {
  color: var(--accent-purple);
  font-weight: 700;
}

.nav-item.active .nav-icon {
  transform: translateY(-2px) scale(1.18);
}

/* --- Game Cards --- */
.game-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- Main Character Featured Card --- */
.main-char-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  align-items: center;
  padding: 24px 16px;
  box-shadow: var(--shadow-md);
}

.char-badge-type {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255,255,255,0.92);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.char-badge-rarity {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.char-avatar-hero {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.8rem;
  margin: 12px 0 8px 0;
  box-shadow: var(--shadow-md);
  position: relative;
  animation: floatCharacter 3s ease-in-out infinite;
}

.char-name-hero {
  font-size: 1.35rem;
  font-weight: 700;
}

.char-level-hero {
  font-size: 0.95rem;
  color: var(--accent-purple);
  font-weight: 700;
  margin-bottom: 4px;
}

.char-actions-row {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

/* --- Buttons --- */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s ease-in-out;
  box-shadow: var(--shadow-sm);
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), #651FFF);
  color: #FFFFFF;
}

.btn-secondary {
  background: #F1F5F9;
  color: var(--text-dark);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-pink), #F50057);
  color: #FFFFFF;
}

.btn-gold {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber));
  color: #FFFFFF;
}

.btn-full { width: 100%; }

/* --- Daily Missions Item --- */
.mission-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #F8FAFC;
  border-radius: var(--radius-sm);
  border: 1px solid #E2E8F0;
  gap: 12px;
}

.mission-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.mission-title {
  font-weight: 700;
  font-size: 0.92rem;
}

.mission-reward-text {
  font-size: 0.78rem;
  color: #D97706;
  font-weight: 700;
}

.mission-progress-bar {
  height: 8px;
  background: #CBD5E1;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 2px;
}

.mission-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7C4DFF, #FF4081);
  border-radius: 4px;
}

/* --- Quick Play Grid --- */
.quick-play-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.quick-play-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 2px solid #F1F5F9;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.quick-play-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-purple-light);
  box-shadow: var(--shadow-md);
}

.quick-play-card:active {
  transform: scale(0.97);
}

.quick-play-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #FFFFFF;
}

.quick-play-name {
  font-weight: 700;
  font-size: 0.95rem;
}

/* --- Character Collection & Preview Grid --- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.char-card-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.char-card-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.char-card-item.locked {
  opacity: 0.65;
  filter: grayscale(0.85);
}

.char-card-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.char-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.15;
}

.char-card-level {
  font-size: 0.72rem;
  background: #EDE7F6;
  color: var(--accent-purple);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* --- Filter Tabs --- */
.tab-filter-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.tab-filter-container::-webkit-scrollbar { display: none; }

.tab-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: #E2E8F0;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-chip.active {
  background: var(--accent-purple);
  color: #FFFFFF;
}

/* --- Gacha Recruit Section --- */
.gacha-hero-banner {
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
}

.gacha-card-stage {
  width: 140px;
  height: 200px;
  perspective: 1000px;
  margin: 12px 0;
}

.gacha-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gacha-card-inner.flipped {
  transform: rotateY(180deg);
}

.gacha-card-front, .gacha-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.gacha-card-front {
  background: linear-gradient(135deg, #7C4DFF, #FF4081);
  border: 3px solid #FFFFFF;
  color: #FFFFFF;
  font-size: 3.5rem;
}

.gacha-card-back {
  background: #FFFFFF;
  transform: rotateY(180deg);
  border: 3px solid var(--accent-gold);
  color: var(--text-dark);
  padding: 12px;
  text-align: center;
}

/* --- Quiz Components --- */
.quiz-subject-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 2px solid #F1F5F9;
  cursor: pointer;
  transition: transform 0.2s;
}

.quiz-subject-card:active { transform: scale(0.98); }

.quiz-subject-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #FFFFFF;
}

.quiz-option-btn {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border-radius: var(--radius-sm);
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-option-btn:hover { background: #EDF2F7; }
.quiz-option-btn.selected { border-color: var(--accent-purple); background: var(--accent-purple-light); }
.quiz-option-btn.correct { border-color: var(--accent-green); background: #E8F5E9; color: #1B5E20; }
.quiz-option-btn.wrong { border-color: #EF4444; background: #FEE2E2; color: #991B1B; }

/* --- Streak Calendar Grid --- */
.streak-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.streak-day-box {
  background: #F1F5F9;
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid #E2E8F0;
}

.streak-day-box.active {
  background: #FEF3C7;
  border-color: var(--accent-gold);
  color: #B45309;
}

.streak-day-box.claimed {
  background: #DCFCE7;
  border-color: var(--accent-green);
  color: #15803D;
}

/* --- Modals Overlay --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

/* Full Screen Gacha Popup Modal Styling */
.modal-overlay.full-screen .modal-content {
  max-width: 500px;
  max-height: 92vh;
  background: linear-gradient(180deg, #1E1B4B 0%, #312E81 100%);
  color: #FFFFFF;
  border: 2px solid var(--accent-gold);
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.5);
  position: relative;
  overflow-x: hidden;
}

/* Gacha Booster Pack in Center */
.gacha-booster-pack {
  width: 170px;
  height: 240px;
  background: linear-gradient(135deg, #4F46E5, #9333EA, #EC4899);
  border: 4px solid #FDE047;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(253, 224, 71, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  margin: 16px auto;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gacha-booster-pack:hover {
  transform: scale(1.05) rotate(2deg);
}

.gacha-booster-pack::after {
  content: '✨';
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 1.4rem;
  animation: bounceSlow 1.5s infinite ease-in-out;
}

/* Profile Stat Cards */
.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

.profile-stat-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.profile-stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
}

.profile-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Notification Bell Badge */
.notif-btn-wrapper {
  position: relative;
  display: inline-block;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
  animation: pulseGlow 1.5s infinite;
}

/* Daily Check-In Grid */
.checkin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.checkin-card {
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}

.checkin-card.active {
  background: #EFF6FF;
  border-color: #3B82F6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
  transform: translateY(-2px);
}

.checkin-card.claimed {
  background: #F1F5F9;
  border-color: #CBD5E1;
  opacity: 0.75;
}

.checkin-card.day7 {
  grid-column: span 2;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border-color: #F59E0B;
}

.checkin-card-day {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-dark);
}

.checkin-card-icon {
  font-size: 1.6rem;
}

.checkin-card-reward {
  font-size: 0.72rem;
  font-weight: 700;
  color: #D97706;
}

/* Daily Goal & Chest Section */
.daily-goal-card {
  background: linear-gradient(135deg, #FFFFFF, #F8FAFC);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 2px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.goal-track-item {
  margin-bottom: 12px;
}

.goal-track-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.goal-track-bar {
  height: 10px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.goal-track-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease-out;
}

/* Chest Box Styling */
.chest-box-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.chest-icon-wrapper {
  font-size: 4.5rem;
  cursor: pointer;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.15));
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chest-icon-wrapper:hover {
  transform: scale(1.1) rotate(4deg);
}

.chest-bounce {
  animation: bounceSlow 1.2s infinite ease-in-out;
}

/* Notifications List */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  position: relative;
}

.notif-item.unread {
  background: #EFF6FF;
  border-color: #BFDBFE;
}

.notif-item-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.notif-item-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-dark);
}

.notif-item-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.notif-item-time {
  font-size: 0.7rem;
  color: #94A3B8;
  margin-top: 4px;
}


