* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem;
}

.container {
  max-width: 500px;
  width: 100%;
}

.page-title {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

nav {
  display: flex;
  gap: 0.5rem;
}

nav button {
  background: #2d2d44;
  border: none;
  color: #eee;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

nav button:hover {
  background: #3d3d5c;
}

.legend {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.red { background: #e74c3c; }
.legend-dot.yellow { background: #f1c40f; }
.legend-dot.green { background: #2ecc71; }

.calendar {
  background: #16213e;
  border-radius: 12px;
  padding: 1rem;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 0.5rem;
}

.weekday {
  text-align: center;
  font-size: 0.75rem;
  color: #888;
  padding: 0.5rem 0;
  text-transform: uppercase;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day {
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  font-size: 0.875rem;
  background: #2d2d44;
  color: #888;
}

.day.current-month {
  color: #eee;
}

.day.today {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.day.red {
  background: #e74c3c;
  color: #fff;
}

.day.yellow {
  background: #f1c40f;
  color: #1a1a2e;
}

.day.green {
  background: #2ecc71;
  color: #fff;
}

.day.empty {
  background: transparent;
}

.cbt-tracker {
  background: #16213e;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}

.cbt-tracker h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #e74c3c;
}

.cbt-rules {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.cbt-rule {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cbt-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.total-number {
  font-size: 3rem;
  font-weight: 700;
  color: #e74c3c;
}

.total-label {
  font-size: 0.875rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.cbt-breakdown {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #666;
}

.star-chart {
  background: #16213e;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}

.star-chart h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #ff69b4;
}

.star-chart-rule {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 1.25rem;
}

.streak-display {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.streak-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.streak-number {
  font-size: 2rem;
  font-weight: 700;
  color: #ff69b4;
}

.streak-label {
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
}

.week-grid {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.week-day-label {
  font-size: 0.7rem;
  color: #666;
  text-transform: uppercase;
}

.week-day-icons {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.icon {
  font-size: 1.25rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #2d2d44;
}

.icon.yes {
  background: #2ecc71;
}

.icon.no {
  color: #555;
}

.reward-status {
  font-size: 0.9rem;
  color: #888;
  padding: 0.75rem;
  border-radius: 8px;
  background: #2d2d44;
}

.reward-status.earned {
  background: linear-gradient(135deg, #ff69b4, #ff1493);
  color: #fff;
  font-weight: 600;
}

@media (max-width: 400px) {
  body {
    padding: 1rem;
  }

  .legend {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .page-title {
    font-size: 1.4rem;
  }

  .cbt-rules {
    flex-direction: column;
    gap: 0.5rem;
  }

  .week-grid {
    gap: 0.25rem;
  }

  .icon {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1rem;
  }
}
