/* ============================================================================
   DECATHLON CALCULATOR — loaded after css/styles-v4.css, so it inherits every
   design token (--bg, --text, --blue, --hairline, --space-*, --radius …).
   Prefix: dc-
   ========================================================================== */

.dc-page {
  min-height: 100dvh;
  padding-top: 96px;
  padding-bottom: calc(var(--space-5) + 64px);   /* room for the phone total bar */
}

.dc-intro { max-width: 40rem; margin-bottom: var(--space-4); }
.dc-intro .lede { margin-top: var(--space-2); }

/* ---------- layout: events left, total + target right (sticky) ---------- */
.dc-layout { display: grid; gap: var(--space-4); }
@media (min-width: 900px) {
  .dc-layout { grid-template-columns: minmax(0, 1fr) 21rem; align-items: start; }
  .dc-side { position: sticky; top: 96px; }
}

.dc-events { display: grid; gap: var(--space-4); }

.dc-day-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-text);
}
.dc-day-title span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
}
.dc-day-title em { font-style: normal; font-size: var(--text-sm); color: var(--text-3); }
.dc-day-title b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.dc-rows { display: grid; gap: var(--space-1); }

/* ---------- one event ---------- */
.dc-row {
  display: grid;
  gap: 0.55rem;
  padding: var(--space-2);
  background: linear-gradient(165deg, #141926 0%, #0C0F16 75%);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  transition: border-color 250ms var(--ease);
}
.dc-row.is-done { border-color: rgba(138, 180, 255, 0.22); }
.dc-row.is-bad  { border-color: rgba(255, 140, 140, 0.5); }

.dc-row-main { display: flex; align-items: baseline; gap: 0.75rem; }
.dc-row-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--blue);
}
.dc-row-name { flex: 1; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.dc-row-pts {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.dc-row.is-done .dc-row-pts { color: var(--text); }

.dc-input {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1rem;              /* 16px+ stops iOS zooming the page on focus */
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.dc-input::placeholder { color: var(--text-3); }
.dc-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

.dc-meter { height: 3px; border-radius: 3px; background: rgba(233, 236, 242, 0.06); overflow: hidden; }
.dc-meter i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(138, 180, 255, 0.55), var(--blue));
  border-radius: 3px;
  transition: width 350ms var(--ease);
}
.dc-row-msg { font-size: 0.8rem; color: var(--text-2); }
.dc-row.is-bad .dc-row-msg { color: #ff9c9c; }

/* ---------- right-hand cards ---------- */
.dc-side { display: grid; gap: var(--space-2); }

.dc-card {
  padding: var(--space-3);
  background: linear-gradient(165deg, #141926 0%, #0C0F16 75%);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.dc-card-label {
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
}
.dc-total {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 2.4rem + 3vw, 4.25rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dc-progress { margin-top: 0.5rem; font-size: var(--text-sm); color: var(--text-3); }

.dc-target-label { display: block; margin-bottom: 0.55rem; font-size: var(--text-sm); color: var(--text-2); }
.dc-target-out { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--text-2); line-height: 1.55; }
.dc-target-out strong { color: var(--text); font-weight: 600; }
.dc-t-list { list-style: none; margin: var(--space-1) 0; padding: 0; border-top: 1px solid var(--hairline); }
.dc-t-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--hairline);
  font-variant-numeric: tabular-nums;
}
.dc-t-list li span:last-child { color: var(--text); font-weight: 600; text-align: right; }
.dc-t-note { font-size: 0.8rem; color: var(--text-3); }
.dc-t-warn { color: #ffcf8a; }

.dc-reset { justify-self: start; }
.dc-fine { font-size: 0.75rem; color: var(--text-3); line-height: 1.5; }

/* ---------- phone: pinned total bar ---------- */
.dc-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom));
  background: rgba(9, 11, 16, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--hairline-strong);
}
.dc-bar span { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--blue); }
.dc-bar b { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  .dc-bar { display: none; }
  .dc-page { padding-bottom: var(--space-5); }
}

/* ============================================================================
   Personal best (v2)
   ========================================================================== */
.dc-up   { color: #7fe0a0; font-weight: 600; }
.dc-down { color: #ff9c9c; font-weight: 600; }
.dc-even { color: var(--text-2); font-weight: 600; }

.dc-row-pb { font-size: 0.8rem; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* under the big total */
.dc-vs { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--hairline); display: grid; gap: 0.4rem; }
.dc-vs-line { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--text-sm); color: var(--text-2); font-variant-numeric: tabular-nums; }
.dc-vs-line b { color: var(--text); font-weight: 600; }
.dc-vs-line strong { font-weight: 600; }

.dc-pb-total {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.25rem;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.dc-pb-sub { margin-top: 0.4rem; font-size: var(--text-sm); color: var(--text-3); line-height: 1.5; }

.dc-pb-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: var(--space-2); }
.dc-pb-actions .btn { flex: 1 1 auto; }
.dc-pb-actions .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.is-highlight { box-shadow: 0 0 0 3px rgba(127, 224, 160, 0.35); }

.dc-pb-form { margin-top: var(--space-2); }
.dc-pb-help { font-size: var(--text-sm); color: var(--text-2); margin-bottom: var(--space-1); }
.dc-pb-field { margin-bottom: 0.6rem; }
.dc-pb-field label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.dc-pb-err { margin-top: 0.6rem; font-size: 0.85rem; color: #ff9c9c; }
.dc-pb-remove {
  margin-top: var(--space-2);
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--text-3);
  text-decoration: underline;
  cursor: pointer;
}
.dc-pb-remove:hover { color: #ff9c9c; }
.dc-pb-note { margin-top: var(--space-2); font-size: 0.85rem; color: var(--text-2); }
.dc-pb-note.is-error { color: #ffcf8a; }

.dc-bar-vs { flex: 1; margin-left: 0.9rem; font-size: 0.85rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dc-bar .dc-bar-vs span { font-size: inherit; letter-spacing: 0; text-transform: none; font-weight: 600; }
.dc-bar .dc-bar-vs .dc-up   { color: #7fe0a0; }
.dc-bar .dc-bar-vs .dc-down { color: #ff9c9c; }
.dc-bar .dc-bar-vs .dc-even { color: var(--text-2); }

/* ============================================================================
   Phones: the FW / "The vault" bar scrolls away with the page instead of being
   pinned. It was eating ~75px of a small screen for the whole visit; the total
   bar at the bottom is the only thing that needs to stay put.
   (A web page can't share a row with the browser's own address bar.)
   ========================================================================== */
@media (max-width: 899px) {
  .site-header { position: absolute; }
}

/* target list (v4): result on top, points underneath */
.dc-t-val { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; }
.dc-t-val b { color: var(--text); font-weight: 600; }
.dc-t-val small { font-size: 0.75rem; color: var(--text-3); font-weight: 400; }
