:root { --pw-steel: #6fb6db; }

/* Helles Theme: nur die Variablen aus style.css umdefinieren,
   damit Header, Footer, Blog und Karten automatisch mitziehen. */
html[data-theme="light"] {
  --color-bg: #f5f6fb;
  --color-bg-alt: #eaecf7;
  --color-text: #171a30;
  --color-text-muted: #565a7a;
  --color-card-bg: rgba(23, 26, 48, .045);
  --color-card-border: rgba(23, 26, 48, .13);
  --color-primary-light: #5a51db;
  --pw-steel: #2b6f96;
}
html[data-theme="light"] .blob { opacity: .18; }

/* ---------- Handy ----------
   style.css ist für breite Bildschirme gebaut. Diese Regeln gelten
   nur auf dieser Seite und räumen drei Dinge auf:
   waagerechtes Scrollen, zu viel Innenabstand, zu grosse Schrift. */
@media (max-width: 640px) {
  /* Die Blobs ragen seitlich heraus und erzeugen eine Scrollleiste */
  .bg-blobs { overflow: hidden; }

  /* Die Navigation passt in einer Zeile nicht, "Kontakt" fiel raus */
  .site-header .top-nav {
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: .92rem;
  }
  .site-header .header-inner { gap: 12px; }

  /* main trägt person-page und container, beide mit 24px Abstand.
     Zusammen bleiben von 390px nur 294px für den Inhalt übrig. */
  .person-page { padding: 28px 16px 64px; }
  .person-page.container { padding-left: 16px; padding-right: 16px; }

  .pw-section { margin: 32px auto 0; }
  .pw-section > h2 { font-size: 1.3rem; }
  .pw-intro p, .pw-timeline p:not(.pw-what) { font-size: .95rem; }

  .pw-card-head { padding: 18px; }
  .pw-card-detail-inner { padding: 0 18px 18px; }
  .pw-chevron { top: 20px; right: 16px; }

  .pw-steam { padding: 20px 16px; }
  .pw-stat { padding: 12px 6px; }
  .pw-stat b { font-size: 1.25rem; }
  .pw-facts li { font-size: .8rem; padding: 5px 12px; }
}

/* ---------- Blog: Liste ----------
   In style.css sind die Bilder auf 100x150 im Hochformat festgenagelt.
   Das hier gilt nur auf dieser Seite. */
.person-page .blog-entry {
  cursor: pointer;
  align-items: center;          /* Text mittig zum Bild, nicht oben klebend */
  transition: border-color .18s ease, transform .18s ease;
}
.person-page .blog-entry:hover,
.person-page .blog-entry:focus-visible {
  border-color: var(--color-primary-light);
  transform: translateY(-2px);
}

/* Feste Bildfläche für alle Einträge. Das Bild wird darin zentriert
   und vollständig gezeigt, statt zugeschnitten zu werden – dadurch
   sind die Karten gleich hoch und nichts fehlt. */
.person-page .blog-gallery {
  flex-shrink: 0;
  width: 190px;
  display: grid;
  gap: 6px;
  align-self: center;
}
.person-page .blog-gallery.is-multi { grid-template-columns: 1fr 1fr; }
.person-page .blog-gallery .shot {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--color-card-border);
  aspect-ratio: 4 / 3;
}
.person-page .blog-entry-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;           /* nichts abschneiden */
  border: 0;
  border-radius: 0;
}
.person-page .blog-video-thumb {
  position: relative;
  overflow: hidden;
  z-index: 1;
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  background: #101321;
  color: #fff;
  font-size: .85rem;
}
.person-page .blog-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.person-page .blog-video-thumb.has-thumbnail::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.4rem;
  text-shadow: 0 1px 5px #000;
  background: rgba(0, 0, 0, .12);
  pointer-events: none;
}
/* Unscharfe Kopie des Bildes fuellt die Raender, statt leerer Flaeche.
   Liegt hinter dem scharfen Bild, das vollstaendig sichtbar bleibt. */
.person-page .shot-bg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(16px) saturate(.7);
  transform: scale(1.2);
  opacity: .5;
  z-index: 0;
}
.person-page .blog-entry-image { position: relative; z-index: 1; }

/* Bei mehreren Fotos sind die Kacheln klein – da wirkt formatfüllend
   ruhiger als viel Leerraum. */
.person-page .blog-gallery.is-multi .blog-entry-image { object-fit: cover; }
/* Erst ab drei Bildern steht das erste ueber beide Spalten. Bei genau
   zwei sehen zwei gleich grosse Kacheln besser aus. */
.person-page .blog-gallery.is-many .shot:first-child { grid-column: 1 / -1; }

.person-page .shot-more::after {
  content: attr(data-more);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 18, 38, .68);
  color: #f4f4fb; font-weight: 600; font-size: 1.1rem;
}

.person-page .blog-entry-body { align-self: center; }
.person-page .blog-entry-content {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}
.pw-more { margin: 8px 0 0; font-size: .85rem; color: var(--color-primary-light); font-weight: 500; }

/* Ersatzbild ist freigestellt: ohne Kasten und Rahmen */
.person-page .shot.has-fallback { background: transparent; border-color: transparent; }

@media (max-width: 600px) {
  .person-page .blog-entry { flex-direction: column; align-items: stretch; }
  .person-page .blog-gallery { width: 100%; }
  .person-page .blog-gallery .shot { aspect-ratio: 16 / 9; }
}

/* ---------- Reaktionen ---------- */
.pw-react { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pw-react button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font: inherit;
  font-size: .95rem;
  line-height: 1.2;
  border-radius: 999px;
  border: 1px solid var(--color-card-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.pw-react button:hover { border-color: var(--color-primary-light); }
.pw-react button:active { transform: scale(.94); }
.pw-react button.mine {
  border-color: var(--color-primary);
  background: rgba(108, 99, 255, .14);
  color: var(--color-text);
}
.pw-react .num { font-size: .8rem; font-variant-numeric: tabular-nums; }
/* Zahl erst zeigen, wenn es etwas zu zeigen gibt */
.pw-react .num:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .pw-react button { transition: none; }
  .pw-react button:active { transform: none; }
}
/* ---------- Blog: Detailansicht ---------- */
/* Browser ohne dialog-Unterstützung behandeln das Element wie einen
   normalen Kasten und würden es dauerhaft anzeigen. Deshalb explizit
   ausblenden, solange es nicht geöffnet ist. */
.pw-modal:not([open]) { display: none; }

.pw-modal {
  position: relative;
  width: min(1000px, 94vw);
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  color: var(--color-text);
  overflow: hidden;
}
.pw-modal::backdrop { background: rgba(5, 7, 18, .82); backdrop-filter: blur(3px); }
.pw-modal-inner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); max-height: 92vh; }

.pw-shot { position: relative; background: #05070f; display: flex; align-items: center; justify-content: center; min-height: 0; }
.pw-shot img, .pw-shot video { width: 100%; height: 100%; max-height: 92vh; object-fit: contain; display: block; }
.pw-shot img[hidden], .pw-shot video[hidden] { display: none; }
.pw-shot video { background: #05070f; }
.pw-video-fallback { position: absolute; inset: auto 16px 16px; margin: 0; color: #fff; text-align: center; }
.pw-video-fallback p { margin: 0 0 8px; }
.pw-video-fallback a { color: #fff; }
.pw-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--color-card-border);
  background: rgba(15, 18, 38, .75); color: var(--color-text);
  font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.pw-nav:hover { background: var(--color-primary); border-color: transparent; }
.pw-nav[hidden] { display: none; }
.pw-prev { left: 12px; }
.pw-next { right: 12px; }
.pw-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.pw-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.35); }
.pw-dots span.on { background: #fff; }

.pw-text { padding: 28px 26px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.pw-text .pw-modal-date { font-size: .82rem; font-weight: 600; color: var(--color-primary-light); margin: 0; }
.pw-text h3 { font-family: var(--font-heading); font-size: 1.35rem; margin: 0; }
.pw-text .pw-modal-body { margin: 0; color: var(--color-text-muted); white-space: pre-wrap; }
#pw-modal-react { position: relative; min-height: 32px; margin-top: auto; }
#pw-modal-react .frank-reactions { left: 0; bottom: 0; }
.pw-modal > .pw-modal-reaction-badge { top: 12px; right: 58px; z-index: 3; }

.pw-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--color-card-border);
  background: rgba(15, 18, 38, .8); color: var(--color-text);
  font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.pw-close:hover { background: var(--color-primary); border-color: transparent; }

@media (max-width: 760px) {
  .pw-modal-inner { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .pw-shot img, .pw-shot video { max-height: 46vh; }
  .pw-text { padding: 20px 18px 26px; }
}

/* ---------- Theme-Umschalter ---------- */
.theme-toggle {
  display: inline-flex; 
  align-items: center;
  gap: .4rem;
  padding: 6px 14px;
  font: inherit;
  font-size: .85rem;
  line-height: 1.4;
  cursor: pointer;
  border-radius: 999px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  color: var(--color-text-muted);
}
.theme-toggle:hover { color: var(--color-text); }
html[data-theme="light"] .tt-dark { display: none; }
html[data-theme="dark"]  .tt-light { display: none; }
@media (max-width: 640px) { .theme-toggle .tt-text { display: none; } }

:focus-visible { outline: 2px solid var(--color-primary-light); outline-offset: 3px; border-radius: 6px; }

/* ---------- Abschnitte, gleiche Breite wie .person-card und .blog-list ---------- */
.pw-section { max-width: 880px; margin: 48px auto 0; }
.pw-eyebrow {
  display: block;
  font-size: .75rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-primary-light);
  margin-bottom: 6px;
}
.pw-section > h2 { font-family: var(--font-heading); font-size: 1.5rem; margin: 0 0 6px; }
.pw-lead { margin: 0 0 24px; color: var(--color-text-muted); font-size: .95rem; }
.pw-intro p { margin: 0 0 14px; }

.pw-facts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 20px 0 0; list-style: none; }
.pw-facts li {
  font-size: .85rem;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  color: var(--color-text-muted);
}

/* ---------- Werdegang ---------- */
.pw-timeline { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 2px solid var(--color-card-border); }
.pw-timeline li { position: relative; padding-bottom: 28px; }
.pw-timeline li:last-child { padding-bottom: 0; }
.pw-timeline li::before {
  content: "";
  position: absolute;
  left: -33px; top: 7px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--color-card-border);
}
.pw-timeline li.is-now::before {
  background: var(--color-primary);
  box-shadow: 0 0 0 5px rgba(108, 99, 255, .2);
}
.pw-when { display: block; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 3px; }
.pw-what { font-weight: 600; margin: 0 0 5px; }
.pw-timeline p:not(.pw-what) { margin: 0; color: var(--color-text-muted); font-size: .95rem; }

/* ---------- Interessen ---------- */
.pw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: start;   /* sonst wachsen Nachbarkarten mit */
}
.pw-card {
  border-radius: var(--radius);
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  transition: border-color .18s ease;
  overflow: hidden;
}
.pw-card:hover { border-color: var(--color-primary-light); }
.pw-card.is-open {
  border-color: var(--color-primary);
  grid-column: 1 / -1;   /* geöffnet über die volle Breite, sonst wird
                            der Text zu einer schmalen hohen Säule */
}
.pw-card.is-open .pw-card-detail-inner { max-width: 68ch; }

/* Kopf der Karte ist der Schalter */
.pw-card-head {
  display: block;
  width: 100%;
  padding: 22px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  position: relative;
}
.pw-card-head h3 { font-family: var(--font-heading); margin: 0 0 8px; font-size: 1.05rem; padding-right: 24px; }
.pw-card-head p { margin: 0; font-size: .93rem; color: var(--color-text-muted); }
.pw-icon { font-size: 1.5rem; display: block; margin-bottom: 8px; }

/* Pfeil oben rechts, dreht sich beim Öffnen */
.pw-chevron {
  position: absolute; top: 24px; right: 20px;
  width: 9px; height: 9px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  transition: transform .25s ease, border-color .18s ease;
}
.pw-card.is-open .pw-chevron {
  transform: rotate(-135deg);
  border-color: var(--color-primary-light);
}

/* Aufklappen ohne feste Höhe: 0fr auf 1fr lässt sich animieren,
   auto dagegen nicht. Das innere Element braucht overflow hidden. */
.pw-card-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
}
.pw-card.is-open .pw-card-detail { grid-template-rows: 1fr; }
.pw-card-detail > div { overflow: hidden; }
.pw-card-detail-inner { padding: 0 22px 22px; }
.pw-card-detail p { margin: 0 0 12px; font-size: .9rem; color: var(--color-text-muted); }
.pw-card-detail p:last-child { margin-bottom: 0; }

/* Datenblatt, z.B. für den Rechner */
.pw-spec { margin: 0; font-size: .88rem; }
.pw-spec > div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--color-card-border);
}
.pw-spec > div:last-child { border-bottom: none; }
.pw-spec dt { color: var(--color-text-muted); flex-shrink: 0; }
.pw-spec dd { margin: 0; text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .pw-card-detail, .pw-chevron { transition: none; }
}

/* ---------- Steam ---------- */
.pw-steam {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.pw-steam-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 22px; }
.pw-avatar { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--color-card-border); }
.pw-handle { font-family: var(--font-heading); font-weight: 600; font-size: 1.15rem; }
.pw-level { font-size: .78rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--pw-steel); color: var(--pw-steel); }
.pw-online { font-size: .78rem; color: var(--color-text-muted); }
.pw-online[data-online="true"]::before {
  content: ""; display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80; margin-right: 6px; vertical-align: middle;
}

.pw-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; background: var(--color-card-border); border-radius: 14px; overflow: hidden; }
.pw-stat { background: var(--color-bg-alt); padding: 16px 10px; text-align: center; }
.pw-stat b { display: block; font-family: var(--font-heading); font-size: 1.45rem; color: var(--pw-steel); line-height: 1.2; }
.pw-stat span { font-size: .76rem; color: var(--color-text-muted); }

.pw-subhead { margin: 26px 0 12px; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--color-text-muted); }

.pw-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.pw-games a {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-card-border);
  text-decoration: none;
  color: var(--color-text);
  transition: transform .18s ease, border-color .18s ease;
}
.pw-games a:hover { transform: translateY(-2px); border-color: var(--pw-steel); }
.pw-games img { display: block; width: 100%; aspect-ratio: 92 / 43; object-fit: cover; }
.pw-game-meta { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px 10px; font-size: .8rem; }
.pw-game-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-game-hours { color: var(--color-text-muted); white-space: nowrap; }

.pw-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.pw-bar-row { display: grid; grid-template-columns: minmax(85px, 125px) 1fr auto; align-items: center; gap: 12px; font-size: .88rem; }
.pw-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-bar-track { height: 8px; border-radius: 999px; background: var(--color-bg-alt); border: 1px solid var(--color-card-border); overflow: hidden; }
.pw-bar-fill { height: 100%; background: var(--pw-steel); border-radius: 999px; width: 0; transition: width .6s ease; }
.pw-bar-value { color: var(--color-text-muted); font-size: .82rem; white-space: nowrap; }
@media (max-width: 480px) { .pw-bar-row { grid-template-columns: 1fr auto; } .pw-bar-track { grid-column: 1 / -1; } }

.pw-recent { list-style: none; padding: 0; margin: 0; }
.pw-recent li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--color-card-border); font-size: .92rem; }
.pw-recent li:last-child { border-bottom: none; }
.pw-recent span { color: var(--color-text-muted); white-space: nowrap; }

.pw-steam-link {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
}
.pw-steam-link:hover { background: var(--color-primary-light); }
.pw-stand { margin: 14px 0 0; font-size: .78rem; color: var(--color-text-muted); }

@media (prefers-reduced-motion: reduce) {
  .pw-card, .pw-games a, .pw-bar-fill { transition: none; }
  .pw-card:hover, .pw-games a:hover { transform: none; }
}
