:root {
  --bg-primary: #000000; /* transparent on additive display */
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #14141f;
  --bg-card: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent-primary: #4fd1ff;
  --accent-secondary: #7ee8fa;
  --danger: #ff4466;
  --focus-ring: #4fd1ff;
  --focus-glow: rgba(79, 209, 255, 0.4);
  --success: #7ee8fa;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 600px;
  height: 600px;
  overflow: hidden;
}

#app { width: 100%; height: 100%; position: relative; }

/* --- Screens --- */
.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.hidden { display: none; }

/* --- Header --- */
.header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  gap: 12px;
  flex-shrink: 0;
}
.header h1 { font-size: 22px; font-weight: 600; flex: 1; }
.header-meta { font-size: 14px; color: var(--accent-secondary); font-weight: 600; }
.back-btn {
  background: transparent;
  color: var(--text-primary);
  font-size: 22px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
}

/* --- Content Area --- */
.content {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-content { align-items: center; justify-content: center; gap: 6px; }

/* --- Focus States --- */
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; min-height: 44px; }
.focusable:focus { outline: none; border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }

/* --- Nav Bar --- */
.nav-bar { display: flex; gap: 8px; padding: 12px 20px; background: var(--bg-secondary); flex-shrink: 0; }
.nav-item {
  flex: 1;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.nav-item:focus { background: var(--bg-card); }
.nav-item.primary { background: var(--accent-primary); color: #06181f; }
.nav-item.primary:focus { background: var(--accent-secondary); }
.nav-item.danger { background: rgba(255, 68, 102, 0.18); color: var(--danger); }
.nav-item.danger:focus { background: rgba(255, 68, 102, 0.32); }
.nav-item.icon-only { flex: 0 0 60px; font-size: 20px; padding: 14px 0; }

/* --- Cards --- */
.card { background: var(--bg-card); border-radius: var(--radius-md); padding: 16px; border: 2px solid transparent; }
.card-title { font-size: 15px; color: var(--text-secondary); margin-bottom: 8px; }
.card-value { font-size: 28px; font-weight: 700; color: var(--accent-primary); }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* --- Stepper --- */
.stepper { display: flex; align-items: center; justify-content: center; gap: 20px; }
.stepper-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper-btn:focus { background: var(--bg-card); }
.stepper-value { font-size: 30px; font-weight: 700; min-width: 56px; text-align: center; }

/* --- Droplet Character --- */
.droplet-wrap { position: relative; width: 220px; height: 220px; display: flex; align-items: center; justify-content: center; }
.progress-ring { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }
.ring-bg, .ring-fill { fill: none; stroke-width: 10; }
.ring-bg { stroke: var(--bg-tertiary); }
.ring-fill {
  stroke: var(--accent-primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.4, 0.04, 0.5, 1), stroke 0.4s ease;
}
.droplet {
  position: relative;
  transition: transform 0.5s cubic-bezier(0.4, 0.04, 0.5, 1);
  filter: drop-shadow(0 0 18px rgba(79, 209, 255, 0.55));
}
.droplet.wilted { filter: drop-shadow(0 0 8px rgba(79, 209, 255, 0.2)); }
.droplet-body { fill: var(--accent-primary); transition: fill 0.4s ease, opacity 0.4s ease; }
.droplet.wilted .droplet-body { fill: #2f7a92; opacity: 0.75; }
.droplet-shine { fill: rgba(255, 255, 255, 0.55); }
.droplet.wilted .droplet-shine { fill: rgba(255, 255, 255, 0.25); }
.droplet-eye { fill: #06181f; }
.droplet-mouth { fill: none; stroke: #06181f; stroke-width: 4; stroke-linecap: round; }
.droplet-mouth.hidden { display: none; }

/* --- Readout --- */
.cups-readout { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; }
.cups-num { font-size: 40px; font-weight: 700; color: var(--text-primary); }
.cups-sep { font-size: 22px; color: var(--text-muted); }
.cups-goal { font-size: 22px; color: var(--text-secondary); }
.cups-label { font-size: 16px; color: var(--text-secondary); margin-left: 2px; }
.hint-text { font-size: 14px; color: var(--text-secondary); text-align: center; }

/* --- Condition Row (weather / humidity / activity) --- */
.condition-row { display: flex; gap: 8px; margin-top: 6px; }
.cond-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.cond-icon { font-size: 13px; }
.breakdown-text { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 2px; }

/* --- Toast --- */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  max-width: 536px;
  transform: translateX(-50%) translateY(-80px);
  opacity: 0;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  text-align: center;
  border: 1px solid var(--accent-primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 100;
  pointer-events: none;
}
.toast.visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-color: var(--accent-secondary); }

.hidden { display: none !important; }
