:root {
  /* CI Musikverein Stadtkapelle Bönnigheim */
  --gold: #ea9a05;        /* Primär-Akzent */
  --gold-dark: #c07f00;
  --bordeaux: #8d141a;    /* Sekundär-Akzent */
  --ink: #1b1f29;         /* Anthrazit / Text */
  --ink-2: #4c5262;
  --ink-dim: #6b7280;
  --bg: #f7f5f0;          /* warmes Off-White */
  --surface: #ffffff;
  --surface-2: #f1efe8;
  --line: #dcdfe5;
  --radius: 14px;
  --maxw: 760px;
  --shadow: 0 2px 10px rgba(27, 31, 41, 0.06);

  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding-bottom: 84px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; }

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #000;
  border-bottom: 3px solid var(--gold);
}
.app-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 16px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-logo {
  flex: 0 0 auto;
  height: 52px;
  width: auto;
  display: block;
  transition: height 0.2s ease;
}
.app-header__text { min-width: 0; }
.app-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.6rem;
  letter-spacing: 0.2px;
  color: #fff;
}
.app-title .accent { color: var(--gold); }
.app-tagline {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--gold);
}
.app-subtitle {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: #c7cad3;
}

/* ---------- Kompakter Header beim Scrollen (mobil) ---------- */
.app-tagline,
.app-subtitle {
  transition: max-height 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
}
@media (max-width: 619px) {
  .app-header__inner {
    transition: padding 0.2s ease;
  }
  .app-header.is-condensed .app-header__inner {
    padding-top: 9px;
    padding-bottom: 9px;
  }
  .app-header.is-condensed .app-logo {
    height: 38px;
  }
  .app-header.is-condensed .app-title {
    font-size: 1.3rem;
  }
  .app-header.is-condensed .app-tagline,
  .app-header.is-condensed .app-subtitle {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
  }
}

/* ---------- View container ---------- */
.view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 16px 8px;
}

.section-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin: 24px 4px 10px;
  color: var(--ink);
}
.section-title:first-child { margin-top: 8px; }
.podium-group__title {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin: 24px 4px 2px;
  color: var(--bordeaux);
}
.podium-group__subtitle {
  margin: 0 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-dim);
}

.detail__subtitle {
  margin: -2px 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold-dark);
}

.legend__theme {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-dark);
}

.muted { color: var(--ink-dim); }

/* ---------- Segmented control ---------- */
.segmented {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin: 4px 0 8px;
}
.segmented button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 9px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-family: var(--sans);
  cursor: pointer;
}
.segmented button[aria-pressed="true"] {
  background: var(--gold);
  color: #fff;
  font-weight: 700;
}

/* ---------- Time group ---------- */
.timegroup__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 22px 4px 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.timegroup__time {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--bordeaux);
}
.timegroup__note {
  font-size: 0.78rem;
  color: var(--ink-dim);
}
.timegroup__live {
  display: inline-flex;
  align-items: center;
  color: var(--gold-dark);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.timegroup--live .timegroup__head {
  border-bottom-color: var(--gold);
}

/* ---------- Card ---------- */
.card {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  margin: 8px 0;
  box-shadow: var(--shadow);
}
.card__link {
  flex: 1 1 auto;
  min-width: 0;            /* erlaubt dem Titel das Umbrechen statt Überlaufen */
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.card__link:active { transform: scale(0.995); }
.card__thumb {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
}
.card--live {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(234, 154, 5, 0.28), var(--shadow);
}
.card__body { flex: 1; min-width: 0; }
.card__title {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--ink-dim);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.pill {
  display: inline-block;
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.pill--podium {
  color: var(--bordeaux);
  border-color: rgba(141, 20, 26, 0.25);
  background: rgba(141, 20, 26, 0.06);
}
.pill--live {
  color: #fff;
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 700;
}

/* ---------- Star toggle ---------- */
.star-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-dim);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.star-btn[aria-pressed="true"] {
  color: #fff;
  background: var(--gold);
  border-color: var(--gold);
}

/* ---------- Detail page ---------- */
.detail__hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.detail__credit {
  margin: 6px 2px 0;
  font-size: 0.7rem;
  color: var(--ink-dim);
}
.detail__title {
  margin: 16px 0 6px;
  font-size: 1.9rem;
  color: var(--ink);
}
.detail__web {
  margin: 12px 0 2px;
}
.web-link {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--surface);
  color: var(--gold-dark);
  display: grid;
  place-items: center;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.web-link:active { transform: scale(0.96); }
.detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}
.detail__desc {
  line-height: 1.6;
  color: var(--ink-2);
  font-size: 1.02rem;
}
.detail__times {
  margin: 16px 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.detail__times h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--ink); }
.detail__times ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.detail__times li { margin: 5px 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  border: 2px solid var(--gold);
  background: var(--gold);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  margin: 6px 0;
  text-decoration: none;
}
.btn--ghost {
  background: transparent;
  color: var(--gold-dark);
}
.back-link {
  display: inline-block;
  margin: 2px 0 8px;
  color: var(--bordeaux);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Plan ---------- */
.plan-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.plan-wrap svg { display: block; width: 100%; height: auto; }
.plan-marker { cursor: pointer; }
.plan-marker__dot { transition: r 0.15s ease, stroke-width 0.15s ease; }
.plan-marker:hover .plan-marker__dot,
.plan-marker:focus-visible .plan-marker__dot {
  r: 4.3;
  stroke-width: 0.9;
}
.plan-marker:focus { outline: none; }
.plan-marker:focus-visible .plan-marker__dot {
  stroke: var(--gold);
}
.legend { margin-top: 12px; }
.legend__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.legend__dot {
  width: 16px; height: 16px; border-radius: 50%;
  flex: 0 0 16px;
}
.legend__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.legend__name { font-weight: 700; color: var(--ink); }
.legend__desc { font-size: 0.8rem; color: var(--ink-dim); }
.legend__food {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: rgba(234, 154, 5, 0.14);
  color: var(--gold-dark);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.legend__food svg { width: 13px; height: 13px; }
.plan-key {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 4px 0;
  font-size: 0.82rem;
  color: var(--ink-dim);
}
.plan-key svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--gold-dark); }

/* ---------- Finale banner (prominent) ---------- */
.finale {
  position: relative;
  overflow: hidden;
  margin: 30px 0 10px;
  padding: 26px 22px;
  border-radius: 18px;
  border: 2px solid var(--gold);
  background: linear-gradient(135deg, #2a0608 0%, var(--bordeaux) 55%, #6b0f14 100%);
  color: #fff;
  text-align: center;
  box-shadow: 0 10px 28px rgba(141, 20, 26, 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.finale:active { transform: scale(0.992); }
.finale:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.finale__hint {
  position: relative;
  margin: 14px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold);
}
.finale::before,
.finale::after {
  content: "♪";
  position: absolute;
  font-size: 7rem;
  line-height: 1;
  color: rgba(234, 154, 5, 0.14);
  pointer-events: none;
}
.finale::before { top: -14px; left: 8px; }
.finale::after { bottom: -34px; right: 10px; transform: rotate(12deg); }
.finale__badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--gold);
  color: #2a0608;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.finale__title {
  position: relative;
  margin: 0;
  font-family: var(--serif);
  font-size: 1.85rem;
  line-height: 1.15;
  color: #fff;
}
.finale__when {
  position: relative;
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
}
.finale__time {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--gold);
}
.finale__loc {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f3e6d6;
}
.finale__loc::before {
  content: "·";
  margin-right: 14px;
  color: rgba(255, 255, 255, 0.4);
}
.finale__desc {
  position: relative;
  margin: 12px auto 0;
  max-width: 46ch;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
}
@media (max-width: 380px) {
  .finale__loc::before { display: none; }
}

/* ---------- Conflict warning ---------- */
.warn {
  margin: 8px 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(141, 20, 26, 0.07);
  border: 1px solid rgba(141, 20, 26, 0.4);
  color: var(--bordeaux);
  font-size: 0.85rem;
}
.warn__head { font-weight: 700; margin-bottom: 6px; }
.warn__row { margin: 6px 0; }
.warn__row:not(:last-child) {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(141, 20, 26, 0.18);
}
.warn__tip {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 0.82rem;
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-dim);
}
.empty h2 { font-family: var(--serif); color: var(--ink); }
.empty__icon { font-size: 2.5rem; color: var(--gold); }

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(27, 31, 41, 0.06);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.tabbar__item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  text-decoration: none;
  color: var(--ink-dim);
  font-size: 0.72rem;
  font-weight: 600;
}
.tabbar__item.is-active { color: var(--gold-dark); }
.tabbar__icon { font-size: 1.2rem; line-height: 1; }
.tabbar__badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(18px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bordeaux);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.tabbar__badge[hidden] { display: none; }

@media (min-width: 620px) {
  .card__thumb { width: 70px; height: 70px; flex-basis: 70px; }
}
