/* Meta Ray-Ban Display: 600x600 additive waveguide.
   #000 emits no light (transparent). Visible surfaces use dark grays. */
:root {
  --canvas: #000000;
  --surface: #1C1E21;
  --surface-done: #16241C;
  --text: #FFFFFF;
  --text-2: #E4E6EB;
  --muted: #B0B3B8;
  --sand: #F0D2A8;      /* Earned clay, lifted so it emits enough light */
  --done: #8CF0B4;
  --rec: #FF5A4E;
  --focus-on: 475ms cubic-bezier(0.6, 0, 0.4, 1);
  --focus-off: 625ms cubic-bezier(0.24, 0.24, 0.6, 1);
}

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

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--canvas);
  color: var(--text);
  font-family: -apple-system, "Roboto", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app-root {
  width: 600px;
  height: 600px;
  padding: 24px 24px 16px;
  display: flex;
  flex-direction: column;
}

/* Header */
.top { flex: 0 0 auto; padding-bottom: 14px; }
.top-row { display: flex; align-items: center; gap: 12px; }
.rec-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--rec);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; }
.sub { margin-top: 6px; font-size: 16px; color: var(--text-2); }

/* List */
.list-wrap { position: relative; flex: 1 1 auto; min-height: 0; }
.habits {
  list-style: none;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 4px 0 40px;
  scroll-padding: 8px 0 48px; /* keep the focused row clear of the bottom scrim */
}
.habits::-webkit-scrollbar { display: none; }
.list-wrap::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 40px;
  background: linear-gradient(to top, #000 0%, transparent 100%);
  pointer-events: none;
}

.habit {
  height: 88px;
  margin-bottom: 10px;
  border-radius: 22px;
  background: var(--surface);
  outline: none;
  transition: transform var(--focus-off), box-shadow var(--focus-off);
}
.habit .content {
  height: 100%;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  opacity: 0.8;
  transition: opacity 400ms cubic-bezier(0.2, 0.24, 0.9, 1);
}
.habit:focus {
  transform: scale(calc(1 - 8 / 88));
  box-shadow: 0 0 0 2px var(--sand), 0 0 22px rgba(240, 210, 168, 0.35);
  transition: transform var(--focus-on), box-shadow var(--focus-on);
}
.habit:focus .content { opacity: 1; }
.habit.done { background: var(--surface-done); }

.mark {
  flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; line-height: 1;
  border: 3px solid var(--muted);
  color: transparent;
}
.habit.done .mark { border-color: var(--done); background: var(--done); color: #0B1A12; }

.body { flex: 1 1 auto; min-width: 0; }
.name {
  font-size: 22px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.state { margin-top: 3px; font-size: 14px; color: var(--muted); }
.habit.done .state { color: var(--done); }

.streak { flex: 0 0 auto; text-align: right; }
.streak .n { font-size: 26px; font-weight: 800; color: var(--sand); line-height: 1; }
.streak .l { margin-top: 3px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }

/* Reel banner (appears once tonight's reel is ready) */
.habit.reel { background: #2A2318; }
.habit.reel .mark { border-color: var(--sand); background: var(--sand); color: #2A2318; }
.habit.reel .state { color: var(--sand); }

/* Footer */
.foot { flex: 0 0 auto; padding-top: 8px; font-size: 14px; color: var(--muted); display: flex; justify-content: space-between; }
.foot b { color: var(--text-2); font-weight: 700; }

/* Empty / error */
.empty { padding: 40px 12px; text-align: center; font-size: 18px; color: var(--text-2); line-height: 1.4; }

/* Toast */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  max-width: 536px; padding: 14px 22px; border-radius: 24px;
  background: #24262B; color: var(--text); font-size: 16px; text-align: center;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
  z-index: 20;
}
