:root {
  --bg: #0b0b14;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --muted: #9a9ab0;
  --faint: #5d5d73;
  --accent: #c6f432;
  --g1: #8b5cf6;
  --g2: #22d3ee;
  --pink: #f472b6;
  --orange: #fb923c;
  --grad: linear-gradient(135deg, var(--g1), var(--g2));
  --radius: 22px;
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(60% 40% at 0% 0%, color-mix(in srgb, var(--g1) 22%, transparent), transparent 70%),
    radial-gradient(50% 35% at 100% 15%, color-mix(in srgb, var(--g2) 12%, transparent), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; }

#app { max-width: 520px; margin: 0 auto; min-height: 100%; }
.view {
  padding: calc(var(--safe-top) + 18px) 16px calc(var(--safe-bottom) + 104px);
  animation: viewIn 0.35s ease;
}
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; z-index: 20;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + 12px);
  width: min(calc(100% - 32px), 488px);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px;
  background: rgba(20, 20, 34, 0.72);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 6px; border-radius: 20px;
  color: var(--muted); font-size: 11px; font-weight: 600;
  transition: color 0.2s, background 0.2s;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab svg .dot { fill: currentColor; stroke: none; }
.tab.active { color: var(--text); background: var(--surface-2); }
.tab.active svg .dot { fill: var(--accent); }

/* ---------- Generic ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.section-title { font-size: 20px; margin: 10px 2px 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head h1 { font-size: 28px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
}
.chip.lime { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-weight: 600; transition: transform 0.12s, background 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: #12140a; border-color: transparent; }
.btn.danger { color: #fda4af; }
.btn.block { width: 100%; }

/* ---------- Home ---------- */
.greet { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  background: var(--grad); color: #fff;
  border: 2px solid var(--bg);
}
.greet h1 { font-size: 22px; }

.hero { position: relative; overflow: hidden; text-align: center; padding: 22px 18px 20px; }
.hero::before {
  content: ''; position: absolute; inset: -40% -20% auto; height: 120%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--g1) 25%, transparent), transparent);
  pointer-events: none;
}
.ring-wrap { position: relative; width: 210px; height: 210px; margin: 6px auto 10px; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 16; }
.ring-bar { fill: none; stroke: url(#ringGrad); stroke-width: 16; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.ring-bar.done { stroke: var(--accent); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 55%, transparent)); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; }
.ring-num { font-family: var(--font-display); font-size: 54px; font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
.ring-num small { font-size: 22px; color: var(--muted); font-weight: 600; }
.ring-label { margin-top: 6px; font-size: 13px; color: var(--muted); }
.status-line { position: relative; font-size: 14px; margin: 0 auto; max-width: 300px; }
.pace { margin-top: 10px; }

.checkin {
  position: relative; width: 100%;
  padding: 20px; border-radius: 24px;
  background: var(--accent); color: #12140a;
  font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em;
  box-shadow: 0 10px 40px color-mix(in srgb, var(--accent) 28%, transparent), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform 0.15s;
}
.checkin:active { transform: scale(0.97); }
.checkin .sub { display: block; font-family: var(--font); font-size: 12px; font-weight: 600; opacity: 0.7; }
.checkin.loading { opacity: 0.7; pointer-events: none; }
.checkin-done {
  display: flex; align-items: center; gap: 14px;
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--accent) 3%, transparent));
}
.check-icon {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #12140a; font-size: 22px; font-weight: 800;
}
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.wday {
  display: grid; justify-items: center; gap: 6px; padding: 10px 0; border-radius: 16px;
  background: rgba(255, 255, 255, 0.03); font-size: 12px; color: var(--muted);
}
.wday b { font-family: var(--font-display); font-size: 16px; color: var(--text); }
.wday .pip { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.wday.today { outline: 1.5px solid rgba(255, 255, 255, 0.35); }
.wday.office { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.wday.office .pip { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.wday.remote .pip { background: var(--g1); }
.wday.off .pip, .wday.holiday .pip { background: var(--orange); }
.wday.plan .pip { background: transparent; border: 1.5px dashed var(--accent); }
.wday.rest { opacity: 0.45; }

.xp-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin: 10px 0 6px; }
.xp-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width 0.8s cubic-bezier(.2,.8,.2,1); }
.level-badge {
  width: 52px; height: 52px; flex: none; border-radius: 16px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  background: var(--grad); color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--g1) 35%, transparent);
}
.stat-big { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.stat-big .unit { font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.flame { font-size: 22px; }

.next-ach { display: flex; gap: 14px; align-items: center; }

.install-card { border-style: dashed; }

/* ---------- Calendar ---------- */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-nav h2 { font-size: 20px; text-transform: capitalize; }
.icon-btn { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { text-align: center; font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; padding-bottom: 4px; }
.cal-day {
  aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center; position: relative;
  background: rgba(255, 255, 255, 0.03); font-weight: 600; font-size: 14px;
  transition: transform 0.12s;
}
.cal-day:active { transform: scale(0.92); }
.cal-day.empty { background: none; pointer-events: none; }
.cal-day.rest { color: var(--faint); background: transparent; }
.cal-day.today { outline: 1.5px solid rgba(255, 255, 255, 0.5); }
.cal-day.office { background: var(--accent); color: #12140a; box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 25%, transparent); }
.cal-day.remote { background: color-mix(in srgb, var(--g1) 25%, transparent); color: #ddd6fe; }
.cal-day.off { background: rgba(251, 146, 60, 0.18); color: #fed7aa; }
.cal-day.holiday { background: repeating-linear-gradient(135deg, rgba(251,146,60,.14) 0 5px, transparent 5px 10px); color: #fdba74; }
.cal-day.plan { outline: 1.5px dashed var(--accent); color: var(--accent); }
.cal-day .mark { position: absolute; top: 3px; right: 5px; font-size: 9px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.summary-grid .stat-big { font-size: 24px; }

/* ---------- Trophies ---------- */
.ach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ach {
  position: relative; overflow: hidden;
  padding: 16px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  display: grid; gap: 8px; align-content: start;
}
.ach .medal, .next-ach .medal {
  width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; font-size: 28px;
  background: var(--tier, var(--grad));
  box-shadow: 0 8px 24px var(--tier-glow, color-mix(in srgb, var(--g1) 30%, transparent));
}
.ach h3 { font-size: 15px; line-height: 1.25; }
.ach p { margin: 0; font-size: 12px; color: var(--muted); }
.ach .xp { font-size: 11px; font-weight: 700; color: var(--accent); }
.ach.locked .medal { background: rgba(255, 255, 255, 0.06); box-shadow: none; filter: grayscale(1); opacity: 0.5; }
.ach.locked h3 { color: var(--muted); }
.ach .prog { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.ach .prog i { display: block; height: 100%; background: var(--muted); border-radius: inherit; }
.tier-bronze { --tier: linear-gradient(135deg, #f59e0b, #b45309); --tier-glow: rgba(245, 158, 11, 0.3); }
.tier-silver { --tier: linear-gradient(135deg, #e2e8f0, #64748b); --tier-glow: rgba(148, 163, 184, 0.3); }
.tier-gold { --tier: linear-gradient(135deg, #fde047, #f97316); --tier-glow: rgba(250, 204, 21, 0.35); }
.tier-legend { --tier: linear-gradient(135deg, #c6f432, #22d3ee 50%, #8b5cf6); --tier-glow: color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---------- Profile ---------- */
.field { display: grid; gap: 8px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input {
  width: 100%; padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
  outline: none;
}
.input:focus { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); }
.seg button { padding: 9px 6px; border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.days-toggle { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days-toggle button { padding: 10px 0; border-radius: 12px; background: rgba(255,255,255,.05); font-weight: 600; font-size: 13px; color: var(--muted); }
.days-toggle button.on { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,.12); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); background: #12140a; }

.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; align-items: end; height: 120px; margin-top: 12px; }
.bar { display: grid; gap: 6px; justify-items: center; align-content: end; height: 100%; font-size: 11px; color: var(--muted); }
.bar i { width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: var(--grad); min-height: 4px; }
.bar i.hit { background: var(--accent); }
.bar b { color: var(--text); font-size: 12px; }

/* ---------- Sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(5, 5, 12, 0.6);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fade 0.2s ease;
}
.sheet {
  position: fixed; z-index: 41; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 520px);
  padding: 10px 16px calc(var(--safe-bottom) + 18px);
  background: #15151f; border: 1px solid var(--border); border-bottom: 0;
  border-radius: 28px 28px 0 0;
  animation: slideUp 0.28s cubic-bezier(.2,.8,.2,1);
}
.sheet .grabber { width: 40px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.2); margin: 0 auto 14px; }
.sheet h2 { font-size: 22px; margin-bottom: 4px; }
.sheet-options { display: grid; gap: 8px; margin-top: 16px; }
.sheet-option { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid var(--border); text-align: left; font-weight: 600; }
.sheet-option.on { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.sheet-option .emo { font-size: 22px; width: 32px; text-align: center; }
@keyframes slideUp { from { transform: translate(-50%, 100%); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Toasts & FX ---------- */
#toast-root { position: fixed; z-index: 60; top: calc(var(--safe-top) + 12px); left: 0; right: 0; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: flex; align-items: center; gap: 12px;
  width: min(100%, 440px); padding: 12px 14px; border-radius: 20px;
  background: rgba(24, 24, 38, 0.92); border: 1px solid var(--border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: toastIn 0.4s cubic-bezier(.2,.9,.3,1.2);
}
.toast.out { animation: toastOut 0.3s ease forwards; }
.toast .medal { width: 42px; height: 42px; border-radius: 14px; font-size: 22px; display: grid; place-items: center; background: var(--tier, var(--grad)); flex: none; }
.toast b { display: block; font-size: 14px; }
.toast span { font-size: 12px; color: var(--muted); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px) scale(0.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-20px); } }

.xp-float {
  position: fixed; z-index: 55; pointer-events: none;
  font-family: var(--font-display); font-weight: 700; font-size: 28px; color: var(--accent);
  text-shadow: 0 0 20px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: floatUp 1.4s ease-out forwards;
}
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -20px) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -110px) scale(1); } }

.levelup {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: rgba(5, 5, 12, 0.75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fade .3s ease;
}
.levelup .card { text-align: center; max-width: 340px; max-height: calc(100dvh - 48px); overflow-y: auto; padding: 28px 22px; background: #15151f; animation: pop .5s cubic-bezier(.2,.9,.3,1.3); }
.levelup .level-badge { width: 96px; height: 96px; font-size: 44px; border-radius: 30px; margin: 0 auto 16px; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- v1.1: frames, planning, rewards ---------- */
.accent { color: var(--accent); }
.avatar-frame { padding: 3px; border-radius: 50%; background: var(--accent); flex: none; width: fit-content; }
.avatar-frame.lg .avatar { width: 64px; height: 64px; font-size: 26px; }
.avatar-frame.sm .avatar { width: 34px; height: 34px; font-size: 14px; }
.frame-bronze { background: linear-gradient(135deg, #fbbf24, #92400e); }
.frame-silver { background: linear-gradient(135deg, #f8fafc, #64748b); }
.frame-gold { background: linear-gradient(135deg, #fde047, #f97316, #fde047); box-shadow: 0 0 14px rgba(250, 204, 21, 0.45); }
.frame-rainbow { background: conic-gradient(#f43f5e, #f59e0b, #facc15, #22c55e, #22d3ee, #8b5cf6, #f43f5e); }
.frame-pulse { background: linear-gradient(135deg, var(--accent), var(--g2)); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 22px var(--accent); } }

.quick-actions.single { grid-template-columns: 1fr; }
.reminder { display: flex; align-items: center; gap: 12px; padding: 14px; border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), var(--surface)); }
.rem-icon { width: 40px; height: 40px; flex: none; border-radius: 13px; display: grid; place-items: center; font-size: 20px; background: var(--surface-2); }
.plans { display: grid; gap: 8px; margin-top: 10px; }
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.03); }
.plan-row b.cap { text-transform: capitalize; }
button.chip { cursor: pointer; }
.next-rewards { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.next-rewards .chip { font-size: 12px; padding: 4px 10px; }
.next-ach .medal { flex: none; }
.wday { border: 0; font: inherit; }

.plan-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; }
.plan-day { display: grid; justify-items: center; gap: 4px; padding: 10px 0; border-radius: 16px; background: rgba(255, 255, 255, 0.05); border: 1.5px solid transparent; font-size: 11px; color: var(--muted); }
.plan-day b { font-family: var(--font-display); font-size: 17px; color: var(--text); }
.plan-day i { font-style: normal; height: 16px; font-size: 12px; }
.plan-day.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.plan-day.done { background: var(--accent); color: #12140a; }
.plan-day.done b { color: #12140a; }
.plan-day.rest:not(.on) { opacity: 0.45; }
.plan-day:disabled { cursor: default; }

.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pick { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1.5px solid var(--border); font-size: 12px; font-weight: 600; text-align: center; }
.pick small { font-size: 10px; color: var(--muted); font-weight: 500; }
.pick.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pick.locked { opacity: 0.45; cursor: default; }
.swatch { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; }
.swatch.emoji { font-size: 24px; background: var(--surface-2); }

.reward-form { display: grid; grid-template-columns: 1fr 64px auto; gap: 8px; }
.reward-form .lv { text-align: center; padding: 12px 6px; }
.icon-btn.small { width: 32px; height: 32px; border-radius: 10px; font-size: 13px; }

.road { display: grid; gap: 0; }
.road-step { position: relative; display: flex; gap: 14px; padding: 0 0 14px; }
.road-step::before { content: ''; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--border); }
.road-step:last-of-type::before { display: none; }
.road-lv { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; background: var(--surface-2); color: var(--muted); }
.road-step.reached .road-lv { background: linear-gradient(135deg, var(--g1), var(--g2)); color: #fff; }
.road-step.reached::before { background: color-mix(in srgb, var(--g2) 60%, transparent); }
.road-step.next .road-lv { outline: 2px solid var(--accent); color: var(--accent); }
.road-items { display: flex; flex-wrap: wrap; gap: 6px; align-content: center; min-height: 36px; }
.road-items .chip { font-size: 12px; padding: 4px 10px; }
.road-step:not(.reached) .road-items { opacity: 0.6; }

.unlocks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 14px; }
.gift { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; margin-bottom: 14px; border-radius: 18px; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.gift-icon { font-size: 30px; }
.level-badge.miss { background: linear-gradient(135deg, #f43f5e, #9f1239); }

/* ---------- v1.2: cloud ---------- */
.btn.loading { opacity: 0.6; pointer-events: none; }
.input.code { font-family: var(--font-display); font-size: 24px; letter-spacing: 0.3em; text-align: center; }
.form-error { color: #fda4af; margin: 0; }

/* ---------- v1.3: auth ---------- */
.google-btn { background: #fff; color: #1f1f1f; border-color: transparent; margin-top: 14px; text-decoration: none; }
.divider { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-links { display: grid; gap: 4px; justify-items: center; }
.link { color: var(--muted); font-size: 13px; padding: 6px; }
.link b { color: var(--accent); }
a.btn { text-decoration: none; }
.qr { width: 200px; margin: 0 auto; padding: 8px; border-radius: 16px; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; color: var(--text); }
.btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- v1.4: login gate ---------- */
.gate-screen {
  position: fixed; inset: 0; z-index: 45; overflow-y: auto;
  background: var(--bg);
  background-image:
    radial-gradient(70% 45% at 10% 0%, color-mix(in srgb, var(--g1) 30%, transparent), transparent 70%),
    radial-gradient(60% 40% at 100% 20%, color-mix(in srgb, var(--g2) 18%, transparent), transparent 70%);
  display: grid; place-items: center;
  padding: calc(var(--safe-top) + 24px) 16px calc(var(--safe-bottom) + 24px);
}
.gate-inner { width: min(100%, 420px); text-align: center; animation: viewIn .4s ease; }
.gate-logo { width: 84px; height: 84px; border-radius: 24px; box-shadow: 0 16px 50px color-mix(in srgb, var(--g1) 40%, transparent); }
.gate-logo.pulse { animation: gatePulse 1.4s ease-in-out infinite; }
@keyframes gatePulse { 50% { transform: scale(1.06); } }
.gate-inner h1 { font-size: 34px; margin: 16px 0 6px; }
.gate-tag { margin: 0 auto 20px; max-width: 320px; }
.gate-body { text-align: left; padding: 20px; }
.gate-body h2 { font-size: 20px; margin-bottom: 4px; }
.gate-body .google-btn { margin-top: 12px; }
.gate-status { font-size: 44px; text-align: center; margin-bottom: 8px; }
.gate-body .gate-status + h2 { text-align: center; }
