* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0e1116;
  --panel: #171c24;
  --panel-2: #1f2630;
  --line: #2a3441;
  --text: #e6edf3;
  --muted: #8b97a7;
  --accent: #4ea1ff;
  --good: #46d39a;
  --bad: #ff6b6b;
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

#app { display: flex; height: 100vh; }

/* ---- Sidebar ---- */
#sidebar {
  width: 340px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}

#sidebar header h1 { font-size: 20px; letter-spacing: 0.2px; }
.tagline { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---- Budget ---- */
#budget-bar {
  margin: 18px 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.budget-row { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 4px; }
.budget-row.muted { color: var(--muted); font-size: 13px; }
#total { font-weight: 700; }
#budget-track {
  height: 8px; background: #0c0f14; border-radius: 99px; overflow: hidden; margin: 8px 0 6px;
}
#budget-fill { height: 100%; width: 0%; background: var(--good); transition: width .3s ease, background .3s; }
#budget-msg { font-size: 12px; min-height: 16px; color: var(--muted); }
#budget-msg.over { color: var(--bad); }
#budget-msg.done { color: var(--good); }

/* ---- Categories ---- */
.category { margin-bottom: 16px; }
.category-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}
.category.filled .step-num { background: var(--good); border-color: var(--good); color: #062018; }

.option {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 6px; cursor: pointer;
  transition: border-color .15s, transform .05s;
  font-size: 14px;
}
.option:hover { border-color: var(--accent); }
.option:active { transform: scale(0.99); }
.option.selected { border-color: var(--accent); background: #14304d; }
.option .price { color: var(--muted); font-size: 13px; margin-left: 8px; white-space: nowrap; }
.option.selected .price { color: var(--text); }

#reset {
  margin-top: auto;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 10px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
#reset:hover { border-color: var(--bad); color: var(--bad); }

/* ---- Stage ---- */
#stage { flex: 1; position: relative; }
#stage canvas { display: block; }

#info-card {
  position: absolute; left: 20px; bottom: 20px; max-width: 380px;
  background: rgba(23,28,36,.92); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; backdrop-filter: blur(8px);
  transition: opacity .2s;
}
#info-card.hidden { opacity: 0; pointer-events: none; }
#info-title { font-size: 17px; margin-bottom: 6px; }
#info-desc { font-size: 14px; color: var(--text); margin-bottom: 8px; }
.teaches { font-size: 13px; color: var(--muted); line-height: 1.4; }
#info-link {
  display: inline-block; margin-top: 12px; padding: 8px 14px;
  background: var(--accent); color: #fff; text-decoration: none;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  transition: filter .15s;
}
#info-link:hover { filter: brightness(1.12); }
#info-link.hidden { display: none; }

#step-banner {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(23,28,36,.92); border: 1px solid var(--line);
  border-radius: 99px; padding: 8px 18px; font-size: 14px;
  color: var(--text); white-space: nowrap;
}
