/* Krafttraining-Tagebuch: warm, weich, fuer den Daumen gebaut. */

@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/fraunces-v38-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/fraunces-v38-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/fraunces-v38-latin-900.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "Karla";
  src: url("/static/fonts/karla-v33-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "Karla";
  src: url("/static/fonts/karla-v33-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "Karla";
  src: url("/static/fonts/karla-v33-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  font-style: normal;
}

:root {
  --sand: #f6eee6;
  --cream: #fffaf4;
  --ink: #2b1f26;
  --muted: #7c6b73;
  --plum: #5c2f4e;
  --berry: #c1436b;
  --berry-soft: #f7e3e9;
  --moss: #4f7c52;
  --moss-soft: #e4efe2;
  --amber: #e2932f;
  --line: #e8dbd0;
  --shadow: 0 1px 2px rgba(60, 32, 48, 0.06), 0 10px 24px rgba(60, 32, 48, 0.07);
  --radius: 22px;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.wrap {
  width: min(100% - 1.6rem, 34rem);
  margin: 0 auto;
  padding: 1.1rem 0 6.5rem;
}

/* ---------------------------------------------------------------- Typografie */

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(1.75rem, 7vw, 2.3rem); font-weight: 900; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 700; }

p { margin: 0.5rem 0; }

a { color: var(--berry); }

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--plum);
  opacity: 0.75;
  margin: 0 0 0.3rem;
}

.lead { color: var(--muted); margin-top: 0.35rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------------------------------------------------------------- Kopfzeile */

.topbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 0 0.4rem;
}
.topbar .back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid var(--line);
  color: var(--plum);
  text-decoration: none;
  font-size: 1.2rem;
  line-height: 1;
}
.topbar .title { font-family: var(--display); font-weight: 700; font-size: 1.1rem; }

/* ---------------------------------------------------------------- Karten */

.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem;
  margin: 1rem 0;
}
.card.tight { padding: 0.9rem 1rem; }
section.card { scroll-margin-top: 1rem; }
.card h2 { margin-bottom: 0.2rem; }

.stack > * + * { margin-top: 1rem; }

.row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.row.between { justify-content: space-between; }

/* ---------------------------------------------------------------- Knoepfe */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--berry);
  color: #fff;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; }
.btn.big { min-height: 60px; font-size: 1.12rem; }
.btn.ghost {
  background: var(--cream);
  color: var(--plum);
  border-color: var(--line);
}
.btn.quiet {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  min-height: 44px;
  padding: 0.4rem 0.6rem;
  font-weight: 500;
  font-size: 0.9rem;
}
.btn.plum { background: var(--plum); }

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- Formulare */

label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.25rem; }

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
}
textarea { min-height: 5.5rem; resize: vertical; }

.field + .field { margin-top: 0.8rem; }
.field-row { display: flex; gap: 0.7rem; }
.field-row .field { flex: 1; margin-top: 0; }

.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-weight: 500;
}
.check input { width: 1.35rem; height: 1.35rem; accent-color: var(--berry); }

/* ---------------------------------------------------------------- Die Scheibe */

.plate-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 0.8rem 0 0.4rem;
}
.plate {
  width: 8.2rem;
  height: 8.2rem;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #fff 40%, var(--berry-soft) 41%);
  border: 6px solid var(--berry);
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: var(--shadow);
}
.plate .kg {
  font-family: var(--display);
  font-weight: 900;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--plum);
  font-variant-numeric: tabular-nums;
}
.plate .unit {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.2rem;
}
.step {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--plum);
  font-size: 1.7rem;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.plate-input {
  width: 5.5rem;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
}

.reps-row { display: flex; align-items: center; justify-content: center; gap: 0.7rem; }
.reps-row .step { width: 48px; height: 48px; font-size: 1.4rem; }

/* ---------------------------------------------------------------- Abzeichen */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--berry-soft);
  color: var(--plum);
}
.badge.up { background: var(--moss-soft); color: var(--moss); }
.badge.warn { background: #fdeedd; color: #96591a; }
.badge.plain { background: var(--sand); color: var(--muted); }

/* ---------------------------------------------------------------- Listen */

.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.list a.item,
.list .item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 56px;
  padding: 0.7rem 0;
  color: inherit;
  text-decoration: none;
}
.item .name { font-weight: 700; }
.item .meta { color: var(--muted); font-size: 0.88rem; }
.chev { color: var(--berry); font-size: 1.2rem; }

.sets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}
.set-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.5rem 0.3rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.set-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  min-width: 28px;
  min-height: 28px;
}

/* ---------------------------------------------------------------- Verlauf */

.spark { width: 100%; height: auto; display: block; margin: 0.6rem 0 0.2rem; }
.spark polyline { fill: none; stroke: var(--berry); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: var(--plum); }

/* ---------------------------------------------------------------- Fussnavigation */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 250, 244, 0.96);
  border-top: 1px solid var(--line);
  padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
  backdrop-filter: blur(8px);
  z-index: 20;
}
.tabbar ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  width: min(100% - 1rem, 34rem);
  display: flex;
  justify-content: space-between;
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 60px;
  min-height: 50px;
  padding: 0.3rem 0.2rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tabbar a.on { color: var(--berry); }
.tabbar svg { width: 24px; height: 24px; }

/* ---------------------------------------------------------------- Kleinigkeiten */

.empty {
  text-align: center;
  color: var(--muted);
  padding: 1.4rem 0.6rem;
}

details.adder > summary {
  list-style: none;
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--berry);
}
details.adder > summary::-webkit-details-marker { display: none; }
details.adder[open] > summary { margin-bottom: 0.6rem; }

hr.soft { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

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