:root {
  /* Build Ideas CI: gold #dc9f16 and blue #21548f (logo), on a dark navy base. */
  --accent: #dc9f16;
  --accent-dark: #b8840f;
  --on-accent: #0b1626;
  --bg: #0b1626;
  --card: #12233b;
  --card2: #21548f;
  --text: #f0f0f0;
  --muted: #888;
  --radius: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 env(safe-area-inset-bottom);
}

.screen { display: none; padding: 20px 16px; }
.screen.active { display: block; }

/* HOME */
.app-header {
  text-align: center;
  padding: 40px 0 32px;
}
.logo { font-size: 48px; display: block; margin-bottom: 8px; }

.app-header h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -1px;
}
.subtitle { color: var(--muted); margin-top: 4px; font-size: 14px; }

.btn-ag {
  background: var(--card2);
  border: none;
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  margin-top: 8px;
}

.ag-focus {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: 8px 0 20px;
  line-height: 1.5;
  padding: 0 8px;
}

.training-buttons { display: flex; flex-direction: column; gap: 14px; }

.btn-training {
  background: var(--card);
  border: 2px solid var(--card2);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, transform 0.1s;
  text-align: left;
}
.btn-training:active { transform: scale(0.98); border-color: var(--accent); }
.btn-icon { font-size: 32px; flex-shrink: 0; }
.btn-label { font-size: 18px; font-weight: 700; display: block; }
.btn-sub { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; }

/* TRAINING HEADER */
.training-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 20px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 0;
  flex-shrink: 0;
}
.training-header h2 { font-size: 16px; font-weight: 600; color: var(--muted); }

/* STEP NAV */
.steps-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.btn-nav {
  background: var(--card);
  border: none;
  color: var(--text);
  font-size: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-nav:disabled { color: var(--card2); cursor: default; }
.btn-nav:not(:disabled):active { background: var(--card2); }
#step-counter { color: var(--muted); font-size: 14px; }

/* STEP CARD */
.step-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 20px;
  min-height: 260px;
}

.step-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.step-card h3 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.step-time { font-size: 13px; color: var(--muted); margin-bottom: 20px; min-height: 18px; }

/* EXPLAIN */
.btn-explain {
  background: var(--card2);
  border: none;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 0;
}

.explain-box {
  max-height: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
  color: #ccc;
  transition: max-height 0.3s ease, padding 0.3s;
  padding: 0 4px;
}

.explain-box.open {
  max-height: 400px;
  padding: 12px 4px 4px;
}

/* TIMER */
.timer-section {
  margin-top: 24px;
  text-align: center;
}

.timer-display {
  font-size: 56px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin-bottom: 16px;
}
.timer-controls { display: flex; gap: 12px; justify-content: center; }

.btn-timer {
  background: var(--accent);
  border: none;
  color: var(--on-accent);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-timer:active { background: var(--accent-dark); }
.btn-timer.btn-secondary { background: var(--card2); }

/* DICE */
.dice-zone {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  min-height: 22px;
  margin-bottom: 12px;
  text-align: center;
}

.dice-section {
  margin-top: 24px;
  text-align: center;
}

.dice-display {
  font-size: 100px;
  line-height: 1;
  margin-bottom: 16px;
  transition: transform 0.1s;
}

.dice-controls {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

.btn-dice {
  background: var(--accent);
  border: none;
  color: var(--on-accent);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn-dice:active { background: var(--accent-dark); }

.dice-auto-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.dice-auto-label input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); }
