/* LogPose Fitness : barre de navigation et écrans (historique, rangs, succès, réglages). */

/* ---------- Barre de navigation du bas ---------- */

.nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 0 var(--gutter) calc(10px + env(safe-area-inset-bottom));
  pointer-events: none;
}

.nav-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px;
  background: rgba(17, 26, 51, 0.94);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.45), 0 10px 30px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 58px;
  padding: 7px 2px 6px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.12s ease;
  touch-action: manipulation;
}

.nav-item:active {
  transform: scale(0.94);
}

.nav-item[aria-current='page'] {
  color: var(--gold);
  background: rgba(244, 196, 48, 0.12);
}

.nav-icon {
  font-size: 22px;
  line-height: 1;
  filter: grayscale(0.55) brightness(0.9);
  transition: filter 0.2s ease;
}

.nav-item[aria-current='page'] .nav-icon {
  filter: none;
}

.nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Écrans ---------- */

.screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: rise 0.35s ease both;
}

.screen-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 400;
  color: var(--gold);
}

.screen-title span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 18px;
}

.card-title {
  font-size: 20px;
  color: var(--text);
}

.card .note {
  margin-top: 6px;
}

/* ---------- Historique ---------- */

.sessions {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.session {
  padding: 14px 14px 12px 16px;
  background: linear-gradient(180deg, var(--surface), #0e1730);
  border: 1px solid var(--border);
  border-left: 5px solid var(--ember);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.session-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.session-date {
  font-weight: 700;
}

.session-circuit,
.session-reps {
  font-size: 13px;
  color: var(--text-dim);
}

.session-score {
  flex: none;
  text-align: right;
}

.session-rounds {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.1;
  color: var(--gold);
}

.session-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.btn-danger-text {
  color: var(--ember-soft);
}

.empty {
  text-align: center;
}

.empty-title {
  font-family: var(--font-title);
  font-size: 24px;
  color: var(--gold);
}

.empty .btn {
  margin-top: 16px;
}

/* ---------- Rangs et graphique ---------- */

.chart-card {
  padding: 14px 12px 12px;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-guide {
  stroke: rgba(154, 164, 199, 0.4);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.chart-guide-label,
.chart-date {
  fill: var(--text-dim);
  font-family: var(--font-body);
  font-size: 10px;
}

.chart-area {
  fill: rgba(244, 196, 48, 0.16);
}

.chart-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-dot {
  fill: var(--gold);
}

.chart-dot-last {
  fill: var(--gold-soft);
  stroke: var(--gold-deep);
  stroke-width: 1.5;
}

.ladder {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rung {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  opacity: 0.62;
}

.rung[data-reached] {
  opacity: 1;
}

.rung[data-current] {
  border-color: var(--ember);
  background: linear-gradient(135deg, rgba(228, 70, 58, 0.16), var(--surface) 70%);
  box-shadow: 0 0 0 1px rgba(228, 70, 58, 0.25), var(--shadow);
}

.medal.small {
  width: 38px;
  height: 38px;
  font-size: 20px;
  border-width: 1.5px;
}

.rung-text {
  flex: 1;
  min-width: 0;
}

.rung-name {
  font-weight: 700;
}

.rung-req {
  font-size: 13px;
  color: var(--text-dim);
}

.rung-here {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ember-soft);
}

/* ---------- Succès ---------- */

.achievements {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.achievement {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.achievement[data-unlocked] {
  border-left: 5px solid var(--gold);
  background: linear-gradient(135deg, rgba(244, 196, 48, 0.1), var(--surface) 65%);
  box-shadow: var(--shadow);
}

.achievement-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 26px;
  filter: grayscale(1);
  opacity: 0.55;
}

.achievement[data-unlocked] .achievement-icon {
  filter: none;
  opacity: 1;
  background: rgba(244, 196, 48, 0.14);
}

.achievement-text {
  flex: 1;
  min-width: 0;
}

.achievement-title {
  font-weight: 700;
  color: var(--text-dim);
}

.achievement[data-unlocked] .achievement-title {
  color: var(--text);
}

.achievement-desc {
  font-size: 13px;
  color: var(--text-dim);
}

.achievement-check {
  flex: none;
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
}

/* ---------- Réglages ---------- */

.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.stepper-button {
  width: 54px;
  padding: 0;
  font-size: 26px;
}

.stepper-value {
  min-width: 44px;
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.stepper-unit {
  color: var(--text-dim);
}

.about {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  margin: 12px 0 0;
  font-size: 14px;
}

.about dt {
  color: var(--text-dim);
}

.about dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.card.danger::before {
  background: linear-gradient(90deg, #7a1c15, var(--ember));
}

.card.danger {
  border-color: rgba(228, 70, 58, 0.4);
}

.btn-outline-danger {
  margin-top: 14px;
  background: transparent;
  color: var(--ember-soft);
  border: 2px solid var(--ember);
}

.data .btn-ghost {
  margin-top: 6px;
}

/* ---------- Saisie d'un nombre ---------- */

.field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.field {
  flex: 1;
  width: 100%;
  min-height: 56px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 28px; /* au moins 16 px : sinon iOS zoome sur le champ */
  font-weight: 700;
  text-align: center;
}

.field:focus {
  outline: none;
  border-color: var(--gold);
}

.field-unit {
  color: var(--text-dim);
  font-size: 18px;
}

.field-error {
  min-height: 1.4em;
  margin-top: 6px;
  color: var(--ember-soft);
  font-size: 14px;
}
