/* HeldixClient – Webseite: Konto (/konto) – Übersicht (Dashboard), Freunde mit Profilkarte, Chat-Extras, Party,
   Meine Welten, Profil-Status. Rahmen und gemeinsame Teile: bereich.css; Cosmetics, Einladungen, Support, Addons,
   Sicherheit: bereich-bausteine.css. */

/* ---------- Übersicht (Dashboard) ---------- */
.dash {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--sp-4);
}
.dash > .card {
  --card-pad: var(--sp-5);
}
.dash__hero {
  grid-column: span 8;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-6);
}
.dash__invite {
  grid-column: span 4;
}
.dash__friends,
.dash__messages {
  grid-column: span 6;
}
.dash__party,
.dash__worlds,
.dash__support,
.dash__security {
  grid-column: span 3;
}
.dash__invite[hidden] + .dash__friends {
  grid-column: span 6;
}
.figur {
  position: relative;
  display: grid;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: radial-gradient(70% 60% at 50% 40%, rgba(59, 130, 246, 0.25), transparent 70%), #141b2b;
}
.figur canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}
.figur canvas:active {
  cursor: grabbing;
}
.figur__ersatz {
  display: grid;
  place-items: center;
}
.figur figcaption {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  background: rgba(7, 10, 18, 0.72);
  white-space: nowrap;
  pointer-events: none;
}
.figur figcaption .icon {
  width: 14px;
  height: 14px;
}
.dash__hero-text {
  display: grid;
  gap: var(--sp-3);
  justify-items: start;
  min-width: 0;
}
.dash__hero-text .h2 {
  overflow-wrap: anywhere;
}
.dash__status {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-style: italic;
}
.look-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.reward-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-raised);
}
.reward-row__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--reward-soft);
  color: var(--c-amber-300);
}
.reward-row.is-done .reward-row__icon {
  background: var(--online-soft);
  color: var(--c-green-300);
}
.reward-row > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: var(--fs-sm);
}
.reward-row > div span {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.party-mini {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.party-mini > div {
  min-width: 0;
}
.ticket-mini {
  display: grid;
  gap: var(--sp-1);
  justify-items: start;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.ticket-mini:hover {
  border-color: var(--line-strong);
  color: var(--text);
}
.dash .check-list .is-warn .icon {
  color: var(--reward);
}
.dash .card__head {
  flex-wrap: nowrap;
}
.dash .rows > li:has(> .join-card) {
  flex-wrap: wrap;
  row-gap: var(--sp-2);
}
.dash .rows > li > .join-card {
  flex: 1 1 calc(100% - 52px);
  margin: 0 0 4px 52px;
}
.dash .empty {
  padding: var(--sp-5) var(--sp-3);
}

/* ---------- Freunde ---------- */
.friends-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  align-items: start;
  gap: var(--sp-4);
}
.friends-side {
  display: grid;
  gap: var(--sp-4);
}
.friends-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.live-chip .dot {
  margin: 0;
}
.friend-row .row-name {
  overflow-wrap: anywhere;
}
.row-realname {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.fav-mark {
  display: inline-grid;
  color: var(--reward);
}
.fav-mark .icon {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
.row-status {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-style: italic;
  overflow-wrap: anywhere;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-3);
}
.inline-form .field {
  flex: 1 1 180px;
}

/* Profilkarte */
dialog.profile-card {
  width: min(520px, calc(100% - 24px));
}
.profile-card__top {
  display: flex;
  justify-content: flex-end;
  padding: var(--sp-3) var(--sp-3) 0;
}
.profile-card__body {
  display: grid;
  gap: var(--sp-4);
  padding: 0 var(--sp-6) var(--sp-6);
}
.profile-card__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-4);
}
.profile-card__head .fav-toggle {
  grid-column: 1 / -1;
  justify-self: start;
}
.profile-card__who {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.profile-card__name {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-lg);
  overflow-wrap: anywhere;
}
.profile-card__status {
  color: var(--text-2);
  font-style: italic;
}
.fav-toggle.is-on {
  border-color: rgba(251, 191, 36, 0.4);
  background: var(--reward-soft);
  color: var(--c-amber-300);
}
.fav-toggle.is-on .icon {
  fill: currentColor;
}
.profile-card__actions,
.profile-card__danger {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.profile-card__danger {
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}
.profile-card__facts {
  display: grid;
  gap: var(--sp-2);
  margin: 0;
}
.profile-card__facts div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: var(--sp-3);
  font-size: var(--fs-sm);
}
.profile-card__facts dt {
  color: var(--text-3);
}
.profile-card__facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.profile-card__own {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-raised);
}
.profile-card__own .btn-group {
  align-items: center;
}
.quiet-danger:hover {
  color: var(--danger-text);
}

/* ---------- Nachrichten: Extras ---------- */
#chat.chat {
  padding: 0;
  gap: 0;
}
.chat-head .chat-who {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.chat-head .chat-who:hover {
  background: var(--surface-2);
}
.chat-who__text {
  display: grid;
  min-width: 0;
}
.chat-name {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-form {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.chat-form .input {
  flex: 1;
  min-width: 0;
}
.msg {
  position: relative;
}
.msg__body {
  display: grid;
  justify-items: start;
  gap: 4px;
  max-width: min(78%, 560px);
}
.msg.mine .msg__body {
  justify-items: end;
  margin-left: auto;
}
.msg__author {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.msg__quote {
  display: grid;
  gap: 1px;
  max-width: 100%;
  padding: 4px 10px;
  border: 0;
  border-left: 3px solid var(--line-accent);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--text-2);
  font: 500 var(--fs-xs) / 1.35 var(--font);
  text-align: left;
  cursor: pointer;
}
.msg__quote strong {
  color: var(--accent-text);
}
.msg__quote span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg__quote.is-deleted span {
  font-style: italic;
}
.msg .join-card {
  margin-top: 0;
}
.msg__reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font: 700 var(--fs-xs) var(--font);
  cursor: pointer;
}
.reaction-chip.is-mine {
  border-color: var(--line-accent);
  background: var(--accent-soft);
  color: var(--text);
}
.reaction-chip__emoji {
  font-size: 15px;
  line-height: 1;
}
.msg__tools {
  position: absolute;
  top: -14px;
  z-index: 2;
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  box-shadow: var(--sh-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast);
}
.msg.theirs .msg__tools {
  left: 48px;
}
.msg.mine .msg__tools {
  right: 8px;
}
.msg:hover .msg__tools,
.msg:focus-within .msg__tools {
  opacity: 1;
  pointer-events: auto;
}
.msg__tool {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.msg__tool:hover {
  background: var(--surface-3);
  color: var(--text);
}
.msg__tool--danger:hover {
  color: var(--danger-text);
}
.msg__tool .icon {
  width: 16px;
  height: 16px;
}
.msg.flash .bubble {
  box-shadow: 0 0 0 2px var(--c-blue-300);
}
.reaction-picker {
  position: absolute;
  top: -48px;
  z-index: 3;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  box-shadow: var(--sh-3);
}
.msg.mine .reaction-picker {
  right: 8px;
}
.msg.theirs .reaction-picker {
  left: 40px;
}
.reaction-picker__item {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 19px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease);
}
.reaction-picker__item:hover,
.reaction-picker__item:focus-visible {
  background: var(--surface-3);
  transform: scale(1.12);
}
.reaction-picker__item.is-mine {
  background: var(--accent-soft);
}
.chat-typing {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4) var(--sp-2);
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.typing-dots {
  display: inline-flex;
  gap: 3px;
}
.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-3);
  animation: tippen 1.2s infinite ease-in-out;
}
.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes tippen {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
.chat-reply {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 var(--sp-4) var(--sp-2);
  padding: 6px 6px 6px 12px;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
}
.chat-reply > .icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--accent-text);
}
.chat-reply__text {
  display: grid;
  flex: 1;
  min-width: 0;
  font-size: var(--fs-xs);
}
.chat-reply__text span {
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-preview.is-typing {
  color: var(--c-green-300);
  font-style: italic;
}

/* ---------- Party ---------- */
.party-layout {
  display: grid;
  gap: var(--sp-4);
}
#party-inhalt {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  align-items: start;
  gap: var(--sp-4);
}
#party-inhalt > .party-follow,
#party-inhalt > .party-empty {
  grid-column: 1 / -1;
}
#party-inhalt > .party-main {
  grid-row: span 2;
}
.party-invites {
  display: grid;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.party-invite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}
.party-invite .row-main {
  flex: 1 1 220px;
}
.party-target {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-raised);
}
.party-target > .icon {
  width: 20px;
  height: 20px;
  color: var(--accent-text);
}
.party-target > span {
  display: grid;
  flex: 1 1 180px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.party-voice {
  justify-self: start;
}
.party-member.is-away {
  opacity: 0.7;
}
.party-follow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  border-color: var(--line-accent);
  background: var(--accent-soft);
  color: var(--text);
}
.party-follow > span {
  flex: 1 1 200px;
}
.party-chat__log {
  display: grid;
  align-content: start;
  gap: var(--sp-2);
  height: 320px;
  overflow-y: auto;
  padding: var(--sp-2);
  border-radius: var(--r-md);
  background: var(--bg-raised);
}
.party-chat .chat-start {
  color: var(--text-3);
  font-size: var(--fs-sm);
  text-align: center;
}
.party-chat .msg__body {
  max-width: 85%;
}

/* ---------- Meine Welten ---------- */
.world-list {
  display: grid;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.world-card {
  --card-pad: var(--sp-4);
  background: var(--bg-raised);
}
.world-card.is-online {
  border-color: rgba(52, 211, 153, 0.3);
}
.world-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}
.world-card__title {
  flex: 1 1 150px;
  min-width: 0;
}
.world-card__title .card__title {
  overflow-wrap: anywhere;
}
.world-card__address {
  max-width: 460px;
}
.world-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  margin: 0;
  font-size: var(--fs-sm);
}
.world-card__facts dt {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.world-card__facts dd {
  margin: 0;
  font-weight: 600;
}
.world-card__members {
  padding-top: var(--sp-2);
  border-top: 1px solid var(--line);
}

/* ---------- Profil, Einstellungen ---------- */
.status-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-3);
}
.status-form .field {
  flex: 1 1 260px;
}
.invite-card #einladen-inhalt {
  display: grid;
  gap: var(--sp-4);
}

/* ---------- Schmalere Bildschirme ---------- */
@media (max-width: 1240px) {
  .dash__hero,
  .dash__invite {
    grid-column: 1 / -1;
  }
  .dash__party,
  .dash__worlds,
  .dash__support,
  .dash__security {
    grid-column: span 6;
  }
  .friends-layout,
  #party-inhalt {
    grid-template-columns: minmax(0, 1fr);
  }
  #party-inhalt > .party-main {
    grid-row: auto;
  }
}
@media (max-width: 900px) {
  .dash > *,
  .dash__party,
  .dash__worlds,
  .dash__support,
  .dash__security,
  .dash__invite[hidden] + .dash__friends {
    grid-column: 1 / -1;
  }
  .dash > .card {
    --card-pad: var(--sp-4);
  }
  .dash__hero {
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: start;
    gap: var(--sp-4);
  }
  .dash__hero .figur figcaption,
  .dash__hero .eyebrow {
    display: none;
  }
  .dash__hero-text {
    display: contents;
  }
  .dash__hero-text > :not(.h2) {
    grid-column: 1 / -1;
  }
  .dash__hero .h2 {
    align-self: center;
    font-size: var(--fs-xl);
  }
  .dash .rows > li > .join-card {
    flex-basis: 100%;
    margin-left: 0;
  }
  .msg__body {
    max-width: 88%;
  }
  .msg__tools {
    opacity: 1;
    pointer-events: auto;
    position: static;
    align-self: flex-end;
    box-shadow: none;
    background: transparent;
    border-color: transparent;
  }
  .msg {
    flex-wrap: wrap;
  }
  .profile-card__body {
    padding: 0 var(--sp-4) var(--sp-4);
  }
  .profile-card__facts div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}
@media (max-width: 560px) {
  /* Übersicht: Zeilen mit nur einem Symbol-Knopf brechen nicht um */
  .dash .row > .row-actions:not(:has(> .btn:not(.btn--icon))) {
    width: auto;
    margin-left: auto;
    padding-left: 0;
  }
  .dash .row:has(> .row-actions:not(:has(> .btn:not(.btn--icon)))) {
    flex-wrap: nowrap;
  }
}
@media (max-width: 480px) {
  .chat-actions .label,
  .chat-form .label {
    display: none;
  }
  .reaction-picker {
    left: 0 !important;
    right: auto !important;
    flex-wrap: wrap;
    max-width: calc(100vw - 48px);
    border-radius: var(--r-md);
  }
}
@media (prefers-reduced-motion: reduce) {
  .typing-dots i {
    animation: none;
  }
  .reaction-picker__item {
    transition: none;
  }
}
