/* ============================================================================
 * Historie (client/historie.css)
 * Eigenständig, alles unter .hx gekapselt. Keine Abhängigkeit von styles.css.
 * ==========================================================================*/

.hx {
  --hx-night: #131b2e;
  --hx-panel: #18223a;
  --hx-raised: #1f2b47;
  --hx-parch: #ece3cf;
  --hx-mute: #98a2b8;
  --hx-faint: #66708a;
  --hx-brass: #c9a75e;
  --hx-brass-soft: rgba(201, 167, 94, 0.16);
  --hx-blue-soft: rgba(106, 156, 240, 0.16);
  --hx-line: rgba(236, 227, 207, 0.09);
  --hx-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --hx-sans: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  position: fixed;
  inset: 0;
  z-index: 7000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vh 2vw;
  background: rgba(8, 11, 20, 0.72);
  backdrop-filter: blur(3px);
  font-family: var(--hx-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--hx-parch);
  -webkit-font-smoothing: antialiased;
}
.hx *,
.hx *::before,
.hx *::after {
  box-sizing: border-box;
}
.hx[hidden] {
  display: none;
}

.hx .hx-panel[tabindex]:focus,
.hx .hx-panel[tabindex]:focus-visible {
  outline: none;
}
.hx-panel {
  width: min(1120px, 100%);
  height: min(920px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--hx-night);
  border: 1px solid var(--hx-line);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: hx-open 260ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
@keyframes hx-open {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Kopf ---------- */
.hx-head {
  padding: 22px 28px 0;
  border-bottom: 1px solid var(--hx-line);
  background: linear-gradient(180deg, #1a2440 0%, var(--hx-night) 100%);
}
.hx-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.hx-title {
  flex: 1;
  min-width: 0;
}
.hx-title h2 {
  margin: 0;
  font-family: var(--hx-serif);
  font-weight: 500;
  font-size: 2.1rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--hx-parch);
}
.hx-title p {
  margin: 4px 0 0;
  color: var(--hx-mute);
  font-size: 0.92rem;
}
.hx-close {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--hx-line);
  background: transparent;
  color: var(--hx-mute);
  font-size: 1rem;
  cursor: pointer;
}
.hx-close:hover {
  color: var(--hx-parch);
  border-color: rgba(236, 227, 207, 0.25);
}

.hx-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.hx-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.hx-tabs::-webkit-scrollbar {
  display: none;
}
.hx-tab {
  position: relative;
  padding: 10px 14px 14px;
  border: 0;
  background: none;
  color: var(--hx-mute);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}
.hx-tab:hover {
  color: var(--hx-parch);
}
.hx-tab[aria-selected="true"] {
  color: var(--hx-parch);
}
.hx-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--hx-brass);
}

.hx-filters {
  display: flex;
  gap: 10px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}
.hx-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--hx-line);
}
.hx-seg button {
  border: 0;
  background: none;
  color: var(--hx-mute);
  font: inherit;
  font-size: 0.82rem;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.hx-seg button:hover {
  color: var(--hx-parch);
}
.hx-seg button[aria-pressed="true"] {
  background: var(--hx-raised);
  color: var(--hx-parch);
}

.hx button:focus-visible,
.hx [tabindex]:focus-visible {
  outline: 2px solid var(--hx-brass);
  outline-offset: 2px;
}

/* ---------- Inhalt ---------- */
.hx-body {
  flex: 1;
  overflow-y: auto;
  padding: 26px 28px 40px;
  scrollbar-color: rgba(236, 227, 207, 0.18) transparent;
}
.hx-sec + .hx-sec,
.hx-figs + .hx-sec {
  margin-top: 34px;
}
.hx-sec h3 {
  margin: 0 0 4px;
  font-family: var(--hx-serif);
  font-weight: 500;
  font-size: 1.32rem;
  color: var(--hx-parch);
}
.hx-sechead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.hx-sechead h3 {
  margin: 0;
}
.hx-note {
  margin: 0 0 14px;
  color: var(--hx-mute);
  font-size: 0.86rem;
  max-width: 68ch;
}
.hx-empty {
  padding: 28px 0;
  color: var(--hx-mute);
}
.hx-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
}

/* ---------- Diagramm ---------- */
.hx-chart {
  position: relative;
  width: 100%;
}
.hx-chart svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.hx-chart text {
  font-family: var(--hx-sans);
  fill: var(--hx-mute);
  font-size: 11px;
}
.hx-chart .hx-endlabel {
  font-size: 12.5px;
  font-weight: 600;
}
.hx-tip {
  position: absolute;
  top: 0;
  pointer-events: none;
  min-width: 170px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 21, 37, 0.96);
  border: 1px solid var(--hx-line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  font-size: 0.82rem;
  opacity: 0;
  transition: opacity 120ms ease;
}
.hx-tip.on {
  opacity: 1;
}
.hx-tip b {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--hx-parch);
}
.hx-tip div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--hx-mute);
}
.hx-tip span:last-child {
  color: var(--hx-parch);
  font-variant-numeric: tabular-nums;
}

/* ---------- Tabellen ---------- */
.hx-tablewrap {
  overflow-x: auto;
}
.hx-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  min-width: 620px;
}
.hx-table th {
  text-align: left;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--hx-faint);
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--hx-line);
  white-space: nowrap;
}
.hx-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--hx-line);
  vertical-align: middle;
}
.hx-table .r,
.hx-table th.r {
  text-align: right;
}
.hx-table tr.hx-click {
  cursor: pointer;
}
.hx-table tr.hx-click:hover td {
  background: rgba(236, 227, 207, 0.03);
}
.hx-rank {
  width: 32px;
  font-family: var(--hx-serif);
  font-size: 1.1rem;
  color: var(--hx-faint);
}
.hx-table tr:first-child .hx-rank {
  color: var(--hx-brass);
}
.hx-big {
  font-family: var(--hx-serif);
  font-size: 1.15rem;
  font-weight: 500;
}
.hx-sub {
  color: var(--hx-faint);
  font-size: 0.8rem;
}
.hx-warm {
  color: #e8a160;
}
.hx-cool {
  color: #7fa9f0;
}
.hx-table.hx-compact {
  min-width: 0;
}
.hx-table.hx-compact {
  font-size: 0.88rem;
}
.hx-table.hx-compact td {
  padding: 9px 6px;
  white-space: nowrap;
}
.hx-table.hx-compact th {
  padding: 0 6px 8px;
}
.hx-table.hx-compact td:first-child,
.hx-table.hx-compact th:first-child {
  padding-left: 0;
}
.hx-table.hx-compact td:last-child,
.hx-table.hx-compact th:last-child {
  padding-right: 0;
}
.hx-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--hx-raised);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hx-ou {
  display: flex;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  gap: 2px;
  margin: 4px 0 10px;
}
.hx-ou i {
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.hx-game.short > button {
  opacity: 0.5;
}
.hx-up {
  color: #7cc79b;
}
.hx-down {
  color: #e38b86;
}

.hx-who {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  white-space: nowrap;
}
.hx-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

/* Form: letzte Platzierungen */
.hx-form {
  display: inline-flex;
  gap: 4px;
}
.hx-form i {
  font-style: normal;
  width: 21px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--hx-mute);
  background: rgba(236, 227, 207, 0.06);
}
.hx-form i.p1 {
  background: #d4b05c;
  color: #241b06;
}
.hx-form i.p2 {
  background: #b9c0cd;
  color: #1c212b;
}
.hx-form i.p3 {
  background: #b47c52;
  color: #23140a;
}
.hx-form i.last {
  color: var(--hx-faint);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--hx-line);
}

/* ---------- Kennzahlen ---------- */
.hx-figs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--hx-line);
  border-bottom: 1px solid var(--hx-line);
}
.hx-fig {
  padding: 16px 18px;
}
.hx-fig + .hx-fig {
  border-left: 1px solid var(--hx-line);
}
.hx-fig span {
  display: block;
  color: var(--hx-mute);
  font-size: 0.82rem;
}
.hx-fig strong {
  display: block;
  margin-top: 2px;
  font-family: var(--hx-serif);
  font-weight: 500;
  font-size: 1.9rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.hx-fig em {
  font-style: normal;
  color: var(--hx-faint);
  font-size: 0.8rem;
}

/* ---------- Spielerwahl ---------- */
.hx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.hx-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--hx-line);
  background: transparent;
  color: var(--hx-mute);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.hx-chip:hover {
  color: var(--hx-parch);
}
.hx-chip[aria-pressed="true"] {
  color: var(--hx-parch);
  background: var(--hx-raised);
  border-color: transparent;
}

.hx-profile-name {
  margin: 0;
  font-family: var(--hx-serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.hx-profile-meta {
  margin: 6px 0 22px;
  color: var(--hx-mute);
}

/* Stil-Balken: Abweichung vom Gruppenschnitt */
.hx-style {
  display: grid;
  gap: 16px;
}
.hx-style-row {
  display: grid;
  grid-template-columns: 150px 1fr 92px;
  align-items: center;
  gap: 14px;
}
.hx-style-row > span:first-child {
  color: var(--hx-mute);
  font-size: 0.9rem;
}
.hx-style-row > span:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.hx-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: rgba(236, 227, 207, 0.06);
}
.hx-track::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  bottom: -5px;
  width: 1px;
  background: rgba(236, 227, 207, 0.28);
}
.hx-track b {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 4px;
}
.hx-style-legend {
  display: flex;
  justify-content: space-between;
  margin: 6px 92px 0 164px;
  color: var(--hx-faint);
  font-size: 0.76rem;
}

/* Platzierungsverteilung */
.hx-dist {
  display: grid;
  gap: 12px;
}
.hx-dist-row {
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}
.hx-dist-row > span:first-child {
  color: var(--hx-mute);
}
.hx-dist-row > span:last-child {
  text-align: right;
  color: var(--hx-faint);
  font-variant-numeric: tabular-nums;
}
.hx-stack {
  display: flex;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  gap: 2px;
}
.hx-stack i {
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
}

/* Gegnerkarten */
.hx-rivals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.hx-rival {
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--hx-panel);
}
.hx-rival > span {
  display: block;
  color: var(--hx-mute);
  font-size: 0.82rem;
}
.hx-rival > strong {
  display: block;
  margin: 4px 0 2px;
  font-family: var(--hx-serif);
  font-weight: 500;
  font-size: 1.25rem;
}
.hx-rival > em {
  font-style: normal;
  color: var(--hx-faint);
  font-size: 0.82rem;
}

/* ---------- Duelle ---------- */
.hx-matrix {
  border-collapse: separate;
  border-spacing: 4px;
  font-variant-numeric: tabular-nums;
}
.hx-matrix th {
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--hx-mute);
  padding: 4px 8px;
  white-space: nowrap;
}
.hx-matrix thead th {
  vertical-align: bottom;
  text-align: center;
  width: 112px;
  max-width: 112px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.hx-matrix thead .hx-who {
  white-space: normal;
  justify-content: center;
}
.hx-matrix tbody th {
  text-align: right;
}
.hx-matrix td {
  width: 112px;
  height: 64px;
  text-align: center;
  border-radius: 10px;
}
.hx-matrix td strong {
  display: block;
  font-family: var(--hx-serif);
  font-weight: 500;
  font-size: 1.25rem;
}
.hx-matrix td span {
  color: var(--hx-faint);
  font-size: 0.74rem;
}
.hx-matrix td.self {
  background: repeating-linear-gradient(
    135deg,
    transparent 0 6px,
    rgba(236, 227, 207, 0.04) 6px 7px
  );
}

/* ---------- Rekorde ---------- */
.hx-rec {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}
.hx-rec h4 {
  margin: 0 0 10px;
  font-weight: 500;
  font-size: 0.86rem;
  color: var(--hx-mute);
}
.hx-rec ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hx-rec li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hx-line);
  font-size: 0.9rem;
}
.hx-rec li .hx-who {
  flex: 1;
  min-width: 0;
}
.hx-rec li b {
  font-family: var(--hx-serif);
  font-weight: 500;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.hx-rec li small {
  color: var(--hx-faint);
  font-size: 0.76rem;
  white-space: nowrap;
}
.hx-rec li:first-child b {
  color: var(--hx-brass);
}
.hx-rec ol.low li:first-child b {
  color: inherit;
}

/* Tischwerte */
.hx-split {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  gap: 2px;
  margin: 10px 0 8px;
}
.hx-split i {
  display: block;
}
.hx-kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hx-line);
  font-size: 0.92rem;
}
.hx-kv span:first-child {
  color: var(--hx-mute);
}
.hx-kv span:last-child {
  font-variant-numeric: tabular-nums;
}

/* ---------- Archiv ---------- */
.hx-month {
  margin: 26px 0 6px;
  font-family: var(--hx-serif);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--hx-mute);
}
.hx-month:first-child {
  margin-top: 0;
}
.hx-evening {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 26px 0 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(236, 227, 207, 0.18);
}
.hx-evening .hx-month {
  margin: 0;
  color: var(--hx-parch);
}
.hx-game {
  border-bottom: 1px solid var(--hx-line);
}
.hx-game > button {
  width: 100%;
  display: grid;
  grid-template-columns: 112px 74px 1fr 18px;
  align-items: center;
  gap: 14px;
  padding: 13px 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hx-game > button:hover {
  background: rgba(236, 227, 207, 0.03);
}
.hx-game-date {
  color: var(--hx-mute);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.hx-game-type {
  color: var(--hx-faint);
  font-size: 0.84rem;
}
.hx-game-pod {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 0.9rem;
  min-width: 0;
}
.hx-game-pod span {
  white-space: nowrap;
  color: var(--hx-mute);
}
.hx-game-pod span:first-child {
  color: var(--hx-parch);
  font-weight: 600;
}
.hx-game-pod small {
  color: var(--hx-faint);
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}
.hx-chev {
  color: var(--hx-faint);
  transition: transform 160ms ease;
}
.hx-game.open .hx-chev {
  transform: rotate(90deg);
}
.hx-game-detail {
  padding: 4px 4px 22px;
}
.hx-game-detail .hx-table {
  min-width: 520px;
  margin-bottom: 18px;
}

/* ---------- Übersicht: Ranglisten in drei Spalten ---------- */
.hx-rec.hx-rec-big h3 {
  margin-bottom: 4px;
}
.hx-rec.hx-rec-big .hx-note {
  min-height: 2.9em;
}
.hx-rec.hx-rec-one {
  grid-template-columns: 1fr;
}

/* ---------- Tischgrößen ---------- */
.hx-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 26px;
  color: var(--hx-mute);
  font-size: 0.82rem;
}
.hx-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hx-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.hx-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hx-stack-wide {
  min-width: 240px;
  height: 26px;
}
.hx-stack i {
  font-variant-numeric: tabular-nums;
}

/* ---------- Spielerwerte (Radar) ---------- */
.hx-profile-grid {
  align-items: start;
}
.hx-card {
  padding: 20px 22px 16px;
  border-radius: 14px;
  background: var(--hx-panel);
  border: 1px solid var(--hx-line);
}
.hx-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.hx-card-head .hx-note {
  margin-bottom: 0;
}
.hx-ovr {
  flex: none;
  text-align: center;
  padding: 8px 14px 6px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.hx-ovr strong {
  display: block;
  font-family: var(--hx-serif);
  font-weight: 500;
  font-size: 2.3rem;
  line-height: 1;
  color: var(--c);
  font-variant-numeric: tabular-nums;
}
.hx-ovr span {
  font-size: 0.74rem;
  color: var(--hx-mute);
}
.hx-radar {
  max-width: 420px;
  margin: 6px auto 0;
}
.hx-radar svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.hx-radar .hx-rlabel {
  font-family: var(--hx-sans);
  font-size: 12.5px;
  fill: var(--hx-mute);
}
.hx-radar .hx-rvalue {
  font-family: var(--hx-serif);
  font-size: 19px;
  fill: var(--hx-parch);
}
.hx-radar-note {
  margin: 8px 0 0;
  font-size: 0.8rem;
}
.hx-rivals.hx-rivals-stack {
  grid-template-columns: 1fr;
  gap: 10px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hx {
    padding: 0;
  }
  .hx-panel {
    height: 100%;
    border-radius: 0;
    border: 0;
  }
  .hx-head {
    padding: 16px 16px 0;
  }
  .hx-body {
    padding: 20px 16px 32px;
  }
  .hx-grid2,
  .hx-rivals,
  .hx-rec {
    grid-template-columns: 1fr;
  }
  .hx-figs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hx-fig:nth-child(3) {
    border-left: 0;
  }
  .hx-fig:nth-child(n + 3) {
    border-top: 1px solid var(--hx-line);
  }
  .hx-style-row {
    grid-template-columns: 110px 1fr 74px;
    gap: 10px;
  }
  .hx-style-legend {
    margin: 6px 74px 0 120px;
  }
  .hx-game > button {
    grid-template-columns: 88px 1fr 14px;
  }
  .hx-game-type {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-panel {
    animation: none;
  }
  .hx-chev,
  .hx-tip {
    transition: none;
  }
}

/* ============================================================================
 * GRANIT-OPTIK
 * Überschreibt die glatte Optik oben: Steinplatten, Fasen, Gravur, Messing.
 * ==========================================================================*/
.hx {
  --hx-night: #1d1d20;
  --hx-panel: #27272b;
  --hx-raised: #323238;
  --hx-parch: #e6e1d6;
  --hx-mute: #a19d95;
  --hx-faint: #77736c;
  --hx-brass: #d6b25e;
  --hx-gold-hi: #f0d68e;
  --hx-gold-lo: #8f6e2a;
  --hx-grout: #0e0e10;
  --hx-line: rgba(230, 225, 214, 0.07);
  --hx-serif: "Cinzel", "Trajan Pro", Georgia, serif;
  --hx-sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --hx-noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/></svg>");
  --hx-mottle: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='420'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='.018' numOctaves='4' seed='7'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 -.3'/></filter><rect width='100%25' height='100%25' filter='url(%23m)' opacity='.6'/></svg>");
  --hx-bevel: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -2px 0 rgba(0, 0, 0, 0.45);
  --hx-metal-gold: linear-gradient(180deg, var(--hx-gold-hi), var(--hx-brass) 55%, var(--hx-gold-lo));
  --hx-metal-silver: linear-gradient(180deg, #eef0f3, #b9bec7 55%, #7c818a);
  --hx-metal-bronze: linear-gradient(180deg, #e1a77b, #b47c52 55%, #6f4628);
  --hx-metal-iron: linear-gradient(180deg, #7d7d83, #55555b 60%, #3f3f44);
  background: rgba(4, 4, 5, 0.82);
  font-size: 16px;
}

.hx-panel {
  background-color: var(--hx-night);
  background-image: var(--hx-noise), var(--hx-mottle),
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.04), transparent 60%);
  border: 1px solid var(--hx-grout);
  border-radius: 3px;
  box-shadow: var(--hx-bevel), 0 0 0 3px #161618, 0 0 0 4px rgba(214, 178, 94, 0.32),
    0 30px 80px rgba(0, 0, 0, 0.75);
}
.hx-head {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));
  border-bottom: 2px solid var(--hx-grout);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Gravur */
.hx-title h2,
.hx-sec h3,
.hx-month,
.hx-profile-name {
  font-family: var(--hx-serif);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.85), 0 1px 0 rgba(255, 255, 255, 0.1);
}
.hx-title h2,
.hx-sec h3 {
  color: var(--hx-brass);
}
.hx-title h2 {
  font-size: 1.9rem;
}
.hx-sec h3 {
  font-size: 1.1rem;
}
.hx-evening .hx-month {
  color: var(--hx-parch);
  font-size: 0.98rem;
}
.hx-rec h4,
.hx-table th,
.hx-matrix th,
.hx-fig span,
.hx-rival > span,
.hx-legend {
  font-family: var(--hx-serif);
  letter-spacing: 0.04em;
}
.hx-table th,
.hx-rec h4 {
  font-size: 0.72rem;
  font-weight: 700;
}
.hx-big,
.hx-fig strong,
.hx-rival > strong,
.hx-rec li b,
.hx-matrix td strong,
.hx-ovr strong,
.hx-rank {
  font-family: var(--hx-serif);
  font-weight: 700;
}

/* Tabs und Schalter */
.hx-tab {
  font-family: var(--hx-serif);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.05em;
}
.hx-tab[aria-selected="true"]::after {
  height: 3px;
  border-radius: 0;
  background: var(--hx-metal-gold);
}
.hx-seg {
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.4);
  border-color: var(--hx-grout);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65);
}
.hx-seg button {
  border-radius: 2px;
  font-family: var(--hx-serif);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}
.hx-seg button[aria-pressed="true"] {
  background: var(--hx-metal-gold);
  color: #241a07;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.hx-close {
  border-radius: 3px;
  border-color: var(--hx-grout);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.hx-chip {
  border-radius: 3px;
  border-color: var(--hx-grout);
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.hx-chip[aria-pressed="true"] {
  background: var(--hx-raised);
  box-shadow: inset 0 0 0 1px rgba(214, 178, 94, 0.55), var(--hx-bevel);
}
.hx-pill {
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Platten */
.hx-card,
.hx-rival,
.hx-figs {
  background-color: var(--hx-panel);
  background-image: var(--hx-noise), linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.08));
  border: 1px solid var(--hx-grout);
  border-radius: 3px;
  box-shadow: var(--hx-bevel), 0 4px 10px rgba(0, 0, 0, 0.45);
}
.hx-fig + .hx-fig {
  border-left: 2px solid var(--hx-grout);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.04);
}
.hx-ovr {
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--hx-grout);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent), var(--hx-bevel);
}

/* Fugenlinien */
.hx-table td,
.hx-table th,
.hx-kv,
.hx-rec li,
.hx-game,
.hx-evening {
  border-color: rgba(0, 0, 0, 0.5);
}
.hx-table td,
.hx-kv,
.hx-rec li,
.hx-game {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035);
}

/* Spielerfarben als Rauten */
.hx-dot {
  border-radius: 1px;
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}

/* Letzte 5: Medaillen aus Metall */
.hx-form i {
  border-radius: 2px;
  font-family: var(--hx-serif);
  font-weight: 700;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}
.hx-form i.p1 {
  background: var(--hx-metal-gold);
}
.hx-form i.p2 {
  background: var(--hx-metal-silver);
}
.hx-form i.p3 {
  background: var(--hx-metal-bronze);
}
.hx-form i.p1,
.hx-form i.p2,
.hx-form i.p3 {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Balken in eingelassenen Rillen */
.hx-stack,
.hx-ou,
.hx-split {
  border-radius: 2px;
  padding: 2px;
  gap: 2px;
  background: var(--hx-grout);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.05);
}
.hx-stack i,
.hx-ou i {
  border-radius: 1px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
  font-family: var(--hx-serif);
  font-weight: 700;
}
.hx-stack i:nth-child(1)[style*="#d4b05c"] {
  background: var(--hx-metal-gold) !important;
}
.hx-stack i[style*="#b9c0cd"] {
  background: var(--hx-metal-silver) !important;
}
.hx-stack i[style*="#b47c52"] {
  background: var(--hx-metal-bronze) !important;
}
.hx-stack i[style*="#d4b05c"] {
  background: var(--hx-metal-gold) !important;
}
.hx-ou i {
  filter: saturate(0.8) brightness(0.92);
}
.hx-legend i {
  border-radius: 1px;
}

/* Duelle */
.hx-matrix td {
  border-radius: 2px;
  box-shadow: var(--hx-bevel);
}
.hx-matrix td.self {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Tooltip */
.hx-tip {
  border-radius: 3px;
  background-color: #1a1a1d;
  background-image: var(--hx-noise);
  border-color: var(--hx-grout);
  box-shadow: var(--hx-bevel), 0 10px 30px rgba(0, 0, 0, 0.6);
}
.hx-chart text {
  font-family: var(--hx-sans);
}
.hx-chart .hx-endlabel {
  font-family: var(--hx-serif);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Rekorde: erster Platz in Messing */
.hx-rec li:first-child b {
  color: var(--hx-brass);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.8);
}
.hx-warm {
  color: #e2a15c;
}
.hx-cool {
  color: #84a7dd;
}
.hx-stack i[style*="#5a647e"],
.hx-legend i[style*="#5a647e"] {
  background: linear-gradient(180deg, #8a8a90, #636369 60%, #4b4b50) !important;
}
.hx-stack i[style*="#475069"],
.hx-legend i[style*="#475069"] {
  background: linear-gradient(180deg, #6e6e74, #4f4f55 60%, #3b3b40) !important;
}
.hx-stack i[style*="#394057"],
.hx-legend i[style*="#394057"] {
  background: linear-gradient(180deg, #5a5a60, #414146 60%, #303034) !important;
}

/* ============================================================================
 * KACHELN: Jeder Block liegt auf einer eigenen Granitplatte,
 * Gruppenüberschriften (z. B. Hall of Fame) bleiben auf dem Grundstein.
 * ==========================================================================*/
.hx-sec:not(.hx-grid2):not(.hx-rec):not(.hx-rivals):not(.hx-group),
.hx-grid2 > div:not(.hx-card),
.hx-rec > div,
.hx-evening-block {
  padding: 18px 20px;
  background-color: var(--hx-panel);
  background-image: var(--hx-noise), linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.08));
  border: 1px solid var(--hx-grout);
  border-radius: 3px;
  box-shadow: var(--hx-bevel), 0 4px 10px rgba(0, 0, 0, 0.45);
}
.hx-sec + .hx-sec,
.hx-figs + .hx-sec {
  margin-top: 22px;
}
.hx-grid2,
.hx-rec {
  gap: 18px;
}
.hx-group > h3,
.hx-group > .hx-note {
  padding: 0 2px;
}
.hx-sec .hx-tablewrap {
  margin: 0 -4px;
  padding: 0 4px;
}

/* Platten in Platten wirken eingelassen statt doppelt */
.hx-grid2 > div .hx-rival,
.hx-sec .hx-rec.hx-rec-one,
.hx-sec:not(.hx-rivals) .hx-rival {
  background: rgba(0, 0, 0, 0.22);
  background-image: none;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.04);
}
.hx-rec.hx-rec-one {
  padding: 0;
  background: none !important;
  box-shadow: none !important;
}

/* Spieleabende als eigene Platten */
.hx-evening-block {
  margin-top: 16px;
  padding-top: 12px;
  padding-bottom: 6px;
}
.hx-evening-block .hx-evening {
  margin-top: 0;
}
.hx-evening-block .hx-game:last-child {
  border-bottom: 0;
  box-shadow: none;
}
.hx-rec li .hx-who {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hx-rec li .hx-who .hx-dot {
  display: inline-block;
  margin: 0 9px 1px 1px;
  vertical-align: middle;
}
