* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #f6f7fb;
  color: #333;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f6f7fb;
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 20px 16px 12px;
  text-align: center;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header h1 {
  margin: 0;
  font-size: 24px;
}

.content {
  flex: 1;
  padding: 16px;
  padding-bottom: 90px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card h2 {
  margin-top: 0;
  font-size: 20px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  font-weight: 600;
}

input[type="time"],
input[type="text"],
input[type="number"],
input[type="password"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
}

.primary-button,
.small-button,
.nav-button {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
}

.primary-button {
  width: 100%;
  padding: 14px;
  margin-top: 16px;
  background: #4f46e5;
  color: white;
  font-weight: 700;
}

.primary-button:disabled {
  background: #a5b4fc;
  cursor: not-allowed;
}

.small-button {
  padding: 8px 12px;
  background: #e5e7eb;
}

.message {
  min-height: 24px;
  margin-top: 12px;
  font-size: 14px;
  color: #4b5563;
  white-space: pre-wrap;
}

.stats p {
  margin: 10px 0;
}

.reward-item {
  padding: 14px 0;
  border-top: 1px solid #eceff3;
}

.reward-item:first-of-type {
  border-top: none;
  padding-top: 8px;
}

.divider {
  border: none;
  border-top: 1px solid #eceff3;
  margin: 20px 0 12px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 8px;
}

.nav-button {
  background: transparent;
  padding: 10px 4px;
  font-size: 14px;
  color: #6b7280;
}

.nav-button.active {
  color: #4f46e5;
  font-weight: 700;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-weekdays {
  margin-top: 16px;
  margin-bottom: 8px;
  text-align: center;
  font-weight: 700;
  color: #6b7280;
}

.calendar-cell {
  background: #f9fafb;
  border-radius: 10px;
  min-height: 68px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid #eceff3;
}

.calendar-cell.empty {
  background: transparent;
  border: none;
}

.calendar-day {
  font-size: 13px;
  margin-bottom: 6px;
}

.calendar-mark {
  font-size: 20px;
  line-height: 1;
}

.calendar-cell.today {
  border: 2px solid #4f46e5;
}

.legend {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  font-size: 14px;
  color: #4b5563;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 320px;
  background: #ffffff;
  border-radius: 18px;
  padding: 24px 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.modal-card h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.modal-card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.modal-button {
  margin-top: 20px;
}
