:root {
  --bg-color: #f0f2f5;
  --app-bg: #ffffff;
  --text-main: #111111;
  --text-muted: #666666;
  --border-color: #e0e0e0;
  --primary: #000000;
  --primary-fg: #ffffff;
  --danger: #d32f2f;
  --success: #388e3c;
  --surface: #f8f9fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* Mobile Frame Simulation */
.mobile-frame {
  width: 100%;
  max-width: 414px; /* iPhone Max width ballpark */
  background-color: var(--app-bg);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.05);
  padding-bottom: 80px; /* Space for bottom nav */
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, p {
  margin: 0;
}

h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.text-sm { font-size: 13px; color: var(--text-muted); }
.text-xs { font-size: 11px; color: var(--text-muted); }

/* Components */
.header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--app-bg);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
}

.card {
  border: 2px solid var(--text-main);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 24px;
  background: white;
  box-shadow: 4px 4px 0px rgba(0,0,0,1); /* Brutalist wireframe shadow */
}

.card.flat {
  box-shadow: none;
  border: 1px solid var(--border-color);
}

.section {
  padding: 16px 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  border: 2px solid var(--primary);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  width: auto;
}

/* Inputs */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
}
.form-input:focus {
  border-color: var(--text-main);
}
.input-with-icon {
  position: relative;
}
.input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

/* Gamification Elements */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 600;
}
.progress-container {
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--text-main);
  border-radius: 4px;
}

/* Charts & Visualizations */
.chart-line-container {
  height: 150px;
  border-left: 2px solid var(--text-main);
  border-bottom: 2px solid var(--text-main);
  position: relative;
  margin: 20px 0;
  padding: 10px;
}
.chart-line-point {
  width: 8px;
  height: 8px;
  background: var(--text-main);
  border-radius: 50%;
  position: absolute;
}
.chart-line-segment {
  position: absolute;
  height: 2px;
  background: var(--text-main);
  transform-origin: left center;
}

.pie-chart {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--text-main) 0% 70%, #ddd 70% 100%);
  margin: 0 auto;
}

.chart-bar-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 150px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--text-main);
}
.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.chart-bar {
  width: 12px;
  background: var(--text-main);
  border-radius: 4px 4px 0 0;
}

/* Bottom Navigation */
.nav-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  z-index: 100;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
}
.nav-item.active {
  color: var(--text-main);
  font-weight: 700;
}
.nav-icon {
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 6px; /* Square icons style */
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Icon Shapes */
.nav-icon.home::after {
  content: '';
  width: 0; 
  height: 0; 
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 8px solid currentColor;
}
.nav-icon.track::after {
  content: '';
  width: 10px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
}
.nav-icon.goals::after {
  content: '';
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.nav-icon.ideas::after {
  content: '?';
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.nav-icon.stats::after {
  content: '';
  width: 4px;
  height: 6px;
  background: currentColor;
  box-shadow: 5px -4px 0 currentColor, 10px 0 0 currentColor;
  transform: translateY(2px);
}

/* Specific Utilities */
.offline-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  padding: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.offline-dot {
  width: 6px;
  height: 6px;
  background: #aaa;
  border-radius: 50%;
}
.balance-display {
  text-align: center;
  margin-bottom: 20px;
}
.currency-main {
  font-size: 32px;
  font-weight: 800;
}
.thermometer-container {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
}
.thermometer-bar {
  flex-grow: 1;
  height: 24px;
  background: var(--surface);
  border: 2px solid var(--text-main);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.thermometer-fill {
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    #333,
    #333 10px,
    #fff 10px,
    #fff 20px
  );
}

/* Icons / Placeholders */
.icon-placeholder {
  width: 20px;
  height: 20px;
  background: #eee;
  border-radius: 4px;
  display: inline-block;
  vertical-align: middle;
}
