/**
 * Air Hockey – Styles.
 * Alle Regeln beginnen mit .ahk (eindeutiger Namensraum), keine globalen Selektoren.
 * Die Farbvariablen im :root tragen das Präfix --ahk-, damit nichts kollidiert.
 */

:root {
  --ahk-color-primary: #3452ff;
  --ahk-color-primary-dark: #2238d4;
  --ahk-color-primary-soft: #eef1ff;
  --ahk-color-on-primary: #ffffff;
  --ahk-color-accent: #ff4d6d;
  --ahk-color-accent-dark: #d92e52;
  --ahk-color-secondary: #00b8a3;
  --ahk-color-warning: #ffb020;
  --ahk-color-warning-soft: #fff6e0;
  --ahk-color-danger: #d92d4a;
  --ahk-color-background: #ffffff;
  --ahk-color-surface: #f5f7ff;
  --ahk-color-text: #151a33;
  --ahk-color-text-muted: #5a6285;
  --ahk-color-border: #dce1f3;
  --ahk-color-overlay: rgba(14, 18, 48, 0.55);
  --ahk-color-overlay-light: rgba(255, 255, 255, 0.8);
  --ahk-color-table-a: #f7f9ff;
  --ahk-color-table-b: #e3e9ff;
  --ahk-color-puck: #1b2140;
  --ahk-color-dot: rgba(52, 82, 255, 0.12);
  --ahk-color-shadow: rgba(52, 82, 255, 0.14);
  --ahk-color-win-bg: #d9f7f1;
  --ahk-color-win-text: #00695a;
  --ahk-color-loss-bg: #ffe3e8;
  --ahk-color-loss-text: #a3213a;
}

/* ---------- Grundgerüst ---------- */
.ahk {
  display: block;
  width: 100%;
  /* max-width: 1080px; */
  margin: 0 auto;
  padding: 0;
  border: 0;
  color: var(--ahk-color-text);
  background-color: transparent;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
}

.ahk *,
.ahk *::before,
.ahk *::after {
  box-sizing: border-box;
}

.ahk .ahk-title {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  color: var(--ahk-color-text);
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: left;
  text-transform: none;
}

.ahk .ahk-subline {
  margin: 0;
  color: var(--ahk-color-text-muted);
  font-size: 1.1rem;
  text-align: left;
}

.ahk .ahk-text {
  margin: 0 0 1em !important;
  color: var(--ahk-color-text);
  text-align: left;
}

.ahk .ahk-fallback {
  margin: 16px 0;
  padding: 12px 16px;
  border: 1px solid var(--ahk-color-warning);
  border-radius: 12px;
  background-color: var(--ahk-color-warning-soft);
  color: var(--ahk-color-text);
}

.ahk .ahk-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Anwendung (Karte) ---------- */
.ahk .ahk-app {
  container-type: inline-size;
  position: relative;
  margin: 28px 0 40px;
  padding: 22px;
  border: 1px solid var(--ahk-color-border);
  border-radius: 24px;
  background-color: var(--ahk-color-background);
  background-image: linear-gradient(160deg, var(--ahk-color-background) 0%, var(--ahk-color-surface) 100%);
  /* box-shadow: 0 18px 48px var(--ahk-color-shadow); */
  outline: none;
}

.ahk .ahk-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ahk .ahk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Spielstand */
.ahk .ahk-scoreboard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border: 1px solid var(--ahk-color-border);
  border-radius: 16px;
  background-color: var(--ahk-color-background);
}

.ahk .ahk-team {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ahk .ahk-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--ahk-color-primary);
}

.ahk .ahk-team--two .ahk-dot {
  background-color: var(--ahk-color-accent);
}

.ahk .ahk-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.ahk .ahk-pts {
  min-width: 40px;
  padding: 2px 10px;
  border-radius: 10px;
  background-color: var(--ahk-color-primary-soft);
  color: var(--ahk-color-primary-dark);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.ahk .ahk-team--two .ahk-pts {
  color: var(--ahk-color-accent-dark);
}

.ahk .ahk-goalinfo {
  color: var(--ahk-color-text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.ahk .ahk-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid var(--ahk-color-border);
  border-radius: 12px;
  background-color: var(--ahk-color-background);
  background-image: none;
  color: var(--ahk-color-text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.ahk .ahk-btn:hover {
  background-color: var(--ahk-color-primary-soft);
  border-color: var(--ahk-color-primary);
  color: var(--ahk-color-text);
}

.ahk .ahk-btn:active {
  transform: translateY(1px);
}

.ahk .ahk-btn:focus-visible,
.ahk .ahk-tab:focus-visible,
.ahk .ahk-select:focus-visible,
.ahk .ahk-faq__q:focus-visible,
.ahk .ahk-canvas:focus-visible {
  outline: 3px solid var(--ahk-color-primary);
  outline-offset: 2px;
}

.ahk .ahk-btn--primary {
  border-color: var(--ahk-color-primary);
  background-color: var(--ahk-color-primary);
  background-image: linear-gradient(135deg, var(--ahk-color-primary), var(--ahk-color-primary-dark));
  color: var(--ahk-color-on-primary);
}

.ahk .ahk-btn--primary:hover {
  border-color: var(--ahk-color-primary-dark);
  background-color: var(--ahk-color-primary-dark);
  background-image: linear-gradient(135deg, var(--ahk-color-primary-dark), var(--ahk-color-primary));
  color: var(--ahk-color-on-primary);
}

.ahk .ahk-ico {
  width: 18px;
  height: 18px;
  flex: none;
  fill: currentColor;
}

.ahk .ahk-ico-pause {
  display: none;
}

.ahk .ahk-app[data-phase="playing"] .ahk-ico-play,
.ahk .ahk-app[data-phase="goal"] .ahk-ico-play {
  display: none;
}

.ahk .ahk-app[data-phase="playing"] .ahk-ico-pause,
.ahk .ahk-app[data-phase="goal"] .ahk-ico-pause {
  display: block;
}

/* Statusmeldung */
.ahk .ahk-status {
  margin: 14px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--ahk-color-warning);
  border-radius: 12px;
  background-color: var(--ahk-color-warning-soft);
  color: var(--ahk-color-text);
  font-size: 0.92rem;
}

/* ---------- Layout ---------- */
.ahk .ahk-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  margin-top: 18px;
}

.ahk .ahk-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

.ahk .ahk-canvaswrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 7;
  overflow: hidden;
  border-radius: 26px;
  background-color: var(--ahk-color-table-b);
  box-shadow: 0 14px 34px var(--ahk-color-shadow), 0 0 0 1px var(--ahk-color-border);
}

.ahk .ahk-canvas {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  touch-action: pan-y;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.ahk .ahk-app[data-phase="playing"] .ahk-canvas {
  touch-action: none;
  cursor: none;
}

/* Start-/Pause-Overlay */
.ahk .ahk-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: var(--ahk-color-overlay-light);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.ahk .ahk-overlay__box {
  max-width: 280px;
  text-align: center;
  animation: ahk-pop 0.3s ease;
}

.ahk .ahk-overlay__title {
  margin: 0 0 6px;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--ahk-color-text);
}

.ahk .ahk-overlay__text {
  margin: 0 0 16px;
  color: var(--ahk-color-text-muted);
}

/* Modal – nur innerhalb des Spielfelds */
.ahk .ahk-modal {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background-color: var(--ahk-color-overlay);
}

.ahk .ahk-modal__dialog {
  width: 100%;
  max-width: 340px;
  max-height: 100%;
  overflow: auto;
  padding: 20px;
  border-radius: 18px;
  background-color: var(--ahk-color-background);
  box-shadow: 0 20px 50px rgba(14, 18, 48, 0.35);
  animation: ahk-pop 0.25s ease;
}

.ahk .ahk-modal__title {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  color: var(--ahk-color-text);
  font-size: 1.3rem;
  font-weight: 800;
  text-align: left;
}

.ahk .ahk-modal__text {
  margin: 0 0 18px;
  color: var(--ahk-color-text-muted);
  text-align: left;
}

.ahk .ahk-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- Panel ---------- */
.ahk .ahk-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ahk-color-border);
  border-radius: 18px;
  background-color: var(--ahk-color-surface);
}

.ahk .ahk-panel__mobile {
  display: none;
  margin-bottom: 14px;
}

.ahk .ahk-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 5px;
  border: 1px solid var(--ahk-color-border);
  border-radius: 14px;
  background-color: var(--ahk-color-background);
}

.ahk .ahk-tab {
  appearance: none;
  flex: 1;
  min-height: 42px;
  margin: 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background-color: transparent;
  background-image: none;
  color: var(--ahk-color-text-muted);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.ahk .ahk-tab:hover {
  background-color: var(--ahk-color-primary-soft);
  color: var(--ahk-color-primary-dark);
}

.ahk .ahk-tab[aria-selected="true"] {
  background-color: var(--ahk-color-primary);
  background-image: linear-gradient(135deg, var(--ahk-color-primary), var(--ahk-color-primary-dark));
  color: var(--ahk-color-on-primary);
}

.ahk .ahk-tabpanel {
  animation: ahk-fade 0.25s ease;
}

.ahk .ahk-tabpanel:focus-visible {
  outline: 3px solid var(--ahk-color-primary);
  outline-offset: 4px;
  border-radius: 8px;
}

.ahk .ahk-panel__heading {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  color: var(--ahk-color-text);
  font-size: 1rem;
  font-weight: 800;
  text-align: left;
}

.ahk .ahk-list {
  margin: 0 0 16px;
  padding-left: 1.2em;
  color: var(--ahk-color-text);
  font-size: 0.93rem;
  text-align: left;
}

.ahk .ahk-list li {
  margin: 0 0 6px;
  padding: 0;
}

/* Formularelemente */
.ahk .ahk-field {
  margin: 0 0 16px;
}

.ahk .ahk-field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.ahk .ahk-label {
  display: block;
  margin: 0 0 6px;
  color: var(--ahk-color-text);
  font-size: 0.92rem;
  font-weight: 700;
}

.ahk .ahk-value {
  color: var(--ahk-color-primary-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.ahk .ahk-hint {
  margin: 6px 0 0;
  color: var(--ahk-color-text-muted);
  font-size: 0.82rem;
  text-align: left;
}

.ahk .ahk-select {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 8px 46px 8px 14px;
  border: 1px solid var(--ahk-color-border);
  border-radius: 12px;
  background-color: var(--ahk-color-background);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6' fill='none' stroke='%233452ff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  color: var(--ahk-color-text);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.3;
  box-shadow: none;
  cursor: pointer;
}

.ahk .ahk-select:hover {
  border-color: var(--ahk-color-primary);
}

.ahk .ahk-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Schalter */
.ahk .ahk-switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin: 0;
  cursor: pointer;
}

.ahk .ahk-switch__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.ahk .ahk-switch__text {
  color: var(--ahk-color-text);
  font-size: 0.95rem;
  font-weight: 600;
}

.ahk .ahk-switch__track {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background-color: var(--ahk-color-border);
  transition: background-color 0.2s ease;
}

.ahk .ahk-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--ahk-color-background);
  box-shadow: 0 2px 6px rgba(14, 18, 48, 0.3);
  transition: transform 0.2s ease;
}

.ahk .ahk-switch__input:checked~.ahk-switch__track {
  background-color: var(--ahk-color-primary);
}

.ahk .ahk-switch__input:checked~.ahk-switch__track::after {
  transform: translateX(20px);
}

.ahk .ahk-switch__input:focus-visible~.ahk-switch__track {
  outline: 3px solid var(--ahk-color-primary);
  outline-offset: 3px;
}

/* Schieberegler (Füllstand per --ahk-fill, vom Skript gesetzt) */
.ahk .ahk-range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  background-color: transparent;
  cursor: pointer;
  --ahk-fill: 50%;
}

.ahk .ahk-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background-color: var(--ahk-color-border);
  background-image: linear-gradient(90deg, var(--ahk-color-primary), var(--ahk-color-primary-dark));
  background-repeat: no-repeat;
  background-size: var(--ahk-fill) 100%;
}

.ahk .ahk-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -8px;
  border: 3px solid var(--ahk-color-primary);
  border-radius: 50%;
  background-color: var(--ahk-color-background);
  box-shadow: 0 2px 6px rgba(14, 18, 48, 0.3);
}

.ahk .ahk-range::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background-color: var(--ahk-color-border);
}

.ahk .ahk-range::-moz-range-progress {
  height: 8px;
  border-radius: 4px;
  background-color: var(--ahk-color-primary);
}

.ahk .ahk-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid var(--ahk-color-primary);
  border-radius: 50%;
  background-color: var(--ahk-color-background);
  box-shadow: 0 2px 6px rgba(14, 18, 48, 0.3);
}

.ahk .ahk-range:focus-visible {
  outline: 3px solid var(--ahk-color-primary);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Info & FAQ ---------- */
.ahk .ahk-info {
  /* max-width: 820px; */
}

.ahk .ahk-info__title {
  margin: 28px 0 12px;
  padding: 0;
  border: 0;
  color: var(--ahk-color-text);
  font-size: 1.4rem;
  font-weight: 800;
  text-align: left;
  text-transform: none;
}

.ahk .ahk-faq {
  display: grid;
  gap: 10px;
}

.ahk .ahk-faq__item {
  border: 1px solid var(--ahk-color-border);
  border-radius: 14px;
  background-color: var(--ahk-color-background);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ahk .ahk-faq__item[open] {
  border-color: var(--ahk-color-primary);
  background-color: var(--ahk-color-surface);
}

.ahk .ahk-faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 18px;
  color: var(--ahk-color-text);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
  border-radius: 14px;
}

.ahk .ahk-faq__q::-webkit-details-marker {
  display: none;
}

.ahk .ahk-faq__q::after {
  content: "+";
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--ahk-color-primary-soft);
  color: var(--ahk-color-primary);
  font-size: 1.3rem;
  line-height: 28px;
  text-align: center;
}

.ahk .ahk-faq__item[open] .ahk-faq__q::after {
  content: "\2013";
  background-color: var(--ahk-color-primary);
  color: var(--ahk-color-on-primary);
}

.ahk .ahk-faq__a {
  padding: 0 18px 6px;
  animation: ahk-fade 0.25s ease;
}

/* ---------- Responsive (Container-Abfragen auf die Anwendung) ---------- */
@container (min-width: 760px) {
  .ahk .ahk-main {
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: start;
  }
}

@container (max-width: 559px) {
  .ahk .ahk-toolbar {
    width: 100%;
  }

  .ahk .ahk-toolbar .ahk-btn {
    flex: 1 1 auto;
    padding: 8px 10px;
    font-size: 0.88rem;
  }

  .ahk .ahk-scoreboard {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
  }

  .ahk .ahk-goalinfo__goal {
    display: none;
  }
}

@media (max-width: 600px) {
  .ahk .ahk-app {
    padding: 14px;
    border-radius: 20px;
  }

  .ahk .ahk-subline {
    font-size: 1rem;
  }
}

/* ---------- Vollbild (echt oder Ersatz für iPhone-Safari) ---------- */
.ahk .ahk-app.ahk-is-fs {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 14px;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background-color: var(--ahk-color-background);
}

.ahk .ahk-app.ahk-is-pseudo {
  position: fixed;
  inset: 0;
  z-index: 99999;
  height: 100vh;
  height: 100dvh;
}

.ahk .ahk-app.ahk-is-fs .ahk-main {
  flex: 1;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}

.ahk .ahk-app.ahk-is-fs .ahk-canvaswrap {
  width: auto;
  height: auto;
  aspect-ratio: auto;
}

.ahk .ahk-app.ahk-is-fs .ahk-panel {
  max-height: 100%;
  overflow: auto;
}

@container (max-width: 759px) {
  .ahk .ahk-app.ahk-is-fs .ahk-panel {
    display: none;
  }
}

@media (max-height: 560px) {
  .ahk .ahk-app.ahk-is-fs .ahk-panel {
    display: none;
  }
}

/* ---------- Animation ---------- */
@keyframes ahk-pop {
  from {
    opacity: 0;
    transform: scale(0.94);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ahk-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {

  .ahk *,
  .ahk *::before,
  .ahk *::after {
    animation: none;
    transition: none;
  }
}

/* ---------- Verlauf & Rekorde ---------- */
.ahk .ahk-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 8px;
}

.ahk .ahk-stat {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border: 1px solid var(--ahk-color-border);
  border-radius: 12px;
  background-color: var(--ahk-color-background);
}

.ahk .ahk-stat__v {
  color: var(--ahk-color-primary-dark);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.ahk .ahk-stat__l {
  color: var(--ahk-color-text-muted);
  font-size: 0.8rem;
}

.ahk .ahk-table {
  width: 100%;
  margin: 0 0 16px;
  border-collapse: collapse;
  border: 0;
  font-size: 0.92rem;
}

.ahk .ahk-table th,
.ahk .ahk-table td {
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--ahk-color-border);
  background-color: transparent;
  color: var(--ahk-color-text);
  text-align: left;
}

.ahk .ahk-table thead th {
  color: var(--ahk-color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.ahk .ahk-dl {
  margin: 0 0 16px;
  padding: 0;
}

.ahk .ahk-dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--ahk-color-border);
}

.ahk .ahk-dl dt {
  margin: 0;
  color: var(--ahk-color-text-muted);
  font-size: 0.9rem;
}

.ahk .ahk-dl dd {
  margin: 0;
  color: var(--ahk-color-text);
  font-weight: 700;
}

.ahk .ahk-hist {
  max-height: 300px;
  margin: 0 0 12px;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.ahk .ahk-hist__item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 10px;
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--ahk-color-border);
}

.ahk .ahk-hist__score {
  color: var(--ahk-color-text);
  font-size: 1.05rem;
  font-weight: 800;
}

.ahk .ahk-hist__meta {
  grid-column: 1 / -1;
  color: var(--ahk-color-text-muted);
  font-size: 0.8rem;
}

.ahk .ahk-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background-color: var(--ahk-color-primary-soft);
  color: var(--ahk-color-primary-dark);
}

.ahk .ahk-badge--w {
  background-color: var(--ahk-color-win-bg);
  color: var(--ahk-color-win-text);
}

.ahk .ahk-badge--l {
  background-color: var(--ahk-color-loss-bg);
  color: var(--ahk-color-loss-text);
}

/* ---------- Bereiche: Einstellungen neben dem Spiel, Tabs darunter ---------- */
.ahk .ahk-lower {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--ahk-color-border);
  border-radius: 18px;
  /* background-color: var(--ahk-color-surface); */
  background-color: #fff !important;
}

.ahk .ahk-lower .ahk-tabs {
  display: inline-flex;
  width: auto;
  max-width: 100%;
}

.ahk .ahk-lower .ahk-tab {
  flex: none;
  padding: 6px 22px;
}

.ahk .ahk-lower [data-panel="controls"] {
  /* column-width: 300px; */
  column-gap: 32px;
}

.ahk .ahk-lower [data-panel="controls"] .ahk-panel__heading {
  break-after: avoid;
}

.ahk .ahk-panel__title {
  margin: 0 0 14px;
}

/* Kompakt (Tablet/Smartphone): ein Auswahlfeld mit allen drei Bereichen */
.ahk .ahk-app.ahk-compact .ahk-tabs {
  display: none;
}

.ahk .ahk-app.ahk-compact .ahk-panel__mobile {
  display: block;
}

.ahk .ahk-app.ahk-compact .ahk-panel__title {
  display: none;
}

.ahk .ahk-app.ahk-joined .ahk-panel {
  padding-bottom: 0;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
}

.ahk .ahk-app.ahk-joined .ahk-lower {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  border-radius: 0 0 18px 18px;
}

@container (min-width: 560px) {
  .ahk .ahk-lower .ahk-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.ahk .ahk-app.ahk-is-fs .ahk-lower {
  display: none;
}

/* Muss zuletzt stehen: hidden-Attribut gewinnt gegen display-Regeln oben. */
.ahk [hidden] {
  display: none;
}
