:root {
  /* Palette sampled from the client's own tracker sheet (Google Sheets "Звички" tab):
     black canvas, white type, #3C78D8 accent blue, mid-gray cards. Fixed brand look —
     intentionally not overridden by the viewer's Telegram theme (see app.js). */
  --tg-bg: #000000;
  --tg-text: #ffffff;
  --tg-hint: #9aa0a6;
  --tg-link: #3c78d8;
  --tg-button: #3c78d8;
  --tg-button-text: #ffffff;
  --tg-secondary-bg: #1c1c1e;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--tg-bg);
  color: var(--tg-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  min-height: 100vh;
}

.app__header {
  padding: 8px 4px 16px;
}

.app__title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
}

.app__date {
  margin: 0;
  color: var(--tg-hint);
  font-size: 14px;
}

.stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  flex: 1;
  background: var(--tg-secondary-bg);
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-card__value {
  font-size: 26px;
  font-weight: 700;
  color: var(--tg-button);
  transition: color 0.3s ease;
}

.stat-card__label {
  font-size: 13px;
  color: var(--tg-hint);
}

.stat-card__trophy {
  display: none;
  font-size: 20px;
  line-height: 1;
  margin-top: 2px;
}

.stat-card--complete .stat-card__trophy {
  display: block;
  animation: trophy-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card--complete {
  animation: card-glow 0.6s ease;
}

@keyframes trophy-pop {
  0% { transform: scale(0) rotate(-15deg); opacity: 0; }
  60% { transform: scale(1.25) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes card-glow {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
  40% { box-shadow: 0 0 0 6px rgba(46, 204, 113, 0.25); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.habit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.habit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--tg-secondary-bg);
  border-radius: 12px;
  padding: 14px 14px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.habit-row:active {
  background: color-mix(in srgb, var(--tg-secondary-bg) 80%, var(--tg-button) 20%);
}

.habit-row__check {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 8px;
  border: 2px solid var(--tg-hint);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.habit-row__check svg {
  width: 16px;
  height: 16px;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.habit-row--done .habit-row__check {
  background: var(--tg-button);
  border-color: var(--tg-button);
}

.habit-row--done .habit-row__check svg {
  opacity: 1;
}

.habit-row__name {
  font-size: 16px;
  flex: 1;
}

.habit-row--done .habit-row__name {
  color: var(--tg-hint);
  text-decoration: line-through;
}

.app__footnote {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--tg-hint);
}
