﻿/* C42N86-C
   Aktive XP-Kosmetik in persönlicher Akte, Loge und Ranglisten.
   Die endgültigen Bildassets folgen später; bis dahin werden die stabilen
   Kosmetik-IDs mit einer viktorianischen CSS-Darstellung sichtbar gemacht.
*/

/* ------------------------------------------------------------
   Gemeinsame Medaille
   ------------------------------------------------------------ */

.so-cosmetic-medal-display {
  position: absolute;
  right: -.42rem;
  bottom: -.34rem;
  z-index: 40;
  width: 2.75rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: .17rem double rgba(240, 215, 175, .94);
  background:
    radial-gradient(circle at 35% 28%, #9c8464 0 7%, #5d4835 25%, #2a1c15 56%, #0b0807 82%);
  color: #eed6ad;
  box-shadow:
    0 .28rem .7rem rgba(0,0,0,.64),
    inset 0 0 0 .16rem rgba(0,0,0,.38),
    0 0 .9rem rgba(183,28,28,.12);
  font-family: Georgia, "Times New Roman", serif;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .025em;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.so-cosmetic-medal-display::before {
  content: "";
  position: absolute;
  inset: .26rem;
  border-radius: 50%;
  border: 1px solid rgba(220,190,153,.34);
}

.so-cosmetic-medal-display.is-legend {
  border-color: rgba(255,232,191,.98);
  background:
    radial-gradient(circle at 35% 28%, #d3b987 0 7%, #79603c 27%, #321a15 57%, #090605 82%);
  color: #fff1cb;
  box-shadow:
    0 .3rem .8rem rgba(0,0,0,.68),
    inset 0 0 0 .16rem rgba(0,0,0,.42),
    0 0 1rem rgba(183,28,28,.24);
}

/* ------------------------------------------------------------
   Rahmen
   ------------------------------------------------------------ */

.so-cosmetic-frame-host {
  position: relative !important;

  /* C42N86-C1:
     Rahmen duerfen die darueberliegende Medaille nicht abschneiden.
     Das eigentliche Profilbild behaelt seine vorhandene Rundung. */
  overflow: visible !important;
}

.so-cosmetic-frame-level30 {
  box-shadow:
    0 0 0 2px rgba(220,190,153,.66),
    0 0 0 5px rgba(183,28,28,.23),
    0 .45rem 1rem rgba(0,0,0,.30) !important;
}

.so-cosmetic-frame-level75 {
  box-shadow:
    0 0 0 2px rgba(224,198,158,.86),
    0 0 0 5px rgba(91,70,47,.78),
    0 0 1.05rem rgba(220,190,153,.16),
    0 .45rem 1rem rgba(0,0,0,.34) !important;
}

.so-cosmetic-frame-level100 {
  box-shadow:
    0 0 0 2px rgba(247,223,184,.98),
    0 0 0 5px rgba(183,28,28,.68),
    0 0 0 8px rgba(220,190,153,.18),
    0 0 1.2rem rgba(183,28,28,.22),
    0 .45rem 1rem rgba(0,0,0,.38) !important;
}

/* ------------------------------------------------------------
   Hintergrund / Aktenstil / Ornament
   ------------------------------------------------------------ */

.so-cosmetic-background-level50 {
  background-image:
    linear-gradient(115deg, rgba(34,17,8,.50), rgba(0,0,0,.18)),
    repeating-linear-gradient(
      135deg,
      rgba(220,190,153,.055) 0 1px,
      transparent 1px 13px
    ) !important;
}

.so-cosmetic-style-level90 {
  border-color: rgba(220,190,153,.42) !important;
  box-shadow:
    inset 0 0 0 1px rgba(220,190,153,.08),
    inset 0 0 3.5rem rgba(183,28,28,.07) !important;
}

.so-cosmetic-style-level100 {
  border-color: rgba(239,215,177,.62) !important;
  box-shadow:
    inset 0 0 0 1px rgba(239,215,177,.15),
    inset 0 0 4.2rem rgba(183,28,28,.12),
    0 0 1.4rem rgba(183,28,28,.11) !important;
}

.so-cosmetic-ornament-display {
  position: absolute;
  left: .5rem;
  top: .42rem;
  z-index: 18;
  color: #dcbe99;
  font-size: 1.15rem;
  line-height: 1;
  text-shadow:
    0 0 .55rem rgba(220,190,153,.38),
    0 0 .85rem rgba(183,28,28,.20);
  pointer-events: none;
}

/* ------------------------------------------------------------
   Persönliche Akte
   ------------------------------------------------------------ */

.some-dashboard-dossier-c42m3.so-has-cosmetic-appearance {
  position: relative;
}

.some-dashboard-dossier-c42m3.so-cosmetic-background-level50 {
  background-color: rgba(8,5,5,.94) !important;
}

.some-dashboard-dossier-avatar-frame.so-cosmetic-frame-host {
  border-radius: 1.75rem;
}

/* C42N86-C2:
   Der Rahmen bleibt abgerundet; das eigentliche Profilbild folgt exakt
   derselben Form. overflow bleibt am Host sichtbar, damit die Medaille
   weiterhin ueber Bild und Rahmen hinausragen kann. */
.some-dashboard-dossier-avatar-frame.so-cosmetic-frame-host > img {
  display: block;
  border-radius: inherit !important;
}

.some-dashboard-dossier-avatar-frame .so-cosmetic-medal-display {
  /* Etwas kompakter als zuvor, Ueberstand bleibt bewusst erhalten. */
  width: clamp(2.65rem, 6vw, 3.45rem);
  right: -.7rem;
  bottom: -.55rem;

  /* Die Levelzahl soll auf der kleineren Medaille klarer lesbar sein. */
  font-size: clamp(.88rem, 1.8vw, 1.05rem);
  font-weight: 900;
}

.some-dashboard-dossier-avatar-frame .so-cosmetic-ornament-display {
  left: -.65rem;
  top: -.65rem;
  font-size: 1.7rem;
}

/* ------------------------------------------------------------
   Loge
   ------------------------------------------------------------ */

.so-profile-card.so-has-cosmetic-appearance {
  position: relative;
  isolation: isolate;
}

.so-profile-card.so-cosmetic-background-level50 {
  background-color: rgba(11,7,6,.95) !important;
}

.so-profile-avatar.so-cosmetic-frame-host {
  border-radius: 1rem;
}

.so-profile-avatar.so-cosmetic-frame-host {
  overflow: visible !important;
}

.so-profile-avatar.so-cosmetic-frame-host > img {
  display: block;
  border-radius: inherit;
}

.so-profile-avatar .so-cosmetic-medal-display {
  /* C42N86-C3:
     In der Loge kompakter, damit die Medaille weder zu viel Bild
     verdeckt noch in den Textbereich hineinragt. */
  width: 2.05rem;

  /* Weiterhin sichtbar ueber Bild/Rahmen, aber deutlich dezenter. */
  right: -.46rem;
  bottom: -.42rem;

  z-index: 50;
  font-size: .78rem;
  font-weight: 900;
}

.so-profile-card > .so-cosmetic-ornament-display {
  left: .72rem;
  top: .64rem;
}

/* ------------------------------------------------------------
   Oeffentliche Loge-Detailseite /profile/{idOrLogin}
   ------------------------------------------------------------ */

.so-public-file.so-has-cosmetic-appearance {
  position: relative;
  isolation: isolate;
}

.so-public-file.so-cosmetic-background-level50 {
  border-radius: 1.25rem;
  background-image:
    linear-gradient(115deg, rgba(34,17,8,.34), rgba(0,0,0,.10)),
    repeating-linear-gradient(
      135deg,
      rgba(220,190,153,.045) 0 1px,
      transparent 1px 13px
    );
}

.so-public-file.so-cosmetic-style-level90 .so-public-file-hero {
  border-color: rgba(220,190,153,.45) !important;
  box-shadow:
    inset 0 0 0 1px rgba(220,190,153,.09),
    inset 0 0 3.7rem rgba(183,28,28,.08) !important;
}

.so-public-file.so-cosmetic-style-level100 .so-public-file-hero {
  border-color: rgba(239,215,177,.66) !important;
  box-shadow:
    inset 0 0 0 1px rgba(239,215,177,.16),
    inset 0 0 4.4rem rgba(183,28,28,.13),
    0 0 1.5rem rgba(183,28,28,.12) !important;
}

.so-public-file-avatar,
.so-public-file-avatar-frame {
  overflow: visible !important;
}

.so-public-file-avatar-frame.so-cosmetic-frame-host {
  position: relative !important;
  overflow: visible !important;
  border-radius: 1.5rem;
}

.so-public-file-avatar-frame.so-cosmetic-frame-host > img {
  display: block;
  border-radius: inherit !important;
}

.so-public-file-avatar-frame .so-cosmetic-medal-display {
  width: clamp(2.65rem, 6vw, 3.45rem);
  right: -.78rem;
  bottom: -.62rem;
  z-index: 50;
  font-size: clamp(.88rem, 1.8vw, 1.05rem);
  font-weight: 900;
}

.so-public-file-avatar-frame .so-cosmetic-ornament-display {
  left: -.62rem;
  top: -.62rem;
  z-index: 45;
  font-size: 1.65rem;
}

/* ------------------------------------------------------------
   Ranglisten
   ------------------------------------------------------------ */

.so-table tr.so-has-cosmetic-appearance > td {
  transition: background-color .16s ease, box-shadow .16s ease;
}

.so-table tr.so-cosmetic-background-level50 > td {
  background-image:
    linear-gradient(90deg, rgba(70,42,19,.16), rgba(0,0,0,.02)),
    repeating-linear-gradient(
      135deg,
      rgba(220,190,153,.035) 0 1px,
      transparent 1px 12px
    );
}

.so-table tr.so-cosmetic-style-level90 > td:first-child {
  box-shadow: inset 2px 0 0 rgba(220,190,153,.55);
}

.so-table tr.so-cosmetic-style-level100 > td:first-child {
  box-shadow: inset 3px 0 0 rgba(183,28,28,.82);
}

.so-leaderboard-cosmetic-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  aspect-ratio: 1;
  margin-right: .52rem;
  vertical-align: middle;
  border-radius: .72rem;
  border: 1px solid rgba(220,190,153,.18);
  background:
    radial-gradient(circle at 35% 28%, rgba(220,190,153,.14), transparent 34%),
    #100b0b;
  color: #dcbe99;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.so-leaderboard-cosmetic-avatar.so-cosmetic-frame-level30 {
  box-shadow:
    0 0 0 1px rgba(220,190,153,.66),
    0 0 0 3px rgba(183,28,28,.22) !important;
}

.so-leaderboard-cosmetic-avatar.so-cosmetic-frame-level75 {
  box-shadow:
    0 0 0 1px rgba(224,198,158,.84),
    0 0 0 3px rgba(91,70,47,.74) !important;
}

.so-leaderboard-cosmetic-avatar.so-cosmetic-frame-level100 {
  box-shadow:
    0 0 0 1px rgba(247,223,184,.98),
    0 0 0 3px rgba(183,28,28,.66),
    0 0 0 5px rgba(220,190,153,.14) !important;
}

.so-leaderboard-cosmetic-avatar .so-cosmetic-medal-display {
  width: 1.3rem;
  right: -.56rem;
  bottom: -.42rem;
  border-width: .1rem;
  font-size: .42rem;
}

.so-leaderboard-cosmetic-avatar .so-cosmetic-ornament-display {
  left: -.42rem;
  top: -.42rem;
  font-size: .76rem;
}

@media (max-width: 620px) {
  .so-cosmetic-medal-display {
    width: 2.35rem;
  }

  .so-leaderboard-cosmetic-avatar {
    width: 1.9rem;
    margin-right: .4rem;
  }
}

/* ============================================================
   C42N86-D2 – SilentObscure in der Loge
   Urspruengliche Kartenoptik bleibt erhalten.
   SilentObscure ist kein Ranglistenplatz innerhalb der Loge.
   ============================================================ */

.so-profile-card.so-silentobscure-unranked .so-profile-rank {
  display: none !important;
}

.so-profile-card.so-silentobscure-unranked .so-profile-login {
  color: #dcbe99;
  font-weight: 700;
}

/* Falls ein alter Sonderstil noch aus dem Browser-DOM stammt,
   neutralisieren wir ihn bis zum Hard-Reload ebenfalls. */
.so-profile-card.so-silentobscure-card {
  border-color: inherit !important;
  background: inherit !important;
  box-shadow: inherit !important;
}

.so-profile-card.so-silentobscure-card::before,
.so-profile-card .so-silentobscure-card-seal {
  display: none !important;
}

/* ============================================================
   C42N86-D3 – SilentObscure: feste Vernebelung in der Loge
   ============================================================ */

/* Unter dem Namen darf ausschließlich "Herr des Anwesens" stehen.
   Der XP-Meilensteintitel wird von einem separaten asynchronen Script
   erzeugt und deshalb hier zusätzlich dauerhaft ausgeblendet. */
.so-profile-card.so-silentobscure-unranked .some-loge-xp-title-c42n84 {
  display: none !important;
}

/* Die Statuszeile "Herr des Anwesens" bleibt bewusst sichtbar. */
.so-profile-card.so-silentobscure-unranked .so-profile-login {
  display: block !important;
  color: #dcbe99;
  font-weight: 700;
}

/* Alle Zahlenfelder der Loge-Kachel werden bei SilentObscure unabhängig
   von den persönlichen Sichtbarkeitseinstellungen als vernebelt geführt. */
.so-profile-card.so-silentobscure-unranked .so-profile-metric strong {
  color: #f2e2ce;
}

/* ============================================================
   C42N86-D4 / F1.4-A.6 – Sonderakte: Geschichte des Hausherrn
   Nur /profile/silentobscure
   Vollbreite Sonderakte ohne SOME-Livewerte.
   ============================================================ */

.so-silentobscure-story {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  min-height: 18rem;
  padding: clamp(1.35rem, 3vw, 2.2rem) !important;
  border-color: rgba(220,190,153,.20) !important;
  background:
    radial-gradient(circle at 88% 18%, rgba(183,28,28,.13), transparent 33%),
    linear-gradient(135deg, rgba(33,11,11,.80), rgba(6,4,4,.94)) !important;
}

.so-silentobscure-story::before {
  content: "SO";
  position: absolute;
  right: clamp(.8rem, 4vw, 2.8rem);
  bottom: -1rem;
  color: rgba(220,190,153,.035);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(7rem, 18vw, 14rem);
  font-weight: 900;
  line-height: .8;
  letter-spacing: -.08em;
  pointer-events: none;
}

.so-silentobscure-story > * {
  position: relative;
  z-index: 2;
}

.so-silentobscure-story-kicker {
  margin-bottom: .25rem;
  color: rgba(220,190,153,.76);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.so-silentobscure-story h2 {
  margin: 0 0 1rem;
  color: #fff3df;
  font-size: clamp(1.75rem, 3.5vw, 2.7rem);
}

.so-silentobscure-story-text {
  display: grid;
  width: 100%;
  max-width: none;
  gap: .9rem;
}

.so-silentobscure-story-text p {
  margin: 0;
  color: rgba(241,232,220,.83);
  font-size: 1rem;
  line-height: 1.7;
}

.so-silentobscure-story-text strong {
  color: #efd0a5;
}

.so-silentobscure-lestat-note {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin-top: 1.2rem;
  padding: .9rem 1rem;
  border-left: 3px solid rgba(183,28,28,.68);
  border-radius: 0 .75rem .75rem 0;
  background: rgba(0,0,0,.24);
  color: rgba(220,190,153,.85);
  font-style: italic;
  line-height: 1.55;
}

.so-silentobscure-lestat-note::before {
  content: "Lestat:";
  display: block;
  margin-bottom: .22rem;
  color: #dcbe99;
  font-style: normal;
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

/* ============================================================
   C42N87 – Medienverwaltung für aktive Kosmetik
   ============================================================ */

.so-cosmetic-frame-media {
  position: absolute;
  inset: 0;
  z-index: 35;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.so-cosmetic-medal-display.has-media-asset {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.so-cosmetic-medal-display.has-media-asset::before {
  display: none;
}

.so-cosmetic-medal-media,
.so-cosmetic-ornament-media {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.so-cosmetic-ornament-display.has-media-asset {
  width: 2.25rem;
  aspect-ratio: 1;
  font-size: 0;
}

.some-dashboard-dossier-avatar-frame .so-cosmetic-ornament-display.has-media-asset,
.so-public-file-avatar-frame .so-cosmetic-ornament-display.has-media-asset {
  width: 2.7rem;
}

.so-has-cosmetic-media-background {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.so-cosmetic-style-media {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: .82;
}

/* Die eigentlichen Seiteninhalte bleiben immer über dem Stil-Overlay. */
.so-has-cosmetic-style-media {
  position: relative;
  isolation: isolate;
}

.so-has-cosmetic-style-media > *:not(.so-cosmetic-style-media) {
  position: relative;
  z-index: 2;
}

/* ============================================================
   C42N87-B – echte Profilbilder in Tabellen-Ranglisten
   ============================================================ */

.so-leaderboard-cosmetic-avatar {
  overflow: visible;
}

/* Das Twitch-Profilbild füllt exakt den bisherigen BA/SA/BR-Platzhalter. */
.so-leaderboard-profile-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
  background: #100b0b;
  pointer-events: none;
}

/* Initialen dienen nur noch als Fallback, wenn kein echtes Bild gefunden wird. */
.so-leaderboard-avatar-initials {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  line-height: 1;
}

.so-leaderboard-cosmetic-avatar.has-profile-image
  > .so-leaderboard-avatar-initials {
  visibility: hidden;
}

/* Kosmetik muss weiterhin über dem echten Profilbild liegen. */
.so-leaderboard-cosmetic-avatar
  > .so-cosmetic-frame-media {
  z-index: 35;
}

.so-leaderboard-cosmetic-avatar
  > .so-cosmetic-medal-display {
  z-index: 50;
}

.so-leaderboard-cosmetic-avatar
  > .so-cosmetic-ornament-display {
  z-index: 45;
}
