* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Arial', sans-serif;
  background: linear-gradient(135deg, #e0f7fa 0%, #f5f5f5 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: #333;
  overflow: auto;
}

#game-container {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 360px;
  height: 600px;
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.tab {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
  padding: 5px;
}

.tab.active {
  display: flex;
}

.icon-bar {
  display: flex;
  justify-content: space-around;
  background: #f0f0f0;
  border-radius: 10px;
  padding: 5px;
  margin-bottom: 10px;
}

.icon-button {
  background: #ffffff;
  border: none;
  padding: 8px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-button:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
}

.icon-button.active {
  background: linear-gradient(135deg, #ffccdd 0%, #ff99cc 100%);
  color: #fff;
}

.icon-button.pending::after {
  content: '•';
  color: #ff4444;
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 14px;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-bottom: 10px;
}

button {
  background: linear-gradient(135deg, #ffccdd 0%, #ff99cc 100%);
  border: none;
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  transition: transform 0.1s, background 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

button:hover {
  background: linear-gradient(135deg, #ff99cc 0%, #ff66bb 100%);
  transform: translateY(-1px);
}

button:disabled {
  background: #d3d3d3;
  cursor: not-allowed;
  box-shadow: none;
}

#duck-image {
  width: 160px;
  height: 160px;
  margin: 10px auto;
  transition: transform 0.2s;
}

#duck-image.clickPulse {
  transform: scale(1.1);
}

#duck-image.hungry {
  animation: shake 0.5s infinite;
}

#duck-image.normal {
  animation: flap 1s infinite;
}

#duck-image.overfed {
  animation: scale 1s infinite;
}

#duck-image.fitness {
  animation: bounce 0.6s infinite;
}

#duck-image.dead {
  animation: fade 2s forwards;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

@keyframes flap {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(10deg); }
}

@keyframes scale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes fade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.stats {
  font-size: 14px;
  font-weight: bold;
  margin: 5px 0;
  line-height: 1.4;
}

.progress-section {
  margin: 10px 0;
  font-size: 12px;
  font-weight: bold;
}

.progress-bar {
  background: #e0e0e0;
  border-radius: 8px;
  height: 6px;
  margin: 5px 0;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar div {
  height: 100%;
  transition: width 0.5s ease-in-out;
}

#xp-bar div {
  background: #66cc99;
}

#energy-bar div {
  background: #66cccc;
}

#log {
  max-height: 70px;
  overflow-y: auto;
  margin: 5px 0;
  padding: 6px;
  background: #f0f0f0;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#log div {
  animation: slideIn 0.3s;
}

@keyframes slideIn {
  0% { transform: translateY(-10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

#shop-items,
#achievements-list,
#quests-list {
  font-size: 12px;
  padding: 10px;
  overflow-y: auto;
  flex: 1;
}

#shop-items h3,
#shop-items h4,
#achievements-list h2,
#quests-list h2 {
  margin: 10px 0 5px;
  font-size: 16px;
  font-weight: bold;
}

#shop-items .locked {
  opacity: 0.5;
  pointer-events: none;
}

#shop-items > div,
#achievements-list > div,
#quests-list > div {
  margin-bottom: 10px;
}

#shop-items div:not(h3, h4, p),
#achievements-list div,
#quests-list div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.can-buy,
.can-claim {
  background: #e6ffe6;
}

.unavailable,
.incomplete {
  background: #f0f0f0;
  opacity: 0.7;
}

.purchased,
.completed {
  background: #d3d3d3;
}

.item-text {
  font-weight: bold;
  margin-bottom: 5px;
}

.item-description {
  font-size: 10px;
  color: #666;
  margin-bottom: 5px;
}

#help-button {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #ffccdd 0%, #ff99cc 100%);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
  z-index: 10;
}

#help-button:hover {
  transform: scale(1.1);
}

#modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 300px;
  max-height: 80vh;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 15px;
  padding: 15px;
  z-index: 1000;
  color: #fff;
  animation: fadeIn 0.3s;
}

#modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#modal-text {
  font-size: 14px;
  margin-bottom: 15px;
  white-space: pre-wrap;
  text-align: center;
}

#modal-option1,
#modal-option2,
#modal-next,
#modal-done {
  margin: 5px;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

#hide-game-box {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 15px;
  z-index: 100;
}

.bush {
  font-size: 30px;
  cursor: pointer;
  transition: transform 0.2s;
}

.bush:hover {
  transform: scale(1.2);
}

#hide-game-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 20px;
  color: #fff;
}

.coin-animation {
  position: absolute;
  font-size: 20px;
  animation: coinRise 1s forwards;
}

@keyframes coinRise {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100px); opacity: 0; }
}

@media (max-width: 400px) {
  #game-container {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  button {
    padding: 6px 12px;
    font-size: 12px;
  }

  #duck-image {
    width: 120px;
    height: 120px;
  }

  .stats {
    font-size: 12px;
  }

  #shop-items,
  #achievements-list,
  #quests-list {
    font-size: 10px;
  }

  #modal-text {
    font-size: 12px;
  }
}