/* Ranglisten-Seite (web/ranglisten.js) im Stil "Spielgefuehl Hell": Farben ueber die Variablen aus spiel.css. */
.ranglisten { display: grid; gap: 18px; min-width: 0; }
.ranglisten .work-section { min-width: 0; }
.ranglisten h3 { margin: 16px 0 8px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.ranglisten .rang-icon { width: 24px; height: 24px; image-rendering: pixelated; vertical-align: middle; flex: none; }

/* ---------- Profilkarte ---------- */
.ranglisten .rang-kopf { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.ranglisten .rang-wappen, .ranglisten .rang-gast > .rang-wappen-icon {
  width: 72px; height: 72px; display: grid; place-items: center; background: var(--slot);
  box-shadow: inset 3px 3px 0 var(--slot-sh), inset -3px -3px 0 var(--slot-hl);
}
.ranglisten .rang-wappen-icon { width: 48px; height: 48px; image-rendering: pixelated; }
.ranglisten .rang-gast > .rang-wappen-icon { padding: 12px; box-sizing: border-box; }
.ranglisten .rang-wappen[data-stufe="4"] { background: #b89a3a; }
.ranglisten .rang-wappen[data-stufe="5"] { background: #6a4fa3; }
.ranglisten .rang-kopftext { min-width: 0; }
.ranglisten .rang-kopftext p { margin: 0; }
.ranglisten .rang-ueber { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.ranglisten .rang-name { margin: 2px 0; font-size: 30px; line-height: 1.1; overflow-wrap: anywhere; }
.ranglisten .rang-stufe { font-size: 13px; }
.ranglisten .rang-titelzeile { font-size: 13px; color: #5a3f00; font-weight: 700; }
.ranglisten .rang-titelzeile:empty { display: none; }
.ranglisten .rang-gesamt {
  padding: 10px 14px; text-align: right; background: #bdbdbd;
  box-shadow: inset 2px 2px 0 #8b8b8b, inset -2px -2px 0 #ececec;
}
.ranglisten .rang-gesamt span { display: block; font-size: 12px; color: var(--muted); }
.ranglisten .rang-gesamt strong { font-family: var(--pixel); font-weight: 500; font-size: 26px; color: #1e1e1e; }

/* Fortschritt wie die Erfahrungsleiste im Spiel */
.ranglisten .rang-fortschritt { margin-top: 14px; }
.ranglisten .rang-fortschritt p { margin: 6px 0 0; font-size: 13px; color: #303030; }
.ranglisten .rang-balken { height: 14px; background: #2b2b2b; box-shadow: 0 0 0 2px var(--edge), inset 0 2px 0 #111; overflow: hidden; }
.ranglisten .rang-balken span {
  display: block; height: 100%; width: 0; background: #7ed321;
  box-shadow: inset 0 2px 0 #b7f56b, inset 0 -3px 0 #4a8f12;
}
.ranglisten .rang-hoechster { margin: 14px 0 0; display: flex; align-items: center; gap: 8px; font-weight: 700; color: #4a2f86; }
.ranglisten .rang-hoechster img { width: 24px; height: 24px; image-rendering: pixelated; }

.ranglisten .rang-raster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 4px; }
.ranglisten .rang-teile { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.ranglisten .rang-teile li, .ranglisten .rang-trophaeen li, .ranglisten .rang-season {
  display: flex; gap: 8px; align-items: center; padding: 8px 10px; min-width: 0; background: #bdbdbd;
  box-shadow: inset 2px 2px 0 #8b8b8b, inset -2px -2px 0 #ececec;
}
.ranglisten .rang-teile li img, .ranglisten .rang-trophaeen li img, .ranglisten .rang-season img { width: 24px; height: 24px; image-rendering: pixelated; flex: none; }
.ranglisten .rang-teile span, .ranglisten .rang-trophaeen span, .ranglisten .rang-season span { display: grid; min-width: 0; }
.ranglisten .rang-teile small { font-size: 12px; }
.ranglisten .rang-teile strong { font-family: var(--pixel); font-weight: 500; font-size: 18px; color: #1e1e1e; overflow-wrap: anywhere; }

.ranglisten .rang-einstellungen { display: grid; gap: 12px; margin-top: 4px; }
.ranglisten .rang-titelwahl { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; }
.ranglisten .rang-titelwahl h3 { flex: 1 1 100%; margin-bottom: 0; }
.ranglisten .rang-titelwahl label { display: grid; gap: 4px; flex: 1 1 200px; min-width: 0; font-size: 12px; color: var(--muted); }
.ranglisten .rang-titelwahl select { width: 100%; min-width: 0; }
.ranglisten .rang-schalter { display: flex; gap: 10px; align-items: center; font-weight: 650; cursor: pointer; }
.ranglisten .rang-schalter input[type=checkbox] { appearance: auto; -webkit-appearance: checkbox; width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; accent-color: var(--blau); flex: none; }
.ranglisten .rang-sichtbar .work-note { margin: 4px 0 0 30px; }
.ranglisten .rang-season small { font-size: 12px; }
.ranglisten .rang-trophaeen { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ranglisten .rang-trophaeen li[data-medaille="gold"] { box-shadow: inset 2px 2px 0 #8b8b8b, inset -2px -2px 0 #ececec, inset 4px 0 0 #e0b100; }
.ranglisten .rang-trophaeen li[data-medaille="silber"] { box-shadow: inset 2px 2px 0 #8b8b8b, inset -2px -2px 0 #ececec, inset 4px 0 0 #9fa7ad; }
.ranglisten .rang-trophaeen li[data-medaille="bronze"] { box-shadow: inset 2px 2px 0 #8b8b8b, inset -2px -2px 0 #ececec, inset 4px 0 0 #b46a2c; }
.ranglisten .rang-trophaeen small { font-size: 12px; }

/* Rangstufen */
.ranglisten .rang-stufen { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ranglisten .rang-stufen > li { padding: 8px 10px; background: #bdbdbd; box-shadow: inset 2px 2px 0 #8b8b8b, inset -2px -2px 0 #ececec; }
.ranglisten .rang-stufen > li[data-erreicht="false"] { background: #b0b0b0; }
.ranglisten .rang-stufen > li[data-erreicht="false"] .rang-stufenkopf img { filter: grayscale(1) opacity(.6); }
.ranglisten .rang-stufen > li[data-aktuell="true"] { background: #c9d8f2; box-shadow: inset 2px 2px 0 #8b8b8b, inset -2px -2px 0 #ececec, 0 0 0 2px var(--blau); }
.ranglisten .rang-stufenkopf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ranglisten .rang-stufenkopf img { width: 24px; height: 24px; image-rendering: pixelated; }
.ranglisten .rang-stufenkopf strong { font-family: var(--pixel); font-weight: 500; font-size: 17px; color: #262626; }
.ranglisten .rang-stufenkopf small { font-size: 12px; }
.ranglisten .rang-hier { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 6px; background: var(--blau); color: #fff; }
.ranglisten .rang-stufen .work-note { margin: 4px 0 0 32px; }
.ranglisten .rang-rechte { list-style: none; margin: 6px 0 0; padding: 0 0 0 32px; display: grid; gap: 4px; font-size: 13px; }
.ranglisten .rang-rechte li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ranglisten .rang-marke { width: 14px; height: 14px; flex: none; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; line-height: 1; color: #fff; }
.ranglisten .rang-rechte [data-zustand="frei"] .rang-marke { background: var(--go); box-shadow: 0 0 0 2px var(--go-sh); }
.ranglisten .rang-rechte [data-zustand="frei"] .rang-marke::before { content: "\2713"; }
.ranglisten .rang-rechte [data-zustand="bestand"] .rang-marke { background: var(--sell); box-shadow: 0 0 0 2px var(--sell-sh); }
.ranglisten .rang-rechte [data-zustand="bestand"] .rang-marke::before { content: "\2713"; }
.ranglisten .rang-rechte [data-zustand="gesperrt"] .rang-marke { background: #6b6b6b; box-shadow: 0 0 0 2px #3a3a3a; }
/* Schloss in Pixeln: Buegel und Koerper */
.ranglisten .rang-rechte [data-zustand="gesperrt"] .rang-marke::before { content: ""; width: 6px; height: 4px; margin-top: 4px; background: #e8e8e8; box-shadow: 0 -3px 0 -1px #e8e8e8; }
.ranglisten .rang-rechte [data-zustand="gesperrt"] { color: #555; }
.ranglisten .rang-zustand { font-size: 11px; padding: 0 5px; background: rgba(0, 0, 0, .08); color: #3a3a3a; }
.ranglisten .rang-rechte [data-zustand="frei"] .rang-zustand { background: #dff0d4; color: #173d10; }
.ranglisten .rang-rechte [data-zustand="bestand"] .rang-zustand { background: #f6ebc8; color: #5a3f00; }

.ranglisten .rang-gast { display: flex; gap: 16px; align-items: center; }
.ranglisten .rang-gast h2 { margin: 0 0 4px; }
.ranglisten .rang-gast p { margin: 0; }

/* ---------- Ranglisten ---------- */
.ranglisten .rang-listen .work-heading { margin-bottom: 12px; }
.ranglisten .rang-reiter { display: flex; flex-wrap: wrap; gap: 8px; }
.ranglisten .rang-reiter button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 10px; }
.ranglisten .rang-reiter button img { width: 22px; height: 22px; image-rendering: pixelated; }
.ranglisten .rang-listenkopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 16px; margin: 14px 0 10px; }
.ranglisten .rang-listenkopf h3 { margin: 0; }
.ranglisten .rang-listenkopf .work-note { margin: 2px 0 0; }
.ranglisten .rang-zeitraum { display: flex; gap: 6px; }
.ranglisten .rang-zeitraum button { min-height: 36px; padding: 4px 12px; }

.ranglisten .rang-tabelle { width: 100%; border-collapse: collapse; }
.ranglisten .rang-tabelle td { vertical-align: middle; }
.ranglisten .rang-tabelle .rang-platz { width: 64px; text-align: center; }
.ranglisten .rang-platzmarke {
  display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 4px; box-sizing: border-box;
  font-family: var(--pixel); font-size: 17px; color: #303030;
}
.ranglisten tr:is([data-medaille="gold"], [data-medaille="silber"], [data-medaille="bronze"]) .rang-platzmarke { color: #fff; text-shadow: 1px 1px 0 rgba(0, 0, 0, .55); }
.ranglisten tr[data-medaille="gold"] .rang-platzmarke { background: #e0b100; box-shadow: inset 2px 2px 0 #ffe27a, inset -2px -2px 0 #8a6a00, 0 0 0 2px var(--edge); }
.ranglisten tr[data-medaille="silber"] .rang-platzmarke { background: #9fa7ad; box-shadow: inset 2px 2px 0 #e3e8eb, inset -2px -2px 0 #5d656a, 0 0 0 2px var(--edge); }
.ranglisten tr[data-medaille="bronze"] .rang-platzmarke { background: #b46a2c; box-shadow: inset 2px 2px 0 #e6a56c, inset -2px -2px 0 #6b3a12, 0 0 0 2px var(--edge); }
.ranglisten tr[data-medaille="gold"] td { background: rgba(224, 177, 0, .14); }
.ranglisten .rang-spieler { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; overflow-wrap: anywhere; }
.ranglisten .rang-spielertitel, .ranglisten .rang-detail { display: block; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.ranglisten .rang-spielertitel { color: #5a3f00; font-weight: 650; }
.ranglisten .rang-du { font-size: 11px; font-weight: 700; padding: 0 6px; background: var(--blau); color: #fff; }
.ranglisten .rang-wert { white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.ranglisten tr.rang-eigen td { background: #c9d8f2; }
.ranglisten tr.rang-eigen td:first-child { box-shadow: inset 4px 0 0 var(--blau); }
.ranglisten tbody tr.rang-eigen:hover td { background: #b8cbed; }
.ranglisten .rang-eigenzeile {
  margin: 10px 0 0; padding: 8px 12px; font-weight: 700; color: #0f3577; background: #c9d8f2;
  box-shadow: inset 4px 0 0 var(--blau);
}
.ranglisten .rang-eigenzeile[data-art="ausgeblendet"], .ranglisten .rang-eigenzeile[data-art="ohne"] { color: #3a3a3a; background: #bdbdbd; box-shadow: inset 4px 0 0 #8b8b8b; }
.ranglisten .rang-leer { margin: 0; }

@media (max-width: 900px) {
  .ranglisten .rang-raster { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .ranglisten .work-section { padding: 14px 12px; }
  .ranglisten .rang-kopf { grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
  .ranglisten .rang-gesamt { grid-column: 1 / -1; text-align: left; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
  .ranglisten .rang-wappen { width: 60px; height: 60px; }
  .ranglisten .rang-wappen-icon { width: 40px; height: 40px; }
  .ranglisten .rang-name { font-size: 24px; }
  .ranglisten .rang-reiter { gap: 6px; }
  .ranglisten .rang-reiter button { flex: 1 1 calc(50% - 6px); justify-content: flex-start; min-width: 0; font-size: 12px; }
  .ranglisten .rang-reiter button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ranglisten .rang-zeitraum { width: 100%; }
  .ranglisten .rang-zeitraum button { flex: 1 1 0; }
  .ranglisten .rang-tabelle .rang-platz { width: 44px; }
  .ranglisten .rang-tabelle th, .ranglisten .rang-tabelle td { padding-left: 6px; padding-right: 6px; }
  .ranglisten .rang-wert { font-size: 12px; }
  .ranglisten .rang-teile { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ranglisten .rang-rechte, .ranglisten .rang-stufen .work-note { padding-left: 0; margin-left: 0; }
}
