.matrix-identity {
  min-width: 150px;
  max-width: 235px;
  height: 38px;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  gap: 1px;
  padding: 4px 11px;
  border: 1px solid #3b8057;
  border-radius: 999px;
  background: linear-gradient(100deg, #07150ff2, #102419ee);
  box-shadow: inset 0 0 18px #50f7b20a, 0 0 20px #50f7b20c;
}

.matrix-identity[hidden] {
  display: none;
}

.matrix-identity span,
.matrix-identity b,
.matrix-identity small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-identity span {
  color: var(--mint);
  font: 800 6px ui-monospace, monospace;
  letter-spacing: .13em;
}

.matrix-identity b {
  color: var(--text);
  font-size: 8px;
}

.matrix-identity small {
  color: var(--muted);
  font: 700 6px ui-monospace, monospace;
}

body.topbar-collapsed .head-actions > .matrix-identity {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.matrix-widget-gate {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 20px;
  background:
    radial-gradient(circle at 27% 45%, #184d2ca8 0, transparent 30%),
    radial-gradient(circle at 77% 12%, #4da72124 0, transparent 27%),
    #020705f2;
  backdrop-filter: blur(18px);
}

.matrix-widget-gate[hidden] {
  display: none;
}

.matrix-widget-card {
  width: min(920px, 100%);
  min-height: min(570px, calc(100vh - 40px));
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  overflow: hidden;
  border: 1px solid #69ec81;
  border-radius: 28px;
  background: linear-gradient(145deg, #06120d, #102917);
  box-shadow: 0 36px 110px #000e, 0 0 70px #73ff3523;
}

.matrix-widget-visual {
  position: relative;
  min-height: 470px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, #7aff8e32 0 8%, transparent 9%),
    radial-gradient(circle at 50% 50%, #133d246e 0 28%, transparent 29%),
    linear-gradient(145deg, #020705, #092015);
}

.matrix-widget-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .72;
  background-image:
    radial-gradient(circle at 20% 28%, var(--mint) 0 1px, transparent 1.6px),
    radial-gradient(circle at 72% 19%, var(--lime) 0 1px, transparent 1.6px),
    radial-gradient(circle at 44% 78%, #fff 0 1px, transparent 1.6px);
  background-size: 83px 83px, 127px 127px, 173px 173px;
}

.matrix-widget-orbit,
.matrix-widget-orbit::before,
.matrix-widget-orbit::after {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid #69f69a52;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.matrix-widget-orbit {
  width: 315px;
  height: 315px;
  box-shadow: 0 0 55px #50f7b217;
}

.matrix-widget-orbit::before,
.matrix-widget-orbit::after {
  content: "";
}

.matrix-widget-orbit::before {
  width: 225px;
  height: 225px;
}

.matrix-widget-orbit::after {
  width: 390px;
  height: 190px;
  transform: translate(-50%, -50%) rotate(-25deg);
}

.matrix-widget-orbit i {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 1px solid var(--mint);
  border-radius: 50%;
  background: #0b2919;
  box-shadow: 0 0 18px #50f7b2;
}

.matrix-widget-orbit i:nth-child(1) { left: 47%; top: -9px; }
.matrix-widget-orbit i:nth-child(2) { right: 12px; top: 25%; }
.matrix-widget-orbit i:nth-child(3) { right: 22px; bottom: 17%; }
.matrix-widget-orbit i:nth-child(4) { left: 45%; bottom: -9px; }
.matrix-widget-orbit i:nth-child(5) { left: 9px; bottom: 20%; }
.matrix-widget-orbit i:nth-child(6) { left: 20px; top: 17%; }

.matrix-widget-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 130px;
  height: 170px;
  display: grid;
  place-items: center;
  align-content: center;
  transform: translate(-50%, -50%);
  clip-path: polygon(19% 0, 81% 0, 100% 17%, 88% 100%, 12% 100%, 0 17%);
  background: linear-gradient(135deg, #efffb6, #62dd42 42%, #0e351b 43% 70%, #c8ffaf 71%);
  color: #061209;
  filter: drop-shadow(0 0 36px #8dff54);
}

.matrix-widget-mark b {
  font-size: 58px;
  line-height: .8;
}

.matrix-widget-mark span {
  margin-top: 12px;
  font: 900 9px ui-monospace, monospace;
  letter-spacing: .13em;
}

.matrix-widget-content {
  align-self: center;
  padding: 38px 42px;
}

.matrix-widget-content > small {
  color: var(--mint);
  font: 800 8px ui-monospace, monospace;
  letter-spacing: .15em;
}

.matrix-widget-content h1 {
  margin: 8px 0 13px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: .96;
}

.matrix-widget-content h1 em {
  color: var(--lime);
  font-style: normal;
}

.matrix-widget-content > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.matrix-widget-content > .matrix-game-intro {
  color: #e8f5ec;
  font-size: clamp(13px, 1.15vw, 15px);
  line-height: 1.48;
}

.matrix-widget-state {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #2b6b47;
  border-radius: 15px;
  background: #050d09;
  box-shadow: inset 0 0 24px #50f7b20a;
}

.matrix-widget-state strong,
.matrix-widget-state span {
  display: block;
}

.matrix-widget-state strong {
  color: var(--text);
  font-size: 14px;
}

.matrix-widget-state span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.matrix-widget-gate[data-state="error"] .matrix-widget-state {
  border-color: #b84c62;
}

.matrix-lounge-link {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 46px;
  margin-top: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid var(--lime);
  border-radius: 999px;
  background: var(--lime);
  color: #071008;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 0 28px #b9ff4230;
}

.matrix-room-join-hint {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: start;
  margin: 12px 0 0;
  border-left: 2px solid var(--lime);
  background: #06130dd9;
  padding: 10px 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.matrix-room-join-hint b {
  color: var(--lime);
  font: 850 10px ui-monospace, Consolas, monospace;
  letter-spacing: .1em;
}

.matrix-room-join-hint q {
  color: var(--text);
  font-weight: 750;
}

.matrix-client-link {
  margin: 11px 12px 0;
  display: inline-flex;
  color: var(--mint);
  font-size: 10px;
  font-weight: 800;
  text-underline-offset: 3px;
}

.matrix-widget-privacy {
  margin-top: 14px !important;
  padding: 10px 12px;
  border-left: 2px solid var(--mint);
  background: #05110c;
  font-size: 10px !important;
}

.matrix-widget-install {
  margin-top: 13px;
  border: 1px solid #75ffc738;
  border-radius: 14px;
  background: #06140ee8;
  color: var(--text);
}

.matrix-widget-install summary {
  padding: 10px 7px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  cursor: pointer;
}

.matrix-widget-install p,
.matrix-widget-install code,
.matrix-widget-install button,
.matrix-widget-install span {
  margin: 0 13px 10px;
}

.matrix-widget-install p {
  color: var(--muted);
  font-size: 10px !important;
  line-height: 1.5;
}

.matrix-widget-install code {
  display: block;
  padding: 9px;
  overflow-wrap: anywhere;
  border: 1px solid #75ffc724;
  border-radius: 9px;
  background: #020a07;
  color: #d9ffef;
  font-size: 10px;
  user-select: all;
}

.matrix-widget-install button {
  min-height: 32px;
  padding: 0 7px;
  border: 1px solid #b8ff70;
  border-radius: 999px;
  background: transparent;
  color: #dfffbd;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.matrix-widget-install span {
  color: var(--lime);
  font-size: 10px;
}

.project-family-links {
  min-height: 31px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px 13px;
  color: #7fa18e;
  font: 750 10px/1.4 ui-monospace, monospace;
  letter-spacing: .08em;
}

.project-family-links span {
  color: #668274;
  text-transform: uppercase;
}

.project-family-links a {
  color: #b7dcca;
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 150ms ease, text-shadow 150ms ease;
}

.project-family-links a:hover,
.project-family-links a:focus-visible {
  color: var(--mint);
  text-decoration: underline;
  text-shadow: 0 0 12px #50f7b266;
}

.project-family-links--gate {
  margin-top: 10px;
  border-top: 1px solid #75ffc71c;
}

.project-family-links--lounge {
  padding: 8px 20px;
  border-top: 1px solid #205a3a;
  background: #030a07a8;
}

@media (max-height: 780px) and (min-width: 681px) {
  .matrix-widget-gate {
    align-items: start;
    padding-block: 10px;
  }

  .matrix-widget-card {
    min-height: 0;
  }

  .matrix-widget-content {
    padding: 24px 30px;
  }

  .matrix-widget-content h1 {
    margin-block: 6px 10px;
    font-size: clamp(30px, 3.6vw, 44px);
  }

  .matrix-widget-state {
    margin-top: 14px;
    padding: 13px;
  }

  .matrix-lounge-link,
  .matrix-widget-install {
    margin-top: 10px;
  }
}

@media (max-width: 680px) {
  .matrix-widget-gate {
    align-items: start;
    padding: 8px;
  }

  .matrix-widget-card {
    min-height: 0;
    grid-template-columns: 1fr;
    border-radius: 19px;
  }

  .matrix-widget-visual {
    min-height: 155px;
  }

  .matrix-widget-orbit {
    width: 220px;
    height: 135px;
  }

  .matrix-widget-mark {
    width: 72px;
    height: 94px;
  }

  .matrix-widget-mark b {
    font-size: 32px;
  }

  .matrix-widget-mark span {
    margin-top: 7px;
    font-size: 9px;
  }

  .matrix-widget-content {
    padding: 22px 18px;
  }

  .matrix-widget-content h1 {
    font-size: 32px;
  }

  .matrix-identity {
    min-width: 130px;
  }
}

.table-chat {
  position: fixed;
  z-index: 95;
  right: 18px;
  bottom: 18px;
  width: min(390px, calc(100vw - 36px));
  height: min(420px, calc(100vh - 36px));
  min-width: 280px;
  min-height: 180px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid #55f2a9a8;
  border-radius: 16px;
  background: #04110df5;
  box-shadow: 0 20px 65px #000d, 0 0 32px #29db8a38;
  color: #eafff4;
}

.table-chat[hidden] { display: none; }
.table-chat.minimized { height: 50px !important; min-height: 50px; }
.table-chat.minimized > :not(header):not(.table-chat-resize) { display: none; }
.table-chat > header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:7px 8px 7px 12px; border-bottom:1px solid #245a43; background:#071b13; cursor:grab; touch-action:none; }
.table-chat > header:active { cursor:grabbing; }
.table-chat > header div { display:grid; min-width:0; }
.table-chat > header small { color:#6bf5b1; font:800 10px/1.2 ui-monospace,monospace; letter-spacing:.08em; }
.table-chat > header strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:800 16px/1.15 system-ui,sans-serif; }
.table-chat > header button { width:34px; height:32px; padding:0 2px; border:1px solid #3d8c68; border-radius:9px; background:#06130e; color:#dffff0; font:900 20px/1 sans-serif; }
.table-chat-messages { min-height:0; overflow:auto; padding:9px; display:flex; flex-direction:column; gap:6px; }
.table-chat-messages p { margin:0; display:grid; gap:2px; max-width:88%; align-self:flex-start; padding:7px 9px; border:1px solid #285c46; border-radius:10px; background:#0a2118; }
.table-chat-messages p.mine { align-self:flex-end; border-color:#7ce93e78; background:#142816; }
.table-chat-messages strong { color:#70f0b0; font:800 11px/1.2 ui-monospace,monospace; }
.table-chat-messages span { overflow-wrap:anywhere; font:600 14px/1.35 system-ui,sans-serif; }
.table-chat form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; padding:7px; border-top:1px solid #245a43; }
.table-chat form input { min-width:0; padding:8px 9px; border:1px solid #32694f; border-radius:9px; background:#020a07; color:#f1fff7; font:600 14px/1.2 system-ui,sans-serif; }
.table-chat form button { padding:7px 10px; border:1px solid #69f5b2; border-radius:9px; background:#173b28; color:#ecfff6; font:800 13px/1 system-ui,sans-serif; }
.table-chat > a { padding:7px 10px; color:#8fffc8; text-align:right; font:700 11px/1.2 system-ui,sans-serif; }
.table-chat[data-mode="external"] { height:180px; min-height:180px; }
.table-chat[data-mode="external"] .table-chat-messages:empty::before { content:"Für den Live-Chat das Tisch-Widget im Matrix-Client geöffnet lassen. Der losgelöste Tab verbindet sich automatisch."; margin:auto; padding:12px; color:#a7c9b7; text-align:center; font:650 13px/1.4 system-ui,sans-serif; }
.table-chat-resize { position:absolute; right:2px; bottom:2px; width:18px; height:18px; padding:0; border:0; border-right:2px solid #6af4b2; border-bottom:2px solid #6af4b2; background:transparent; cursor:nwse-resize; touch-action:none; }
