:root {
  --bg: #f4f8fb;
  --bg-card: #ffffff;
  --line: #dbe7ee;
  --ink: #1c2b36;
  --ink-dim: #5c7385;

  --power: #ff6b4a;      /* coral — energy / power breath */
  --power-dim: #ffe1d8;
  --calm: #2fb8c4;       /* teal — calm / good */
  --calm-dim: #d7f3f5;
  --gold: #ffb443;       /* badge gold */

  --font-display: 'Baloo 2', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
}

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

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
}

.app-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.app-title .jr {
  color: var(--power);
}

.power-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  background: var(--power-dim);
  color: var(--power);
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
}
.power-btn .bolt { width: 15px; height: 15px; fill: var(--power); }
.power-btn:hover { background: var(--power); color: white; }
.power-btn:hover .bolt { fill: white; }

.screen {
  flex: 1;
  padding: 10px 20px 24px;
}

.prompt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  margin: 10px 0 4px;
}
.prompt-sub {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-dim);
}

/* ---- Mood grid ---- */
.mood-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}
.mood-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 10px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.mood-btn svg { width: 56px; height: 56px; }
.mood-btn circle:first-child { fill: var(--calm-dim); stroke: none; }
.mood-btn .face { stroke: var(--ink); }
.mood-btn .eye { fill: var(--ink); }
.mood-btn:hover, .mood-btn.selected {
  border-color: var(--power);
  background: var(--power-dim);
}
.mood-btn:hover circle:first-child, .mood-btn.selected circle:first-child {
  fill: white;
}

/* ---- Chips ---- */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 26px;
}
.chip {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  background: var(--bg-card);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--ink);
}
.chip.selected {
  background: var(--calm);
  border-color: var(--calm);
  color: white;
}

.save-btn {
  display: block;
  width: 100%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  background: var(--power);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
}
.save-btn:hover { filter: brightness(1.06); }
.save-btn.secondary {
  background: var(--bg-card);
  color: var(--ink);
  border: 2px solid var(--line);
  margin-top: 20px;
}

/* ---- Badge shelf ---- */
.shelf-sub {
  color: var(--ink-dim);
  font-weight: 600;
  margin-top: -2px;
}
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}
.badge {
  background: var(--bg-card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.badge-medal {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.badge-date {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--ink-dim);
}
.badge-tags {
  font-size: 11px;
  color: var(--ink-dim);
  line-height: 1.3;
}
.empty-shelf {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-dim);
  font-weight: 600;
  padding: 30px 10px;
}

/* ---- Tab bar ---- */
.tabbar {
  display: flex;
  border-top: 2px solid var(--line);
  background: var(--bg-card);
}
.tab-btn {
  flex: 1;
  padding: 14px;
  border: none;
  background: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-dim);
  cursor: pointer;
}
.tab-btn.active { color: var(--power); }

/* ---- Overlay ---- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 43, 54, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.overlay[hidden] { display: none; }
.overlay-panel {
  max-width: 340px;
  width: 88%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.breath-ring { width: 190px; height: 190px; }
.breath-track { fill: none; stroke: rgba(255,255,255,0.2); stroke-width: 8; }
.breath-fill {
  fill: none;
  stroke: var(--power);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 502;
  stroke-dashoffset: 502;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 4s linear;
}
.breath-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: white;
  margin: 0;
}
.overlay-close {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  background: white;
  border: none;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
}

/* ---- Focus grid (Get Ready) ---- */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.focus-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 6px;
  font-size: 26px;
  cursor: pointer;
}
.focus-btn span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}
.focus-btn:hover, .focus-btn.selected {
  border-color: var(--gold);
  background: #fff6e2;
}

.affirm-card {
  margin-top: 20px;
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.affirm-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 14px;
}

/* ---- Tough Spots ---- */
.tough-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.tough-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  text-align: left;
}
.tough-card:hover { border-color: var(--power); background: var(--power-dim); }
.tough-icon {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--power);
  min-width: 36px;
  text-align: center;
}
.tough-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}
.tough-desc {
  display: block;
  font-size: 12px;
  color: var(--ink-dim);
  font-weight: 600;
}

/* ---- Breath picker overlay ---- */
.picker-panel { gap: 10px; }
.picker-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: white;
  margin: 0 0 6px;
}
.picker-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: white;
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}
.picker-btn span {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-dim);
}
.picker-btn:hover { background: var(--power-dim); }

.breath-reframe {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: white;
  text-align: center;
  margin: 0;
  padding: 0 10px;
}
