:root {
  --primary-bg: #f0f4f8;
  --tab-active: #009688;
  --color-low: #ff5252;
  --color-mid: #ffd740;
  --color-good: #69f0ae;
  --color-over: #ff9800;
  --gold: #ffc107;
  --water-color: #4fc3f7;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Segoe UI", Roboto, sans-serif;
  background-color: var(--primary-bg);
  margin: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
}
.account-btn {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.account-btn:hover {
  transform: scale(1.05);
}
.header-bar {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  margin-top: 15px;
  padding: 0 10px;
}
.app-title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}
.settings-btn {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
}
.game-container {
  background: white;
  border-radius: 25px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 900px;
  overflow: hidden;
  margin-bottom: 20px;
}

.achievements {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 15px;
  background: #fff;
  border-bottom: 2px solid #f0f0f0;
}
.medal {
  font-size: 32px;
  filter: grayscale(1);
  opacity: 0.3;
  transition: 0.5s;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: bold;
}
.medal.active {
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.1);
  color: var(--gold);
}
.medal span {
  font-size: 11px;
  color: #666;
}
.tabs {
  display: flex;
  background: #e0f2f1;
}
.tab-btn {
  flex: 1;
  padding: 18px;
  border: none;
  background: none;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}
.tab-btn.active {
  background: var(--tab-active);
  color: white;
}
.tab-content {
  display: none;
  padding: 15px;
  animation: fadeIn 0.4s;
}
.tab-content.active {
  display: block;
}
.animal-row {
  background: #fff;
  border: 2px solid #f0f0f0;
  border-radius: 25px;
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
}
.animal-food-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 10px;
}
.animal-card {
  width: 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.animal-card img {
  width: 100%;
  max-width: 180px;
  height: 180px;
  object-fit: contain;
  animation: float 4s infinite ease-in-out;
  transition: opacity 0.2s ease-in-out;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.food-card {
  cursor: pointer;
  text-align: center;
  width: 50%;
  position: relative;
  border-radius: 15px;
}
.food-card img {
  width: 100%;
  max-width: 260px;
  height: 180px;
  object-fit: contain;
  will-change: transform;
  transition: 0.3s;
}
.fact-box {
  background: #f9f9f9;
  padding: 12px;
  border-radius: 12px;
  margin: 10px 0;
  font-size: 14px;
  color: #555;
  border-left: 5px solid var(--tab-active);
  text-align: left;
  line-height: 1.4;
}
.progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
}
.progress-bg {
  flex-grow: 1;
  height: 38px;
  background: #eee;
  border-radius: 19px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
.progress-fill {
  height: 100%;
  transition:
    width 0.4s ease,
    background-color 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 16px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);

  width: 0%;
  position: relative;
  z-index: 1;
}
.limit-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 83.33%;
  width: 2px;
  border-left: 2px dashed rgba(0, 0, 0, 0.4);
  z-index: 10;
  pointer-events: none;
}
.water-container {
  background: white;
  border-radius: 25px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 900px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.water-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}
.water-header img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  animation: float 3s infinite ease-in-out;
}
.glasses-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  cursor: pointer;
}
.glass {
  width: 45px;
  height: 60px;
  border: 3px solid #b3e5fc;
  border-radius: 5px 5px 15px 15px;
  background: transparent;
  position: relative;
  overflow: hidden;
  transition: 0.3s;
}
.glass.filled {
  background: var(--water-color);
  border-color: var(--water-color);
}
.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
  width: 100%;
  max-width: 450px;
}

.btn {
  padding: 16px;
  border: none;
  border-radius: 15px;
  font-weight: bold;
  cursor: pointer;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 450px;
  margin: 20px 0;
}
.btn-calendar {
  background: var(--tab-active);
  color: white;
  box-shadow: 0 5px 15px rgba(0, 150, 136, 0.3);
}
.btn-danger {
  background: #ff5252;
  color: white;
}
.btn-reset {
  background: #cfd8dc;
  color: #546e7a;
}

.settings-block {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 15px;
  margin-bottom: 20px;
  text-align: left;
}
.settings-block label {
  font-weight: bold;
  display: block;
  margin-bottom: 10px;
  color: #333;
  font-size: 15px;
}
.settings-input-row {
  display: flex;
  gap: 10px;
}

.settings-input-row input {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 16px;
}
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: white;
  padding: 30px;
  border-radius: 30px;
  width: 95%;
  max-width: 450px;
  text-align: center;
  animation: popModal 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.nav-btn {
  background: #e0f2f1;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  color: var(--tab-active);
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.day-name {
  font-size: 11px;
  color: #999;
  font-weight: bold;
  text-transform: uppercase;
  padding-bottom: 5px;
}
.day-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
  color: #666;
}

.day-cell.current-today {
  border: 3px solid var(--tab-active);
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
@keyframes popModal {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

.pop-anim {
  animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes animalHappy {
  0% {
    transform: scale(1);
  }

  20% {
    transform: scale(1.1) rotate(-3deg);
  }

  40% {
    transform: scale(1.05) rotate(3deg);
  }

  100% {
    transform: scale(1);
  }
}

.animal-happy {
  animation: animalHappy 0.6s ease !important;
}

@media (max-width: 650px) {
  .animal-food-container {
    flex-direction: column;
    gap: 15px;
  }
  .animal-card,
  .food-card {
    width: 100%;
  }
  .animal-card img {
    max-width: 140px;
    height: 140px;
  }

  .food-card img {
    max-width: 200px;
    height: 140px;
  }
}
/* === ПРЕЛОАДЕР === */
.preloader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.preloader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #e0e0e0;
  border-top-color: var(--tab-active);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}
.preloader-text {
  font-size: 18px;
  font-weight: bold;
  color: #555;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* === ФУТЕР ПРИЛОЖЕНИЯ === */
.app-footer {
  width: 100%;
  max-width: 900px;
  margin: 20px 0 30px;
  padding-top: 25px;
  border-top: 2px dashed #cfd8dc;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  text-align: center;
}

.footer-logo {
  width: 120px;
  height: auto;
  margin-bottom: 5px;
  opacity: 0.9;
}
/* Стилизация блока соцсетей под дизайн PWA */
.app-footer .header-social-inner-wrap {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
}
.app-footer .header-social-item {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  text-decoration: none;
  color: var(--color);
}
.app-footer .header-social-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

.app-footer .header-social-item svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
/* Юридические ссылки */
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 5px;
}
.footer-legal a {
  color: #90a4ae;
  font-size: 12px;
  text-decoration: underline;
  font-weight: normal;
  transition: color 0.3s ease;
}
.footer-legal a:hover {
  color: var(--tab-active);
}

/* Копирайт */
.footer-copyright {
  color: #78909c;
  font-size: 13px;
  line-height: 1.6;
  margin-top: 5px;
}

/* Черно-белая тарелка Пчелки при строгом режиме */
.food-card.strict-locked img {
  filter: grayscale(1);
  opacity: 0.5;
  transition:
    filter 0.3s ease,
    opacity 0.3s ease;
}

/* demo */
.premium-box {
  background: linear-gradient(135deg, #009688, #26a69a);
  color: white;
  padding: 30px;
  border-radius: 25px;
  width: 100%;
  max-width: 900px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.premium-box h2 {
  margin-top: 0;
  font-size: 30px;
}

.premium-features {
  font-size: 18px;
  line-height: 1.8;
  margin: 20px 0;
}

.premium-btn {
  display: inline-block;
  background: white;
  color: #009688;
  padding: 16px 30px;
  border-radius: 18px;
  font-size: 20px;
  font-weight: bold;
  text-decoration: none;
  transition: 0.3s;
}

.premium-btn:hover {
  transform: scale(1.05);
}

.food-card.locked img,
.animal-card.locked img {
  filter: grayscale(1);
  opacity: 0.6;
}

.food-card.locked::after {
  content: "🔒 PREMIUM";
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 12px;
}

.locked-water {
  position: relative;
  filter: grayscale(1);
  opacity: 0.7;
}

.locked-water::after {
  content: "🔒 Вода доступна в полной версии";
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: bold;
  z-index: 20;
}
/* Исправление кнопки в настройках воды */
.settings-input-row .btn {
  margin: 0 !important;
  width: auto !important;
  flex-shrink: 0;
}
