:root {
  --bg: #000;
  --fg: #d4d4d4;
  --dim: #7a7a7a;
  --line: #262626;
  --neon: #e4ff1a;
  --neon-soft: rgba(228, 255, 26, 0.12);
  --vac: #3a3a3a;
  --font: "Helvetica Neue", "Inter", "Segoe UI", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100svh;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
.hl { color: var(--neon); }

:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; border-radius: 4px; }

.wrap {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 40px);
  padding-bottom: max(clamp(16px, 3vw, 40px), env(safe-area-inset-bottom));
  gap: clamp(24px, 4vw, 48px);
}

/* ---------- Header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  text-transform: uppercase;
}

.weeknav { display: flex; align-items: center; gap: 8px; }

.weekinfo {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 170px;
  line-height: 1.2;
}
.weekinfo strong { font-size: 1.05rem; color: var(--neon); letter-spacing: 0.04em; }
.weekinfo span { font-size: 0.8rem; color: var(--dim); }

.nav-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.1rem;
  transition: border-color .2s, color .2s;
}
.nav-btn:hover { border-color: var(--neon); color: var(--neon); }

.today-btn {
  margin-left: 4px;
  padding: 0 14px;
  height: 40px;
  border-radius: 20px;
  border: 1px solid var(--neon);
  color: var(--neon);
  font-size: 0.85rem;
  font-weight: 600;
}
.today-btn:hover { background: var(--neon); color: #000; }
.today-btn[hidden] { display: none; }

/* ---------- Spruch ---------- */

.stage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 40vh;
}

.quote {
  font-weight: 800;
  font-size: clamp(2rem, 6.4vw, 5.6rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 21ch;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

.quote .line { display: block; text-wrap: balance; }
.quote .line + .line { margin-top: 0.12em; }
.quote .w { display: inline-block; will-change: transform, opacity, filter; }
.quote .hl { color: var(--neon); }

.quote-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(20px, 3vw, 36px);
}
.quote-meta {
  font-size: 0.8rem;
  color: var(--dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.replay {
  color: var(--dim);
  font-size: 1.1rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  transition: color .2s, transform .4s;
}
.replay:hover { color: var(--neon); transform: rotate(-180deg); }

/* ---------- Kalender ---------- */

.calendar { display: grid; gap: 0; }

.slots, .days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.slot-tab {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  border-bottom: 2px solid var(--line);
  transition: color .25s, border-color .25s;
}
.slot-tab[data-slot="0"] { grid-column: 1 / 4; }
.slot-tab[data-slot="1"] { grid-column: 4 / 8; }
.slot-tab:hover { color: var(--fg); }
.slot-tab.active { color: var(--neon); border-color: var(--neon); }

.days { list-style: none; }

.day {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 150px;
  padding: 14px 12px 34px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .25s;
}
.day:first-child { border-left: 1px solid var(--line); }
.day:hover { background: #0b0b0b; }
.day.in-slot { background: #090909; }

.dname {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.dname .long { display: none; }

.dnum {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-top: 6px;
  align-self: flex-start;
}
.dmonth { font-size: 0.75rem; color: var(--dim); }

.weekend .dnum { color: #9a9a9a; }

.today .dnum {
  color: #000;
  background: var(--neon);
  padding: 4px 8px 3px;
  border-radius: 8px;
  margin-left: -8px;
}
.today .dname { color: var(--neon); }

.tags { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.tag {
  font-size: 0.72rem;
  line-height: 1.25;
  padding: 3px 6px;
  border-radius: 4px;
  align-self: flex-start;
}
.tag-holiday { color: var(--neon); border: 1px solid var(--neon); }
.holiday:not(.today) .dnum { color: var(--neon); }
.vac-cont .ferien { color: transparent; }

.ferien {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  height: 18px;
  font-size: 0.68rem;
  line-height: 18px;
  padding: 0 8px;
  white-space: nowrap;
  overflow: visible;
  z-index: 1;
  color: var(--fg);
  visibility: hidden;
}
.vacation .ferien { visibility: visible; background: var(--vac); }
.vac-start .ferien { left: 8px; border-radius: 9px 0 0 9px; }
.vac-end .ferien { right: 8px; border-radius: 0 9px 9px 0; }
.vac-start.vac-end .ferien { border-radius: 9px; }
.vacation:not(.vac-end) .ferien { right: -1px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 14px;
  font-size: 0.72rem;
  color: var(--dim);
  align-items: center;
}
.lg { display: inline-block; width: 18px; height: 10px; margin-right: 6px; vertical-align: -1px; border-radius: 3px; }
.lg-holiday { border: 1px solid var(--neon); }
.lg-vacation { background: var(--vac); }
.data-note { color: var(--neon); }
.data-note[hidden] { display: none; }
.source { margin-left: auto; }
.source a { text-decoration: none; border-bottom: 1px solid var(--line); }
.source a:hover { color: var(--neon); border-color: var(--neon); }

/* ---------- Mobile: Tage als Liste ---------- */

@media (max-width: 720px) {
  .top { justify-content: center; text-align: center; }
  .brand { width: 100%; }
  .weekinfo { min-width: 0; flex: 1; }
  .weeknav { width: 100%; }

  .slots { grid-template-columns: 1fr 1fr; }
  .slot-tab[data-slot="0"], .slot-tab[data-slot="1"] { grid-column: auto; text-align: center; }

  .days { grid-template-columns: 1fr; }
  .day {
    display: grid;
    grid-template-columns: 44px 92px minmax(0, 1fr);
    grid-template-areas: "num name tags" "num month tags";
    align-items: center;
    column-gap: 10px;
    row-gap: 0;
    min-height: 0;
    padding: 10px 12px;
    border-left: 1px solid var(--line);
  }
  .day.in-slot { box-shadow: inset 3px 0 0 var(--neon); }
  .dnum { grid-area: num; margin: 0; font-size: 1.6rem; justify-self: start; }
  .today .dnum { margin-left: -6px; padding: 3px 6px 2px; }
  .dname { grid-area: name; }
  .dname .short { display: none; }
  .dname .long { display: inline; }
  .dmonth { grid-area: month; }
  .tags { grid-area: tags; margin: 0; align-items: flex-end; }
  .tags .tag { align-self: flex-end; }

  .ferien { position: static; grid-area: tags; height: auto; padding: 0; background: none !important; justify-self: end; align-self: end; }
  .vacation .ferien { display: block; color: var(--fg); font-size: 0.72rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .vac-cont .ferien { color: var(--fg); }
  .vacation { background-image: linear-gradient(to left, rgba(58, 58, 58, 0.55), transparent 60%); }
  .holiday.vacation .ferien { display: none; }

  .source { margin-left: 0; }
}

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