:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: 64px; flex: 0 0 64px; padding: 0 20px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
}
.topbar-title { font-size: 22px; font-weight: 700; flex: 1; }
.topbar-date { font-size: 15px; color: var(--text-secondary); font-weight: 500; }
.iconbtn {
  width: 48px; height: 48px; flex: 0 0 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; line-height: 1; font-weight: 700;
  background: var(--bg-tertiary); color: var(--text-primary);
  border-radius: var(--radius-md);
}

/* Home */
.home-main {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px 28px; gap: 22px;
}
.streak-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 999px;
  background: var(--bg-tertiary);
  font-size: 16px; font-weight: 600; color: var(--accent-secondary);
}
.streak-flame { font-size: 18px; }
.affirmation-card {
  width: 100%; min-height: 300px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; padding: 36px 28px;
  background: linear-gradient(160deg, var(--bg-secondary), var(--bg-primary));
  border-radius: 20px;
}
.card-cat {
  font-size: 14px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent);
}
.affirmation-text {
  font-size: 30px; line-height: 1.35; font-weight: 700;
  text-align: center; color: var(--text-primary);
}
.card-hint { font-size: 14px; color: var(--text-muted); }

/* Home nav */
.home-nav {
  display: flex; gap: 12px; padding: 18px 20px 22px;
  flex: 0 0 auto;
}
.navbtn {
  flex: 1; min-height: 88px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  background: var(--bg-secondary); color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 19px; font-weight: 700;
}
.navbtn small { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

/* Lists */
.list-main {
  flex: 1; overflow-y: auto; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.list-main::-webkit-scrollbar { width: 6px; }
.list-main::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 3px; }
.empty-msg {
  margin: auto; max-width: 420px; text-align: center;
  font-size: 19px; line-height: 1.5; color: var(--text-secondary);
}

/* Favorite item */
.fav-item {
  display: flex; align-items: center; gap: 14px;
  min-height: 88px; padding: 16px 18px;
  background: var(--bg-secondary); border-radius: var(--radius-md);
}
.fav-body { flex: 1; }
.fav-text { font-size: 18px; line-height: 1.35; font-weight: 600; }
.fav-cat {
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 4px;
}
.fav-remove {
  font-size: 13px; font-weight: 700; color: var(--danger);
  flex: 0 0 auto; align-self: center;
}

/* Theme item */
.theme-item {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; padding: 16px 20px;
  background: var(--bg-secondary); border-radius: var(--radius-md);
  font-size: 20px; font-weight: 700;
}
.theme-item .theme-check { color: var(--accent-secondary); font-size: 22px; opacity: 0; }
.theme-item.selected .theme-check { opacity: 1; }
.theme-item .theme-count { font-size: 14px; font-weight: 500; color: var(--text-muted); }

/* Saved flash */
.saved-flash {
  position: absolute; bottom: 130px; left: 50%; transform: translateX(-50%);
  background: var(--accent-secondary); color: #00231a;
  font-size: 16px; font-weight: 800; padding: 10px 22px;
  border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.saved-flash.show { opacity: 1; }
