@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&family=Nunito:wght@400;600;700;800&display=swap');

/* ---------- Design-Tokens: einheitliche Skala für Ecken-Radius & Schatten ----------
   Vorher waren im Projekt ~13 verschiedene border-radius-Werte (6-32px) und über 25
   fast identische box-shadow-Varianten im Einsatz, gewachsen über viele Feature-Sessions.
   Diese Tokens fassen das auf eine feste Skala zusammen - Kreise (50%) und Pill-Formen
   (999px) bleiben bewusst außen vor, da sie eine eigene, formbedingte Bedeutung haben. */
:root {
  --radius-xs: 8px;    /* kleine Elemente: Badges, Tags, Chips */
  --radius-sm: 12px;   /* Inputs, kleine Buttons, Zeilen */
  --radius-md: 16px;   /* Standard-Karten (Item-Kacheln, Chat-Bubbles, Panels) */
  --radius-lg: 20px;   /* größere Karten, Modals, Formularblöcke */
  --radius-xl: 24px;   /* große Container: Sidebar-Boxen, Login-Karte, Sektionen */

  --shadow-flat: none;
  --shadow-xs: 0 2px 6px rgba(0,0,0,0.15);                   /* kleine Badges/Icons */
  --shadow-sm: 0 3px 10px -4px rgba(150,110,200,0.4);        /* kleine schwebende Buttons */
  --shadow-card: 0 4px 14px -8px rgba(150,110,200,0.3);      /* Standard-Kartenschatten (hell) */
  --shadow-card-dark: 0 4px 14px -8px rgba(60,10,45,0.3);    /* Standard-Kartenschatten (dunkle Flächen) */
  --shadow-panel: 0 6px 20px -10px rgba(150,110,200,0.3);    /* größere Panels (Details/Match-Karten) */
  --shadow-float: 0 10px 35px -10px rgba(150,110,200,0.35);  /* schwebende Boxen (Sidebar, FAQ) */
  --shadow-modal: 0 14px 34px -10px rgba(30,5,20,0.6);       /* Modals/Popovers auf dunklem Grund */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  background: var(--my-theme-bg,
    radial-gradient(circle at 8% 10%, rgba(255,111,181,0.32) 0%, transparent 40%),
    radial-gradient(circle at 90% 8%, rgba(154,228,208,0.35) 0%, transparent 42%),
    radial-gradient(circle at 85% 85%, rgba(255,159,124,0.28) 0%, transparent 45%),
    radial-gradient(circle at 10% 88%, rgba(201,166,232,0.35) 0%, transparent 42%),
    linear-gradient(135deg, #FFF6FA 0%, #F6E9FB 50%, #FBEAF1 100%));
  min-height: 100vh;
  color: #333;
  --pinkblack-strong: radial-gradient(120% 140% at 50% -20%, #7a2354 0%, #4a1638 40%, #1c0c1a 75%, #120810 100%);
  --pinkblack-soft: linear-gradient(160deg, #5c2a4a 0%, #3a1830 60%, #241220 100%);
}

/* Die --chrome-* Variablen (Tauschbörse-Karten, Suchfelder, Admin-Kacheln, Bestenliste/Feedback/
   Seltenste-Blätter-Panels ohne eigenes Profil-Theme) kommen jetzt direkt als Inline-Style auf
   <body> von chrome_style() in includes.php - dort wird die eigene helle Profilfarbe verwendet,
   damit diese Bereiche nicht mehr flach weiß sind, sich aber auch nicht "dunkel" von den übrigen
   (immer hellen) Menüpunkten/Icons abheben. */

/* Dunkles schimmerndes Pink-Schwarz - für die "Hero"-Flächen des Haustiers */
.pet-shimmer { position: relative; overflow: hidden; }
.pet-shimmer::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,182,224,0.18) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: petShimmerSweep 3.5s ease-in-out infinite;
}
@keyframes petShimmerSweep {
  0% { background-position: 130% 0; }
  100% { background-position: -30% 0; }
}

.page, .auth-wrap { max-width: 480px; margin: 0 auto; padding: 40px 16px; }

h1, h2, .login-logo-text { font-family: 'Baloo 2', sans-serif; }

/* ---------- Layout mit Sidebar (Grid, damit FAQ auf Mobile ans Ende wandert) ---------- */
.layout {
  display: grid;
  grid-template-columns: 1fr 230px;
  grid-template-areas: "main sidebar";
  align-items: start;
  gap: 24px;
  max-width: 940px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}
.layout .page { grid-area: main; min-width: 0; max-width: none; padding: 0; margin: 0; }

/* Sammler:innen-Box + FAQ-Box teilen sich EINE sticky Spalte, damit sie sauber
   untereinander bleiben (statt als getrennte Grid-Zeilen, die sich mit hohem
   Hauptinhalt überlappen/verschieben konnten). */
.sidebar-col { grid-area: sidebar; position: sticky; top: 20px; display: flex; flex-direction: column; gap: 24px; max-height: calc(100vh - 40px); overflow-y: auto; }

.sammler-box, .faq-box {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-float);
  flex-shrink: 0;
}
.faq-box h3 { margin: 0 0 12px; color: var(--theme-heading, #5B3E96); font-size: 16px; }
.sammler-box h3 { margin: 0 0 8px; color: var(--theme-heading, #5B3E96); font-size: 12px; font-weight: 700; opacity: 0.75; }
.sb-list { display: flex; flex-direction: column; gap: 4px; max-height: 42vh; overflow-y: auto; }
.sb-empty { font-size: 12px; color: var(--theme-muted, #bbb); margin: 4px 0 0; }
.sb-user {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: var(--radius-sm);
  text-decoration: none; color: inherit;
}
.sb-user:hover { background: var(--theme-card, #F8F3FD); }
.sb-user.sb-me { background: var(--theme-card, #F3ECFE); }
.sb-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--theme-card, #F3ECFE); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px; position: relative;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%; position: absolute; bottom: -1px; right: -1px; border: 2px solid #fff;
}
.status-dot.online { background: #4CAF6D; }
.status-dot.offline { background: #ccc; }
.sb-name { font-weight: 700; font-size: 13px; color: var(--theme-text, #555); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-count { margin-left: auto; color: var(--theme-muted, #999); font-size: 11px; flex-shrink: 0; }

/* Offline-Liste: eingeklappt, nimmt keinen Platz weg bis man draufklickt */
.offline-toggle { margin-top: 10px; }
.offline-toggle summary {
  font-size: 12px; font-weight: 800; color: var(--theme-muted, #999); cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 5px;
}
.offline-toggle summary::-webkit-details-marker { display: none; }

/* Globaler Chat direkt im Sammler:innen-Feld */
.chat-box { margin-top: 12px; border-top: 1px solid rgba(150,110,200,0.2); padding-top: 10px; }
.chat-box summary {
  font-size: 13px; font-weight: 800; color: var(--theme-link, #8A5FC7); cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 5px;
}
.chat-box summary::-webkit-details-marker { display: none; }
.chat-unread-badge {
  display: none; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  background: #F3ECFE; color: #8A5FC7; margin-left: auto;
}
.chat-unread-badge.show { display: inline-block; }
.chat-unread-badge.mentioned { background: #FDE2E2; color: #C23F3F; }
.chat-box .chat-thread { max-height: 200px; margin-top: 10px; }

/* FAQ-Box */
.faq-item { margin-bottom: 8px; }
.faq-item summary {
  font-size: 12px; font-weight: 800; color: var(--theme-heading, #5B3E96); cursor: pointer; list-style: none; padding: 4px 0;
  display: flex; align-items: center; gap: 5px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--theme-muted, #888); }
.faq-item a { color: var(--theme-link, #8A5FC7); font-weight: 800; text-decoration: none; }
.faq-item a:hover { text-decoration: underline; }

/* Kontextueller FAQ-Hinweis direkt beim Upload */
.faq-hint-link {
  font-size: 12px; font-weight: 800; color: #8A5FC7; text-decoration: none; margin-top: 10px; display: inline-block;
}
.upload-report-link {
  font-size: 12px; font-weight: 800; color: #B4293F; text-decoration: none; margin: 10px 0 0 14px; display: inline-block;
}
.faq-hint-content {
  display: none; margin-top: 8px; padding: 10px 12px; background: #FAF6FE; border-radius: var(--radius-sm);
  font-size: 12px; color: #888; line-height: 1.5;
}
.faq-hint-content.open { display: block; }
.faq-hint-content a { color: #8A5FC7; font-weight: 800; text-decoration: none; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; grid-template-areas: "sidebar" "main"; gap: 18px; }
  .sidebar-col { position: static; max-height: none; overflow-y: visible; }
  .sb-list { max-height: none; flex-direction: row; flex-wrap: wrap; }
  .sb-user { flex-direction: column; text-align: center; width: 72px; }
  .sb-count { margin-left: 0; }
  .faq-box { margin-top: 18px; }
}

/* ---------- Hinweis-/Fehlermeldung (z.B. Foto-Upload) ---------- */
.flash-error {
  background: #FFF0F0; border: 2px solid #F3B6C2; color: #B4293F;
  padding: 12px 16px; border-radius: var(--radius-md); font-size: 13px; font-weight: 700;
  margin-bottom: 18px; line-height: 1.5;
}

/* ---------- Admin-Testmodus-Banner ---------- */
.impersonate-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #2D2640; color: #fff; padding: 10px 14px; border-radius: var(--radius-md);
  font-size: 12px; font-weight: 700; margin-bottom: 18px;
}
.impersonate-banner b { color: #FFD966; }
.impersonate-banner button {
  border: none; background: rgba(255,255,255,0.15); color: #fff; font-weight: 800;
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: 11px; cursor: pointer; flex-shrink: 0;
}
.impersonate-banner button:hover { background: rgba(255,255,255,0.25); }

/* ---------- Patbox: mitwanderndes Haustier ohne Zimmer, einklappbar ---------- */
.patbox-toggle {
  position: fixed; bottom: 30px; right: 6px; z-index: 41; width: 32px; height: 32px;
  border-radius: 50%; border: none; background: #fff; box-shadow: 0 3px 10px -4px rgba(0,0,0,0.35);
  font-size: 15px; cursor: pointer; opacity: 0.75;
}
.patbox-toggle:hover { opacity: 1; }
.patbox-wrap {
  width: 56px; z-index: 40; cursor: pointer; opacity: 0.9;
  transition: left 0.9s cubic-bezier(.4,0,.2,1), top 0.9s cubic-bezier(.4,0,.2,1), opacity 0.2s ease;
}
.patbox-wrap:hover { opacity: 1; }
.patbox-wrap img { width: 100%; display: block; filter: drop-shadow(0 5px 5px rgba(0,0,0,0.3)); image-rendering: pixelated; }
.patbox.collapsed .patbox-wrap { display: none; }
@media (max-width: 640px) {
  .patbox-wrap { width: 46px; }
}

/* ---------- PWA-Installations-Banner ---------- */
.pwa-banner {
  display: flex; align-items: center; gap: 10px; background: #E3F2FD; border: 2px solid #A8D4F5;
  color: #1565C0; padding: 12px 14px; border-radius: var(--radius-md); font-size: 13px; font-weight: 700;
  line-height: 1.5; margin-bottom: 18px;
}
.pwa-icon { font-size: 18px; flex-shrink: 0; }
.pwa-text { flex: 1; }
.pwa-ios-icon { display: inline-block; }
.pwa-install-btn {
  border: none; background: #1565C0; color: #fff; font-weight: 800; padding: 8px 16px;
  border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; flex-shrink: 0;
}
.pwa-install-btn:hover { background: #0D47A1; }
.pwa-close {
  border: none; background: rgba(255,255,255,0.6); color: #1565C0; border-radius: 50%;
  width: 24px; height: 24px; flex-shrink: 0; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pwa-close:hover { background: rgba(255,255,255,0.9); }

/* ---------- Admin-Ankündigungs-Banner ---------- */
.announcement-banner {
  display: flex; align-items: flex-start; gap: 12px; background: #FFF6DA; border: 2px solid #F5D98A;
  color: #7A5300; padding: 12px 14px; border-radius: var(--radius-md); font-size: 13px; font-weight: 700;
  line-height: 1.5; margin-bottom: 18px;
}
.announcement-text { flex: 1; }
.announcement-close {
  border: none; background: rgba(255,255,255,0.6); color: #7A5300; border-radius: 50%;
  width: 24px; height: 24px; flex-shrink: 0; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.announcement-close:hover { background: rgba(255,255,255,0.9); }

/* ---------- Top-Navigation ---------- */
.topnav { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.topnav a {
  background: #fff; color: #8A5FC7; font-weight: 800; font-size: 13px; padding: 9px 14px;
  border-radius: var(--radius-md); text-decoration: none; box-shadow: var(--shadow-card);
}
.topnav a.active { background: #B892E0; color: #fff; }
.jump-nav { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; margin: 0 0 18px; }
.jump-nav a {
  flex-shrink: 0; font-size: 13px; font-weight: 700; padding: 7px 14px;
  border-radius: var(--radius-lg); background: #F8F1FE; color: #8A5FC7;
  text-decoration: none; white-space: nowrap; scroll-behavior: smooth;
}
.jump-nav a:hover { background: #EFE0FB; }
.nav-icon-link {
  background: #fff; padding: 9px 12px !important; font-size: 15px; position: relative;
}
.nav-badge {
  position: absolute; top: -4px; right: -4px; background: #FF4F6D; color: #fff;
  font-size: 10px; font-weight: 800; border-radius: 999px; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1;
}
.version-badge {
  margin-left: auto; align-self: center; font-size: 10px; font-weight: 800; color: #bbb;
  background: #fff; padding: 5px 10px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}

/* Footer (Impressum/Datenschutz/AGB) */
.site-footer {
  max-width: 480px; margin: 36px auto 10px; padding: 18px 16px 0;
  border-top: 2px solid rgba(150,110,200,0.15);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.footer-link { color: #8A5FC7; font-size: 12px; font-weight: 700; text-decoration: none; }
.footer-link:hover { text-decoration: underline; }
.footer-disabled { color: #bbb; cursor: default; }
.footer-disabled:hover { text-decoration: none; }
.footer-row { display: flex; gap: 16px; }

/* Datenschutz-/AGB-Seiten */
.legal-page { max-width: 640px; margin: 0 auto; padding: 40px 16px; }
.legal-text h3 { color: #5B3E96; font-size: 15px; margin: 22px 0 6px; }
.legal-text h3:first-child { margin-top: 0; }
.legal-text p, .legal-text li { color: #555; font-size: 14px; line-height: 1.6; }
.legal-text ul { margin: 6px 0; padding-left: 20px; }
.legal-text a { color: #8A5FC7; font-weight: 700; text-decoration: none; }
.legal-text a:hover { text-decoration: underline; }
.legal-text code { background: #F3ECFE; color: #8A5FC7; padding: 1px 6px; border-radius: var(--radius-xs); font-size: 12px; }


/* Auth */
.auth-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card {
  background: #fff; border-radius: var(--radius-xl); padding: 32px; width: 100%;
  box-shadow: var(--shadow-float);
}
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-logo-badge {
  width: 84px; height: 84px; border-radius: var(--radius-lg);
  box-shadow: 0 10px 24px -8px rgba(184,146,224,.6);
  object-fit: cover;
}
.login-logo-text {
  font-family: 'Baloo 2', sans-serif; font-size: 21px; font-weight: 700; text-align: center;
  background: linear-gradient(135deg, #FF6FB5, #8A5FC7);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-card h2 { color: #5B3E96; margin: 0 0 16px; }
.auth-card form { display: flex; flex-direction: column; gap: 10px; }
.auth-card input {
  padding: 12px 14px; border-radius: var(--radius-sm); border: 2px solid #E4D3F5; font-size: 15px; outline: none;
}
.auth-card button {
  margin-top: 6px; padding: 12px; border: none; border-radius: var(--radius-sm);
  background: #B892E0; color: #fff; font-weight: 800; font-size: 15px; cursor: pointer;
}
.auth-card .switch { margin-top: 14px; font-size: 14px; color: #777; }
.auth-card .switch a { color: #8A5FC7; font-weight: 700; text-decoration: none; }
.consent-check {
  display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: #777;
  line-height: 1.4; margin-top: 4px; cursor: pointer;
}
.invite-hint { font-size: 11px; color: #aaa; margin: -4px 0 2px; font-weight: 600; }
.consent-check input[type=checkbox] { margin-top: 2px; flex-shrink: 0; }
.consent-check a { color: #8A5FC7; font-weight: 700; text-decoration: none; }
.consent-check a:hover { text-decoration: underline; }
.error { color: #C2578F; font-weight: 700; font-size: 14px; }

/* Profil */
.profile-card {
  background: var(--theme-bg, #fff); border-radius: var(--radius-xl); padding: 28px; margin-bottom: 32px;
  box-shadow: var(--shadow-float);
  position: relative;
}
.profile-card.has-freeform-pet { min-height: 420px; }
.profile-spruch { color: #776a72; font-size: 14px; margin: 4px 0 8px; }

/* Virtuelles Haustier - eigenes Zimmer-Fenster, oben im Profil-Kästchen */
.profile-top-icons { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 4px; position: relative; }

/* Geheimnisvoller Schrank neben dem Profilbild - Teaser für ein kommendes Feature */
.schrank-wrap { position: relative; flex-shrink: 0; align-self: center; }
.schrank-icon-btn {
  border: none; background: none; padding: 0; cursor: pointer; width: 90px; display: block;
  transition: transform 0.15s ease;
}
.schrank-icon-btn img { width: 100%; height: auto; display: block; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.25)); }
.schrank-icon-btn:hover { transform: scale(1.06) rotate(-2deg); }
.schrank-speech {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(6px);
  background: #fff; color: #5B3E96; font-size: 12px; font-weight: 700; line-height: 1.4;
  padding: 10px 14px; border-radius: var(--radius-md); box-shadow: var(--shadow-float);
  width: max-content; max-width: 200px; text-align: center; z-index: 5;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
}
.schrank-speech::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: #fff;
}
.schrank-speech.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* Auf breiteren Screens ist rechts neben Avatar/Name noch viel Platz frei - dort darf der
   Schrank deutlich größer als schwebendes Deko-Element sitzen, statt winzig neben dem Avatar. */
@media (min-width: 700px) {
  .schrank-wrap { position: absolute; top: 10px; right: 24px; width: 190px; align-self: auto; }
  .schrank-icon-btn { width: 100%; }
}
.profile-top-icons .avatar { flex-shrink: 0; }
.pet-dock-freeform { max-width: 340px; margin: 14px auto 6px; padding-top: 14px; border-top: 1px solid rgba(0,0,0,0.06); position: relative; }
.pet-dock-freeform-active { z-index: 20; max-width: none; margin: 0; }
.pet-dock-drag-handle, .pet-dock-reset-btn {
  position: absolute; top: -8px; z-index: 6; border: none; border-radius: 50%;
  width: 20px; height: 20px; font-size: 10px; cursor: pointer; touch-action: none;
  background: rgba(255,255,255,0.7); color: #7a2354; box-shadow: 0 2px 6px -3px rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center; opacity: 0.75;
}
.pet-dock-drag-handle:hover, .pet-dock-reset-btn:hover { opacity: 1; }
.pet-dock-drag-handle { left: -6px; cursor: grab; }
.pet-dock-drag-handle:active { cursor: grabbing; }
.pet-dock-reset-btn { right: -6px; }
.pet-dock-resize-handle {
  position: absolute; bottom: 2px; right: 2px; width: 16px; height: 16px; z-index: 6;
  cursor: nwse-resize; touch-action: none; opacity: 0.55;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.8) 50%);
  border-radius: 0 0 var(--radius-xs) 0;
}
.pet-dock-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  cursor: pointer; list-style: none; padding: 8px 12px; border-radius: var(--radius-md);
  background: var(--pinkblack-strong); box-shadow: 0 4px 14px -6px rgba(60,10,45,0.55);
}
.pet-dock-summary::-webkit-details-marker { display: none; }
.pet-dock-summary::before { content: '▸'; color: #FFC2E4; font-size: 11px; margin-right: 2px; transition: transform 0.15s ease; }
.pet-dock-details[open] > .pet-dock-summary::before { transform: rotate(90deg); }
.pet-dock-summary-name { font-weight: 800; color: #FFE3F2; font-family: 'Baloo 2'; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.pet-dock-summary-name .pet-level-badge { background: rgba(255,255,255,0.18); color: #FFD9EC; }
.pet-dock-summary-stats { display: flex; gap: 8px; font-size: 11px; font-weight: 700; color: #FFD9EC; flex-shrink: 0; }
.pet-dock-details[open] > .pet-dock-mini { margin-top: 10px; }
.pet-dock-mini { position: relative; }
.pet-dock-mini-top { max-width: 340px; margin: 0 auto 16px; }
.pet-dock-freeform-active .pet-dock-mini-top { max-width: none; margin: 10px 0 0; }
.pet-dock-readonly .pet-dock-mini-sprite { cursor: default; }
.pet-dock-mini-room { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.pet-dock-mini-room-img { width: 100%; display: block; }
.pet-dock-mini-sprite {
  position: absolute; top: 48%; left: 46%; transform: translate(-50%,-50%); width: 34%; z-index: 1;
  cursor: pointer; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.3));
  transition: transform 0.15s ease, top 1.1s ease-in-out, left 1.1s ease-in-out;
  image-rendering: pixelated;
}
.pet-dock-mini-room:active .pet-dock-mini-sprite { transform: translate(-50%,-50%) scale(0.9); }
.pet-dock-mini-sprite.pose-happy { width: 23%; }
.pet-dock-mini-sprite.visitor-sprite { cursor: default; pointer-events: none; opacity: 0.95; z-index: 0; }
.pet-dock-mini-room:active .visitor-sprite { transform: translate(-50%,-50%); }
.pet-dock-mini-name { font-weight: 800; color: #5B3E96; font-family: 'Baloo 2'; font-size: 13px; text-align: center; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pet-level-badge { background: #F3ECFE; color: #8A5FC7; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: var(--radius-xs); }
.pet-xp-row { margin: 8px 20px 0; display: flex; align-items: center; gap: 8px; }
.pet-xp-bar { flex: 1; height: 7px; background: #F3ECFE; border-radius: 999px; overflow: hidden; }
.pet-xp-fill { height: 100%; background: linear-gradient(90deg,#FFD98A,#FFB84D); border-radius: 999px; }
.pet-xp-label { font-size: 10px; font-weight: 700; color: #B79ADD; flex-shrink: 0; }
.pet-dock-mini-stats { display: flex; justify-content: center; gap: 10px; font-size: 11px; font-weight: 700; color: #8A5FC7; margin-top: 5px; }

.pet-hotspot {
  position: absolute; transform: translate(-50%,-50%); width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7); background: rgba(255,255,255,0.35); font-size: 14px;
  cursor: pointer; z-index: 2; transition: background 0.2s ease;
}
.pet-hotspot:hover, .pet-hotspot:active { background: rgba(255,255,255,0.7); }
.pet-delete-btn {
  position: absolute; top: 8px; right: 8px; z-index: 3; border: none; background: rgba(255,255,255,0.5);
  color: #C2578F; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; cursor: pointer; opacity: 0.8;
}
.pet-delete-btn:hover { background: rgba(255,255,255,0.9); opacity: 1; }
.pet-info-btn {
  position: absolute; top: 8px; left: 8px; z-index: 3; border: none; background: rgba(255,255,255,0.5);
  color: #8A5FC7; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; cursor: pointer; font-weight: 800; opacity: 0.8;
}
.pet-info-btn:hover { background: rgba(255,255,255,0.9); opacity: 1; }
.pet-hotspot-msg {
  position: absolute; bottom: 8px; left: 8px; right: 8px; z-index: 4;
  background: rgba(255,255,255,0.97); color: #5B3E96; font-size: 11px; font-weight: 700;
  padding: 7px 9px; border-radius: var(--radius-sm); text-align: center; opacity: 0; transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease; pointer-events: none;
}
.pet-hotspot-msg.show { opacity: 1; transform: translateY(0); }

.pet-info-popup {
  display: none; position: absolute; top: 10px; left: 10px; right: 10px; z-index: 6;
  background: #fff; border-radius: var(--radius-md); padding: 14px; box-shadow: 0 14px 30px -8px rgba(0,0,0,0.4);
}
.pet-info-popup.show { display: block; }
.pet-info-popup-title { font-weight: 800; color: #5B3E96; font-size: 13px; margin-bottom: 8px; }
.pet-info-popup ul { margin: 0; padding-left: 18px; }
.pet-info-popup li { font-size: 11px; color: #666; margin-bottom: 5px; line-height: 1.4; }
.pet-info-popup-close {
  position: absolute; top: 8px; right: 8px; border: none; background: #F3ECFE; color: #8A5FC7;
  width: 22px; height: 22px; border-radius: 50%; font-size: 11px; cursor: pointer;
}

.pet-xp-toast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: #2D2640; color: #FFD966; font-weight: 800; font-size: 12px; padding: 8px 16px;
  border-radius: var(--radius-sm); box-shadow: 0 6px 18px -6px rgba(0,0,0,0.4); transition: opacity 0.4s ease, top 0.4s ease;
}
.pet-xp-toast.fade-out { opacity: 0; top: -20px; }
.pet-visitor-toast { top: 60px; background: #4A1638; color: #FFE3F2; }
.pet-visitor-toast.fade-out { top: 26px; }

@media (max-width: 480px) {
  .pet-hotspot { width: 28px; height: 28px; font-size: 12px; }
  .pet-dock-mini-top { max-width: 100%; }
}

.pet-mini-setup { position: relative; }
.pet-mini-setup-top { text-align: center; margin-bottom: 16px; }
.pet-mini-setup-btn {
  width: 56px; height: 56px; border-radius: var(--radius-md); background: #F8F4FD; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 20px;
  box-shadow: var(--shadow-sm); list-style: none;
}
.pet-mini-setup-btn::-webkit-details-marker { display: none; }
.pet-mini-setup-popover {
  position: absolute; top: 62px; left: 0; right: 0; z-index: 10; margin: 0 auto; width: min(420px, 100%);
  border-radius: var(--radius-lg); padding: 18px;
  background: var(--pinkblack-strong);
  box-shadow: var(--shadow-modal);
}
.pet-setup-layout { display: flex; gap: 18px; align-items: center; position: relative; z-index: 1; }
.pet-setup-form-col { flex: 1 1 56%; min-width: 0; }
.pet-setup-preview-col { flex: 1 1 44%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pet-setup-preview-room {
  position: relative; width: 100%; max-width: 150px; border-radius: var(--radius-md); overflow: hidden;
  box-shadow: 0 4px 14px -6px rgba(0,0,0,0.5);
}
.pet-setup-preview-room-img { width: 100%; display: block; }
.pet-setup-preview-sprite {
  position: absolute; top: 52%; left: 46%; transform: translate(-50%,-50%); width: 46%;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.5)); image-rendering: pixelated;
}
.pet-setup-preview-name { font-weight: 800; color: #FFE3F2; font-size: 12px; text-align: center; }
.pet-setup-title { font-weight: 800; color: #FFE3F2; font-size: 13px; margin-bottom: 10px; line-height: 1.4; text-align: left; }
.pet-setup-choices { display: flex; gap: 8px; margin-bottom: 10px; }
.pet-choice-btn {
  border: 3px solid transparent; background: rgba(255,255,255,0.12); border-radius: var(--radius-md); padding: 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.pet-choice-btn img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.pet-choice-btn span { font-size: 10px; font-weight: 800; color: #FFD9EC; }
.pet-choice-btn.selected { border-color: #FF9FD1; background: rgba(255,255,255,0.22); }
.pet-mini-setup-popover form { display: flex; flex-direction: column; gap: 8px; }
.pet-mini-setup-popover input[type=text] {
  border: 2px solid rgba(255,255,255,0.3); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px;
  outline: none; text-align: left; background: rgba(255,255,255,0.92); color: #4a1638;
}
@media (max-width: 420px) {
  .pet-setup-layout { flex-direction: column; }
  .pet-setup-preview-col { order: -1; }
  .pet-setup-preview-room { max-width: 120px; }
}

/* Willkommens-Banner für neue Nutzer:innen */
.welcome-banner {
  background: linear-gradient(120deg, #FFD3EC, #E8D2FB);
  border-radius: var(--radius-lg); padding: 16px 20px; margin: -14px 0 24px; font-size: 14px; font-weight: 700;
  color: #5B3E96; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 10px;
}
.welcome-banner span { flex: 1; }
.welcome-banner a { color: #8A5FC7; text-decoration: underline; }
.welcome-close {
  border: none; background: rgba(255,255,255,0.6); color: #5B3E96; border-radius: 50%;
  width: 24px; height: 24px; flex-shrink: 0; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.welcome-close:hover { background: rgba(255,255,255,0.9); }
.avatar {
  width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg,#C9A6E8,#F2ADC9);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; margin-bottom: 16px;
  border: 3px solid #fff; outline: 3px solid #E4D3F5;
}
.top-row { display: flex; align-items: baseline; justify-content: space-between; }
.name { color: #8A5FC7; font-size: 30px; margin: 0; }
.logout { color: #B892E0; font-size: 13px; font-weight: 700; text-decoration: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 50%; background: #F8F1FE; text-decoration: none; font-size: 16px;
  box-shadow: var(--shadow-xs); flex-shrink: 0;
}
.icon-btn:hover { background: #EFE0FB; }
.logout-corner { position: absolute; top: 14px; left: 14px; z-index: 6; }
.edit-profile-corner { position: absolute; top: 58px; left: 14px; z-index: 6; }
.spruch-form { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; }
.spruch-form input[type=text] {
  border: none; border-bottom: 2px solid #E4D3F5; padding: 6px 2px;
  font-size: 15px; color: #777; outline: none; background: transparent;
}
.spruch-form textarea {
  border: 2px solid #E4D3F5; border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 14px; color: #555; outline: none; font-family: inherit; resize: vertical;
}
.mini-btn.secondary { background: #FFF3D6; color: #B9812E; }
.mini-btn.danger { background: #FFD9DF; color: #B4293F; }
.mini-btn.danger:hover { background: #FFC2CC; }
.spruch-form label.field-label { font-size: 11px; font-weight: 800; color: #B892E0; text-transform: uppercase; letter-spacing: .04em; margin-bottom: -6px; }
.field-label .field-hint { display: block; font-size: 10px; font-weight: 600; text-transform: none; letter-spacing: normal; color: #aaa; margin-top: 2px; }
.mini-btn {
  border: none; background: #F3ECFE; color: #8A5FC7; font-weight: 800;
  border-radius: var(--radius-lg); padding: 6px 16px; font-size: 13px; cursor: pointer; align-self: flex-start;
}
.contact-line { font-size: 13px; color: #8A5FC7; font-weight: 700; margin: 4px 0 12px; }
.pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { padding: 10px 18px; border-radius: 999px; font-weight: 800; font-size: 14px; }
.pill-purple { background: #F3ECFE; color: #8A5FC7; }
.pill-pink { background: #FDECF3; color: #C2578F; }
.pill-gold { background: #FEF3DC; color: #B9812E; }
.pill-teal { background: #DFF5EC; color: #237A4B; }

/* Avatar-Auswahl */
.avatar-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.avatar-option {
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 20px; background: #F3ECFE; border: 2px solid transparent; cursor: pointer;
}
.avatar-option.selected { border-color: #B892E0; background: #fff; }

/* Profil-Hintergrund-Auswahl (Mesh-Farbverläufe) */
.theme-picker { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 4px; }
.theme-picker-group-label { font-size: 11px; font-weight: 800; color: var(--chrome-muted, #999); margin: 10px 0 2px; text-transform: uppercase; letter-spacing: .03em; }
.theme-option {
  width: 52px; height: 52px; border-radius: var(--radius-md); cursor: pointer; border: 3px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}
.theme-option.selected { border-color: #B892E0; }

/* Panels (details/summary) */
.panel {
  background: var(--theme-bg, var(--chrome-bg, #fff)); border-radius: var(--radius-xl); padding: 20px 22px; margin-bottom: 18px;
  box-shadow: var(--shadow-panel);
}
.panel summary {
  font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 18px;
  color: var(--theme-heading, var(--chrome-heading, #5B3E96)); cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.panel summary::-webkit-details-marker { display: none; }
.badge { color: var(--theme-muted, var(--chrome-muted, #999)); font-size: 13px; font-weight: 600; }

/* Einheitliches Auf-/Zu-Pfeilsymbol für ALLE aufklappbaren Bereiche (Panels, Formatgruppen,
   Sidebar-Boxen usw.) - vorher hatte nur das Haustier-Dock ein solches Symbol, alle anderen
   Panels sahen von außen wie normaler Text aus, ohne erkennbar zu sein, dass man sie öffnen kann. */
.panel summary::before,
.format-group-header::before,
.nested-panel summary::before,
.match-chat summary::before,
.offline-toggle summary::before,
.chat-box summary::before,
.session-add-picker summary::before,
.faq-item summary::before {
  content: '▸';
  display: inline-block;
  flex-shrink: 0;
  font-size: 0.8em;
  transition: transform 0.15s ease;
}
details[open] > summary::before { transform: rotate(90deg); }

.wish-list { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.wish-list li {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: #FDECF3; border-radius: var(--radius-sm); padding: 8px 14px;
}
.wish-list li .wish-main { display: flex; align-items: center; gap: 10px; }
.wish-list li img.wish-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: var(--radius-xs); }
.wish-list li span { color: #C2578F; font-weight: 700; font-size: 14px; }

.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input, .inline-form select {
  flex: 1; border: 2px solid #E4D3F5; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; outline: none;
}
.inline-form button {
  border: none; background: #B892E0; color: #fff; font-weight: 800;
  border-radius: var(--radius-sm); padding: 0 18px; cursor: pointer;
}

.inline-form-photo { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.inline-form-photo input[type=text] {
  flex: 1; min-width: 140px; border: 2px solid #E4D3F5; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; outline: none;
}
.inline-form-photo input[type=file] { font-size: 12px; max-width: 160px; }
.inline-form-photo button {
  border: none; background: #B892E0; color: #fff; font-weight: 800;
  border-radius: var(--radius-sm); padding: 10px 16px; cursor: pointer;
}

/* Section title */
.section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
.section-title h2 { color: var(--theme-heading, var(--chrome-heading, #5B3E96)); font-size: 22px; margin: 0; }
.count-badge { background: #F5C453; color: #7A5300; font-weight: 800; border-radius: 999px; padding: 3px 12px; font-size: 14px; }
.empty-text { text-align: center; color: var(--theme-muted, var(--chrome-muted, #aaa)); padding: 0 16px; margin-bottom: 24px; }

/* Photo grid */
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.photo-grid.small { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-card { position: relative; background: var(--theme-bg, #fff); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card); }
.photo-card.gold { background: #FEF3DC; }
.photo-card img { width: 100%; height: 110px; object-fit: cover; display: block; }
.photo-card img.zoomable { cursor: zoom-in; }
.photo-grid.small .photo-card img { height: 64px; }
.no-photo {
  width: 100%; height: 110px; display: flex; align-items: center; justify-content: center;
  background: #F3ECFE; font-size: 26px;
}
.no-photo.small { height: 64px; font-size: 16px; }
.caption { display: flex; flex-wrap: wrap; row-gap: 4px; align-items: center; gap: 6px; padding: 8px 10px 2px; font-weight: 700; font-size: 13px; color: #5B3E96; }
.caption .caption-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-card.gold .caption { color: #B9812E; }

/* Format-Pille (A4/A5/A6/unbekannt) */
.format-pill {
  font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: var(--radius-xs); flex-shrink: 0;
  background: #F3ECFE; color: #8A5FC7;
}
.format-pill.format-a4 { background: #E3F2FD; color: #1565C0; }
.format-pill.format-a5 { background: #F3ECFE; color: #8A5FC7; }
.format-pill.format-a6 { background: #FDECF3; color: #C2578F; }
.format-pill.format-a4-tuete { background: #D6EAF8; color: #1B4F72; }
.format-pill.format-a5-tuete { background: #E8DFF5; color: #6C3483; }
.format-pill.format-postkarte { background: #FFF3D6; color: #B9812E; }
.format-pill.format-briefpapier { background: #E8F5E9; color: #388E3C; }
.format-pill.format-sticker { background: #FCE4EC; color: #D81B60; }
.format-pill.format-sonderkarte { background: #EDE7F6; color: #5E35B1; }
.format-pill.format-sonstiges { background: #ECEFF1; color: #546E7A; }
.format-pill.format-a7 { background: #E0F2F1; color: #00695C; }
.format-pill.format-reliefblaetter { background: #FCE4EC; color: #AD1457; }
.qty-pill {
  font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: var(--radius-xs); flex-shrink: 0;
  background: #FFF3D6; color: #B9812E;
}
.format-pill.format-unbekannt { background: #FFF3E0; color: #B9812E; }

/* Editierbare Caption-Zeile in der eigenen Sammlung (Umbenennen) */
/* flex-wrap: bei langen Format-Namen (v.a. "📦 Sonstiges") + Anzahl-Pille + Notiz-Symbol konnte
   die Zeile breiter werden als die Karte - der Stift (✏️) wurde dann nach rechts aus der Karte
   herausgeschoben und war (v.a. auf Android, wo Emoji/Schrift etwas breiter gerendert werden)
   unsichtbar und nicht mehr klickbar. Jetzt bricht die Zeile stattdessen einfach um. */
.caption-row { display: flex; flex-wrap: wrap; row-gap: 4px; align-items: center; gap: 6px; padding: 8px 10px 2px; }
.caption-row .caption-text { flex: 1; min-width: 0; font-weight: 700; font-size: 13px; color: #5B3E96; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-btn { border: none; background: none; font-size: 12px; cursor: pointer; padding: 2px; flex-shrink: 0; opacity: .7; }
.edit-btn:hover { opacity: 1; }
.edit-row { display: none; flex-direction: column; gap: 6px; padding: 8px 10px; }
.edit-row input[type=text], .edit-row select, .edit-row textarea {
  border: 2px solid #E4D3F5; border-radius: var(--radius-sm); padding: 6px 8px; font-size: 12px; outline: none; width: 100%;
  font-family: inherit;
}
.edit-row textarea { resize: vertical; min-height: 44px; }
.edit-row .edit-actions { display: flex; gap: 8px; align-items: center; }
.edit-row .edit-actions .mini-btn { padding: 5px 12px; font-size: 11px; }

/* Tags */
.tag-pills { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px 8px; }
.tag-pill { font-size: 10px; font-weight: 700; background: #F3ECFE; color: #8A5FC7; padding: 2px 8px; border-radius: var(--radius-xs); }
.note-indicator { flex-shrink: 0; font-size: 12px; cursor: help; }

/* Duplikat-Warnung beim Hochladen */
.dup-warning { display: none; font-size: 11px; font-weight: 700; color: #B4293F; padding-left: 54px; margin-top: -4px; }
.dup-warning.show { display: block; }

/* Format-Gruppen (A4/A5/A6) - jede für sich einklappbar */
.format-group-header {
  font-family: 'Baloo 2', sans-serif; color: #8A5FC7; font-size: 15px; margin: 4px 0 0;
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
  padding: 10px 4px; border-bottom: 2px solid #F3ECFE;
}
.format-group-header::-webkit-details-marker { display: none; }
.format-group-header .count { margin-left: auto; font-size: 12px; color: #bbb; font-weight: 700; }
.format-group { margin-bottom: 6px; }
.format-group .photo-grid { margin-top: 12px; }
.del-overlay { position: absolute; top: 6px; right: 6px; margin: 0; z-index: 2; }
.x-btn {
  border: none; background: rgba(255,255,255,0.9); border-radius: 50%;
  width: 22px; height: 22px; font-size: 11px; cursor: pointer; color: #8A5FC7;
  display: flex; align-items: center; justify-content: center; padding: 0;
}

/* Tauschen-Badge & Toggle */
.trade-badge {
  position: absolute; top: 6px; left: 6px; background: #F5C453; color: #7A5300;
  font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: var(--radius-sm); z-index: 2;
}
.trade-toggle {
  display: block; width: calc(100% - 20px); margin: 0 10px 10px; border: none; border-radius: var(--radius-sm);
  padding: 7px; font-size: 11px; font-weight: 800; background: #F3ECFE; color: #8A5FC7; cursor: pointer;
}
.trade-toggle.active { background: #F5C453; color: #7A5300; }

/* Abgleich-Text auf fremden Blättern: hab ich schon / hab ich noch nicht -
   sitzt als eigene kleine Zeile direkt über Format+Name, kein schwebendes
   Overlay mehr auf dem Foto (das kam sich sonst unten links mit dem
   "Brauch ich"-Button in die Quere). */
.owned-badge {
  display: block; font-size: 11px; font-weight: 800;
  padding: 6px 10px 0;
}
.owned-badge.have { color: #2E7D46; }
.owned-badge.missing { color: #B4293F; }
.comment-badge {
  position: absolute; bottom: 6px; left: 6px; z-index: 2;
  background: rgba(255,255,255,0.92); color: #5B3E96; font-size: 11px; font-weight: 800;
  padding: 2px 7px; border-radius: var(--radius-sm); box-shadow: var(--shadow-xs);
}
.view-list .photo-card .owned-badge,
.market-grid.view-list .market-card .owned-badge {
  padding: 0 8px; display: flex; align-items: center; flex-shrink: 0;
}

/* Herz-Button (auf fremden Profilen / im Marktplatz) */
.heart-btn {
  display: block; width: calc(100% - 20px); margin: 0 10px 10px; border: none; border-radius: var(--radius-sm);
  padding: 7px; font-size: 11px; font-weight: 800; background: #FDECF3; color: #C2578F; cursor: pointer;
}
.heart-btn.hearted { background: #F3ECFE; color: #8A5FC7; }

/* Add box */
.add-box {
  border: 2px dashed #CBAAE8; border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 34px;
}
/* Mehrfach-Upload: ein Namensfeld mit Vorschau pro ausgewähltem Foto */
.multi-name-list { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.multi-name-row {
  display: flex; flex-direction: column; gap: 8px; background: #FAF6FE; border-radius: var(--radius-md); padding: 10px;
  border: 2px solid transparent; transition: border-color 0.2s ease;
}
.multi-name-row.row-invalid { border-color: #E4536F; background: #FFF0F2; }
.upload-form-notice {
  display: none; background: #FFF3D6; color: #8A5F1A; border: 2px solid #F5DFA3; border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 12px; font-weight: 700; margin: 4px 0 10px; line-height: 1.5;
}
.upload-form-notice.show { display: block; }
.upload-form-notice.upload-form-notice-loading { background: #F3ECFE; color: #5B3E96; border-color: #E4D3F5; }
.upload-form-notice.upload-form-notice-error { background: #FFF0F2; color: #B4293F; border-color: #F5B8C4; }
.upload-error-report-link {
  display: inline-block; margin-top: 8px; padding: 7px 14px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.7); color: inherit; text-decoration: none; font-weight: 800; font-size: 12px;
}
.upload-error-report-link:hover { background: rgba(255,255,255,0.95); }
.multi-name-top { display: flex; align-items: center; gap: 10px; }
.row-thumb-wrap { width: 44px; height: 44px; flex-shrink: 0; }
.multi-name-thumb {
  width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; background: #F3ECFE;
}
.row-thumb-placeholder {
  width: 44px; height: 44px; border-radius: var(--radius-sm); background: #F3ECFE; color: #B892E0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.multi-name-top input[type=text] {
  flex: 1; border: 2px solid #E4D3F5; border-radius: var(--radius-sm); padding: 9px 12px; font-size: 14px; outline: none;
}
.multi-name-top select {
  border: 2px solid #E4D3F5; border-radius: var(--radius-sm); padding: 9px 4px; font-size: 12px; outline: none;
  width: 70px; flex-shrink: 0; background: #fff;
}
.row-qty-input {
  border: 2px solid #E4D3F5; border-radius: var(--radius-sm); padding: 9px 4px; font-size: 13px; outline: none;
  width: 52px; flex-shrink: 0; background: #fff; text-align: center;
}
.qty-edit-label { font-size: 12px; font-weight: 700; color: #8A5FC7; display: flex; align-items: center; gap: 8px; }
.row-remove-btn {
  border: none; background: #FDECF3; color: #C2578F; width: 30px; height: 30px; border-radius: 50%;
  font-size: 13px; font-weight: 800; cursor: pointer; flex-shrink: 0;
}
.multi-name-extra {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-left: 54px;
}
.multi-trade-label {
  display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: #8A5FC7; cursor: pointer;
}
.multi-trade-label input[type=checkbox] { accent-color: #B892E0; margin: 0; }
.multi-name-extra select.folder-select {
  border: 2px solid #E4D3F5; border-radius: var(--radius-sm); padding: 6px 8px; font-size: 11px; max-width: 150px; background: #fff;
}
.folder-add-box { margin-bottom: 14px; padding: 18px; }

/* Startzeile beim Hochladen: Mehrfachauswahl oder leere Zeile ohne Foto anlegen */
.upload-start-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; width: 100%; margin-bottom: 6px; }
.file-pick-label {
  position: relative; display: inline-block; background: #F3ECFE; color: #8A5FC7; font-weight: 800;
  font-size: 13px; padding: 10px 16px; border-radius: var(--radius-sm); cursor: pointer;
}
.file-pick-label input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%;
}

/* Foto-Quelle innerhalb einer Zeile: eigenes Foto hochladen ODER Status, was gerade gewählt ist */
.photo-source-row { display: flex; align-items: center; gap: 10px; padding-left: 54px; flex-wrap: wrap; }
.photo-source-row .file-pick-label { font-size: 11px; padding: 6px 12px; }
.photo-source-status { font-size: 11px; font-weight: 800; color: #4CAF6D; }

/* Vorschläge beim Hochladen: schon vorhandene Blätter anderer mit ähnlichem Namen */
.upload-suggest { display: none; margin-top: 4px; padding-left: 54px; }
.upload-suggest.show { display: block; }
.upload-suggest-label { font-size: 11px; font-weight: 800; color: #8A5FC7; margin-bottom: 6px; }
.upload-suggest-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.upload-suggest-item { flex-shrink: 0; text-align: center; width: 60px; }
.upload-suggest-item img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--radius-sm); display: block; cursor: zoom-in; border: 2px solid transparent; }
.upload-suggest-item.selected img { border-color: #4CAF6D; }
.upload-suggest-item span { font-size: 9px; color: #999; display: block; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-suggest-use {
  border: none; background: #F3ECFE; color: #8A5FC7; font-size: 9px; font-weight: 800; border-radius: var(--radius-xs);
  padding: 3px 6px; cursor: pointer; width: 100%;
}
.upload-suggest-item.selected .upload-suggest-use { background: #4CAF6D; color: #fff; }

.add-box-title { font-weight: 800; color: #8A5FC7; font-size: 15px; }
.add-box input[type=text] {
  width: 100%; border: 2px solid #E4D3F5; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; outline: none;
}
.add-box input[type=file] { font-size: 13px; }
.add-box button {
  border: none; background: #B892E0; color: #fff; font-weight: 800;
  border-radius: var(--radius-sm); padding: 10px 22px; cursor: pointer;
}

.folder-panel .delete-folder-form { margin-top: 10px; }
.text-link-btn { border: none; background: none; color: #C2578F; font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; }
.new-folder-panel summary { color: #8A5FC7; }

/* Verschachteltes Panel: Blätter aus der Sammlung einem Ordner zuordnen */
.nested-panel {
  background: #FAF6FE; border-radius: var(--radius-md); padding: 14px 16px; margin-top: 14px;
}
.nested-panel summary {
  font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 14px;
  color: #8A5FC7; cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 6px;
}
.nested-panel summary::-webkit-details-marker { display: none; }
.select-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.select-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: #fff; border-radius: var(--radius-sm); padding: 8px 6px; border: 2px solid transparent; cursor: pointer;
  font-size: 11px; color: #5B3E96; font-weight: 700;
}
.select-item.checked { border-color: #B892E0; background: #F3ECFE; }
.select-item img, .select-item .no-photo { width: 100%; height: 56px; object-fit: cover; border-radius: var(--radius-xs); }
.select-item input[type=checkbox] { margin: 0 0 2px; accent-color: #B892E0; }

/* ---------- Fremdes Profil ---------- */
.back-link { display: inline-block; margin-bottom: 14px; color: #8A5FC7; font-weight: 700; font-size: 13px; text-decoration: none; }

/* ---------- Tauschbörse & Matches ---------- */
.match-card {
  background: var(--theme-bg, #fff); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-panel);
}
.match-card.done { opacity: .85; }
.match-swap { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.match-swap .thumb, .match-swap .thumb-fallback {
  width: 52px; height: 52px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; background: #F3ECFE;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.match-swap .thumb.zoomable { cursor: zoom-in; }
.match-swap .swap-icon { font-size: 18px; color: #B892E0; font-weight: 800; }
.match-info .item-name { font-weight: 800; color: #5B3E96; font-family: 'Baloo 2'; font-size: 14px; line-height: 1.4; }
.match-status { font-size: 12px; color: #999; margin: 6px 0; font-weight: 700; }
.match-actions { margin-top: 8px; display: flex; gap: 8px; }

/* Private Nachrichten pro Match */
.match-chat { margin-top: 10px; border-top: 1px solid #F3ECFE; padding-top: 8px; }
.match-chat summary { font-size: 12px; font-weight: 800; color: #8A5FC7; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 5px; }
.match-chat summary::-webkit-details-marker { display: none; }
.chat-thread { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; max-height: 220px; overflow-y: auto; }
.chat-bubble { background: var(--theme-card, #F8F3FD); border-radius: var(--radius-sm); padding: 7px 11px; font-size: 12px; color: var(--theme-text, #555); align-self: flex-start; max-width: 85%; }
.chat-bubble.own { background: var(--theme-card, #FDECF3); align-self: flex-end; }
.chat-bubble .who { color: var(--theme-link, #8A5FC7); font-weight: 800; }
.chat-bubble .who a { color: inherit; text-decoration: none; }
.chat-bubble .who a:hover { text-decoration: underline; }
.chat-bubble-system { border: 1.5px dashed #D8B8EE; background: #FBF7FF !important; }
.chat-send-form { display: flex; gap: 6px; }
.chat-send-form input[type=text] {
  flex: 1; border: 2px solid #E4D3F5; border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; outline: none;
}
.chat-send-form button {
  border: none; background: #B892E0; color: #fff; font-weight: 800; border-radius: var(--radius-sm);
  padding: 0 16px; cursor: pointer; font-size: 14px;
}
.action-btn { border: none; border-radius: var(--radius-sm); padding: 9px 16px; font-size: 12px; font-weight: 800; cursor: pointer; }
.action-btn.primary { background: #B892E0; color: #fff; }
.action-btn.confirm { background: #4CAF6D; color: #fff; }
.action-btn.muted { background: #F3ECFE; color: #8A5FC7; }
.action-btn.cancel { background: #FDECF3; color: #C2578F; }
.action-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Tauschmenü (Tauschsitzung mit mehreren Blättern) ---------- */
.session-pets-meet { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }
.session-pets-meet img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.2)); }
.session-pets-meet-icon { font-size: 16px; }
.session-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 6px; }
.session-partner { font-weight: 800; color: #5B3E96; font-family: 'Baloo 2'; font-size: 14px; }
.session-partner a { color: #5B3E96; text-decoration: none; }
.session-partner a:hover { text-decoration: underline; }
.session-tally { font-size: 11px; font-weight: 800; color: #B892E0; background: #F3ECFE; padding: 3px 10px; border-radius: var(--radius-sm); }
.session-pending-hint { background: #FFF3D6; color: #B9812E; font-size: 12px; font-weight: 700; padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 10px; }
.session-side { margin-bottom: 6px; }
.session-side-label { font-size: 11px; font-weight: 800; color: #8A5FC7; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.session-divider { text-align: center; color: #B892E0; font-size: 16px; margin: 4px 0; }
.session-item {
  display: flex; align-items: center; gap: 10px; background: #F8F4FD; border-radius: var(--radius-md);
  padding: 8px 10px; margin-bottom: 6px;
}
.session-item.requested { background: #FFF8E8; }
.session-thumb, .session-thumb-fallback {
  width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.session-thumb.zoomable { cursor: zoom-in; }
.session-item-info { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.session-item-name { font-weight: 700; font-size: 13px; color: #5B3E96; }
.session-tag { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: var(--radius-xs); flex-basis: 100%; }
.session-tag.auto-tag { color: #B892E0; background: none; padding-left: 0; }
.session-tag.requested-tag { color: #B9812E; background: none; padding-left: 0; }
.session-icon-btn {
  border: none; width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 800;
  cursor: pointer; flex-shrink: 0;
}
.session-icon-btn.remove, .session-icon-btn.decline { background: #FDECF3; color: #C2578F; }
.session-icon-btn.accept { background: #DFF5E3; color: #2E7D46; margin-right: 4px; }
.session-add-picker { margin-top: 4px; }
.session-add-picker summary {
  font-size: 12px; font-weight: 700; color: #8A5FC7; cursor: pointer; list-style: none;
  border: 2px dashed #E4D3F5; border-radius: var(--radius-sm); padding: 8px 10px; text-align: center;
}
.session-add-picker summary::-webkit-details-marker { display: none; }
.session-picker-row { margin-top: 6px; }
.session-picker-row button {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
  border: none; background: #F8F4FD; border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer;
  font-size: 12px; font-weight: 700; color: #5B3E96; font-family: inherit;
}
.session-picker-row button:hover { background: #F0E6FB; }
.session-footer { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.session-partner-ready { font-size: 11px; font-weight: 700; color: #bbb; }
.session-partner-ready.ready { color: #2E7D46; }
.session-inline-form { display: inline-flex; }

.market-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.market-card {
  background: var(--chrome-card, rgba(255,255,255,0.75)); border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-card-dark); position: relative;
}
.market-card img { width: 100%; height: 100px; object-fit: cover; display: block; }
.market-card .caption, .market-card .caption-text { color: var(--chrome-heading, #5B3E96); }
.market-card .owner-line { font-size: 11px; color: var(--chrome-muted, #999); padding: 6px 8px 0; }
.market-card .owner-line a { color: var(--chrome-link, #8A5FC7); font-weight: 700; text-decoration: none; }
.market-card.hidden-by-search { display: none; }

/* Fußzeile der Marktplatz-Karte: Besitzer-Name und "Ich will das!"-Button nebeneinander
   statt der Button volle Breite einnimmt und den Namen in eine eigene Zeile drängt. */
.market-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 10px; flex-wrap: wrap; }
.market-card-footer .owner-line { padding: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-card-footer .heart-form { flex-shrink: 0; }
.market-card-footer .heart-btn { display: inline-block; width: auto; margin: 0; padding: 7px 12px; white-space: nowrap; }

/* Suche (Sammlung & Tauschbörse) */
.search-box {
  position: relative; margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
  background: var(--chrome-bg, #fff); border-radius: var(--radius-lg); padding: 6px 8px;
}
.search-box input {
  flex: 1; border: 2px solid var(--chrome-border, #E4D3F5); border-radius: var(--radius-md); padding: 11px 16px 11px 38px;
  font-size: 14px; outline: none; background: var(--chrome-input-bg, #fff);
}
.search-box input:focus { border-color: #FF9FD1; }
.search-box .search-icon { position: absolute; left: 21px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .6; }
.search-empty { display: none; text-align: center; color: var(--chrome-muted, #bbb); padding: 20px; font-size: 13px; }
.search-empty.show { display: block; }

/* Grid/Listen-Umschalter */
.view-toggle { display: flex; gap: 4px; flex-shrink: 0; }
.view-toggle-btn {
  border: 2px solid #E4D3F5; background: #fff; color: #8A5FC7; border-radius: var(--radius-sm);
  width: 38px; height: 38px; font-size: 14px; cursor: pointer;
}
.view-toggle-btn.active { background: #B892E0; color: #fff; border-color: #B892E0; }

/* Listenansicht (statt Kacheln) - wiederverwendbar für Sammlung, Zum Tauschen, Marktplatz */
.view-list .photo-grid { display: flex; flex-direction: column; gap: 8px; }
.view-list .photo-card {
  display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; flex-wrap: wrap;
}
.view-list .photo-card .trade-badge { display: none; }
.view-list .photo-card .del-overlay { position: static; margin-left: auto; order: 5; }
.view-list .photo-card img,
.view-list .photo-card .no-photo { width: 48px; height: 48px; border-radius: var(--radius-sm); flex-shrink: 0; }
.view-list .photo-card .caption-row { padding: 0; flex: 1; min-width: 120px; }
.view-list .photo-card .tag-pills { display: none; }
.view-list .photo-card .trade-toggle { width: auto; margin: 0; flex-shrink: 0; white-space: nowrap; }
.view-list .photo-card .edit-row { flex-basis: 100%; order: 10; }

/* Listenansicht für den Marktplatz (eigene Karten-Struktur) */
.market-grid.view-list { display: flex; flex-direction: column; gap: 8px; }
.market-grid.view-list .market-card {
  display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; flex-wrap: wrap;
}
.market-grid.view-list .market-card img,
.market-grid.view-list .market-card .no-photo { width: 48px; height: 48px; border-radius: var(--radius-sm); flex-shrink: 0; }
.market-grid.view-list .market-card .caption { padding: 0; flex: 1; min-width: 120px; }
.market-grid.view-list .market-card .tag-pills { display: none; }
.market-grid.view-list .market-card .market-card-footer { display: contents; }
.market-grid.view-list .market-card .owner-line { flex-shrink: 0; padding: 0; }
.market-grid.view-list .market-card .heart-form { width: auto; margin: 0; flex-shrink: 0; }
.market-grid.view-list .market-card .heart-btn { width: auto; margin: 0; white-space: nowrap; }

/* Kategorie-Filter-Chips unter der Suche */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.filter-chip {
  border: 2px solid #E4D3F5; background: #fff; color: #8A5FC7; font-size: 11px; font-weight: 800;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.filter-chip.active { background: #B892E0; color: #fff; border-color: #B892E0; }

/* Dauerhafter Tauschverlauf */
.history-card {
  display: flex; align-items: center; gap: 10px; background: var(--theme-card, var(--chrome-card, rgba(255,255,255,0.75))); border-radius: var(--radius-md);
  padding: 10px 14px; margin-bottom: 10px; box-shadow: var(--shadow-card);
}
.history-card .thumb, .history-card .thumb-fallback {
  width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; background: rgba(150,110,200,0.15);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.history-card .history-info { flex: 1; min-width: 0; font-size: 12px; color: var(--theme-muted, var(--chrome-muted, #777)); }
.history-card .history-info b { color: var(--theme-heading, var(--chrome-heading, #5B3E96)); }
.history-card .history-info b a { color: inherit; text-decoration: none; }
.history-card .history-info b a:hover { text-decoration: underline; }
.history-card .history-date { font-size: 11px; color: var(--theme-muted, var(--chrome-muted, #bbb)); flex-shrink: 0; }
.history-scroll-box { max-height: 480px; overflow-y: auto; padding-right: 4px; }

/* Feedback-Antwort */
.feedback-reply {
  background: var(--chrome-card, #FAF6FE); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 8px;
  font-size: 13px; color: var(--chrome-heading, #5B3E96); line-height: 1.5; width: 100%;
}

/* Patch Notes */
.patch-note summary .tag-pill { margin-left: 8px; }
.patch-list { margin: 10px 0 0; padding-left: 20px; }
.patch-list li { font-size: 13px; color: var(--chrome-text, #666); margin-bottom: 6px; line-height: 1.5; }

/* ---------- Benachrichtigungszentrum ---------- */
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
  display: flex; align-items: center; gap: 10px; background: #fff; border-radius: var(--radius-md);
  padding: 12px 14px; box-shadow: var(--shadow-card);
  text-decoration: none; color: inherit;
}
a.notif-item:hover { background: #FAF6FE; }
.notif-item.unread { border-left: 4px solid #B892E0; padding-left: 10px; }
.notif-icon { font-size: 18px; flex-shrink: 0; }
.notif-text { flex: 1; font-size: 13px; font-weight: 700; color: #5B3E96; line-height: 1.4; }
.notif-time { font-size: 11px; color: #aaa; flex-shrink: 0; white-space: nowrap; }

/* ---------- Seltenste Blätter ---------- */
.rarest-teaser {
  display: inline-block; background: linear-gradient(120deg, #FFF3D6, #FDECF3); color: #B9812E;
  font-weight: 800; font-size: 13px; padding: 10px 16px; border-radius: var(--radius-md); text-decoration: none;
  margin-bottom: 18px;
}
.rarest-teaser:hover { opacity: 0.85; }
.rarity-list { display: flex; flex-direction: column; gap: 8px; }
.rarity-row {
  display: flex; align-items: center; gap: 12px; background: var(--chrome-card, #fff); border-radius: var(--radius-md);
  padding: 10px 14px; box-shadow: var(--shadow-card-dark);
}
.rarity-rank { font-family: 'Baloo 2', sans-serif; font-weight: 700; color: var(--chrome-link, #B892E0); font-size: 16px; width: 32px; flex-shrink: 0; }
.rarity-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; background: rgba(150,110,200,0.18); }
.rarity-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--chrome-link, #B892E0); }
.rarity-info { flex: 1; min-width: 0; }
.rarity-name { font-weight: 800; color: var(--chrome-heading, #5B3E96); font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rarity-meta { font-size: 11px; color: var(--chrome-muted, #999); margin-top: 3px; }
.rarity-meta a { color: var(--chrome-link, #8A5FC7); font-weight: 700; text-decoration: none; }
.rarity-meta a:hover { text-decoration: underline; }
.rarity-badge { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: var(--radius-sm); flex-shrink: 0; }
.rarity-badge.unique { background: #F3ECFE; color: #8A5FC7; }
.rarity-badge.rare { background: #FFF3D6; color: #B9812E; }

/* Admin-Bereich & Bestenliste setzen kein eigenes Profil-Theme -> dezentes Pinkschwarz statt Weiß */
.leaderboard-table, .admin-table { color: var(--chrome-text, #333); }
.leaderboard-table th, .leaderboard-table td,
.admin-table th, .admin-table td { border-bottom-color: var(--chrome-border, #F0E6FB); }
.leaderboard-table tr.me-row { background: var(--chrome-card, #FAF6FE); }
.admin-user-link { color: var(--chrome-heading, #5B3E96); }

/* ---------- Admin-Bereich ---------- */
.admin-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.admin-stat {
  background: var(--chrome-card, rgba(255,255,255,0.75)); border-radius: var(--radius-md); padding: 12px 18px; min-width: 90px; text-align: center;
  box-shadow: var(--shadow-card-dark);
}
.admin-stat-num { display: block; font-family: 'Baloo 2', sans-serif; font-size: 22px; color: var(--chrome-heading, #8A5FC7); font-weight: 700; }
.admin-stat-label { display: block; font-size: 11px; color: var(--chrome-muted, #999); font-weight: 700; margin-top: 2px; }

.admin-table-wrap { overflow-x: auto; margin-top: 12px; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #F0E6FB; white-space: nowrap; }
.admin-table th { color: #8A5FC7; font-family: 'Baloo 2', sans-serif; font-size: 12px; }
.admin-user-link { color: #5B3E96; font-weight: 700; text-decoration: none; }
.admin-user-link:hover { text-decoration: underline; }
.admin-status { font-weight: 800; font-size: 12px; }
.admin-status.active { color: #4CAF6D; }
.admin-status.blocked { color: #B4293F; }
.admin-actions-cell { white-space: nowrap; }
.admin-inline-form { display: inline-block; margin-right: 6px; }
.admin-inline-form:last-child { margin-right: 0; }
.admin-inline-form .mini-btn { padding: 5px 12px; font-size: 11px; }

/* ---------- Einladungscodes ---------- */
.invite-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.invite-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 10px; flex-wrap: wrap;
  background: #F8F4FD; border-radius: var(--radius-sm); padding: 8px 12px;
}
.invite-code { font-weight: 800; letter-spacing: .06em; color: #5B3E96; background: none; padding: 0; font-size: 13px; }
.invite-status { font-size: 11px; font-weight: 700; flex-shrink: 0; }
.invite-status.used { color: #4CAF6D; }
.invite-status.open { color: #B892E0; }

/* ---------- Konto löschen ---------- */
.danger-zone {
  margin-top: 40px; padding: 18px; border-radius: var(--radius-lg); background: #FFF0F0;
  border: 2px dashed #F3B6C2; text-align: center;
}
.danger-zone p { color: #B4293F; font-size: 12px; font-weight: 700; margin: 0 0 10px; }
.danger-btn { border: none; background: #FFD9DF; color: #B4293F; font-weight: 800; padding: 10px 20px; border-radius: var(--radius-md); font-size: 13px; cursor: pointer; }
.danger-btn:hover { background: #FFC2CC; }

/* ---------- Vollbild-Vorschau (Lightbox) ---------- */
.lb-backdrop {
  position: fixed; inset: 0; background: rgba(30,10,28,.9); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.lb-backdrop.open { display: flex; }
.lb-main { max-width: 95vw; max-height: 90vh; display: flex; gap: 18px; align-items: stretch; }
.lb-media { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 65vw; }
.lb-media img { max-width: 65vw; max-height: 74vh; border-radius: var(--radius-md); box-shadow: 0 20px 60px rgba(0,0,0,.5); object-fit: contain; background: #fff; }
.lb-caption { color: #fff; font-weight: 800; font-family: 'Baloo 2', sans-serif; font-size: 16px; text-align: center; }
.lb-info-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.lb-format {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 111, 181, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 2px 10px;
}
.lb-owned { display: none; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; }
.lb-owned.have { display: flex; color: #6FE3A0; }
.lb-owned.missing { display: flex; color: #FF8A8A; }
.lb-notes { color: #FFE29A; font-size: 13px; text-align: center; max-width: 60vw; }
.lb-action { margin: 0; }
.lb-action-btn {
  border: none; background: rgba(255,255,255,.15); color: #fff; font-weight: 800; font-size: 13px;
  padding: 9px 18px; border-radius: var(--radius-md); cursor: pointer;
}
.lb-action-btn.active { background: #FF6FB5; }
.lb-action-btn:hover { background: rgba(255,255,255,.3); }
.lb-action-btn.active:hover { background: #FF4F9A; }

/* Kommentare rechts neben dem Bild */
.lb-comments {
  width: 260px; flex-shrink: 0; background: rgba(255,255,255,.97); border-radius: var(--radius-lg);
  padding: 14px; display: flex; flex-direction: column; max-height: 68vh;
}
.lb-comments h4 { margin: 0 0 8px; color: #5B3E96; font-family: 'Baloo 2', sans-serif; font-size: 15px; }
.lb-comments-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.lb-comments-empty { color: #bbb; font-size: 12px; text-align: center; margin: 10px 0; }
.lb-comment { background: #F8F3FD; border-radius: var(--radius-sm); padding: 7px 10px; font-size: 12px; color: #555; }
.lb-comment.mine { background: #FDECF3; }
.lb-comment .who { color: #8A5FC7; font-weight: 800; }
.lb-comment-form { display: flex; gap: 6px; }
.lb-comment-form input {
  flex: 1; border: 2px solid #E4D3F5; border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; outline: none;
}
.lb-comment-form button {
  border: none; background: #B892E0; color: #fff; font-weight: 800; border-radius: var(--radius-sm);
  padding: 0 14px; cursor: pointer; font-size: 14px;
}

.lb-close {
  position: absolute; top: 18px; right: 18px; background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 38px; height: 38px; border-radius: 50%; font-size: 18px; font-weight: 800; cursor: pointer;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 58px; height: 58px; border-radius: 50%; font-size: 30px; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-nav:hover, .lb-close:hover { background: rgba(255,255,255,.3); }

@media (max-width: 760px) {
  .lb-main { flex-direction: column; max-height: 90vh; overflow-y: auto; }
  .lb-media { max-width: 100%; }
  .lb-media img { max-width: 100%; max-height: 46vh; }
  .lb-notes { max-width: 100%; }
  .lb-comments { width: 100%; max-height: 200px; }
}
@media (max-width: 600px) {
  .lb-nav { width: 50px; height: 50px; font-size: 24px; }
}

/* ---------- Export (PDF-Druckansicht / CSV) ---------- */
.export-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.export-btn {
  border: none; background: #B892E0; color: #fff; font-weight: 800; padding: 12px 20px;
  border-radius: var(--radius-md); font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block;
}
.export-btn.secondary { background: #F3ECFE; color: #8A5FC7; }
.export-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.export-table th, .export-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #F0E6FB; }
.export-table th { color: #8A5FC7; font-family: 'Baloo 2', sans-serif; }
.export-table .fmt-cell { font-weight: 800; color: #8A5FC7; }

/* Bestenliste im Dashboard */
.leaderboard-table th a { color: #8A5FC7; text-decoration: none; }
.leaderboard-table th a.sort-active { color: #B892E0; }
.leaderboard-table th a:hover { text-decoration: underline; }
.leaderboard-table tr.me-row { background: #FAF6FE; }
.leaderboard-table tr.me-row td:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

@media print {
  .topnav, .sidebar-col, .export-actions, .back-link { display: none !important; }
  .layout { display: block; padding: 0; max-width: none; }
  body { background: #fff; }
  .export-table { font-size: 11px; }
}

/* ---------- Mobile-Feinschliff (Android/iOS) ---------- */
@media (max-width: 600px) {
  /* Schriftgröße < 16px lässt Android/iOS beim Fokussieren reinzoomen - hier verhindert */
  input[type=text], input[type=password], input[type=email], select, textarea { font-size: 16px !important; }

  .multi-name-top { flex-wrap: wrap; }
  .multi-name-top input[type=text] { min-width: 140px; }
  .multi-name-top select { width: 90px; }
  .row-qty-input { width: 60px; }
  .edit-row .edit-actions { flex-wrap: wrap; }
  .export-actions .export-btn { width: 100%; text-align: center; }
  table.export-table, table.leaderboard-table, table.admin-table { font-size: 12px; }
}

/* ---------- Live-Update Pet-Stats (kein Reload mehr beim Füttern/Spielen) + sanftes
   Ein-Fade bei echten Seiten-Reloads (Upload, Umbenennen, Aktionen mit Redirect) ---------- */
.pet-dock-summary-stats span { display: inline-block; }
.stat-pop { animation: statPop 0.4s ease; }
@keyframes statPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Federt den kurzen "Ruck" bei echten Seiten-Reloads optisch ab - die Seite blendet ganz
   kurz ein, statt hart "an" zu sein, während sich Layout/Bilder oben noch setzen. Bewusst
   sehr kurz (150ms), damit es nicht wie eine Ladezeit wirkt, sondern nur die Kante glättet. */
body {
  animation: pageFadeIn 0.15s ease-out;
}
@keyframes pageFadeIn {
  from { opacity: 0.4; }
  to   { opacity: 1; }
}

/* ---------- Tausch-Entscheidung: behalten oder aus der Sammlung entfernen ---------- */
.trade-pending-list { display: flex; flex-direction: column; gap: 8px; }
.trade-pending-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: opacity 0.2s ease;
}
.trade-pending-row img { width: 42px; height: 42px; object-fit: cover; border-radius: var(--radius-xs); flex-shrink: 0; }
.trade-pending-name { flex: 1; font-size: 13px; font-weight: 600; color: #5B3E96; min-width: 0; }
.trade-pending-format { display: block; font-size: 11px; font-weight: 500; color: #999; }
.trade-pending-actions { display: flex; gap: 6px; flex-shrink: 0; }
.trade-pending-actions button {
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  background: #FF6FB5;
  color: #fff;
}
.trade-pending-actions button.secondary { background: #eee; color: #777; }

/* ---------- Profilbild-Rahmen ---------- */
/* Avatar + Rahmen übereinander - der Rahmen ist bewusst größer als der reine Avatar-Kreis,
   damit Verzierungen (Flügel, Figuren, Edelsteine) über den Rand hinausragen können. */
.avatar-frame-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.avatar-frame-wrap .avatar { position: absolute; }
.avatar-frame-img { position: absolute; pointer-events: none; }

/* Rahmen-Auswahl in "Profil anpassen" */
.frame-picker { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.frame-option-form { margin: 0; }
.frame-option {
  position: relative;
  width: 76px; height: 76px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 4px;
}
.frame-option img { width: 100%; height: auto; }
.frame-option.selected { border-color: #FF6FB5; background: rgba(255,111,181,0.12); }
.frame-option.locked { cursor: default; }
.frame-lock {
  position: absolute; bottom: 2px; right: 2px;
  font-size: 9px; font-weight: 700; color: #fff;
  background: rgba(0,0,0,0.55);
  border-radius: var(--radius-xs); padding: 1px 4px;
  line-height: 1.3;
}

/* Freischalt-Pop-up direkt am Profilbild */
.frame-unlock-popup {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  background: #FF6FB5; color: #fff; font-size: 11px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(255,111,181,0.4);
  animation: framePopIn 0.3s ease;
  z-index: 3;
}
@keyframes framePopIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- Bildausschnitt-Editor (Vorschau-Zuschnitt anpassen) ---------- */
.photo-pos-editor { margin-top: 4px; }
.photo-pos-hint { font-size: 11px; color: #999; margin: 4px 0 6px; }
.photo-pos-box {
  position: relative;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  background: #F3ECFE;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 0 auto;
  touch-action: none;
}
.photo-pos-box img { width: 100%; height: 100%; object-fit: contain; cursor: crosshair; display: block; }
.photo-pos-marker {
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid #fff;
  background: rgba(255,111,181,0.85);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(255,111,181,0.5), 0 2px 6px rgba(0,0,0,0.3);
  pointer-events: none;
}

/* ---------- Bild-Avatare ---------- */
.avatar-icon-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

.avatar-icon-picker { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.avatar-icon-option {
  position: relative;
  width: 62px; height: 62px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  overflow: visible;
}
.avatar-icon-option img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-icon-option.selected { border-color: #FF6FB5; box-shadow: 0 0 0 2px rgba(255,111,181,0.25); }
.avatar-icon-option.locked { cursor: default; }
.avatar-icon-lock {
  position: absolute; bottom: -4px; right: -4px;
  font-size: 9px; font-weight: 700; color: #fff;
  background: rgba(0,0,0,0.6);
  border-radius: var(--radius-xs); padding: 1px 4px;
  line-height: 1.3;
  white-space: nowrap;
}
.frame-unlock-popup.avatar-unlock-popup { top: -40px; background: #8A5FC7; box-shadow: 0 3px 10px rgba(138,95,199,0.4); }
.lb-avatar { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; overflow: hidden; vertical-align: middle; margin-right: 2px; }
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Aktivitäts-Timer (Fortschritts-Ring beim Füttern/Spielen/Schlafen) ---------- */
.pet-activity-timer {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%) scale(0.85);
  width: 40px; height: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 4;
}
.pet-activity-timer.show { opacity: 1; transform: translateX(-50%) scale(1); }
.pet-activity-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pet-timer-track { fill: none; stroke: rgba(255,255,255,0.55); stroke-width: 3; }
.pet-timer-fill { fill: none; stroke: #FF6FB5; stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 0.1s linear; }
.pet-timer-text {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 10px; font-weight: 800; color: #7a2354;
}

.weekend-bonus-banner { background: linear-gradient(90deg, #FFD98A, #FF6FB5); }

/* ---------- Tage-in-Folge-Kalender ---------- */
.streak-calendar { display: flex; gap: 8px; margin-top: 8px; }
.streak-dot { width: 24px; height: 24px; border-radius: 50%; background: #F0E3F7; border: 2px solid #E4D3F5; }
.streak-dot.filled { background: linear-gradient(135deg, #FFD98A, #FF6FB5); border-color: #FF6FB5; }

/* ---------- @Erwähnungen im Live-Chat ---------- */
.mention { font-weight: 800; color: #4A90D9; }
.mention.mention-me { color: #E5484D; }

/* ---------- @Namensvorschläge beim Tippen im Chat ---------- */
.chat-mention-suggest {
  position: absolute;
  bottom: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #E4D3F5;
  border-radius: var(--radius-sm);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.12);
  max-height: 160px;
  overflow-y: auto;
  display: none;
  z-index: 20;
  margin-bottom: 4px;
}
.chat-mention-suggest.show { display: block; }
.chat-mention-suggest-item {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #5B3E96;
  cursor: pointer;
}
.chat-mention-suggest-item:hover, .chat-mention-suggest-item.active { background: #F3ECFE; }
