:root {
  --bg: #0f1220;
  --bg-card: #1a1e33;
  --accent: #7c5cff;
  --accent-2: #ff6b9d;
  --text: #f2f2f7;
  --text-muted: #a3a7c2;
  --border: #2b2f4a;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(160deg, #0f1220, #171b30 60%, #1c1436);
  color: var(--text);
  min-height: 100vh;
}

header.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  max-width: 720px;
  margin: 0 auto;
}

.app-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
}
.app-title .logo { font-size: 1.6rem; }

#install-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}
#install-btn[hidden] { display: none; }

nav.tabs {
  display: flex;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto 16px;
  padding: 0 24px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}
.tab-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.fact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  list-style: none;
}

.fact-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}

.fact-cat {
  background: rgba(124, 92, 255, 0.15);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.fact-cat.tag-bonus {
  background: rgba(255, 107, 157, 0.15);
  color: var(--accent-2);
}

.bonus-zone {
  margin-top: 20px;
  text-align: center;
}

#bonus-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
#bonus-btn:hover { filter: brightness(1.08); }

#bonus-card { margin-top: 16px; text-align: left; }

.fact-text {
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0 0 14px;
}

#today-card .fact-text { font-size: 1.2rem; }

.like-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}
.like-btn.liked {
  background: rgba(255, 107, 157, 0.15);
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.fact-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.learn-more-btn {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}
.learn-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

select, .filters label {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

#history-list { padding: 0; margin: 0; }

#history-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 0;
}

section.tutorial h2 {
  font-size: 1.1rem;
  margin-top: 28px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
section.tutorial h2:first-child { margin-top: 0; }

section.tutorial ol {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px 16px 36px;
  line-height: 1.6;
}

section.tutorial p.note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 20px;
}
