/* =========================================================
   common.css
   Gemeinsames UI-System für Login, Verify, Lobby und Game.
   Hier liegen nur Basis, Farben, UI-Größen, Header/Reiter,
   Modals und wiederverwendbare Bedien-Optik.
   Seitenpositionen bleiben in lobby.css / game.css / login.css.
   ========================================================= */

:root {
  --color-bg-panel: rgba(20, 25, 48, 0.96);
  --color-panel-soft: rgba(20, 28, 46, 0.50);
  --color-cyan: #38e2ff;
  --color-cyan-soft: rgba(56, 226, 255, 0.45);
  --color-mint: #61ffe0;
  --color-yellow: #ffe271;
  --color-pink: #ffaaee;
  --color-white: #ffffff;
  --color-text-soft: #d7e5ff;

  --neon-cyan-shadow: 0 0 24px 4px #20f6ff55, 0 0 80px 10px #cc8fff22;
  --panel-radius: 12px;

  --ui-scale: 1;
  --ui-font-scale: 1;
  --ui-control-scale: 1;
}

html[data-ui-scale="small"],
body[data-ui-scale="small"] {
  --ui-scale: 0.90;
  --ui-font-scale: 0.92;
  --ui-control-scale: 0.92;
}

html[data-ui-scale="medium"],
body[data-ui-scale="medium"] {
  --ui-scale: 1;
  --ui-font-scale: 1;
  --ui-control-scale: 1;
}

html[data-ui-scale="large"],
body[data-ui-scale="large"] {
  --ui-scale: 1.12;
  --ui-font-scale: 1.12;
  --ui-control-scale: 1.12;
}

html[data-ui-scale="gertrud"],
body[data-ui-scale="gertrud"] {
  --ui-scale: 1.28;
  --ui-font-scale: 1.25;
  --ui-control-scale: 1.30;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--color-white);
  background: url('../img/lobbyhintergrund.png') no-repeat center center fixed;
  background-size: cover;
  overflow-x: hidden;
}

/* Gemeinsamer Lobby/Game-Hintergrund */
.lobby-bg-overlay {
  position: fixed;
  z-index: 1;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 20, 40, 0.25);
  box-shadow: 0 0 40px 10px #0ff6, 0 0 140px 10px #ff09;
  pointer-events: none;
}

.lobby-overlay {
  position: fixed;
  z-index: 2;
  inset: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  background: rgba(18, 25, 48, 0.35);
}

.lobby-overlay::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border: 3px solid #38e2ff66;
  box-shadow: 0 0 70px 12px #38e2ff99, 0 0 160px 10px #ffa2ff55 inset;
  z-index: 3;
  opacity: 0.6;
  animation: neon-border-flicker 2.8s infinite;
}

@keyframes neon-border-flicker {
  0%, 100% { opacity: 0.6; }
  40% { opacity: 0.84; }
  60% { opacity: 0.48; }
}

/* Gemeinsamer Header / Reiter für Lobby und Game */
.lobby-header {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(330px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  column-gap: clamp(10px, 1.5vw, 28px);
  row-gap: 10px;
  width: 100%;
  max-width: 100vw;
  padding: calc(22px * var(--ui-scale)) 3vw 0;
  background: transparent;
  overflow: visible;
}

.lobby-header-left,
.lobby-header-center,
.lobby-header-right {
  min-width: 0;
  display: flex;
  align-items: center;
}

.lobby-header-left {
  justify-content: flex-start;
  gap: calc(12px * var(--ui-scale));
  flex-wrap: nowrap;
}

.lobby-header-center {
  justify-content: center;
}

.lobby-header-right {
  justify-content: flex-end;
  gap: calc(12px * var(--ui-scale));
  flex-wrap: nowrap;
}

.lobby-level,
.lobby-user,
.lobby-chips,
.lobby-diamonds,
.lobby-tab,
.lobby-header-right .lobby-btn,
#tableFilterDropdownBtn {
  font-size: calc(1rem * var(--ui-font-scale));
}

.lobby-level,
.lobby-user,
.lobby-chips,
.lobby-diamonds,
.lobby-tab,
.lobby-header-right .lobby-btn {
  white-space: nowrap;
}

.lobby-level {
  flex: 0 0 auto;
  font-weight: 800;
  color: var(--color-yellow);
  background: rgba(50,40,12,0.16);
  border-radius: 8px;
  padding: calc(4px * var(--ui-control-scale)) calc(14px * var(--ui-control-scale));
  box-shadow: 0 0 12px 2px #fffb, 0 0 16px 2px #fd4e09a9;
  transition: box-shadow 0.3s;
}

.lobby-level.neon-anim.level-update {
  animation: neon-pulse-gold 1s;
}

@keyframes neon-pulse-gold {
  0% { box-shadow: 0 0 24px 6px #ffd90099, 0 0 60px 18px #ffd90060; }
  60% { box-shadow: 0 0 64px 24px #ffd900ff, 0 0 160px 48px #ffe271; }
  100% { box-shadow: 0 0 12px 2px #fffb, 0 0 16px 2px #fd4e09a9; }
}

.lobby-user {
  min-width: 0;
  max-width: min(26vw, 320px);
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 800;
  color: var(--color-mint);
  background: rgba(30,40,60,0.32);
  border: 2px solid #00ffdd44;
  border-radius: 10px;
  box-shadow: 0 0 12px 2px #11fff6;
  padding: calc(6px * var(--ui-control-scale)) calc(18px * var(--ui-control-scale));
  cursor: pointer;
  transition: background 0.25s, box-shadow 0.2s;
}

.lobby-user:hover {
  background: #142535cc;
  box-shadow: 0 0 26px 8px #27d8ff88;
}

.lobby-user span,
#username {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lobby-chips,
.lobby-diamonds {
  flex: 0 0 auto;
  font-weight: 700;
  border-radius: 8px;
  padding: calc(4px * var(--ui-control-scale)) calc(12px * var(--ui-control-scale));
  background: rgba(34, 20, 8, 0.19);
  box-shadow: 0 0 10px 2px #e7ffca55;
}

.lobby-chips.neon-anim.chip-update {
  animation: neon-pulse-chip 1s;
}

.lobby-diamonds.neon-anim.diamond-update {
  animation: neon-pulse-diamond 1s;
}

@keyframes neon-pulse-chip {
  0% { box-shadow: 0 0 10px 4px #ffe960, 0 0 50px 10px #ffe96055; }
  50% { box-shadow: 0 0 60px 24px #ffe960bb, 0 0 160px 60px #ffe96099; }
  100% { box-shadow: 0 0 10px 2px #e7ffca55; }
}

@keyframes neon-pulse-diamond {
  0% { box-shadow: 0 0 10px 4px #50e3ff, 0 0 50px 10px #22b3ff88; }
  60% { box-shadow: 0 0 60px 24px #1feaff, 0 0 160px 60px #1feaffaa; }
  100% { box-shadow: 0 0 10px 2px #e7ffca55; }
}

.lobby-tabs {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: clamp(4px, 0.45vw, 9px);
  max-width: 100%;
  padding: calc(8px * var(--ui-control-scale)) calc(7px * var(--ui-control-scale));
  background: rgba(30, 42, 65, 0.29);
  border-radius: 12px;
  box-shadow: 0 0 16px 2px #28baff22;
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.lobby-tab {
  color: var(--color-white);
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  border-radius: 5px 5px 0 0;
  padding: calc(8px * var(--ui-control-scale)) calc(18px * var(--ui-control-scale));
  cursor: pointer;
  box-shadow: 0 0 8px 0 #02f6f688;
  font-weight: 600;
  transition: color 0.25s, border-color 0.26s, background 0.22s;
}

.lobby-tab.active,
.lobby-tab:hover {
  color: #ffde86;
  border-color: #ffd257;
  background: #221f11cc;
  box-shadow: 0 0 30px 3px #ffe57c77;
}

.lobby-header-right .lobby-btn {
  font-weight: 700;
  background: rgba(36, 40, 60, 0.22);
  border: 2px solid #00b6ff88;
  border-radius: 10px;
  color: var(--color-white);
  padding: calc(6px * var(--ui-control-scale)) calc(16px * var(--ui-control-scale));
  cursor: pointer;
  box-shadow: 0 0 12px 2px #11aaff33;
  transition: background 0.22s, box-shadow 0.23s;
}

.lobby-header-right .lobby-btn:hover {
  background: #0a232b;
  color: #77f9fc;
  box-shadow: 0 0 20px 7px #1ed8fd77;
}

@media (max-width: 1280px) {
  .lobby-header {
    grid-template-columns: 1fr auto 1fr;
  }

  .lobby-user {
    max-width: min(24vw, 260px);
  }
}

@media (max-width: 1050px) {
  .lobby-header {
    grid-template-columns: 1fr 1fr;
    row-gap: 10px;
    justify-items: center;
  }

  .lobby-header-left,
  .lobby-header-right {
    justify-content: center;
    flex-wrap: wrap;
  }

  .lobby-header-center {
    grid-column: 1 / -1;
    grid-row: 2;
    order: 3;
  }

  .lobby-header-right {
    grid-column: 2;
  }

  .lobby-tabs {
    width: max-content;
    max-width: 96vw;
    flex-wrap: wrap;
  }

  .lobby-user {
    max-width: min(82vw, 360px);
  }
}

@media (max-width: 760px) {
  .lobby-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "center"
      "right";
    gap: 11px;
    padding: 10px 1vw 0;
  }

  .lobby-header-left,
  .lobby-header-center,
  .lobby-header-right {
    justify-content: center;
    flex-wrap: wrap;
  }

  .lobby-header-left { grid-area: left; }
  .lobby-header-center { grid-area: center; }
  .lobby-header-right { grid-area: right; grid-column: auto; }

  .lobby-tabs {
    flex-wrap: wrap;
  }
}


.admin-inbox-btn {
  position: relative;
}

.admin-inbox-btn.has-unread {
  border-color: rgba(255, 226, 113, 0.9);
  box-shadow: 0 0 14px rgba(255, 226, 113, 0.45);
}

.admin-inbox-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #161000;
  background: #ffe271;
  border: 2px solid #08111f;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.admin-inbox-count[hidden] { display: none; }

/* Gemeinsames Einstellungen-Fenster */
.settings-modal,
.pw-reset-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.settings-dialog,
.pw-reset-dialog {
  width: min(560px, 94vw);
  color: #fff;
  background: var(--color-bg-panel);
  border: 2px solid #28e0ff66;
  border-radius: var(--panel-radius);
  box-shadow: var(--neon-cyan-shadow);
  padding: 18px;
}

.settings-title,
.pw-reset-title {
  margin: 0 0 8px;
  color: #44d9ff;
  text-shadow: 0 0 12px #2adfff77;
}

.settings-desc,
.settings-help,
.pw-reset-desc {
  color: var(--color-text-soft);
  font-size: 0.92rem;
  line-height: 1.35;
}

.settings-section {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(56, 226, 255, 0.22);
  border-radius: 10px;
  background: rgba(9, 14, 28, 0.36);
}

.settings-section-title {
  color: var(--color-yellow);
  font-weight: 800;
  margin-bottom: 10px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.settings-tab-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-tab-btn {
  padding: 10px 12px;
  color: #dffcff;
  text-align: left;
  font-weight: 900;
  white-space: nowrap;
  background: rgba(20, 38, 58, 0.84);
  border: 1px solid rgba(56, 226, 255, 0.32);
  border-radius: 9px;
  cursor: pointer;
}

.settings-tab-btn.active,
.settings-tab-btn:hover {
  color: #07131b;
  background: linear-gradient(90deg, #ffe271 0%, #38e2ff 100%);
  box-shadow: 0 0 14px rgba(56, 226, 255, 0.38);
}

.settings-panel {
  min-height: 190px;
  padding: 12px;
  border: 1px solid rgba(56, 226, 255, 0.22);
  border-radius: 10px;
  background: rgba(9, 14, 28, 0.36);
}

.settings-panel[hidden] {
  display: none;
}

.settings-scale-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.settings-sound-row {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--color-yellow);
  font-weight: 800;
}

.settings-sound-row input[type="checkbox"] {
  justify-self: end;
  grid-column: 2 / 4;
  width: 20px;
  height: 20px;
  accent-color: #00ffc3;
  cursor: pointer;
}

.settings-sound-row input[type="range"] {
  width: 100%;
  accent-color: #00ffc3;
  cursor: pointer;
}

.settings-sound-value {
  min-width: 40px;
  text-align: right;
  color: #dffcff;
  font-weight: 800;
}

.settings-scale-btn,
.settings-primary-btn,
.settings-close-btn,
.pw-reset-btn {
  border: none;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.settings-scale-btn {
  padding: 8px 10px;
  color: #dffcff;
  background: rgba(20, 38, 58, 0.92);
  border: 1px solid rgba(56, 226, 255, 0.45);
  box-shadow: 0 0 10px #00fff826;
}

.settings-scale-btn.active,
.settings-scale-btn:hover {
  color: #222;
  background: linear-gradient(90deg, #00ffc3 0%, #47a8ff 100%);
}

.settings-primary-btn,
.pw-reset-submit {
  color: #222;
  background: linear-gradient(90deg, #00ffc3, #47a8ff);
}

.settings-primary-btn {
  width: 100%;
  padding: 9px 10px;
}

.settings-account-form {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.settings-account-form label {
  color: var(--color-yellow);
  font-weight: 800;
}

.settings-account-form input {
  width: 100%;
  padding: 9px 10px;
  color: #fff;
  background: rgba(5, 10, 22, 0.72);
  border: 1px solid rgba(56, 226, 255, 0.42);
  border-radius: 8px;
  outline: none;
}

.settings-account-form input:focus {
  border-color: rgba(255, 226, 113, 0.82);
  box-shadow: 0 0 12px rgba(255, 226, 113, 0.22);
}

.settings-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 8px;
}

.settings-account-message {
  min-height: 22px;
  color: var(--color-text-soft);
  font-weight: 700;
}

.settings-account-message.success {
  color: #6dffb0;
}

.settings-account-message.error {
  color: #ff7aa2;
}

.settings-actions,
.pw-reset-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.settings-close-btn,
.pw-reset-cancel {
  background: #444;
  color: #fff;
  padding: 7px 12px;
}

.settings-close-btn:hover,
.pw-reset-cancel:hover {
  background: #666;
}

.pw-reset-dialog {
  text-align: left;
}

@media (max-width: 620px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-tab-list {
    flex-direction: row;
  }

  .settings-tab-btn {
    text-align: center;
    flex: 1;
  }

  .settings-inline-form {
    grid-template-columns: 1fr;
  }
}

.pw-reset-input {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: none;
  background: #20263e;
  color: #fff;
  margin-bottom: 8px;
}

.pw-reset-msg {
  min-height: 18px;
  margin-bottom: 8px;
  color: #f44336;
}

.pw-reset-msg.success {
  color: #4caf50;
}

.pw-reset-btn {
  padding: 8px 12px;
}

/* =========================================================
   Responsive-Erweiterung 2026-06-30
   Ziel: Header-Leisten dürfen umbrechen, bleiben mittig und
   schieben Content nicht mehr untereinander. Die echte Höhe
   wird zusätzlich per js/responsive.js als --header-height gesetzt.
   ========================================================= */
html,
body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

body {
  overflow-wrap: anywhere;
}

.lobby-bg-overlay,
.lobby-overlay {
  height: var(--app-height, 100vh);
}

@supports (height: 100dvh) {
  .lobby-bg-overlay,
  .lobby-overlay {
    height: var(--app-height, 100dvh);
  }
}

.lobby-header {
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
  align-items: start;
  row-gap: clamp(8px, 1.2vw, 14px);
  padding-left: max(10px, env(safe-area-inset-left));
  padding-right: max(10px, env(safe-area-inset-right));
}

.lobby-header-left,
.lobby-header-center,
.lobby-header-right {
  max-width: 100%;
  min-width: 0;
}

.lobby-header-left,
.lobby-header-right,
.lobby-tabs,
.settings-actions,
.pw-reset-actions {
  flex-wrap: wrap;
}

.lobby-header-left {
  justify-content: flex-start;
}

.lobby-header-center {
  justify-content: center;
  overflow: visible;
}

.lobby-header-right {
  justify-content: flex-end;
}

.lobby-tabs {
  width: fit-content;
  max-width: min(100%, 68vw);
  overflow: visible;
}

.lobby-tab,
.lobby-header-right .lobby-btn,
.lobby-level,
.lobby-user,
.lobby-chips,
.lobby-diamonds,
#tableFilterDropdownBtn {
  max-width: 100%;
  line-height: 1.15;
}

.lobby-tab,
.lobby-header-right .lobby-btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.lobby-tab.friends-has-alert {
  position: relative;
}

.lobby-tab.friends-has-alert::after {
  content: attr(data-friends-alert);
  position: absolute;
  right: -6px;
  top: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #07131b;
  background: linear-gradient(90deg, #ffe271 0%, #6dffb0 100%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 12px rgba(255, 226, 113, 0.62), 0 0 14px rgba(109, 255, 176, 0.32);
  font-size: 0.68rem;
  font-weight: 1000;
  line-height: 1;
}

@media (max-width: 1380px) {
  .lobby-header {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
  }

  .lobby-tabs {
    max-width: 100%;
  }

  .lobby-tab {
    padding-left: calc(12px * var(--ui-control-scale));
    padding-right: calc(12px * var(--ui-control-scale));
  }
}

@media (max-width: 1120px) {
  .lobby-header {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "left right"
      "center center";
    justify-items: center;
  }

  .lobby-header-left {
    grid-area: left;
    justify-content: center;
  }

  .lobby-header-center {
    grid-area: center;
    width: 100%;
  }

  .lobby-header-right {
    grid-area: right;
    justify-content: center;
  }

  .lobby-tabs {
    max-width: min(100%, 96vw);
    justify-content: center;
  }
}

@media (max-width: 720px), (max-height: 560px) and (orientation: landscape) {
  .lobby-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "center"
      "right";
    padding-top: max(8px, env(safe-area-inset-top));
    gap: 8px;
  }

  .lobby-header-left,
  .lobby-header-center,
  .lobby-header-right {
    width: 100%;
    justify-content: center;
  }

  .lobby-tabs {
    width: 100%;
    max-width: 100%;
  }

  .lobby-tab,
  .lobby-header-right .lobby-btn,
  .lobby-level,
  .lobby-user,
  .lobby-chips,
  .lobby-diamonds {
    font-size: clamp(0.78rem, 3.15vw, 1rem);
  }

  .lobby-tab {
    flex: 1 1 min(142px, 44vw);
    padding: 7px 9px;
  }

  .lobby-user {
    max-width: min(92vw, 360px);
  }
}

@media (max-width: 420px) {
  .lobby-header-left,
  .lobby-header-right,
  .lobby-tabs {
    gap: 5px;
  }

  .lobby-level,
  .lobby-user,
  .lobby-chips,
  .lobby-diamonds {
    padding-left: 8px;
    padding-right: 8px;
  }

  .lobby-tab {
    flex: 1 1 min(142px, 44vw);
  }
}

@media (max-width: 620px) {
  .settings-modal,
  .pw-reset-modal {
    align-items: flex-start;
    padding: max(12px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    overflow-y: auto;
  }

  .settings-dialog,
  .pw-reset-dialog {
    width: min(100%, 560px);
    max-height: none;
  }

  .settings-tab-list {
    flex-wrap: wrap;
  }
}

/* Feinjustierung: sehr schmale Lobby-Header nutzen echte 2-Spalten-Reiter,
   statt jeden Tab einzeln in eine neue Zeile zu drücken. */
@media (max-width: 720px), (max-height: 560px) and (orientation: landscape) {
  .lobby-tab {
    min-width: 0;
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 135px;
    white-space: normal;
  }
}

@media (max-width: 360px) {
  .lobby-tab {
    flex-basis: 128px;
  }
}

/* Mobile-Menues kompakter halten: die Rahmen sollen zur Textgroesse passen. */
@media (max-width: 720px), (max-height: 560px) and (orientation: landscape) {
  .lobby-tab,
  .lobby-header-right .lobby-btn,
  .lobby-level,
  .lobby-user,
  .lobby-chips,
  .lobby-diamonds {
    min-height: 30px;
    height: auto;
    padding-top: 4px;
    padding-bottom: 4px;
    line-height: 1.05;
    box-sizing: border-box;
  }

  .lobby-tab,
  .lobby-header-right .lobby-btn {
    padding-left: 8px;
    padding-right: 8px;
  }

  .lobby-tabs,
  .lobby-header-left,
  .lobby-header-right {
    gap: 5px;
  }
}

/* Wiederverwendbares Spielerprofil-Fenster */
.player-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 13100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(3, 7, 18, 0.68);
  backdrop-filter: blur(5px);
}

.player-profile-modal.open {
  display: flex;
}

.player-profile-dialog {
  position: relative;
  width: min(620px, 96vw);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  color: #fff;
  background: rgba(18, 25, 48, 0.98);
  border: 2px solid rgba(56, 226, 255, 0.72);
  border-radius: 14px;
  box-shadow: 0 0 26px rgba(56, 226, 255, 0.45), 0 0 80px rgba(255, 226, 113, 0.10) inset;
  padding: 18px;
}

.player-profile-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(56, 226, 255, 0.45);
  border-radius: 9px;
  color: #dffcff;
  background: rgba(8, 17, 35, 0.82);
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.player-profile-close:hover {
  color: #07131b;
  background: linear-gradient(90deg, #ffe271 0%, #38e2ff 100%);
}

.player-profile-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding-right: 42px;
}

.player-profile-head h3 {
  margin: 0 0 4px;
  color: #44d9ff;
  text-shadow: 0 0 12px rgba(68, 217, 255, 0.58);
}

.player-profile-head p {
  margin: 0;
  color: #ffe271;
  font-weight: 800;
}

.player-profile-level {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #07131b;
  background: linear-gradient(135deg, #ffe271 0%, #38e2ff 100%);
  font-weight: 1000;
  box-shadow: 0 0 18px rgba(56, 226, 255, 0.48);
}

.player-profile-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0 12px;
}

.player-profile-tab,
.player-profile-actions button,
.player-profile-subform button {
  border: 1px solid rgba(56, 226, 255, 0.45);
  border-radius: 9px;
  color: #dffcff;
  background: rgba(20, 38, 58, 0.84);
  font-weight: 900;
  cursor: pointer;
  padding: 9px 10px;
}

.player-profile-tab.active,
.player-profile-tab:hover,
.player-profile-actions button:hover:not(:disabled),
.player-profile-subform button:hover:not(:disabled) {
  color: #07131b;
  background: linear-gradient(90deg, #ffe271 0%, #38e2ff 100%);
}

.player-profile-actions button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.player-profile-badges,
.player-profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.player-profile-badge,
.player-profile-stat-card {
  padding: 12px;
  border: 1px solid rgba(56, 226, 255, 0.28);
  border-radius: 10px;
  background: rgba(8, 16, 32, 0.58);
  box-shadow: 0 0 12px rgba(56, 226, 255, 0.12) inset;
}

.player-profile-badge strong {
  display: block;
  color: #ffe271;
  font-size: 1.1rem;
}

.player-profile-badge span {
  color: #dffcff;
  font-size: 0.9rem;
}

.player-profile-badges.is-empty {
  grid-template-columns: 1fr;
}

.player-profile-badge-placeholder {
  text-align: center;
  padding: 22px 14px;
}

.player-profile-stat-card h4 {
  margin: 0 0 8px;
  color: #6dffb0;
}

.player-profile-stat-card div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.player-profile-stat-card div:last-child {
  border-bottom: 0;
}

.player-profile-stat-card span {
  color: #dffcff;
}

.player-profile-stat-card strong {
  color: #ffe271;
}

.player-profile-action-table {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid rgba(56, 226, 255, 0.22);
  border-radius: 10px;
}

.player-profile-action-head,
.player-profile-action-row {
  display: grid;
  grid-template-columns: minmax(max-content, 1.1fr) repeat(6, minmax(max-content, 0.7fr));
  min-width: 470px;
}

.player-profile-action-head span,
.player-profile-action-row span,
.player-profile-action-row strong {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  white-space: nowrap;
}

.player-profile-action-head {
  color: #07131b;
  background: linear-gradient(90deg, #ffe271 0%, #38e2ff 100%);
  font-weight: 1000;
}

.player-profile-action-row {
  background: rgba(8, 16, 32, 0.54);
}

.player-profile-action-row strong {
  color: #6dffb0;
  text-align: left;
}

.player-profile-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.player-profile-tool {
  margin-top: 12px;
}

.player-profile-subform {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 226, 113, 0.32);
  border-radius: 10px;
  background: rgba(12, 18, 36, 0.72);
}

.player-profile-subform input,
.player-profile-subform select,
.player-profile-subform textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(56, 226, 255, 0.32);
  border-radius: 8px;
  color: #fff;
  background: rgba(5, 10, 20, 0.82);
  padding: 8px 10px;
}

.player-profile-subform textarea {
  min-height: 82px;
  resize: vertical;
}

.player-profile-message {
  min-height: 20px;
  margin-top: 10px;
  color: #dffcff;
  font-weight: 800;
  text-align: center;
}

.player-profile-message[data-type="success"] {
  color: #6dffb0;
}

.player-profile-message[data-type="error"],
.player-profile-loading.error {
  color: #ff7c9c;
}

.player-profile-loading {
  padding: 28px;
  text-align: center;
  color: #dffcff;
  font-weight: 900;
}

.player-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 14000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(4px);
}

.player-confirm-dialog {
  width: min(360px, 94vw);
  padding: 18px;
  color: #fff;
  text-align: center;
  background: rgba(18, 25, 48, 0.98);
  border: 2px solid rgba(56, 226, 255, 0.72);
  border-radius: 14px;
  box-shadow: 0 0 24px rgba(56, 226, 255, 0.42);
}

.player-confirm-dialog p {
  margin: 0 0 14px;
  color: #dffcff;
  font-weight: 800;
}

.player-confirm-dialog div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.player-confirm-dialog button {
  border: 1px solid rgba(56, 226, 255, 0.45);
  border-radius: 9px;
  color: #dffcff;
  background: rgba(20, 38, 58, 0.84);
  font-weight: 900;
  cursor: pointer;
  padding: 9px 10px;
}

.player-confirm-dialog button:hover {
  color: #07131b;
  background: linear-gradient(90deg, #ffe271 0%, #38e2ff 100%);
}

/* Gemeinsame Freunde-Zentrale */
.friends-center-modal {
  position: fixed;
  inset: 0;
  z-index: 13050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(3, 7, 18, 0.68);
  backdrop-filter: blur(5px);
}

.friends-center-modal.open {
  display: flex;
}

.friends-center-dialog {
  position: relative;
  width: min(780px, 96vw);
  max-height: min(88vh, 780px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  color: #fff;
  background: rgba(18, 25, 48, 0.98);
  border: 2px solid rgba(56, 226, 255, 0.72);
  border-radius: 14px;
  box-shadow: 0 0 26px rgba(56, 226, 255, 0.45), 0 0 80px rgba(255, 226, 113, 0.10) inset;
  padding: 18px;
}

.friends-center-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(56, 226, 255, 0.45);
  border-radius: 9px;
  color: #dffcff;
  background: rgba(8, 17, 35, 0.82);
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.friends-center-head {
  padding-right: 42px;
}

.friends-center-head h3 {
  margin: 0;
  color: #44d9ff;
  text-shadow: 0 0 12px rgba(68, 217, 255, 0.58);
}

.friends-center-head p {
  margin: 4px 0 0;
  color: #dffcff;
}

.friends-center-tabs,
.friends-center-chat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.friends-center-tab,
.friends-center-chat-tab,
.friends-center-card-actions button,
.friends-center-form button {
  border: 1px solid rgba(56, 226, 255, 0.45);
  border-radius: 9px;
  color: #dffcff;
  background: rgba(20, 38, 58, 0.84);
  font-weight: 900;
  cursor: pointer;
  padding: 8px 10px;
}

.friends-center-card-actions button:disabled,
.friends-center-form button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.friends-center-tab.active,
.friends-center-tab:hover,
.friends-center-chat-tab.active,
.friends-center-chat-tab:hover,
.friends-center-card-actions button:hover,
.friends-center-form button:hover {
  color: #07131b;
  background: linear-gradient(90deg, #ffe271 0%, #38e2ff 100%);
}

.friends-center-tab.has-unread:not(.active) {
  border-color: #ff6d8a;
  box-shadow: 0 0 10px rgba(255, 109, 138, 0.55);
}

.friends-center-chat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.friends-center-chat-tab.unread:not(.active) {
  border-color: #ff6d8a;
}

.friends-center-chat-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3d6a;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  font-style: normal;
}

.friends-center-body {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 10px;
}

.friends-center-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(56, 226, 255, 0.28);
  border-radius: 10px;
  background: rgba(8, 16, 32, 0.66);
}

.friends-center-card > div:first-child {
  position: relative;
  padding-left: 16px;
}

.friends-center-presence {
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.friends-center-presence.online {
  color: #6dffb0;
  background: #6dffb0;
}

.friends-center-presence.offline {
  color: #ff5d7e;
  background: #ff5d7e;
}

.friends-center-card strong,
.friends-center-card span {
  display: block;
}

.friends-center-card strong {
  color: #dffcff;
}

.friends-center-card span,
.friends-center-empty {
  color: rgba(223, 252, 255, 0.78);
}

.friends-center-table {
  color: #ffe271 !important;
  font-size: 0.86em;
}

.friends-center-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.friends-center-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  max-height: min(46vh, 420px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid rgba(56, 226, 255, 0.22);
  border-radius: 10px;
  background: rgba(8, 16, 32, 0.54);
}

.friends-center-message {
  align-self: flex-start;
  max-width: 86%;
  padding: 7px 9px;
  border: 1px solid rgba(56, 226, 255, 0.28);
  border-radius: 10px;
  background: rgba(12, 20, 38, 0.82);
}

.friends-center-message.own {
  align-self: flex-end;
  color: #07131b;
  background: linear-gradient(90deg, #6dffb0 0%, #38e2ff 100%);
}

.friends-center-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.friends-center-form input {
  min-width: 0;
  border: 1px solid rgba(56, 226, 255, 0.32);
  border-radius: 8px;
  color: #fff;
  background: rgba(5, 10, 20, 0.82);
  padding: 8px 10px;
}

.friends-center-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: #ffe271;
  font-weight: 800;
}

.friends-center-loading {
  padding: 28px;
  text-align: center;
  color: #dffcff;
  font-weight: 900;
}

@media (max-width: 620px) {
  .friends-center-dialog {
    width: min(100%, 560px);
    max-height: calc(var(--app-height, 100vh) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 12px;
  }

  .friends-center-card {
    grid-template-columns: 1fr;
  }

  .friends-center-card-actions {
    justify-content: flex-start;
  }

  .friends-center-thread {
    min-height: 180px;
    max-height: 42vh;
  }
}

@media (max-width: 520px) {
  .player-profile-dialog {
    padding: 14px;
  }

  .player-profile-head {
    grid-template-columns: 1fr;
    padding-right: 42px;
  }

  .player-profile-level {
    width: 42px;
    height: 42px;
  }

  .player-profile-actions {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   Header-Statusbereich (Lobby + Game)
   Ein gemeinsamer Statuscontainer mit gerader Trennung:
   - links Spielername über beide Zeilen
   - rechts oben Level-Zahl + XP-Balken (Füllung über --xp-progress)
   - rechts unten Chips + Diamanten
   Die XP-Zahl steckt versteckt in #userXp und erscheint beim Hover
   oder Klick auf die XP-Gruppe als Tooltip (data-xp-tooltip).
   Die Gruppenstruktur wird von responsive.js erzeugt.
   ========================================================= */

/* Gemeinsamer Statuscontainer */
.lobby-header-left {
  --status-player-col: 36%;
  --status-line: rgba(56, 226, 255, 0.38);

  position: relative !important;
  isolation: isolate !important;
  display: grid !important;
  grid-template-columns: minmax(90px, var(--status-player-col)) minmax(150px, 1fr) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  grid-template-areas:
    "user progress"
    "user wallet" !important;
  gap: 0 !important;
  align-items: stretch !important;
  overflow: visible !important;

  border-radius: calc(12px * var(--ui-control-scale, 1)) !important;
  border: 1px solid rgba(56, 226, 255, 0.50) !important;
  background:
    radial-gradient(circle at 18% 20%, rgba(56, 226, 255, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(10, 20, 40, 0.96), rgba(6, 13, 28, 0.92)) !important;
  box-shadow:
    0 0 14px rgba(56, 226, 255, 0.18),
    inset 0 0 18px rgba(56, 226, 255, 0.08) !important;
}

/* Gerade Trennlinien im Container: senkrecht neben dem Namen, waagerecht mittig */
.lobby-header-left::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: var(--status-player-col) !important;
  width: 1px !important;
  background: var(--status-line) !important;
  z-index: 2 !important;
  pointer-events: none !important;
}

.lobby-header-left::after {
  content: "" !important;
  position: absolute !important;
  left: var(--status-player-col) !important;
  right: 0 !important;
  top: 50% !important;
  height: 1px !important;
  background: var(--status-line) !important;
  z-index: 2 !important;
  pointer-events: none !important;
}

/* Innere Status-Elemente ohne eigene Boxen/Rundungen/Glow */
.lobby-header-left > .header-profile-item,
.lobby-header-left > .header-stat-combo,
.lobby-header-left .lobby-level,
.lobby-header-left .lobby-chips,
.lobby-header-left .lobby-diamonds {
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Spielername links über beide Zeilen */
.lobby-header-left > .header-profile-item {
  grid-area: user !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: calc(8px * var(--ui-control-scale, 1)) calc(10px * var(--ui-control-scale, 1)) !important;
  color: #61ffe0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Statusgruppen als Grid-Zellen */
.lobby-header-left > .header-stat-combo {
  position: relative !important;
  isolation: isolate !important;
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  align-self: stretch !important;
  overflow: visible !important;
}

.lobby-header-left > .header-level-xp-group {
  grid-area: progress !important;
  grid-template-columns: minmax(38px, auto) minmax(0, 1fr) !important;
}

.lobby-header-left > .header-wallet-group {
  grid-area: wallet !important;
  grid-template-columns: minmax(0, 1fr) minmax(42px, auto) !important;
}

/* Obere rechte Zeile: Level-Zahl links, XP-Balken rechts */
.lobby-header-left > .header-level-xp-group > #levelDisplay {
  grid-column: 1 / 2 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  padding: calc(7px * var(--ui-control-scale, 1)) calc(10px * var(--ui-control-scale, 1)) !important;
  color: var(--color-yellow, #ffe271) !important;
  font-weight: 1000 !important;
}

.lobby-header-left > .header-level-xp-group > #xpDisplay {
  grid-column: 2 / 3 !important;
  position: relative !important;
  display: block !important;
  min-width: 0 !important;
  padding: 0 calc(12px * var(--ui-control-scale, 1)) !important;
  color: transparent !important;
  text-shadow: none !important;
  overflow: visible !important;
}

/* XP-Balken: Spur + Füllung nach --xp-progress */
.lobby-header-left > .header-level-xp-group > #xpDisplay::before {
  content: "" !important;
  position: absolute !important;
  left: calc(10px * var(--ui-control-scale, 1)) !important;
  right: calc(10px * var(--ui-control-scale, 1)) !important;
  top: 50% !important;
  height: max(7px, calc(8px * var(--ui-control-scale, 1))) !important;
  transform: translateY(-50%) !important;
  border-radius: 999px !important;
  background: rgba(3, 8, 18, 0.88) !important;
  box-shadow:
    inset 0 0 8px rgba(0, 0, 0, 0.60),
    0 0 8px rgba(56, 226, 255, 0.16) !important;
}

.lobby-header-left > .header-level-xp-group > #xpDisplay::after {
  content: "" !important;
  position: absolute !important;
  left: calc(10px * var(--ui-control-scale, 1)) !important;
  top: 50% !important;
  width: calc(100% - calc(20px * var(--ui-control-scale, 1))) !important;
  height: max(7px, calc(8px * var(--ui-control-scale, 1))) !important;
  transform: translateY(-50%) !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, rgba(255, 226, 113, 0.96), rgba(56, 226, 255, 0.88)) !important;
  box-shadow:
    0 0 10px rgba(255, 226, 113, 0.24),
    0 0 12px rgba(56, 226, 255, 0.20) !important;
  clip-path: inset(0 calc(100% - var(--xp-progress, 0%)) 0 0 round 999px) !important;
}

/* XP-Zahl bleibt für Screenreader/Tooltip vorhanden, aber unsichtbar */
.lobby-header-left > .header-level-xp-group > #xpDisplay > #userXp {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* Untere rechte Zeile: Chips links, Diamanten rechts */
.lobby-header-left > .header-wallet-group > #chipDisplay,
.lobby-header-left > .header-wallet-group > #diamondDisplay {
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
  padding: calc(7px * var(--ui-control-scale, 1)) calc(10px * var(--ui-control-scale, 1)) !important;
  color: #f4fbff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.lobby-header-left > .header-wallet-group > #chipDisplay {
  grid-column: 1 / 2 !important;
  justify-content: flex-start !important;
  text-align: left !important;
}

.lobby-header-left > .header-wallet-group > #diamondDisplay {
  grid-column: 2 / 3 !important;
  justify-content: flex-end !important;
  text-align: right !important;
}

/* XP-Tooltip: abgerundete Bubble, Inhalt aus data-xp-tooltip.
   Positionierung je Viewport (Desktop seitlich, sonst darüber). */
.header-level-xp-group[data-xp-tooltip] {
  position: relative !important;
  overflow: visible !important;
  cursor: help !important;
}

.header-level-xp-group[data-xp-tooltip]::before {
  content: none !important;
  display: none !important;
}

.header-level-xp-group[data-xp-tooltip]::after {
  display: inline-flex !important;
  content: attr(data-xp-tooltip) !important;
  box-sizing: border-box !important;
  width: max-content !important;
  min-width: 260px !important;
  max-width: min(520px, calc(100vw - 32px)) !important;
  min-height: 34px !important;
  padding: 8px 16px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(56, 226, 255, 0.76) !important;
  background:
    radial-gradient(circle at 24% 18%, rgba(56, 226, 255, 0.20), transparent 42%),
    linear-gradient(180deg, rgba(12, 24, 45, 0.99), rgba(6, 13, 28, 0.99)) !important;
  color: #f4fbff !important;
  font-size: calc(0.84rem * var(--ui-font-scale, 1)) !important;
  font-weight: 900 !important;
  line-height: 1.18 !important;
  text-align: center !important;
  white-space: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow:
    0 0 22px rgba(56, 226, 255, 0.30),
    0 10px 30px rgba(0, 0, 0, 0.42),
    inset 0 0 18px rgba(56, 226, 255, 0.12) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: 9000 !important;
  transition: opacity 140ms ease, transform 140ms ease !important;
}

/* Nicht-Desktop: Bubble oberhalb der Statusgruppe */
@media (max-width: 1100px) {
  .header-level-xp-group[data-xp-tooltip]::after {
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    min-width: min(260px, calc(100vw - 32px)) !important;
    white-space: normal !important;
    transform: translate(-50%, 2px) !important;
  }

  .header-level-xp-group[data-xp-tooltip]:hover::after,
  .header-level-xp-group[data-xp-tooltip]:focus-visible::after,
  .header-level-xp-group.show-xp-tip::after {
    opacity: 1 !important;
    transform: translate(-50%, 0) !important;
  }
}

/* Desktop/PC: Lobby und Game teilen exakt dieselbe Statusbox-Größe,
   der XP-Tooltip liegt rechts neben der XP-Leiste auf Balkenhöhe */
@media (min-width: 1101px) {
  body.lobby-page .lobby-header-left,
  body.game-page .lobby-header-left {
    --status-player-col: 38% !important;
    width: calc(260px * var(--ui-control-scale, 1)) !important;
    min-width: calc(260px * var(--ui-control-scale, 1)) !important;
    max-width: calc(260px * var(--ui-control-scale, 1)) !important;
    height: calc(48px * var(--ui-control-scale, 1)) !important;
    min-height: calc(48px * var(--ui-control-scale, 1)) !important;
    max-height: calc(48px * var(--ui-control-scale, 1)) !important;
    grid-template-columns: var(--status-player-col) minmax(0, 1fr) !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 0 !important;
    overflow: visible !important;
  }

  body.lobby-page .lobby-header-left > .header-profile-item,
  body.game-page .lobby-header-left > .header-profile-item,
  body.lobby-page .lobby-header-left > .header-stat-combo,
  body.game-page .lobby-header-left > .header-stat-combo {
    min-height: 0 !important;
    height: auto !important;
  }

  body.lobby-page .lobby-header-left > .header-profile-item,
  body.game-page .lobby-header-left > .header-profile-item {
    font-size: calc(0.76rem * var(--ui-font-scale, 1)) !important;
  }

  body.lobby-page .header-level-xp-group > #levelDisplay,
  body.game-page .header-level-xp-group > #levelDisplay,
  body.lobby-page .header-wallet-group > #chipDisplay,
  body.game-page .header-wallet-group > #chipDisplay,
  body.lobby-page .header-wallet-group > #diamondDisplay,
  body.game-page .header-wallet-group > #diamondDisplay {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    font-size: calc(0.76rem * var(--ui-font-scale, 1)) !important;
  }

  body.lobby-page .header-level-xp-group > #xpDisplay::before,
  body.game-page .header-level-xp-group > #xpDisplay::before,
  body.lobby-page .header-level-xp-group > #xpDisplay::after,
  body.game-page .header-level-xp-group > #xpDisplay::after {
    height: max(5px, calc(6px * var(--ui-control-scale, 1))) !important;
  }

  body.lobby-page .lobby-header-left .header-level-xp-group[data-xp-tooltip]::after,
  body.game-page .lobby-header-left .header-level-xp-group[data-xp-tooltip]::after {
    position: absolute !important;
    left: calc(100% + 10px) !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    min-width: 260px !important;
    max-width: min(460px, calc(100vw - 320px)) !important;
    width: max-content !important;
    transform: translate(0, -50%) !important;
  }

  body.lobby-page .lobby-header-left .header-level-xp-group[data-xp-tooltip]:hover::after,
  body.lobby-page .lobby-header-left .header-level-xp-group[data-xp-tooltip]:focus-visible::after,
  body.lobby-page .lobby-header-left .header-level-xp-group.show-xp-tip::after,
  body.game-page .lobby-header-left .header-level-xp-group[data-xp-tooltip]:hover::after,
  body.game-page .lobby-header-left .header-level-xp-group[data-xp-tooltip]:focus-visible::after,
  body.game-page .lobby-header-left .header-level-xp-group.show-xp-tip::after {
    opacity: 1 !important;
    transform: translate(0, -50%) !important;
  }
}




/* Supportbereich in den Einstellungen */
.settings-dialog {
  width: min(920px, 96vw);
  max-height: min(820px, 94vh);
  overflow: auto;
}

.settings-support-panel {
  min-height: 470px;
}

.settings-support-layout {
  display: grid;
  grid-template-columns: minmax(230px, .8fr) minmax(0, 1.45fr);
  gap: 12px;
}

.settings-support-sidebar,
.settings-support-detail {
  min-width: 0;
}

.settings-support-form,
.settings-support-reply {
  display: grid;
  gap: 7px;
}

.settings-support-form label {
  color: var(--color-yellow);
  font-weight: 800;
  font-size: .86rem;
}

.settings-support-form input,
.settings-support-form select,
.settings-support-form textarea,
.settings-support-reply textarea {
  width: 100%;
  color: #fff;
  background: rgba(5, 10, 22, 0.82);
  border: 1px solid rgba(56, 226, 255, 0.42);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  resize: vertical;
}

.settings-support-form textarea { min-height: 84px; }
.settings-support-reply textarea { min-height: 72px; }

.settings-support-feedback {
  min-height: 20px;
  margin: 8px 0;
  color: var(--color-text-soft);
  font-size: .86rem;
  font-weight: 700;
}
.settings-support-feedback.is-success { color: #6dffb0; }
.settings-support-feedback.is-error { color: #ff7aa2; }

.settings-support-list {
  display: grid;
  gap: 7px;
  max-height: 275px;
  overflow: auto;
  padding-right: 3px;
}

.settings-support-case {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px;
  color: #effcff;
  text-align: left;
  background: rgba(20, 38, 58, .76);
  border: 1px solid rgba(56, 226, 255, .2);
  border-radius: 9px;
  cursor: pointer;
}
.settings-support-case:hover,
.settings-support-case.is-selected { border-color: rgba(255, 226, 113, .8); background: rgba(35, 53, 76, .9); }
.settings-support-case.has-unread { box-shadow: inset 3px 0 #ffe271; }
.settings-support-case small { color: var(--color-text-soft); }
.settings-support-case-head { display: flex; justify-content: space-between; gap: 8px; }
.settings-support-unread {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #181000;
  background: #ffe271;
  font-size: 11px;
  font-weight: 900;
}

.settings-support-detail {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 390px;
  padding: 12px;
  border: 1px solid rgba(56, 226, 255, .18);
  border-radius: 10px;
  background: rgba(5, 10, 22, .42);
}
.settings-support-detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.settings-support-detail-head h4 { margin: 4px 0 0; }
.settings-support-status { padding: 5px 8px; border-radius: 999px; background: rgba(255,255,255,.08); white-space: nowrap; font-size: 12px; }
.settings-support-status.status-open,
.settings-support-status.status-in_progress { color: #6dffb0; }
.settings-support-status.status-waiting_for_user { color: #ffe271; }
.settings-support-context { color: var(--color-text-soft); font-size: .86rem; }
.settings-support-thread { display: grid; gap: 8px; max-height: 275px; overflow: auto; padding-right: 4px; }
.settings-support-message { padding: 9px 10px; border-radius: 10px; background: rgba(20, 38, 58, .78); border: 1px solid rgba(255,255,255,.08); }
.settings-support-message.role-admin { border-color: rgba(255, 226, 113, .34); background: rgba(55, 45, 21, .42); }
.settings-support-message > div { display: flex; justify-content: space-between; gap: 10px; color: var(--color-yellow); font-size: .82rem; }
.settings-support-message time { color: var(--color-text-soft); font-weight: 400; }
.settings-support-message p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.settings-support-empty { color: var(--color-text-soft); padding: 18px 8px; text-align: center; }

@media (max-width: 760px) {
  .settings-support-layout { grid-template-columns: 1fr; }
  .settings-support-list { max-height: 210px; }
  .settings-support-detail { min-height: 330px; }
}

.settings-tab-count {
  min-width: 19px;
  height: 19px;
  margin-left: 5px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #1b1200;
  background: #ffe271;
  font-size: 10px;
  font-weight: 900;
}
.settings-tab-count[hidden] { display: none; }

.settings-support-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.settings-danger-btn {
  border: 1px solid rgba(255, 91, 122, .55);
  background: rgba(255, 63, 101, .12);
  color: #ff91a8;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
}
.settings-danger-btn:hover { background: rgba(255, 63, 101, .22); }
