* {
  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;
}

#task {
  font-size: 2rem;
  font-weight: 600;
  background: #1a2340;
  padding: 30px 20px;
  border-radius: 16px;
  margin-bottom: 24px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2a3a60;
}

#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;
}

/* ===== КОМПАКТНЫЙ КАЛЕНДАРЬ ===== */
#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;
}

/* Адаптив для маленьких экранов */
@media (max-width: 480px) {
  #app {
    max-width: 100%;
    padding: 0 4px;
  }
  
  h1 {
    font-size: 1.4rem;
    margin-bottom: 14px;
  }
  
  #task {
    font-size: 1.4rem;
    padding: 20px 16px;
    min-height: 90px;
    border-radius: 12px;
  }
  
  #doneBtn {
    font-size: 1.3rem;
    padding: 14px 20px;
  }
  
  #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;
  }
}

/* Для очень маленьких телефонов (до 360px) */
@media (max-width: 380px) {
  .day {
    font-size: 0.6rem;
    border-radius: 4px;
  }
  .weekdays {
    font-size: 0.55rem;
  }
  .calendar-grid {
    gap: 2px;
  }
}

/* ===== КНОПКА "ПРОПУСТИТЬ" ===== */
#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;
}

/* Адаптив */
@media (max-width: 480px) {
  #packSelector {
    font-size: 0.85rem;
    padding: 8px 14px;
    padding-right: 36px;
    max-width: 100%;
  }
  
  #welcomeContent {
    padding: 24px 18px;
  }
  #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: 24px 18px;
  }
  #installContent h2 {
    font-size: 1.2rem;
  }
  #installSteps .step {
    font-size: 0.85rem;
    padding: 6px 0;
  }
}
