@import url('https://fonts.googleapis.com/css2?family=DynaPuff:wght@400;500;600;700&display=swap');

:root {
  --primary: #ff9f9f;
  --secondary: #98d8d6;
  --dark: #2c3e50;
  --light: #f7f9f9;
  --dynapuff: 'DynaPuff', cursive;
}

body {
  margin: 0;
  padding: 20px;
  background: var(--dark);
  font-family: var(--dynapuff);
  color: var(--light);
  background-image: linear-gradient(45deg, #2c3e50 25%, #34495e 25%, #34495e 50%, #2c3e50 50%, #2c3e50 75%, #34495e 75%, #34495e 100%);
  background-size: 56.57px 56.57px;
}

.game-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  font-family: var(--dynapuff);
}

.music-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--secondary);
  color: var(--dark);
  border: none;
  padding: 10px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: all .3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.music-toggle:hover {
  transform: scale(1.1);
}

.music-toggle.playing {
  background: var(--primary);
}

.reset-button {
  position: fixed;
  top: 20px;
  left: 20px;
  background: #ff6b6b;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.reset-button:hover {
  transform: scale(1.05);
  background: #ff5252;
}

.credits-button {
  position: fixed;
  top: 60px;
  left: 20px;
  background: #4a90e2;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.credits-button:hover {
  transform: scale(1.05);
  background: #357abd;
}

.tutorial-button {
  position: fixed;
  top: 100px;
  left: 20px;
  background: #98d8d6;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.tutorial-button:hover {
  transform: scale(1.05);
  background: #7ac7c4;
}

.roadmap-button {
  position: fixed;
  top: 140px;
  left: 20px;
  background: #ff8c69;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.roadmap-button:hover {
  transform: scale(1.05);
  background: #ff7f50;
}

.currency {
  font-size: 1.2em;
  color: var(--secondary);
  margin: 10px 0;
  font-family: var(--dynapuff);
}

.location-banner {
  background: linear-gradient(45deg, #ff9f9f, #98d8d6);
  padding: 20px;
  border-radius: 20px;
  margin: 20px 0;
  border: 3px solid #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, .2);
  position: relative;
  overflow: hidden;
  font-family: var(--dynapuff);
}

.location-icon {
  font-size: 2em;
  margin-bottom: 10px;
}

.location-name {
  font-size: 1.5em;
  margin-bottom: 5px;
  color: var(--dark);
  text-shadow: 1px 1px 2px rgba(255, 255, 255, .5);
}

.location-description {
  font-size: 0.9em;
  color: var(--dark);
  margin-bottom: 15px;
  opacity: 0.8;
}

.location-decoration {
  position: absolute;
  font-size: 1.5em;
  opacity: 0.2;
  animation: float 3s infinite ease-in-out;
}

.decoration-1 {
  top: 10px;
  left: 10px;
  animation-delay: 0s;
}

.decoration-2 {
  top: 10px;
  right: 10px;
  animation-delay: 1s;
}

.decoration-3 {
  bottom: 10px;
  left: 10px;
  animation-delay: 1.5s;
}

.decoration-4 {
  bottom: 10px;
  right: 10px;
  animation-delay: 0.5s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.banner {
  background: linear-gradient(45deg, #ff9f9f, #98d8d6);
  padding: 20px;
  border-radius: 20px;
  margin: 20px 0;
  border: 3px solid #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, .2);
}

.pull-button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 15px 30px;
  font-size: 1.2em;
  border-radius: 25px;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .2);
}

.pull-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(0, 0, 0, .3);
}

.pull-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.character-card {
  background: var(--light);
  color: var(--dark);
  padding: 15px;
  border-radius: 15px;
  transition: all .3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .1);
  position: relative;
}

.character-card:hover {
  transform: translateY(-5px) rotate(2deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
}

.rarity-1 {
  background: #ffd5d5;
}

.rarity-2 {
  background: #bae8e8;
}

.rarity-3 {
  background: linear-gradient(45deg, gold, #ffa07a);
  animation: shine 2s infinite;
}

.rarity-4 {
  background: linear-gradient(45deg, #ff1493, #00bfff);
  animation: shine 1.5s infinite;
  box-shadow: 0 0 15px rgba(255, 20, 147, .5);
}

.rarity-5 {
  background: linear-gradient(45deg, #8a2be2, gold);
  animation: shine 1s infinite;
}

@keyframes shine {
  0% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.3);
  }
  100% {
    filter: brightness(1);
  }
}

.pull-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, .8);
  z-index: 100;
}

.animal-icon {
  cursor: pointer;
  transition: transform .2s;
}

.animal-icon:hover {
  transform: scale(1.1);
}

.section-tabs {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

.tab-button {
  background: var(--dark);
  color: var(--light);
  border: 2px solid var(--light);
  padding: 10px 20px;
  border-radius: 15px;
  cursor: pointer;
  transition: all .3s;
  font-family: var(--dynapuff);
}

.tab-button.active {
  background: var(--primary);
  transform: scale(1.05);
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.bestiary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.bestiary-card {
  background: var(--light);
  color: var(--dark);
  padding: 15px;
  border-radius: 15px;
  text-align: center;
  transition: all .3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .1);
}

.bestiary-card.collected {
  opacity: 1;
  filter: none;
}

.categories-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.category-header {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 10px;
  transition: background-color 0.3s ease;
}

.category-header:hover {
  background: rgba(255, 255, 255, 0.2);
}

.category-header::after {
  content: '▼';
  margin-left: auto;
  transition: transform 0.3s ease;
}

.category-header.collapsed::after {
  transform: rotate(-90deg);
}

.category .bestiary-grid {
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
  max-height: 1000px;
  opacity: 1;
  overflow: hidden;
}

.category .bestiary-grid.collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

.footer {
  margin-top: 40px;
  padding: 20px;
  background: rgba(0, 0, 0, .2);
  border-radius: 10px;
  font-style: italic;
  color: var(--secondary);
  text-align: center;
}

.footer-signature {
  color: var(--primary);
  font-weight: 700;
  display: inline-block;
  margin-left: 5px;
}

.location-select {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.location-select-content {
  position: relative;
  padding: 30px;
  border: 3px solid var(--primary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--dark);
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--dark);
}

.location-select-content h2 {
  color: #ff8c69;
  font-size: 2em;
  margin-bottom: 20px;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, .2);
}

.location-select-content h3 {
  color: #ffa07a;
  font-size: 1.5em;
  margin: 25px 0 15px 0;
  border-bottom: 2px solid #ff8c69;
  padding-bottom: 5px;
}

.location-option {
  display: flex;
  align-items: center;
  padding: 15px;
  margin: 10px 0;
  background: rgba(255, 140, 105, .1);
  border-radius: 10px;
  cursor: pointer;
  transition: all .3s ease;
  font-family: var(--dynapuff);
}

.location-option:hover {
  background: rgba(255, 140, 105, .2);
  transform: translateX(10px);
}

.location-option .location-icon {
  font-size: 1.5em;
  margin-right: 15px;
}

.location-option .location-name {
  color: #ffa07a;
  font-size: 1.2em;
  font-weight: 500;
}

.location-select-content::-webkit-scrollbar {
  width: 8px;
}

.location-select-content::-webkit-scrollbar-track {
  background: var(--dark);
  border-radius: 4px;
}

.location-select-content::-webkit-scrollbar-thumb {
  background: #ff8c69;
  border-radius: 4px;
}

.location-select-content::-webkit-scrollbar-thumb:hover {
  background: #ffa07a;
}

.trade-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.trade-content {
  background: var(--light);
  color: var(--dark);
  padding: 20px;
  border-radius: 15px;
  max-width: 600px;
  width: 90%;
  position: relative;
}

.duplicate-list {
  max-height: 400px;
  overflow-y: auto;
}

.duplicate-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.trade-button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}

.trade-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.close-button {
  margin-top: 20px;
  width: 100%;
  padding: 10px;
  background: var(--dark);
  color: var(--light);
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.duplicate-count {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
  z-index: 1;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.badge-card {
  background: var(--light);
  color: var(--dark);
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  transition: all .3s;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .1);
  font-family: var(--dynapuff);
}

.badge-icon {
  font-size: 2em;
  margin-bottom: 10px;
}

.badge-status {
  font-size: 1.5em;
  margin-top: 10px;
}

.badge-card.earned {
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
}

.badge-card.earned .badge-status {
  color: #2ecc71;
}

.credits-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.credits-content {
  background: var(--light);
  color: var(--dark);
  padding: 20px;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  text-align: center;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--dark) var(--light);
}

.luck-meter-container {
  width: 80%;
  max-width: 300px;
  margin: 10px auto;
  text-align: center;
}

.luck-meter {
  width: 100%;
  height: 20px;
  background: rgba(0, 0, 0, .2);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--light);
}

.luck-meter-fill {
  height: 100%;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width .3s ease;
}

.luck-meter-text {
  color: var(--dark);
  font-size: 0.9em;
  margin-top: 5px;
}

.backpack-section {
  display: block;
  margin-top: 20px;
}

.backpack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.item-card {
  background: var(--light);
  color: var(--dark);
  padding: 15px;
  border-radius: 15px;
  text-align: center;
  transition: all .3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .1);
}

.item-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
}

.version-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.version-title {
  font-size: 1.3em;
  color: #ff8c69;
  margin-bottom: 10px;
}

.current-version {
  background: rgba(152, 216, 214, 0.2);
  border: 2px solid #98d8d6;
}

.planned-version {
  background: rgba(255, 159, 159, 0.1);
  border: 2px dashed #ff9f9f;
}

.rest-button {
  background: var(--secondary);
  color: #fff;
  border: none;
  padding: 15px 30px;
  font-size: 1.2em;
  border-radius: 25px;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .2);
  margin-left: 10px;
}

.rest-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(0, 0, 0, .3);
}

.quest-items {
  background: rgba(255, 140, 105, 0.1);
  transition: all 0.3s ease;
}

.quest-items .special-item:hover {
  background: rgba(255, 140, 105, 0.2);
}

.special-item {
  transition: all 0.3s ease;
  border-radius: 8px;
}

.backpack-category {
  margin-bottom: 30px;
}

.backpack-quest-items:empty,
.backpack-food-items:empty {
  padding: 20px;
  text-align: center;
  color: var(--light);
  font-style: italic;
}

.backpack-quest-items:empty::before {
  content: "No quest items yet...";
}

.backpack-food-items:empty::before {
  content: "No food items yet...";
}

.shop-categories {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 10px;
  margin: 10px 0;
}

.shop-category {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 15px;
}

.shop-category h3 {
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.shop-items {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.shop-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  margin-bottom: 5px;
  font-family: var(--dynapuff);
}

.item-details {
  flex: 1;
}

.item-description {
  font-size: 0.9em;
  color: #666;
  margin: 5px 0 0 0;
}