/* Beyblade X Wiki - Erscheinungskalender (kalender.js) */
:root {
  --kal-tt: #c8102e; --kal-tt-ink: #ffffff;
  --kal-hb: #0a55c8; --kal-hb-ink: #ffffff;
  --kal-new: #0f7a48; --kal-new-ink: #ffffff;
}
:root[data-theme="dark"] {
  --kal-tt: #ff6b81; --kal-tt-ink: #1a0406;
  --kal-hb: #7ab8ff; --kal-hb-ink: #04101f;
  --kal-new: #3fd08f; --kal-new-ink: #04160c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --kal-tt: #ff6b81; --kal-tt-ink: #1a0406;
    --kal-hb: #7ab8ff; --kal-hb-ink: #04101f;
    --kal-new: #3fd08f; --kal-new-ink: #04160c;
  }
}

.kal-glance { margin: 16px 0 6px; }
.kal-glance .rec b { font-size: 19px; overflow-wrap: anywhere; }
.kal { display: grid; gap: 26px; margin: 22px 0; }
.kal-h { margin: 0 0 12px; font: 700 22px/1.2 var(--font-display); }
.kal-month { margin: 0 0 16px; }
.kal-month h3 {
  margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint);
}
.kal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 10px; }

.kal-item {
  display: grid; grid-template-columns: 54px 76px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
}
.kal-item:hover { border-color: var(--border-strong); }
.kal-day {
  height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
}
.kal-day b { font: 700 25px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.kal-day b.m { font-size: 16px; }
.kal-day small { margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.kal-pic { width: 76px; height: 76px; border-radius: 12px; overflow: hidden; }
.kal-pic img { width: 88%; height: 88%; }
.kal-box { display: grid; place-items: center; background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--faint); }
.kal-box svg { width: 34px; height: 34px; }

.kal-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.kal-top { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 7px; }
.kal-mk { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; line-height: 1.2; }
.kal-mk.tt { background: var(--kal-tt); color: var(--kal-tt-ink); }
.kal-mk.hb { background: var(--kal-hb); color: var(--kal-hb-ink); }
.kal-code { font: 700 13px/1.2 var(--font-display); letter-spacing: .03em; }
.kal-cat { font-size: 12px; color: var(--muted); }
.kal-when { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; line-height: 1.2; color: var(--accent); background: var(--accent-soft); }
.kal-when.soon { background: var(--x); color: #fff; }
.kal-name { margin: 0; font: 700 17px/1.25 var(--font-display); overflow-wrap: anywhere; }
.kal-name a { text-decoration: none; }
.kal-name a:hover { text-decoration: underline; }
.kal-sep { color: var(--faint); font-weight: 500; }
.kal-v { margin: -3px 0 0; font-size: 13px; color: var(--muted); }
.kal-beys { display: flex; flex-wrap: wrap; gap: 5px; }
.kal-bey {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 9px 2px 2px; text-decoration: none;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font: 600 12.5px/1.2 var(--font-display);
}
.kal-bey:hover { border-color: var(--border-strong); }
.kal-bey img { flex: none; width: 26px; height: 26px; object-fit: contain; }
.kal-bey span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kal-new { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.kal-new-l {
  font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; line-height: 1.2; white-space: nowrap;
  background: var(--kal-new); color: var(--kal-new-ink);
}
.kal-new.mk .kal-new-l { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.kal-new .mc-part { padding: 2px 7px; }
.kal-new .mc-part b { font-size: 12.5px; }
.kal-link { align-self: flex-start; font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.kal-link:hover { text-decoration: underline; }
.kal-more { margin-top: 2px; }

/* Verwaltung: "Fehlt im Wiki" (Panel-Regeln für h3 und p nicht auf die Karten übertragen) */
.kal-adm .kal-month h3 { font-family: var(--font-body); line-height: 1.2; }
.kal-adm .kal-month:last-child { margin-bottom: 0; }
.kal-adm .kal-v { margin: -3px 0 0; }
.kal-adm-h { margin: 18px 0 6px; font: 700 17px/1.25 var(--font-display); }
.kal-adm .kal-beys:last-child { margin-bottom: 2px; }

/* „Neu & demnächst“ über der Bey-Liste (ndStrip() in kalender.js). Auf dem Handy wischt man seitlich, am Computer gibt es Pfeile. */
.nd { margin: 0 0 16px; }
.nd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 2px 8px; }
.nd-h { margin: 0; font: 700 16px/1.2 var(--font-display); letter-spacing: .02em; }
.nd-all { margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.nd-all:hover { text-decoration: underline; }
.nd-wrap { position: relative; }
.nd-go {
  position: absolute; top: 50%; z-index: 1; width: 34px; height: 34px; margin-top: -17px; padding: 0; cursor: pointer;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.nd-go:hover { color: var(--accent); }
.nd-go.l { left: -8px; }
.nd-go.r { right: -8px; }
.nd-go svg { width: 16px; height: 16px; }
.nd-go.l svg { transform: rotate(180deg); }
/* Pfeil nur, solange es in diese Richtung weitergeht (data-fade aus app.js); Touch-Geräte wischen */
.nd-row:not([data-fade*="l"]) ~ .nd-go.l, .nd-row:not([data-fade*="r"]) ~ .nd-go.r { display: none; }
.nd-row {
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
  overscroll-behavior-x: contain; padding: 1px;
}
.nd-row::-webkit-scrollbar { display: none; }
.nd-card {
  flex: none; width: 214px; display: flex; align-items: center; gap: 10px; padding: 8px; scroll-snap-align: start;
  text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.nd-card:hover { border-color: var(--border-strong); }
.nd-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nd-pic { flex: none; width: 64px; border-radius: 10px; overflow: hidden; }
.nd-pic img { width: 90%; height: 90%; }
.nd-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nd-top { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.nd-top time { overflow: hidden; text-overflow: ellipsis; }
.nd-b { flex: none; font-size: 10.5px; font-weight: 700; line-height: 1.25; padding: 2px 6px; border-radius: 6px; background: var(--kal-new); color: var(--kal-new-ink); }
.nd-b.soon { background: var(--x); color: #fff; }
.nd-name {
  font: 600 14px/1.2 var(--font-display); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.nd-mk { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-mk::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; vertical-align: 1px; background: var(--kal-tt); }
.nd-mk.hb::before { background: var(--kal-hb); }
@media (hover: none), (pointer: coarse) { .nd-go { display: none; } }

@media (max-width: 720px) {
  .nd { margin-bottom: 14px; }
  .nd-head { margin-bottom: 6px; }
  .nd-card { width: 196px; gap: 8px; padding: 7px; }
  .nd-pic { width: 56px; }
  .nd-name { font-size: 13.5px; }
  .kal-list { grid-template-columns: minmax(0, 1fr); }
  .kal-item { grid-template-columns: 46px 60px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .kal-day { height: 60px; }
  .kal-day b { font-size: 21px; }
  .kal-day b.m { font-size: 14px; }
  .kal-pic { width: 60px; height: 60px; }
  .kal-name { font-size: 16px; }
  .kal-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kal-glance .rec:nth-child(3) { display: none; }
}
