:root {
  --brand: #7c3aed;
  --brand-dark: #5b21b6;
  --bg: #f6f4fb;
  --card: #ffffff;
  --text: #241f33;
  --muted: #837c99;
  --border: #e6e1f5;
  --success: #16a34a;
  --error: #dc2626;
  --gold: #d4a017;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.brand {
  font-family: 'Fredoka', sans-serif;
  color: var(--brand-dark);
  font-size: 1.6rem;
  margin: 0 0 4px;
}

.view { display: none; }
.view.active { display: block; }

.center-card {
  max-width: 380px;
  margin: 12vh auto 0;
  padding: 32px 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin: 16px;
  box-shadow: 0 2px 10px rgba(124,58,237,0.06);
}

.subtitle { color: var(--muted); margin: 0 0 20px; }

.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--muted);
}

input, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

input:focus, select:focus {
  outline: 2px solid var(--brand);
  border-color: var(--brand);
}

.btn {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 4px;
}

.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:active { background: var(--brand-dark); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.small { width: auto; padding: 8px 12px; font-size: 0.85rem; margin-top: 12px; }
.btn.danger { background: #fee2e2; color: var(--error); }

.error { color: var(--error); font-size: 0.85rem; min-height: 1.2em; margin-top: 8px; }
.success { color: var(--success); font-size: 0.85rem; min-height: 1.2em; margin-top: 8px; }
.muted { color: var(--muted); font-size: 0.9rem; }
.muted.small { font-size: 0.78rem; margin-top: 4px; }

.topbar {
  background: var(--brand);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
}

.topbar .btn.ghost { color: #fff; width: auto; }

.pot-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #78350f;
  text-align: center;
  padding: 12px;
  font-weight: 600;
  font-family: 'Fredoka', sans-serif;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.tab {
  flex: 1;
  padding: 14px;
  border: none;
  background: none;
  font-family: inherit;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}

.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

.tabpanel { display: none; }
.tabpanel.active { display: block; }
.tabbody { padding-bottom: 20px; }

.progress-stat {
  text-align: center;
  padding: 12px 0 20px;
}

.progress-num {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: 2.6rem;
  color: var(--brand-dark);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; }

.rank-1 { font-weight: 700; color: var(--gold); }
.you-row { background: #f3edfe; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
}
.checkbox-label input { width: auto; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.pill.yes { background: #dcfce7; color: var(--success); }
.pill.no { background: #fee2e2; color: var(--error); }
