/* Designsprache übernommen von tracht.mv-ststefan.at */
:root {
  --gold: #C0A049;
  --gold-dark: #a3874a;
  --gold-soft: #f4eedd;
  --navy: #022646;
  --ink: #2e2e2e;
  --ink-soft: #6d6d6d;
  --line: #d9d9d9;
  --line-gold: #d8c48e;
  --footer-bg: #cccccc;
  --bg: #ffffff;
  --ok: #3f8a57;
  --off: #b5563f;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PT Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Navigation ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #eee;
  padding-top: env(safe-area-inset-top);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: .9rem 1rem .7rem;
  display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem 2.2rem;
}
.nav-inner a {
  color: var(--ink); text-decoration: none; font-size: .9rem;
  padding-top: .55rem; border-top: 2px solid var(--line);
  min-width: 70px; text-align: center;
}
.nav-inner a:hover { border-top-color: var(--gold-dark); }
.nav-inner a.active { border-top-color: var(--gold); font-weight: 700; }
@media (max-width: 560px) {
  .nav-inner { gap: .4rem .9rem; }
  .nav-inner a { min-width: auto; font-size: .82rem; }
}

/* ---------- Kopf ---------- */
.brand { text-align: center; padding: 1.1rem 1rem 0; }
.brand .logo { width: min(190px, 50vw); height: auto; display: block; margin: 0 auto; }

main { max-width: 620px; margin: 0 auto; padding: .9rem 1rem 0; }
.page-title {
  color: var(--navy); font-size: clamp(1.35rem, 4vw, 2.1rem);
  font-weight: 700; letter-spacing: .06em; text-align: center; line-height: 1.3;
}
.divider { width: 90px; border: 0; border-top: 1px solid #9a9a9a; margin: .6rem auto 1rem; }

/* ---------- Karten & Einstellungen ---------- */
.card {
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 2px 14px rgba(0,0,0,.07);
  padding: 1rem 1.1rem 1.2rem;
}
.settings { margin-top: 1.6rem; }
.setting { padding: .9rem 0 1.1rem; border-bottom: 1px solid var(--line-gold); }
.setting:first-child { border-top: 2px solid var(--gold); }
.setting h4 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--gold-dark); font-weight: 700; margin-bottom: .6rem;
}
.setting h4 small { text-transform: none; letter-spacing: .02em; font-weight: 400; color: var(--ink-soft); }
.hint { font-size: .85rem; color: var(--ink-soft); margin-top: .5rem; }

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit; font-size: .88rem; font-weight: 700; letter-spacing: .14em;
  cursor: pointer; padding: .7rem 1.9rem; border-radius: 0;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  transition: .18s; touch-action: manipulation; user-select: none;
}
.btn:hover { border-color: var(--gold); color: var(--gold-dark); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-primary:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: #fff; }
.btn-primary.running { background: var(--navy); border-color: var(--navy); }
.btn-wide { display: block; width: 100%; margin-top: 1rem; }
.btn:focus-visible, .toggle-wrap button:focus-visible, input:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.toggle-wrap { display: flex; flex-wrap: wrap; gap: .5rem; }
.toggle-wrap button {
  flex: 1 1 0; min-width: 3.2rem;
  font-family: inherit; font-size: .95rem; font-weight: 700; letter-spacing: .08em;
  cursor: pointer; padding: .6rem .5rem; border-radius: 0;
  background: #fff; color: var(--ink); border: 1px solid var(--line); transition: .18s;
  touch-action: manipulation;
}
.toggle-wrap button:hover { border-color: var(--gold); color: var(--gold-dark); }
.toggle-wrap button.active { background: var(--gold); border-color: var(--gold); color: #fff; }
.toggle-wrap.small { margin-top: .5rem; }
.toggle-wrap.small button { font-size: .8rem; padding: .4rem .5rem; }

.stepper { display: flex; align-items: stretch; gap: .5rem; }
.step { padding: .5rem 0; width: 3.2rem; font-size: 1.3rem; letter-spacing: 0; line-height: 1; }
.step-value {
  flex: 1; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); font-weight: 700; font-size: 1.15rem; color: var(--navy);
}
.linkish {
  background: none; border: 0; font: inherit; font-size: .82rem; color: var(--gold-dark);
  text-decoration: underline; cursor: pointer; margin-top: .45rem;
}
.check { display: flex; align-items: center; gap: .5rem; margin-top: .7rem; font-size: .92rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--gold); }

.slider { width: 100%; accent-color: var(--gold); height: 2rem; cursor: pointer; }

/* ---------- Stimmgerät ---------- */
.note-display { text-align: center; }
.note {
  font-size: clamp(4.2rem, 22vw, 6rem); font-weight: 700; line-height: 1;
  color: var(--navy); letter-spacing: .02em; min-height: 1em;
  transition: color .15s;
}
.note sub { font-size: .32em; font-weight: 400; color: var(--ink-soft); vertical-align: baseline; margin-left: .05em; }
.note.in-tune { color: var(--ok); }
.note.idle { color: #c9c9c9; }
.note-meta { font-size: 1rem; color: var(--ink-soft); margin-top: .3rem; font-variant-numeric: tabular-nums; min-height: 1.65em; }
.note-meta .sep { margin: 0 .4rem; }
#tn-cents.flat, #tn-cents.sharp { color: var(--off); font-weight: 700; }
#tn-cents.ok { color: var(--ok); font-weight: 700; }

.gauge { display: block; width: 100%; max-width: 420px; margin: .2rem auto 0; }
.gauge .tick { stroke: #b9b9b9; stroke-width: 1.5; }
.gauge .tick.major { stroke: var(--ink); stroke-width: 2; }
.gauge .tick.center { stroke: var(--navy); stroke-width: 3; }
.gauge .tick-label { font-size: 11px; fill: var(--ink-soft); text-anchor: middle; font-family: inherit; }
.gauge .zone { fill: none; stroke: var(--ok); stroke-width: 10; opacity: .35; transition: opacity .15s; }
.gauge .zone.hit { opacity: 1; }
.gauge .needle line { stroke: var(--navy); stroke-width: 3.5; stroke-linecap: round; }
.gauge .needle.idle { opacity: .2; }
.gauge .needle.in-tune line { stroke: var(--ok); }
.gauge .hub { fill: var(--gold); stroke: #fff; stroke-width: 2; }
.gauge-labels {
  display: flex; justify-content: space-between; max-width: 420px; margin: -.2rem auto 0;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft);
}
.status { text-align: center; font-size: .88rem; color: var(--ink-soft); margin-top: .6rem; min-height: 1.5em; }
.status.error { color: var(--off); }

/* ---------- Metronom ---------- */
.bpm-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.step.big { width: 3.8rem; height: 3.8rem; font-size: 1.8rem; }
.bpm-display { text-align: center; flex: 1; }
#mt-bpm {
  width: 100%; max-width: 12rem; border: 0; background: transparent; text-align: center;
  font-family: inherit; font-weight: 700; color: var(--navy);
  font-size: clamp(3.6rem, 18vw, 5rem); line-height: 1.05; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
#mt-bpm::-webkit-outer-spin-button, #mt-bpm::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bpm-unit { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .18em; color: var(--gold-dark); }
.tempo-name { text-align: center; font-style: italic; color: var(--ink-soft); margin: .2rem 0 .6rem; }

.beats { display: flex; justify-content: center; flex-wrap: wrap; gap: .55rem; margin: 1.1rem 0 1.2rem; min-height: 1.6rem; }
.beat {
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  border: 2px solid var(--line); background: #fff; transition: background .06s, border-color .06s, transform .06s;
}
.beat.accent { border-color: var(--line-gold); }
.beat.on { background: var(--gold); border-color: var(--gold); transform: scale(1.12); }
.beat.accent.on { background: var(--navy); border-color: var(--navy); }

.metro-actions { display: grid; grid-template-columns: 2fr 1fr; gap: .6rem; }
.metro-actions .btn { padding: 1rem .5rem; font-size: 1rem; }
#mt-tap.tapped { background: var(--gold-soft); border-color: var(--gold); }

/* ---------- Footer ---------- */
footer { margin-top: 3rem; }
.footer-bar { height: 12px; background: var(--gold); }
.footer-body { background: var(--footer-bg); padding: 1.8rem 1.2rem calc(1.4rem + env(safe-area-inset-bottom)); text-align: center; color: #333; }
.footer-body .f-label { font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; margin-bottom: .3rem; }
.footer-body p { font-size: .85rem; }
.footer-body a { color: #222; }
.footer-body .copyright { margin-top: 1.1rem; font-size: .72rem; color: #555; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Lautstärke ---------- */
.level-readout { display: flex; align-items: baseline; justify-content: center; gap: .4rem; }
.level-value {
  font-size: clamp(4.2rem, 22vw, 6rem); font-weight: 700; line-height: 1; color: var(--navy);
  font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right;
}
.level-value.idle { color: #c9c9c9; }
.level-value.estimate { color: #3d5874; }
.level-unit { font-size: .9rem; font-weight: 700; letter-spacing: .14em; color: var(--gold-dark); }
.cal-badge { text-align: center; font-size: .78rem; color: var(--ink-soft); margin-top: .2rem; }
.cal-badge.ok { color: var(--ok); font-weight: 700; }

.dyn-label {
  text-align: center; margin-top: .9rem; line-height: 1;
  font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700;
  font-size: clamp(2.6rem, 13vw, 3.4rem); color: var(--gold-dark); min-height: 1em;
}
.dyn-label.idle { color: #d6d6d6; }
.dyn-scale { margin: .7rem auto 0; max-width: 420px; }
.dyn-track { position: relative; height: 6px; background: linear-gradient(90deg, var(--gold-soft), var(--gold)); }
.dyn-marker {
  position: absolute; top: 50%; left: 0; width: 16px; height: 16px; border-radius: 50%;
  background: var(--navy); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3);
  transform: translate(-50%, -50%); transition: left .12s linear; opacity: 0;
}
.dyn-marker.on { opacity: 1; }
.dyn-names { display: flex; justify-content: space-between; margin: .35rem -.35rem 0; }
.dyn-names span {
  width: 2.2rem; text-align: center; font-family: Georgia, "Times New Roman", serif;
  font-style: italic; font-weight: 700; font-size: .85rem; color: var(--ink-soft);
}
.dyn-names span.current { color: var(--navy); }
.scale-source { text-align: center; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); margin-top: .3rem; }

.level-bar { position: relative; height: 14px; margin: 1.3rem auto 0; max-width: 420px; background: #f1f1f1; border: 1px solid var(--line); overflow: hidden; }
.level-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ok); transition: width .1s linear, background-color .2s; }
.level-fill.warn { background: var(--gold); }
.level-fill.loud { background: var(--off); }
.level-mark { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(0,0,0,.35); }
.level-mark.strong { width: 2px; background: var(--navy); }
.level-bar-labels { position: relative; height: 1.2rem; max-width: 420px; margin: .15rem auto 0; font-size: .7rem; color: var(--ink-soft); }
.level-bar-labels span { position: absolute; top: 0; }
.level-bar-labels span.c { transform: translateX(-50%); font-weight: 700; color: var(--navy); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 1.1rem; }
.stat { border: 1px solid var(--line); padding: .5rem .3rem; text-align: center; }
.stat-label { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-dark); font-weight: 700; }
.stat-value { display: block; font-size: 1.15rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dose { text-align: center; margin-top: .8rem; font-size: .95rem; }
.dose b { color: var(--navy); }
.dose-hint { margin-top: .5rem; padding: .55rem .7rem; font-size: .88rem; background: var(--gold-soft); border-left: 3px solid var(--gold); }
.dose-hint.loud { background: #f7e6e1; border-left-color: var(--off); }

.hint.first { margin: 0 0 .7rem; }
.two-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.two-buttons .btn { padding: .75rem .4rem; letter-spacing: .06em; }
.two-buttons .btn.done { border-color: var(--gold); background: var(--gold-soft); }
.ref-input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; font-weight: 700; color: var(--navy);
  border: 1px solid var(--line); border-radius: 0; padding: .5rem .7rem; text-align: center;
}
.stepper .btn:not(.step) { padding: .5rem 1rem; letter-spacing: .06em; }
.sub-h { margin-top: 1rem; }

details.info summary { cursor: pointer; font-weight: 700; color: var(--navy); font-size: .95rem; }
details.info p { font-size: .88rem; margin-top: .6rem; }
details.info table { width: 100%; border-collapse: collapse; margin-top: .6rem; font-size: .85rem; text-align: center; }
details.info th { font-family: Georgia, serif; font-style: italic; color: var(--gold-dark); border-bottom: 1px solid var(--line-gold); padding: .2rem 0; }
details.info td { padding: .25rem 0; font-variant-numeric: tabular-nums; }

.nav-inner a.live::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--off); margin-left: .35rem; vertical-align: middle; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
