* {
  margin: 0; padding: 0; box-sizing: border-box;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

body {
  background-color: #ffe6f2;
  background-image: url('assets/img/bg/spring_bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  color: #333;
  overflow-x: hidden;
}

.screen {
  display: none;
  width: 100%;
  max-width: 480px;
  padding-bottom: 20px;
}

.screen.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 {
  margin: 15px 0;
  font-size: 1.8rem;
  color: #ff5e8c;
  text-shadow: 0 2px 4px rgba(255,100,150,0.3);
  text-align: center;
  font-weight: 800;
}

h3 {
  margin: 15px 0 10px;
  font-size: 1.4rem;
  color: #ff5e8c;
  text-align: center;
  font-weight: 700;
}

h4 {
  font-weight: 700;
}

/* === ВЕРХНЯЯ ПАНЕЛЬ С ПОДЛОЖКОЙ === */
#topStats {
  text-align: center;
  width: 100%;
  margin-bottom: 12px;
  position: relative;
}

#fishCount {
  font-size: 1.6rem;
  margin: 5px 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 18px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  font-weight: 800;
  letter-spacing: 0.2px;
}

#incomeDisplay, #prestigeDisplay {
  font-size: 1rem;
  margin: 4px 0;
  color: #000000;
  text-align: center;
  width: 100%;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 12px;
}

.mute-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  cursor: pointer;
}

/* === КОТИК === */
#catContainer {
  text-align: center;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#cat {
  width: 180px;
  height: 180px;
  background: #ffc9d8;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 4rem;
  cursor: pointer;
  box-shadow: 0 12px #e0a3b8, 0 4px 10px rgba(0,0,0,0.2), inset 0 0 20px rgba(255,255,255,0.7);
  border: 4px solid #ff5e8c;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  transition: transform 0.1s;
}

#cat:active {
  transform: scale(0.93) translateY(5px);
  box-shadow: 0 6px #e0a3b8, 0 2px 5px rgba(0,0,0,0.2);
}

#catEmoji {
  pointer-events: none;
}

.click-anim {
  position: absolute;
  font-weight: 800;
  font-size: 1.5rem;
  pointer-events: none;
  animation: floatUp 0.8s forwards;
  text-shadow: 1px 1px 0 #fff;
  z-index: 10;
  color: #ff5e8c;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-70px) scale(1.3); }
}

/* === НАВИГАЦИЯ === */
nav {
  width: 100%;
  max-width: 480px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

button {
  border: none;
  padding: 11px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  color: #fff;
  transition: all 0.15s;
  font-size: 0.95rem;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

button:disabled {
  background: #e0e0e0;
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary { background: #ff8fb0; }
.btn-gold { background: #ffc400; color: #333; }
.btn-sec { background: #55b2c7; }
.btn-danger { background: #ff6b6b; }

.btn-menu {
  width: 100%;
  margin: 6px 0;
  padding: 13px;
  font-size: 1rem;
}

/* === СЕКЦИИ С ПОДЛОЖКОЙ === */
.section {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px;
  border-radius: 18px;
  width: 100%;
  margin: 12px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.section h4 {
  margin-bottom: 10px;
  color: #555;
  font-weight: 600;
}

input[type="text"] {
  width: 100%;
  padding: 11px;
  margin: 8px 0;
  border: 2px solid #eee;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  outline: none;
  border-color: #ff5e8c;
}

/* === КАРТОЧКИ УЛУЧШЕНИЙ С ПОДЛОЖКОЙ === */
.upgrade, .kitten {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px;
  border-radius: 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.item-info {
  flex: 1;
  min-width: 110px;
  padding-right: 8px;
}

.item-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.item-desc {
  font-size: 0.78rem;
  color: #666;
  line-height: 1.3;
}

.buy-options {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.btn-buy {
  padding: 8px 12px;
  font-size: 0.85rem;
  min-width: 55px;
}

.btn-buy-max {
  background: rgba(238, 238, 238, 0.9);
  backdrop-filter: blur(4px);
  color: #444;
  padding: 8px;
  font-size: 0.8rem;
  min-width: 40px;
  font-weight: 600;
}

.btn-buy-max:hover:not(:disabled) {
  background: rgba(221, 221, 221, 0.9);
}

/* === ПРЕСТИЖ === */
.prestige-upgrade {
  background: rgba(248, 244, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 2px solid #d8b4fe;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}

.prestige-upgrade h4 {
  color: #7c3aed;
  margin-bottom: 4px;
  font-size: 1rem;
}

.prestige-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.prestige-stats span {
  font-weight: 700;
  color: #ff5e8c;
}

.prestige-stats button {
  background: #8b5cf6;
  padding: 7px 14px;
  font-size: 0.85rem;
}

/* === СКИНЫ === */
.skins-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.skin-item {
  height: 65px;
  background: rgba(248, 249, 250, 0.9);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  border: 2px solid #eee;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8rem;
  cursor: pointer;
  position: relative;
}

.skin-item.active {
  border-color: #ff5e8c;
  background: rgba(255, 230, 242, 0.9);
}

.skin-item.locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.skin-img-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.lock-icon {
  position: absolute;
  font-size: 0.9rem;
  bottom: 3px;
  right: 3px;
}

/* === МОДАЛЬНЫЕ ОКНА === */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: 20px;
  width: 92%;
  max-width: 340px;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.close {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 26px;
  cursor: pointer;
  color: #ff5e8c;
  line-height: 1;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(34, 34, 34, 0.95);
  backdrop-filter: blur(6px);
  color: #fff;
  padding: 11px 20px;
  border-radius: 24px;
  z-index: 3000;
  animation: fadeInOut 2s forwards;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

@keyframes fadeInOut {
  0% {opacity:0; top:10px;}
  20% {opacity:1; top:20px;}
  80% {opacity:1; top:20px;}
  100% {opacity:0; top:10px;}
}

/* === СУНДУКИ === */
#chestDisplay {
  font-size: 6rem;
  filter: drop-shadow(0 0 25px #ffeb3b);
  margin: 20px 0;
}

.chest-shake {
  animation: chestHeavyShake 0.5s infinite !important;
}

.chest-opening {
  animation: chestOpenAnim 1.3s forwards !important;
}

@keyframes chestHeavyShake {
  0%,100% { transform: rotate(-12deg) scale(1.06); }
  50% { transform: rotate(12deg) scale(1.1); }
}

@keyframes chestOpenAnim {
  0% { transform: scale(1) rotate(0); }
  40% { transform: scale(1.35) rotate(20deg); }
  75% { transform: scale(0.6) rotate(-25deg); filter: brightness(1.8); }
  100% { transform: scale(0.05) rotate(45deg); opacity: 0; }
}

.particle {
  position: absolute;
  font-size: 1.8rem;
  pointer-events: none;
  z-index: 9999;
  animation: particleBurst 1.3s forwards;
  text-shadow: 0 0 10px gold;
}

@keyframes particleBurst {
  to {
    opacity: 0;
    transform: translateY(-200px) scale(0.4);
  }
}

/* === ПИТОМЦЫ === */
.pet-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 8px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
}

.sell-btn {
  background: linear-gradient(135deg, #ff4757, #c0392b);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.sell-btn:active {
  transform: scale(0.95);
}