/* UI components: titles, cards, buttons, modals, tabs */

.game-title {
  font-family: 'Bagel Fat One', cursive;
  font-size: 56px;
  background: linear-gradient(135deg, #ffd700, #ff66c4 50%, #66ccff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  animation: tp 3s ease-in-out infinite;
  line-height: 1;
}

.game-subtitle {
  font-size: 20px;
  opacity: .9;
  margin-bottom: 50px;
}

.player-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.player-card {
  width: 220px;
  height: 300px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 32px;
  border: 2px solid rgba(255, 255, 255, .15);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all .3s cubic-bezier(.34, 1.56, .64, 1);
  padding: 16px;
}

.player-card:active {
  transform: translateY(-8px) scale(1.03);
  border-color: #ffd700;
}

.player-avatar {
  width: 130px;
  height: 130px;
  margin-bottom: 12px;
}

.player-name {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.player-stats {
  font-size: 13px;
  color: #ffd700;
}

.add-player-btn {
  width: 220px;
  height: 300px;
  background: rgba(255, 255, 255, .04);
  border: 2px dashed rgba(255, 255, 255, .2);
  border-radius: 32px;
  color: rgba(255, 255, 255, .4);
  font-family: inherit;
  font-size: 70px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.add-player-btn span:last-child {
  font-size: 16px;
  margin-top: 12px;
  font-weight: 600;
}

.parent-mode {
  position: fixed;
  top: calc(24px + env(safe-area-inset-top));
  right: calc(24px + env(safe-area-inset-right));
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff;
  padding: 12px 20px;
  border-radius: 50px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 50;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 8px 24px;
  gap: 12px;
}

.back-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.star-counter {
  background: linear-gradient(135deg, rgba(255, 215, 0, .25), rgba(255, 102, 196, .25));
  border: 2px solid rgba(255, 215, 0, .5);
  padding: 12px 24px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 22px;
}

.si {
  font-size: 28px;
  animation: ss 4s linear infinite;
  display: inline-block;
}

.streak-badge {
  background: linear-gradient(135deg, #ff6b35, #ff3366);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pet-section {
  text-align: center;
  margin: 24px 0 40px;
}

.pet-stage {
  position: relative;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pet-platform {
  position: absolute;
  bottom: 30px;
  width: 240px;
  height: 50px;
  background: radial-gradient(ellipse at center, rgba(255, 215, 0, .5), transparent 70%);
  border-radius: 50%;
  filter: blur(10px);
  animation: pp 3s ease-in-out infinite;
}

.pet-container {
  position: relative;
  z-index: 2;
  cursor: pointer;
  animation: pb 2.5s ease-in-out infinite;
}

.pet-svg {
  width: 220px;
  height: 220px;
  filter: drop-shadow(0 15px 30px rgba(255, 102, 196, .5));
}

.pet-name {
  font-size: 24px;
  font-weight: 700;
  margin-top: 8px;
  color: #ffd700;
}

.pet-level {
  font-size: 16px;
  opacity: .85;
  margin-bottom: 16px;
}

.progress-bar {
  width: 80%;
  max-width: 400px;
  height: 18px;
  background: rgba(255, 255, 255, .1);
  border-radius: 50px;
  margin: 0 auto;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .15);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd700, #ff66c4, #66ccff);
  background-size: 200% 100%;
  border-radius: 50px;
  transition: width .6s cubic-bezier(.34, 1.56, .64, 1);
  animation: gs 3s linear infinite;
}

.section {
  margin: 32px 0;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title-icon {
  font-size: 32px;
}

.quest-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .quest-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.quest-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .04));
  border: 2px solid rgba(255, 255, 255, .1);
  border-radius: 24px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all .3s cubic-bezier(.34, 1.56, .64, 1);
}

.quest-card.completed {
  background: linear-gradient(135deg, rgba(76, 217, 100, .2), rgba(76, 217, 100, .05));
  border-color: rgba(76, 217, 100, .4);
  opacity: .7;
}

.quest-card:active:not(.completed) {
  transform: scale(1.02);
  border-color: #ffd700;
}

.quest-icon {
  font-size: 48px;
  flex-shrink: 0;
}

.quest-info {
  flex: 1;
  min-width: 0;
}

.quest-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.quest-reward {
  font-size: 14px;
  color: #ffd700;
  font-weight: 600;
}

.quest-check {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  border: 2px solid rgba(255, 255, 255, .3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quest-card.completed .quest-check {
  background: #4cd964;
  border-color: #4cd964;
}

.quest-card.completed .quest-check::after {
  content: '✓';
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.quest-add-card {
  background: rgba(255, 215, 0, .05);
  border: 2px dashed rgba(255, 215, 0, .4);
  border-radius: 24px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  color: #ffd700;
  font-weight: 600;
  font-size: 16px;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 600px) {
  .reward-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.reward-card {
  background: linear-gradient(135deg, rgba(255, 102, 196, .15), rgba(102, 204, 255, .15));
  border: 2px solid rgba(255, 255, 255, .15);
  border-radius: 24px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
}

.reward-card.locked {
  opacity: .5;
  cursor: not-allowed;
}

.reward-icon {
  font-size: 56px;
  margin-bottom: 8px;
}

.reward-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.reward-cost {
  background: linear-gradient(135deg, #ffd700, #ff66c4);
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  color: #0a0e27;
}

.tab-bar {
  display: flex;
  background: rgba(255, 255, 255, .05);
  border-radius: 50px;
  padding: 6px;
  margin: 24px auto;
  max-width: 400px;
  border: 1px solid rgba(255, 255, 255, .1);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: rgba(255, 255, 255, .6);
  padding: 12px 16px;
  border-radius: 50px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: linear-gradient(135deg, #ffd700, #ff66c4);
  color: #0a0e27;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: linear-gradient(135deg, #1a1f4a, #0f1230);
  border: 2px solid rgba(255, 215, 0, .3);
  border-radius: 32px;
  padding: 32px 24px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  animation: mp .5s cubic-bezier(.34, 1.56, .64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-icon {
  font-size: 80px;
  margin-bottom: 12px;
}

.modal-icon-svg {
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
}

.modal-title {
  font-family: 'Bagel Fat One', cursive;
  font-size: 28px;
  background: linear-gradient(135deg, #ffd700, #ff66c4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.modal-text {
  font-size: 16px;
  opacity: .85;
  margin-bottom: 24px;
  line-height: 1.5;
}

.setup-input {
  width: 100%;
  background: rgba(255, 255, 255, .1);
  border: 2px solid rgba(255, 255, 255, .2);
  color: #fff;
  padding: 14px 18px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  margin-bottom: 12px;
}

.setup-input:focus {
  outline: none;
  border-color: #ffd700;
}

.btn-primary {
  background: linear-gradient(135deg, #ffd700, #ff66c4);
  border: none;
  color: #0a0e27;
  padding: 14px 28px;
  border-radius: 50px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff;
  padding: 12px 24px;
  border-radius: 50px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.btn-danger {
  background: rgba(255, 51, 102, .2);
  border: 1px solid rgba(255, 51, 102, .4);
  color: #ff3366;
  padding: 8px 12px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.pet-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.pet-pick-card {
  background: rgba(255, 255, 255, .05);
  border: 3px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all .3s cubic-bezier(.34, 1.56, .64, 1);
}

.pet-pick-card.selected {
  border-color: #ffd700;
  background: rgba(255, 215, 0, .1);
  transform: scale(1.05);
}

.pet-pick-card svg {
  width: 80px;
  height: 80px;
  margin-bottom: 4px;
}

.creation-egg-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px 0 20px;
  height: 150px;
}

.creation-egg-svg {
  width: 140px;
  height: 140px;
  display: block;
  animation: pb 2.5s ease-in-out infinite;
  filter: drop-shadow(0 8px 25px rgba(196, 144, 255, 0.55))
          drop-shadow(0 0 30px rgba(125, 200, 255, 0.3));
}

.pet-pick-name {
  font-size: 13px;
  font-weight: 600;
}

.parent-screen-wrap {
  max-width: 600px;
  margin: 0 auto;
}

.parent-screen-wrap h2 {
  font-family: 'Bagel Fat One', cursive;
  font-size: 36px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #ffd700, #ff66c4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.editor-card {
  background: rgba(255, 255, 255, .05);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, .5);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 12px;
}

.quick-add-stars {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 16px 0;
}

.quick-add-btn {
  background: linear-gradient(135deg, rgba(255, 215, 0, .2), rgba(255, 102, 196, .2));
  border: 2px solid rgba(255, 215, 0, .4);
  color: #fff;
  padding: 12px 16px;
  border-radius: 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  min-width: 70px;
}

.backup-info {
  background: linear-gradient(135deg, rgba(76, 217, 100, .1), rgba(76, 217, 100, .04));
  border: 1px solid rgba(76, 217, 100, .3);
  border-radius: 16px;
  padding: 16px;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.5;
}

.backup-info strong {
  color: #4cd964;
}
