* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, sans-serif;
}

body {
  background-color: #0a1128;
  color: white;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

#app {
  max-width: 500px;
  width: 100%;
  text-align: center;
}

h1 {
  font-size: 1.8rem;
  font-weight: 300;
  letter-spacing: 2px;
  margin-bottom: 20px;
  color: #a0c4ff;
}

/* ===== КАРТОЧКА ЗАДАНИЯ (БЕЗ СМАЙЛИКОВ) ===== */
#taskContainer {
  background: #1a2340;
  border-radius: 16px;
  border: 1px solid #2a3a60;
  padding: 30px 20px;
  margin-bottom: 24px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#task {
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  color: white;
  line-height: 1.4;
  margin: 0;
  width: 100%;
}

/* ===== КНОПКИ ===== */
#doneBtn {
  background: #2e7d32;
  color: white;
  border: none;
  font-size: 1.6rem;
  padding: 16px 40px;
  border-radius: 50px;
  cursor: pointer;
  transition: 0.3s;
  width: 100%;
  font-weight: bold;
  letter-spacing: 1px;
  box-shadow: 0 6px 0 #1b4d1e;
}

#doneBtn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #1b4d1e;
}

#doneBtn.done {
  background: #1b5e20;
  opacity: 0.7;
  pointer-events: none;
}

#counter {
  font-size: 2rem;
  margin: 24px 0 16px;
  font-weight: 300;
  color: #ffd54f;
}

#counter span {
  font-weight: 700;
  font-size: 2.6rem;
}

#counter.streak-pending {
  color: #8a93a8;
  filter: grayscale(1);
  opacity: 0.78;
}

#counter.streak-empty {
  color: #8a93a8;
  filter: grayscale(1);
  opacity: 0.65;
}

/* ===== КОМПАКТНЫЙ КАЛЕНДАРЬ ===== */
#calendar {
  max-width: 500px;
  margin: 0 auto;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 8px;
}

.month-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #a0c4ff;
  letter-spacing: 0.5px;
}

.arrow {
  background: #1a2340;
  border: 1px solid #2a3a60;
  color: #a0c4ff;
  font-size: 0.9rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arrow:hover:not(:disabled) {
  background: #2a3a60;
  border-color: #4caf50;
}

.arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.7rem;
  color: #667799;
  text-align: center;
  padding: 0 4px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0 4px;
}

.day {
  aspect-ratio: 1 / 1;
  background: #1a2340;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: #c8d8ff;
  border: 1px solid #2a3a60;
  transition: 0.2s;
}

.day.done {
  background: #2e7d32;
  color: white;
  border-color: #4caf50;
}

.day.weekend {
  color: #556;
}

.day.empty {
  background: transparent;
  border: 1px solid transparent;
}

/* ===== КНОПКА "ПРОПУСТИТЬ" ===== */
#skipBtn {
  background: transparent;
  color: #667799;
  border: 1px solid #2a3a60;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: 0.3s;
  margin-top: 8px;
  opacity: 0.5;
  width: auto;
  letter-spacing: 0.3px;
}

#skipBtn:hover:not(:disabled) {
  opacity: 0.9;
  color: #a0c4ff;
  border-color: #4caf50;
  background: #1a2340;
}

#skipBtn:disabled {
  cursor: not-allowed;
  opacity: 0.2;
}

/* ===== КНОПКА УСТАНОВКИ ===== */
#installBtn {
  background: #2a3a60;
  color: #a0c4ff;
  border: 1px solid #4caf50;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.3s;
  margin: 16px auto 0;
  width: 100%;
  max-width: 400px;
  display: none;
  letter-spacing: 0.5px;
  text-align: center;
}

#installBtn:hover {
  background: #4caf50;
  color: white;
  transform: scale(1.02);
}

/* ===== КНОПКА РАЗВОРАЧИВАНИЯ МАГАЗИНА ===== */
#shopToggle {
  background: #1a2340;
  color: #a0c4ff;
  border: 1px solid #2a3a60;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.3s;
  margin-top: 20px;
  width: 100%;
  max-width: 400px;
  display: inline-block;
  letter-spacing: 0.5px;
}

#shopToggle:hover {
  background: #2a3a60;
  border-color: #4caf50;
}

#shopToggle.active {
  border-color: #4caf50;
  background: #1a2340;
}

/* ===== МАГАЗИН (РАЗВОРАЧИВАЕТСЯ) ===== */
#shopSection {
  width: 100%;
  max-width: 500px;
  margin: 12px auto 0;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#shopContent {
  background: #0d1a2e;
  border: 1px solid #2a3a60;
  border-radius: 16px;
  padding: 20px 16px 16px;
  max-height: 400px;
  overflow-y: auto;
  position: relative;
}

#shopContent h2 {
  color: #a0c4ff;
  font-size: 1.3rem;
  margin-bottom: 16px;
  text-align: center;
  letter-spacing: 1px;
}

/* ===== КАРТОЧКИ ПАКОВ ===== */
#packsContainer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pack-card {
  background: #1a2340;
  border: 1px solid #2a3a60;
  border-radius: 12px;
  padding: 14px 16px;
  transition: 0.3s;
}

.pack-card:hover {
  border-color: #4caf50;
}

.pack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.pack-name {
  font-size: 1rem;
  font-weight: 600;
  color: white;
}

.pack-badge {
  font-size: 0.75rem;
  color: #4caf50;
  font-weight: 600;
  background: #0a1128;
  padding: 2px 12px;
  border-radius: 20px;
  border: 1px solid #2a3a60;
}

.pack-price {
  display: none;
}

.pack-desc {
  font-size: 0.8rem;
  color: #8899bb;
  margin-bottom: 6px;
}

.pack-tasks {
  font-size: 0.75rem;
  color: #667799;
  margin-bottom: 10px;
  padding: 6px 10px;
  background: #0a1128;
  border-radius: 6px;
  line-height: 1.6;
}

.pack-btn {
  width: 100%;
  padding: 8px;
  border-radius: 25px;
  border: none;
  background: #2e7d32;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.pack-btn:hover:not(:disabled) {
  background: #388e3c;
  transform: scale(1.01);
}

.pack-btn:disabled {
  background: #1a2340;
  color: #667799;
  cursor: default;
  opacity: 0.4;
}

/* ===== ЗАГОЛОВКИ РАЗДЕЛОВ ===== */
.section-title {
  font-size: 1.1rem;
  font-weight: 400;
  color: #a0c4ff;
  margin: 16px 0 8px;
  letter-spacing: 0.5px;
  text-align: left;
  padding-left: 4px;
}

.section-title:first-of-type {
  margin-top: 0;
}

/* ===== ПРИВЕТСТВИЕ ===== */
#welcomeModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 17, 40, 0.95);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#welcomeContent {
  background: #1a2340;
  border: 1px solid #4caf50;
  border-radius: 20px;
  padding: 30px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

#welcomeContent h2 {
  color: #a0c4ff;
  font-size: 1.6rem;
  margin-bottom: 16px;
}

#welcomeContent ol {
  list-style: none;
  padding: 0;
  text-align: left;
  margin-bottom: 24px;
}

#welcomeContent ol li {
  color: #c8d8ff;
  font-size: 1rem;
  padding: 8px 0;
  border-bottom: 1px solid #2a3a60;
}

#welcomeContent ol li:last-child {
  border-bottom: none;
}

#welcomeBtn {
  background: #2e7d32;
  color: white;
  border: none;
  font-size: 1.2rem;
  padding: 14px 40px;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.3s;
  width: 100%;
  font-weight: bold;
  box-shadow: 0 4px 0 #1b4d1e;
}

#welcomeBtn:hover {
  background: #388e3c;
  transform: scale(1.02);
}

#welcomeBtn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #1b4d1e;
}

/* ===== МОДАЛЬНОЕ ОКНО УСТАНОВКИ ===== */
#installModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 17, 40, 0.95);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#installContent {
  background: #1a2340;
  border: 1px solid #4caf50;
  border-radius: 20px;
  padding: 30px 28px;
  max-width: 420px;
  width: 100%;
  position: relative;
}

#installContent h2 {
  color: #a0c4ff;
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 8px;
}

#installContent > p {
  color: #8899bb;
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

#installSteps {
  background: #0a1128;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

#installSteps .step {
  color: #c8d8ff;
  font-size: 0.95rem;
  padding: 8px 0;
  border-bottom: 1px solid #2a3a60;
  display: flex;
  align-items: center;
  gap: 10px;
}

#installSteps .step:last-child {
  border-bottom: none;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  color: #667799;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: 0.3s;
}

.close-btn:hover {
  color: white;
  background: #1a2340;
}

#installGotItBtn {
  width: 100%;
  padding: 12px;
  border-radius: 30px;
  border: none;
  background: #2e7d32;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

#installGotItBtn:hover {
  background: #388e3c;
  transform: scale(1.02);
}

/* ===== ВЫПАДАЮЩИЙ СПИСОК ПАКОВ ===== */
#packSelectorWrapper {
  margin-bottom: 16px;
}

#packSelector {
  background: #1a2340;
  color: #a0c4ff;
  border: 1px solid #2a3a60;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 1rem;
  width: 100%;
  max-width: 400px;
  cursor: pointer;
  outline: none;
  transition: 0.3s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0c4ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

#packSelector:hover {
  border-color: #4caf50;
}

#packSelector:focus {
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

#packSelector option {
  background: #0a1128;
  color: white;
  padding: 8px;
}

/* ===== КНОПКА ВХОДА ===== */
.user-btn {
  background: #1a2340;
  color: #a0c4ff;
  border: 1px solid #2a3a60;
  font-size: 0.9rem;
  padding: 8px 18px;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.3s;
  opacity: 0.8;
  letter-spacing: 0.3px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-btn:hover {
  opacity: 1;
  border-color: #4caf50;
  background: #2a3a60;
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.15);
}

.user-btn.logged-in {
  border-color: #4caf50;
  opacity: 1;
  background: #1a2340;
}

.user-btn.logged-in:hover {
  background: #2a3a60;
}

/* ===== МОДАЛЬНОЕ ОКНО АВТОРИЗАЦИИ ===== */
#authModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 17, 40, 0.95);
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#authContent {
  background: #1a2340;
  border: 1px solid #4caf50;
  border-radius: 20px;
  padding: 30px 28px;
  max-width: 400px;
  width: 100%;
  position: relative;
}

#authContent h2 {
  color: #a0c4ff;
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 20px;
}

.auth-form input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid #2a3a60;
  background: #0a1128;
  color: white;
  font-size: 1rem;
  outline: none;
  transition: 0.3s;
  box-sizing: border-box;
}

.auth-form input:focus {
  border-color: #4caf50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.auth-form input::placeholder {
  color: #667799;
}

.auth-form button {
  width: 100%;
  padding: 12px;
  border-radius: 30px;
  border: none;
  background: #2e7d32;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  margin-top: 4px;
}

.auth-form button:hover {
  background: #388e3c;
  transform: scale(1.02);
}

.auth-switch {
  text-align: center;
  color: #8899bb;
  font-size: 0.9rem;
  margin-top: 16px;
}

.auth-switch a {
  color: #a0c4ff;
  cursor: pointer;
  text-decoration: underline;
}

.auth-switch a:hover {
  color: #4caf50;
}

#authStatus {
  color: #ffd54f;
  min-height: 24px;
}

#closeAuthBtn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  color: #667799;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: 0.3s;
}

#closeAuthBtn:hover {
  color: white;
  background: #1a2340;
}

/* ===== УВЕДОМЛЕНИЯ (TOAST) ===== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #1a2340;
  color: #c8d8ff;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid #4caf50;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  transition: all 0.4s ease;
  max-width: 90%;
  text-align: center;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   АДАПТИВ (МОБИЛЬНЫЕ УСТРОЙСТВА)
   ============================================================ */

/* Для экранов до 480px (телефоны) */
@media (max-width: 480px) {
  #app {
    max-width: 100%;
    padding: 0 4px;
  }

  h1 {
    font-size: 1.4rem;
    margin-bottom: 14px;
  }

  /* Карточка задания */
  #taskContainer {
    padding: 20px 16px;
    min-height: 90px;
  }

  #task {
    font-size: 1.4rem;
  }

  /* Кнопки */
  #doneBtn {
    font-size: 1.3rem;
    padding: 14px 20px;
  }

  #skipBtn {
    font-size: 0.75rem;
    padding: 4px 12px;
  }

  #counter {
    font-size: 1.5rem;
    margin: 16px 0 12px;
  }

  #counter span {
    font-size: 2rem;
  }

  /* Календарь */
  #calendar {
    max-width: 100%;
  }

  .month-title {
    font-size: 0.95rem;
  }

  .arrow {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .day {
    font-size: 0.7rem;
    border-radius: 6px;
  }

  .weekdays {
    font-size: 0.6rem;
    gap: 3px;
  }

  .calendar-grid {
    gap: 3px;
  }

  /* Магазин */
  .pack-card {
    padding: 10px 12px;
  }
  .pack-name {
    font-size: 0.85rem;
  }
  .pack-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  /* Модалки */
  #welcomeContent {
    padding: 20px 16px;
  }
  #welcomeContent h2 {
    font-size: 1.3rem;
  }
  #welcomeContent ol li {
    font-size: 0.9rem;
    padding: 6px 0;
  }
  #welcomeBtn {
    font-size: 1rem;
    padding: 12px 20px;
  }

  #installContent {
    padding: 20px 16px;
  }
  #installContent h2 {
    font-size: 1.2rem;
  }
  #installSteps .step {
    font-size: 0.85rem;
    padding: 6px 0;
  }

  #authContent {
    padding: 20px 16px;
  }
  #authContent h2 {
    font-size: 1.2rem;
  }
  .auth-form input {
    font-size: 0.9rem;
    padding: 10px 14px;
  }
  .auth-form button {
    font-size: 0.9rem;
    padding: 10px;
  }

  /* Toasts */
  .toast {
    top: 70px;
    font-size: 0.85rem;
    padding: 10px 18px;
    max-width: 95%;
  }

  /* Кнопка установки */
  #installBtn {
    font-size: 0.85rem;
    padding: 10px 16px;
  }

  #shopToggle {
    font-size: 0.85rem;
    padding: 10px 16px;
  }

  #packSelector {
    font-size: 0.85rem;
    padding: 8px 14px;
    padding-right: 36px;
    max-width: 100%;
  }
}

/* Для очень маленьких телефонов (до 360px) */
@media (max-width: 380px) {
  #taskContainer {
    padding: 16px 12px;
    min-height: 80px;
  }
  #task {
    font-size: 1.2rem;
  }
  .day {
    font-size: 0.6rem;
    border-radius: 4px;
  }
  .weekdays {
    font-size: 0.55rem;
  }
  .calendar-grid {
    gap: 2px;
  }
}

.test-environment-badge {
  margin: 0 auto 14px;
  padding: 7px 12px;
  border: 1px solid #f0a000;
  border-radius: 8px;
  color: #ffd166;
  background: rgba(240, 160, 0, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}

#profileModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1002;
}

#profileContent {
  position: relative;
  width: min(100%, 420px);
  padding: 28px 22px 22px;
  border: 1px solid #2a3a60;
  border-radius: 18px;
  background: #111a35;
  text-align: center;
}

#profileContent h2 {
  margin-bottom: 10px;
  color: #a0c4ff;
}

#profileEmail {
  margin-bottom: 14px;
  color: #ffffff;
  overflow-wrap: anywhere;
}

.profile-hint {
  margin-bottom: 18px;
  color: #8899bb;
  font-size: 0.82rem;
  line-height: 1.45;
}

.profile-action-btn {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #3b5488;
  border-radius: 10px;
  color: white;
  background: #22335f;
  cursor: pointer;
}

.profile-action-btn.danger {
  border-color: #8d3c4d;
  color: #ffb3bd;
  background: #3a1f2a;
}

.sync-status {
  margin: -4px 0 18px;
  color: #8fa6cf;
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: right;
}

.sync-status.online {
  color: #67cf7a;
}

.sync-status.offline {
  color: #ffd166;
}

.clear-local-profile-btn {
  display: block;
  margin: -12px 0 18px auto;
  padding: 0;
  border: 0;
  color: #7d8fb4;
  background: transparent;
  font-size: 0.68rem;
  text-decoration: underline;
  cursor: pointer;
}
