:root {
  --bg: #0B1020;
  --panel: #151C2F;
  --primary: #8B5CF6;
  --text: #F8FAFC;
  --text-soft: #94A3B8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
}

.page {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 20px 100px;
}

.page h1 {
  font-size: 28px;
  margin-bottom: 4px;
}

.sub {
  color: var(--text-soft);
  font-size: 14px;
}

.card {
  background: var(--panel);
  border-radius: 16px;
  padding: 20px;
  margin-top: 16px;
}

.card h2 {
  font-size: 16px;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.big {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 4px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel);
  display: flex;
  justify-content: space-around;
  padding: 14px 0;
}

.bottom-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 13px;
}

.bottom-nav a.active {
  color: var(--primary);
  font-weight: bold;
} 

.add-row {
  display: flex;
  gap: 10px;
}

.add-row input {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid #2a3350;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
}

.btn {
  background: var(--primary);
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
}

#habitList {
  list-style: none;
  margin-top: 12px;
}

.habit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid #2a3350;
}

.habit-item span {
  flex: 1;
}

.habit-item.done span {
  color: var(--text-soft);
  text-decoration: line-through;
}

.habit-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.del-btn {
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: 16px;
  cursor: pointer;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-col input,
.form-col textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid #2a3350;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
}

.form-col textarea {
  min-height: 70px;
  resize: vertical;
}

#goalList {
  list-style: none;
  margin-top: 12px;
}

.goal-item {
  padding: 14px 0;
  border-top: 1px solid #2a3350;
}

.goal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.bar {
  background: var(--bg);
  border-radius: 8px;
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
}

.bar-fill {
  background: var(--primary);
  height: 100%;
  width: 0;
}

.goal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.goal-row input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
}

.step-list {
  list-style: none;
  margin-top: 10px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.step-item span {
  flex: 1;
  font-size: 14px;
}

.step-item.done span {
  color: var(--text-soft);
  text-decoration: line-through;
}

.step-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.step-add {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.step-add input {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid #2a3350;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
}

.streak-card {
  border: 1px solid var(--primary);
  background: linear-gradient(135deg, #1b1740 0%, var(--panel) 100%);
}

.streak-pill {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--primary);
  font-size: 14px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.badge {
  background: var(--bg);
  border: 1px solid #2a3350;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}

.badge.earned {
  border-color: var(--primary);
}

.badge.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.b-icon {
  font-size: 28px;
}

.b-name {
  font-size: 13px;
  font-weight: bold;
  margin-top: 6px;
}

.b-desc {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 2px;
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(circle at 50% 0%, #1d1650 0%, rgba(11, 16, 32, 0) 55%);
  background-attachment: fixed;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fadeUp 0.5s ease backwards;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.page .card:nth-of-type(2) { animation-delay: 0.06s; }
.page .card:nth-of-type(3) { animation-delay: 0.12s; }
.page .card:nth-of-type(4) { animation-delay: 0.18s; }
.page .card:nth-of-type(5) { animation-delay: 0.24s; }
.page .card:nth-of-type(6) { animation-delay: 0.3s; }

.btn {
  background-image: linear-gradient(135deg, #8B5CF6, #6D44E0);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
}

.btn:active {
  transform: scale(0.97);
}

.bar-fill {
  background: linear-gradient(90deg, #8B5CF6, #22D3EE);
  transition: width 0.6s ease;
}

.streak-card {
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.25);
}

.bottom-nav {
  background: rgba(21, 28, 47, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid #2a3350;
}

.ring-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ring-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.ring {
  width: 90px;
  height: 90px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: #2a3350;
  stroke-width: 10;
}

.ring-fg {
  fill: none;
  stroke: var(--primary);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 263.9;
  stroke-dashoffset: 263.9;
  transition: stroke-dashoffset 0.9s ease;
}

.ring-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}