/* ============================================================
   AH24 – echtes Logo, kompaktes Hauptfenster, Handy/Tablet
   Wird NACH styles.css/platform.css/public-chat.css geladen.
   ============================================================ */

/* ---------- Benachrichtigungen: verstaendlich statt "tote Glocke" ---------- */
.note-help { margin-bottom: 14px; }
.note-help .panel-head { padding-bottom: 8px; }
.note-help-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 9px; padding: 4px 18px 8px;
}
.note-help-grid > div {
  display: grid; gap: 3px; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface-2);
}
.note-help-grid b { font-size: 12px; color: var(--ink); }
.note-help-grid small { font-size: 11px; line-height: 1.45; color: var(--ink-3); }
.note-help-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 4px 18px 16px;
}
.note-settings .setting-row .text-link {
  display: inline-block; margin-top: 3px; font-size: 11px;
}
.help-steps {
  margin: 8px 0 12px; padding-left: 22px;
  font-size: 12.5px; line-height: 1.7; color: var(--ink-2);
}
.help-steps li { margin-bottom: 4px; }
.help-steps b { color: var(--ink); }

/* ---------- Echte Logos (quadratisch = App, breit = Website) ----------
   Das Wordmark steht FREI in der Kopfzeile – ohne Rahmen, ohne Kapsel,
   ohne Hintergrund. Es wird nicht zugeschnitten. */
.brand {
  gap: 0; overflow: visible;
  padding: 0; margin: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.brand:hover {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: .88;
}
.brand .brand-wordmark {
  display: block;
  /* 1086:362 = 3:1. Die alte max-height:38px hat das Wortmark auf
     effektiv 114 px gestaucht – deshalb war die Schrift schwer lesbar.
     Jetzt bestimmt die Breite die Groesse, die Hoehe bleibt proportional. */
  width: clamp(150px, 15.5vw, 180px);
  height: auto;
  max-height: 60px;
  object-fit: contain;
  object-position: left center;
}
.footer-wordmark {
  display: block;
  width: 116px;
  height: auto;
  max-height: 32px;
  object-fit: contain;
  margin: 0 auto 8px;
  opacity: .96;
}
[data-theme="dark"] .brand .brand-wordmark,
[data-theme="dark"] .footer-wordmark { filter: brightness(1.1) contrast(1.02); }

/* ---------- Hero: kompakter, ohne Inhalt zu verlieren ---------- */
.hero.hero-luxury { min-height: 360px; }
.hero-luxury-copy { padding: 30px 34px 26px; }
.hero-eyebrow-lux { margin-bottom: 10px; }
.hero-luxury-title {
  font-size: clamp(28px, 4.2vw, 42px);
  margin-bottom: 10px;
}
.hero-luxury-sub { margin-bottom: 18px; }
.hero-luxury-search { height: 48px; max-width: 440px; }
.hero-luxury-actions { margin-top: 14px; }
.hero-luxury-actions .btn { min-height: 42px; }
.hero-luxury-stats { margin-top: 18px; padding-top: 14px; }

/* ---------- Arena: Champions + Live-Matches in zwei schmalen Reihen ---------- */
.arena.ah24-arena {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}
.ah24-arena-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ah24-arena-card {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.ah24-arena-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.ah24-arena-head h2 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.ah24-arena-head h2 span { font-weight: 600; color: var(--ink-2); }
.ah24-arena-head a {
  flex: none;
  color: var(--brand-text, var(--brand));
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
}
.ah24-arena-head a:hover { text-decoration: underline; }

.ah24-champs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ah24-champ {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 11px;
  background: var(--surface-2, rgba(0, 0, 0, .03));
  color: inherit;
  text-decoration: none;
}
.ah24-champ i {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--medal);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
.ah24-champ b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.ah24-champ small {
  margin-left: auto;
  flex: none;
  color: var(--ink-3);
  font-size: 10px;
  white-space: nowrap;
}
.ah24-champ.chip-empty { color: var(--ink-3); font-size: 11px; }
.ah24-champ.chip-empty i { background: var(--line); color: var(--ink-2); }

.ah24-lives { display: flex; flex-direction: column; gap: 7px; }
.ah24-live-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 72px auto;
  grid-template-areas: "names score bar meta";
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--surface-2, rgba(0, 0, 0, .03));
  color: inherit;
  text-decoration: none;
}
.ah24-live-row.crown { box-shadow: inset 3px 0 0 #d4a017; }
.ah24-live-names {
  grid-area: names;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11.5px;
}
.ah24-live-names b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ah24-live-names i {
  flex: none;
  color: var(--ink-3);
  font-size: 9px;
  font-style: normal;
}
.ah24-live-score {
  grid-area: score;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ah24-live-bar {
  grid-area: bar;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}
.ah24-live-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0e7a5f, #16a37e);
}
.ah24-live-meta {
  grid-area: meta;
  color: var(--ink-3);
  font-size: 10px;
  white-space: nowrap;
}
.ah24-live-empty {
  padding: 10px;
  text-align: center;
  color: var(--ink-2);
  font-size: 12px;
}
.ah24-live-empty a { color: var(--brand-text, var(--brand)); font-weight: 700; }

.ah24-crown-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(214, 160, 23, .3);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(214, 160, 23, .14), transparent);
  font-size: 11.5px;
}
.ah24-crown-row span { font-weight: 700; white-space: nowrap; }
.ah24-crown-row a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font-weight: 700;
}
.ah24-crown-row .btn {
  min-height: 30px;
  margin-left: auto;
  padding: 0 12px;
  font-size: 11px;
}

/* Chat im Hauptfenster etwas flacher – Inhalt bleibt vollständig */
#public-chat-root.pc-in-arena .pc-panel { height: 280px; }

/* ---------- Handy / Tablet ---------- */
@media (max-width: 899px) {
  .hero.hero-luxury { min-height: auto; }
  .hero-luxury-copy { padding: 26px 18px 22px; }
  .hero-luxury-title { font-size: clamp(26px, 7vw, 36px); }
  .hero-luxury-search { height: 46px; }
  .hero-luxury-actions { flex-direction: row !important; flex-wrap: nowrap; gap: 8px; }
  .hero-luxury-actions .btn {
    flex: 1 1 0; min-width: 0; width: auto !important;
    min-height: 44px; padding: 0 12px !important; font-size: 12.5px !important;
  }
  .hero-luxury-stats { margin-top: 12px; padding-top: 10px; }

  .ah24-arena-grid { grid-template-columns: minmax(0, 1fr); }
  .ah24-champ { flex-direction: column; align-items: flex-start; gap: 4px; padding: 7px; }
  .ah24-champ small { margin-left: 0; }
  .ah24-live-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "names score meta" "bar bar bar";
  }
  .ah24-live-bar { width: 100%; }
  .ah24-crown-row { flex-wrap: wrap; }
  .ah24-crown-row .btn { margin-left: 0; }

  #public-chat-root.pc-in-arena .pc-panel { height: 320px; }

  /* iOS vergrößert Inputs sonst beim Fokus automatisch */
  input, select, textarea { font-size: 16px !important; }
  .btn, .chip, .icon-link, .tab, .icon-btn { min-height: 44px; }
  .ah24-crown-row .btn { min-height: 36px; }
}

@media (max-width: 480px) {
  /* Hero noch flacher: nur LIVE-Chip, knapper Text, Buttons nebeneinander */
  .hero-luxury-copy { padding: 20px 18px 16px; }
  .hero-eyebrow-lux { font-size: 0; margin-bottom: 6px; }
  .hero-eyebrow-lux .hero-live-chip { font-size: 11px; }
  .hero-luxury-title { font-size: 22px; line-height: 1.08; margin-bottom: 8px; }
  .hero-luxury-sub { font-size: 12px; line-height: 1.35; margin-bottom: 10px; }
  .hero-luxury-search { height: 44px; }
  .hero-luxury-actions { flex-direction: row !important; flex-wrap: nowrap; gap: 8px; margin-top: 10px; }
  .hero-luxury-actions .btn {
    flex: 1 1 0; min-width: 0; width: auto !important;
    min-height: 44px; padding: 0 8px !important; font-size: 12px !important;
  }
  .hero-luxury-stats { gap: 6px; margin-top: 8px; padding-top: 8px; }
  .hero-luxury-stats .hstat { padding: 6px 8px; }
  .hero-luxury-stats .hstat b { font-size: 16px; }
  .hero-live-ticker { margin-top: 6px; padding: 4px 10px; }
}

@media (max-width: 419px) {
  .brand .brand-wordmark { width: min(100%, 146px); max-height: none; }
  .ah24-arena-head h2 { font-size: 13px; }
  .ah24-champ b { font-size: 11px; }
  .ah24-live-meta { display: none; }
  .ah24-live-row { grid-template-areas: "names score" "bar bar"; grid-template-columns: minmax(0, 1fr) auto; }
}

@media (min-width: 720px) and (max-width: 1100px) {
  .ah24-arena-card { padding: 11px; }
  .ah24-live-row { grid-template-columns: minmax(0, 1fr) auto 56px auto; }
}

/* ---------- APP: nicht "verbaut" auf Handy/Tablet ---------- */
@media (max-width: 520px) {
  /* WICHTIG: clip statt hidden! hidden macht den Body zum eigenen
     Scroll-Container – die Sticky-Kopfzeile bleibt dann beim
     Hochscrollen abgeschnitten und man kommt nicht mehr ganz nach oben. */
  html, body { overflow-x: clip; max-width: 100%; }
  .appbar, .topbar, .site-header, header.app-bar {
    height: auto !important; min-height: 0 !important;
    flex-wrap: wrap !important; gap: 6px !important;
    padding: 8px 10px !important;
  }
  .top-search, .mobile-search { display: none !important; }
  .brand { padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; }
  /* Logo nativ (1086:362) – keine Hoehenbegrenzung mehr, sonst wird die
     Schrift gestaucht und ist auf dem Handy schlecht lesbar. */
  .brand .brand-wordmark {
    width: min(100%, 150px) !important;
    height: auto !important; max-height: none !important;
  }
  :root { --appbar-h: 62px; }
  .appbar-inner { min-height: 62px !important; }
  .hero.hero-luxury { min-height: 0 !important; }
  .hero-luxury-copy { padding: 18px 14px 14px !important; }
  .hero-luxury-title { font-size: 21px !important; }
  .ah24-arena-card { padding: 10px !important; border-radius: 14px !important; }
  .panel, .settings-shell, .ref-link-card, .ref-qr-card, .profile-hero {
    border-radius: 14px !important; padding: 13px !important;
  }
  .profile-stats-grid, .ref-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .modal { max-width: 100% !important; max-height: calc(100dvh - 20px) !important; border-radius: 16px !important; }
  .modal-body { padding: 14px 16px !important; }
  .modal-foot { padding: 10px 14px calc(12px + env(safe-area-inset-bottom)) !important; }
  .ref-qr-card { flex-direction: column !important; align-items: stretch !important; }
  .ref-qr-image { width: 100% !important; max-width: 200px; margin: 0 auto !important; }
  .setting-row, .ship-row, .ad-actions { flex-wrap: wrap !important; }
}

@media (min-width: 521px) and (max-width: 1024px) {
  .appbar, .topbar, .site-header { flex-wrap: wrap; height: auto !important; }
  .hero.hero-luxury { min-height: 330px; }
  .profile-stats-grid, .ref-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* ---------- Standort: auf PC weiterhin oben, auf Handy einklappbar ---------- */
.loc-topbar .loc-fields {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  flex: 1 1 auto; min-width: 0;
}
.loc-toggle { display: none; }
.pc-mobile-bar { display: none; }

@media (max-width: 899px) {
  /* Keine feste Leiste mehr: die Stadt/PLZ-Zeile scrollt jetzt normal mit
     dem Inhalt und ist standardmäßig zu – ein Tipp öffnet die Felder. */
  .page.feed-page { padding-top: 0 !important; }
  .loc-topbar {
    position: static !important; transform: none !important;
    left: auto !important; width: auto !important;
    margin: 10px 12px 10px !important; padding: 0 !important;
    border: 0 !important; background: transparent !important;
    box-shadow: none !important; backdrop-filter: none !important;
  }
  .loc-toggle {
    display: flex !important; align-items: center; gap: 10px;
    width: 100%; min-height: 48px; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface-2); color: var(--ink);
    font: inherit; text-align: left; cursor: pointer;
    box-shadow: var(--shadow-sm);
  }
  .loc-toggle > span:nth-child(2) { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
  .loc-toggle b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .loc-toggle small { font-size: 10.5px; color: var(--ink-3); }
  .loc-toggle .loc-pin { display: inline-flex; flex: none; color: var(--brand); }
  .loc-toggle .loc-chev { flex: none; font-size: 13px; color: var(--ink-3); transition: transform .18s ease; }
  .loc-topbar.is-open .loc-toggle .loc-chev { transform: rotate(180deg); }
  .loc-topbar .loc-fields {
    display: none; margin-top: 6px; padding: 10px;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface); box-shadow: var(--shadow-sm);
  }
  .loc-topbar.is-open .loc-fields { display: flex; }
  .loc-topbar .loc-input, .loc-topbar .loc-street-wrap, .loc-topbar .loc-input-wrap { flex: 1 1 100%; }

  /* Live-Chat: kompakte Leiste statt 380 px hohem Block. */
  #public-chat-root.pc-in-arena { display: block !important; }
  .pc-mobile-bar {
    display: flex !important; align-items: center; gap: 8px;
    width: 100%; min-height: 48px; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface-2); color: var(--ink);
    font: inherit; text-align: left; cursor: pointer;
    box-shadow: var(--shadow-sm);
  }
  .pc-mobile-title { flex: 1 1 auto; font-size: 13px; font-weight: 750; }
  .pc-mobile-chev { color: var(--ink-3); font-size: 13px; transition: transform .18s ease; }
  #public-chat-root.pc-user-open .pc-mobile-chev { transform: rotate(180deg); }
  .pc-mobile-unread {
    display: inline-grid; place-items: center; min-width: 19px; height: 19px;
    padding: 0 5px; border-radius: 999px;
    background: #e2573f; color: #fff; font: 800 10px/1 sans-serif;
  }
  .pc-mobile-unread[hidden] { display: none !important; }
  #public-chat-root.pc-in-arena .pc-panel {
    display: none !important; height: auto; max-height: none;
    border-radius: 12px; margin-top: 6px;
  }
  #public-chat-root.pc-in-arena.pc-user-open .pc-panel { display: flex !important; }
  #public-chat-root.pc-in-arena .pc-list { max-height: 260px; }
  #public-chat-root.pc-in-arena .pc-compose textarea { min-height: 44px; max-height: 88px; }
}

@media (min-width: 900px) {
  .loc-toggle, .pc-mobile-bar { display: none !important; }
  .loc-topbar .loc-fields { display: flex !important; }
  #public-chat-root.pc-in-arena .pc-panel { display: flex !important; }
}

/* ============================================================
   APP-KOPFZEILE:Eine Zeile statt "Turm". Logo klein links,
   Symbole kompakt rechts – kein Umbrechen, kein riesiger Abstand.
   ============================================================ */
@media (max-width: 899px) {
  /* Sticky-Abstaende an die neue, flachere Kopfzeile anpassen */
  :root { --appbar-h: 120px; }
  .appbar {
    padding: 0 !important; height: auto !important; min-height: 0 !important;
    /* Deckend! Die Basis-Kopfzeile ist nur zu 86 % opak. Beim Scrollen
       rutscht die Stadt/PLZ-Leiste darunter und schien bisher halb
       durch die Kopfzeile durch ("halb ueberlappt"). */
    background: var(--surface) !important;
    backdrop-filter: none !important;
  }
  /* Sticky Betreiber-Leiste ebenfalls deckend – sonst scheint auch hier
     die Stadt/PLZ-Leiste beim Scrollen durch. */
  #operator-bar { background: var(--surface) !important; }
  .appbar-inner {
    display: flex !important; flex-wrap: nowrap !important;
    align-items: center !important; justify-content: space-between !important;
    gap: 6px !important; padding: 6px 10px !important; min-height: 52px !important;
  }
  /* Die freie Breite gehoert dem Logo: es nutzt die ganze Spalte und
     steht darin mittig. Die Symbole rechts brauchen nur ~170 px. */
  .brand {
    flex: 1 1 auto !important; min-width: 0 !important;
    justify-content: center !important;
  }
  .brand .brand-wordmark {
    width: min(100%, 170px) !important;
    height: auto !important; max-height: none !important;
    object-fit: contain !important;
  }
  .top-actions {
    flex: 0 0 auto !important; min-width: 0 !important;
    flex-wrap: nowrap !important; justify-content: flex-end !important;
    gap: 2px !important; margin-left: 0 !important;
  }
  .top-actions .icon-link {
    flex: 0 0 36px !important; width: 36px !important; height: 36px !important;
    min-height: 36px !important; padding: 0 !important;
  }
  .top-actions .icon-link svg { width: 18px !important; height: 18px !important; }
  .avatar-link { flex: 0 0 34px !important; margin-left: 2px !important; }
  .avatar-link .avatar {
    width: 34px !important; height: 34px !important;
    min-height: 34px !important; font-size: 12px !important;
  }
  .guest-cta {
    min-height: 34px !important; padding: 0 8px !important;
    font-size: 11px !important; white-space: nowrap !important;
  }
  .mobile-search-row { padding: 0 10px !important; margin: 0 !important; gap: 8px !important; }
  .mobile-search-row .mobile-search { margin: 0 0 8px !important; }

  /* Der Auktionshammer im Suchfeld bleibt auf Tablets sichtbar (wie auf
     der Homepage). Auf kleinen Handys steht er allein unter dem
     Profilbild – dort wird er im Block weiter unten ausgeblendet. */
  .tabbar .tab-sell svg { width: 22px !important; height: 22px !important; }
}

@media (max-width: 520px) {
  /* Nur noch eine Zeile – kein Suchfeld in der Kopfzeile mehr */
  :root { --appbar-h: 62px; }
  /* Auf dem kleinen Handy ist die mobile Suchzeile ausgeblendet – der
     Hammer wirkte dort als verwaistes Einzelicon unter dem Profilbild.
     „Auktion starten" bleibt über den unteren Hammer-Tab erreichbar. */
  .mobile-top-sales { display: none !important; }
  .mobile-search-row { display: none !important; }
}

@media (max-width: 420px) {
  .top-actions .icon-link {
    flex-basis: 32px !important; width: 32px !important;
    height: 32px !important; min-height: 32px !important;
  }
  .top-actions .icon-link svg { width: 16px !important; height: 16px !important; }
  .brand .brand-wordmark {
    width: min(100%, 146px) !important;
    height: auto !important; max-height: none !important;
  }
  .guest-cta { font-size: 10px !important; padding: 0 6px !important; }
  .avatar-link .avatar { width: 30px !important; height: 30px !important; min-height: 30px !important; }
}

/* Suche und Statistiken im Hero klar trennen – nichts läuft ineinander */
.hero-luxury-search { margin-bottom: 10px !important; }
.hero-luxury-stats { border-top: 1px solid var(--line) !important; }

/* Footer: Logo, Rechtliches und Copyright klar getrennt */
.site-footer {
  display: flex !important; flex-direction: column !important;
  align-items: center !important; gap: 12px !important;
}
.site-footer .footer-wordmark { margin: 2px auto !important; }
.site-footer small { margin-top: 0 !important; line-height: 1.6 !important; }

/* KI-Button bleibt beim Scrollen immer an derselben Stelle */
#ai-root {
  position: fixed !important;
  right: 12px !important;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 58 !important;
}
