/* =============================================================================
 * Higher Lower (hl) — gemeinsames Stylesheet für Host, Teilnehmer und Bühne.
 *
 * Bildsprache angelehnt an klassische „Higher or Lower"-Streams: Raster-Fläche,
 * horizontale Achse mit Strichen + Positionsnummern, „Niedrig"/„Hoch" an den
 * Enden, quadratische Bildkarten mit Rahmen und Versal-Beschriftung darunter.
 * Farben ausschließlich aus theme.css (Grün/Holz, hell + dunkel) — kein Neon.
 *
 *   .hlb-*   Board (Zeitstrahl + Auswahlbereich)       .hlp-*   Spieler-Kacheln
 *   .hl-p-*  Teilnehmer-Ansicht    .hl-s-*  Bühne     .hl-h-*  Host-Cockpit
 *   .hl-adm-* Baukasten-Editor     .hl-flash / .hl-notice  Rückmeldungen
 * ========================================================================== */

:root,
[data-theme="light"] {
  --hl-val: #8b5e34;
  --hl-grid: rgba(54, 45, 30, 0.055);
  --hl-board: #f7f1e4;
  --hl-veil: rgba(28, 26, 22, 0.58);
}
[data-theme="dark"] {
  --hl-val: #d9a86c;
  --hl-grid: rgba(255, 255, 255, 0.045);
  --hl-board: #222125;
  --hl-veil: rgba(8, 8, 10, 0.62);
}

/* -----------------------------------------------------------------------------
 * Board
 * -------------------------------------------------------------------------- */
.hlb {
  --hl-gap: 12px;
  --hl-gapbtn: 34px;
  --hl-card: 110px;
  --hl-card-min: 56px;
  --hl-card-max: 128px;
  --hl-pool-card: 104px;
  --hl-tick-h: 30px;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px 18px 20px;
  border: 1px solid var(--br);
  border-radius: var(--radius-lg);
  background-color: var(--hl-board);
  background-image:
    linear-gradient(to right, var(--hl-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--hl-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  box-shadow: var(--edge);
  user-select: none;
  -webkit-user-select: none;
}

/* Achse: Linie über die volle Breite, Enden links/rechts */
.hlb-rail {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 14px;
  align-items: start;
}
.hlb-rail::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--hl-tick-h) - 6px);
  height: 2px;
  border-radius: 2px;
  background: var(--br-strong);
}
.hlb-end {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: calc(var(--hl-tick-h) - 14px);
  min-width: 3.5rem;
}
.hlb-end.is-l { align-items: flex-start; }
.hlb-end.is-r { align-items: flex-end; }
.hlb-end-label {
  padding: 0 8px;
  line-height: 16px;
  background: var(--hl-board);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tx-dim);
  white-space: nowrap;
}
.hlb-end.is-l .hlb-end-label { padding-left: 0; }
.hlb-end.is-r .hlb-end-label { padding-right: 0; }
.hlb-end-val {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--hl-val);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hlb-scroll { position: relative; min-width: 0; padding-bottom: 6px; }
.hlb-scroll.is-overflow { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.hlb-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--hl-gap);
  width: max-content;
  min-height: calc(var(--hl-tick-h) + var(--hl-card) + 44px);
  margin: 0 auto;
  padding: 0 4px;
}

/* Slot = Strich + Karte (wandert als Ganzes, FLIP braucht origin oben links) */
.hlb-slot {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--hl-card);
  transform-origin: 0 0;
  outline: none;
}
.hlb-slot:focus-visible .hlb-img { box-shadow: 0 0 0 3px var(--ac-line); }
.hlb-tick {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: var(--hl-tick-h);
  width: 100%;
}
.hlb-tick-num {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 14px;
  font-weight: 700;
  color: var(--ac);
  font-variant-numeric: tabular-nums;
}
.hlb-tick-mark {
  margin-top: 4px;
  width: 2px;
  height: 12px;
  border-radius: 2px;
  background: var(--tx-dim);
}
.hlb-pool .hlb-tick { display: none; }

.hlb-card {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
  transition: transform var(--t) var(--ease-out);
}
.hlb-pool .hlb-card { margin-top: 0; }
.hlb-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 2px solid var(--br-strong);
  background: var(--sf);
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.hlb-img img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.hlb-mono {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: calc(var(--hl-card) * 0.34);
  letter-spacing: -0.02em;
  color: var(--tx-dim);
}
.hlb-cap { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0; }
.hlb-label {
  max-width: 100%;
  font-size: clamp(9.5px, calc(var(--hl-card) * 0.11), 13px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--tx);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Wert: nackte Zahl (Einheit steht an der Achse). Lange Zahlen schrumpfen mit der
   Kartenbreite (--val-len setzt der Renderer), nichts ragt über die Karte hinaus. */
.hlb-val {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  font-size: clamp(8px, min(calc(var(--hl-card) * 0.17), calc(var(--hl-card) * 1.55 / var(--val-len, 6))), 15px);
  line-height: 1.3;
  font-weight: 700;
  color: var(--hl-val);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hlb-val:empty { display: none; }
.hlb-val[data-kind="host"] { color: var(--tx-mute); font-weight: 600; }
.hlb-val[data-kind="known"] { color: var(--gold); }
.hlb-val svg { width: 1em; height: 1em; vertical-align: -0.14em; margin-right: 2px; }
.hlb-end-unit {
  max-width: 10rem;
  font-size: var(--fs-2xs);
  line-height: 1.25;
  color: var(--tx-mute);
  text-align: right;
}
.hlb-flag {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: 9px;
  line-height: 14px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--on-ac);
  background: var(--ac);
  box-shadow: var(--shadow);
}
.hlb-flag[hidden] { display: none; }

/* Varianten */
.hlb-slot.v-anchor .hlb-img { border-color: var(--ac-2); border-width: 3px; }
.hlb-slot.v-anchor .hlb-flag { background: var(--ac-2); color: #fff; }
.hlb-slot.v-anchor .hlb-tick-mark { width: 3px; height: 16px; margin-top: 1px; background: var(--ac-2); }
.hlb-slot.v-anchor .hlb-tick-num { color: var(--ac-2); }
.hlb-slot.v-fixed .hlb-img { border-color: var(--ac); }
.hlb-slot.v-new .hlb-img { border-color: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft), var(--shadow); }
.hlb-slot.v-new .hlb-flag { background: var(--ok); color: #fff; }
.hlb-slot.v-pending .hlb-img { border-style: dashed; border-color: var(--ac); box-shadow: 0 0 0 4px var(--ac-soft), var(--shadow-lg); }
.hlb-slot.v-pending .hlb-card { transform: translateY(-4px); }
.hlb-slot.v-submitted .hlb-img { border-color: var(--gold); animation: hl-await 1.6s var(--ease) infinite; }
.hlb-slot.v-submitted .hlb-flag { background: var(--gold); color: #fff; }
.hlb-slot.v-tentative .hlb-img { border-style: dashed; border-color: var(--tx-mute); box-shadow: none; opacity: .82; }
.hlb-slot.v-tentative .hlb-flag { background: var(--sf); color: var(--tx-dim); border: 1px solid var(--br-strong); }
.hlb-slot.v-wrong .hlb-img { border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft), var(--shadow); }
.hlb-slot.v-wrong .hlb-card { animation: hl-shake .5s var(--ease) .15s both; }
.hlb-slot.v-wrong .hlb-flag { background: var(--bad); color: #fff; }
.hlb-slot.v-auto .hlb-img { border-color: var(--gold); }
.hlb-slot.v-auto-new .hlb-img { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(var(--gold-rgb), .22), var(--shadow); }
.hlb-slot.v-pick .hlb-img { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--gold-rgb), .25), var(--shadow); }
.hlb-slot.v-pick-on .hlb-img { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(var(--gold-rgb), .38), var(--shadow-lg); }
.hlb-slot.v-pick-on .hlb-card { transform: translateY(-6px); }
.hlb-slot.is-selected .hlb-card { transform: translateY(-8px); }
.hlb-slot.is-selected .hlb-img { border-color: var(--ac); box-shadow: 0 0 0 4px var(--ac-soft), var(--shadow-lg); }

.hlb-slot.can-drag { cursor: grab; touch-action: none; }
.hlb-slot.can-tap { cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .hlb-slot.can-drag:hover .hlb-card,
  .hlb-slot.can-tap:hover .hlb-card { transform: translateY(-3px); }
  .hlb-slot.can-drag:hover .hlb-img,
  .hlb-slot.can-tap:hover .hlb-img { box-shadow: var(--shadow-lg); }
}
.hlb.is-dragging, .hlb.is-dragging .hlb-slot { cursor: grabbing; }
.hlb-slot.hlb-dragging { display: none !important; }
.hlb-slot.hlb-lifted { visibility: hidden; }

/* Platzhalter beim Ziehen */
.hlb-ph .hlb-img { border: 2px dashed var(--ac); background: var(--ac-soft); box-shadow: none; }
.hlb-ph .hlb-tick-mark { background: var(--ac); height: 16px; margin-top: 1px; }

/* „Geist" unter dem Finger/Mauszeiger */
.hlb.hlb-ghostlayer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  pointer-events: none;
}
.hlb-ghost { position: absolute; left: 0; top: 0; width: var(--hl-card); }
.hlb-ghost .hlb-tick { display: none; }
.hlb-ghost .hlb-card { margin-top: 0; transform: rotate(-3deg) scale(1.06); }
.hlb-ghost .hlb-img { border-color: var(--ac); box-shadow: 0 22px 44px rgba(0, 0, 0, .28); }

/* Lücken-Buttons („auswählen → Position antippen") */
.hlb-gap {
  position: relative;
  flex: none;
  width: var(--hl-gapbtn);
  align-self: stretch;
  display: flex;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--on-ac);
  align-items: flex-start;
  cursor: pointer;
}
.hlb-gap::after {
  content: '';
  position: absolute;
  top: calc(var(--hl-tick-h) + 16px);
  bottom: 30px;
  left: 50%;
  border-left: 2px dashed var(--ac-line);
}
.hlb-gap-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: calc(var(--hl-tick-h) - 18px);
  border-radius: 50%;
  background: var(--ac);
  box-shadow: 0 0 0 4px var(--hl-board), var(--shadow);
  animation: hl-gap-in .28s var(--ease-out) both;
}
.hlb-gap-dot svg { width: 14px; height: 14px; }
.hlb-gap:hover .hlb-gap-dot, .hlb-gap:focus-visible .hlb-gap-dot { transform: scale(1.12); }
.hlb-gap-text { display: none; }

/* Auswahlbereich */
.hlb-poolbox {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--br-strong);
  border-radius: 0 0 var(--radius) var(--radius);
  transition: background var(--t) var(--ease);
}
.hlb-poolbox[hidden] { display: none; }
.hlb-poolbox.is-over { background: var(--ac-soft); }
.hlb-poolhead {
  margin-bottom: 12px;
  text-align: center;
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tx-dim);
}
.hlb-poolhead[hidden] { display: none; }
.hlb-pool {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 14px var(--hl-gap);
  min-height: 40px;
}
.hlb-pool .hlb-slot { --hl-card: var(--hl-pool-card); }
.hlb-poolempty { text-align: center; color: var(--tx-mute); font-size: var(--fs-sm); padding: 6px 0 2px; }
.hlb-poolempty[hidden] { display: none; }

@keyframes hl-await {
  0%, 100% { box-shadow: 0 0 0 3px rgba(var(--gold-rgb), .18), var(--shadow); }
  50% { box-shadow: 0 0 0 7px rgba(var(--gold-rgb), .30), var(--shadow-lg); }
}
@keyframes hl-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
@keyframes hl-gap-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 719px) {
  .hlb {
    --hl-gap: 10px;
    --hl-card-min: 66px;
    --hl-pool-card: 74px;
    --hl-tick-h: 28px;
    padding: 14px 12px 16px;
  }
  .hlb-rail { column-gap: 8px; }
  .hlb-end { min-width: 0; }
  .hlb-end-val { font-size: var(--fs-2xs); }
}

/* -----------------------------------------------------------------------------
 * Senkrechter Zeitstrahl (schmale Boards: Handy, Tablet hochkant)
 * Oben das eine Achsen-Ende, unten das andere; jede Karte ist eine Zeile über die
 * volle Breite mit Positionsnummer auf der Achse, Bild, Name und Wert. Kein
 * seitliches Scrollen — beim Ziehen scrollt die Seite selbst mit.
 * -------------------------------------------------------------------------- */
.hlb.is-vertical { --hl-tick-w: 36px; }
.hlb.is-vertical .hlb-rail { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
.hlb.is-vertical .hlb-rail::before {
  left: calc(var(--hl-tick-w) / 2 - 1px);
  right: auto;
  top: 6px;
  bottom: 6px;
  width: 2px;
  height: auto;
}
.hlb.is-vertical .hlb-end {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  margin: 0;
  min-width: 0;
  padding-left: calc(var(--hl-tick-w) + 8px);
}
.hlb.is-vertical .hlb-end.is-r { align-items: baseline; }
.hlb.is-vertical .hlb-end-label { padding: 0; background: none; }
.hlb.is-vertical .hlb-end-val { font-size: var(--fs-sm); }
.hlb.is-vertical .hlb-end-unit { max-width: none; text-align: left; }
.hlb.is-vertical .hlb-scroll { overflow: visible; padding: 0; }
.hlb.is-vertical .hlb-row {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
}
.hlb.is-vertical .hlb-row .hlb-slot { flex-direction: row; align-items: center; width: 100%; }
.hlb.is-vertical .hlb-row .hlb-tick {
  position: relative;
  z-index: 1;
  flex: none;
  width: var(--hl-tick-w);
  height: auto;
  justify-content: center;
}
.hlb.is-vertical .hlb-row .hlb-tick-num {
  min-width: 22px;
  padding: 3px 0;
  border-radius: var(--radius-pill);
  background: var(--hl-board);
  text-align: center;
  font-size: 12px;
}
.hlb.is-vertical .hlb-row .hlb-tick-mark { display: none; }
.hlb.is-vertical .hlb-row .hlb-card {
  flex: 1;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 6px 12px 6px 6px;
  border-radius: 12px;
  border: 1px solid var(--br);
  background: var(--sf);
  box-shadow: var(--shadow);
}
.hlb.is-vertical .hlb-row .hlb-img { flex: none; width: 54px; border-radius: 9px; box-shadow: none; }
.hlb.is-vertical .hlb-row .hlb-mono { font-size: 19px; }
.hlb.is-vertical .hlb-row .hlb-cap {
  flex: 1;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}
.hlb.is-vertical .hlb-row .hlb-label { font-size: 13px; letter-spacing: .03em; }
.hlb.is-vertical .hlb-row .hlb-val { flex: none; max-width: 45%; font-size: 15px; }
.hlb.is-vertical .hlb-row .hlb-flag { left: 4px; top: -7px; transform: none; }
.hlb.is-vertical .hlb-row .v-anchor .hlb-card { border-color: var(--ac-2); }
.hlb.is-vertical .hlb-row .v-fixed .hlb-card { border-color: var(--ac-line); }
.hlb.is-vertical .hlb-row .v-new .hlb-card { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.hlb.is-vertical .hlb-row .v-pending .hlb-card { border: 2px dashed var(--ac); transform: none; box-shadow: 0 0 0 3px var(--ac-soft); }
.hlb.is-vertical .hlb-row .v-submitted .hlb-card { border-color: var(--gold); }
.hlb.is-vertical .hlb-row .v-tentative .hlb-card { border: 2px dashed var(--tx-mute); box-shadow: none; }
.hlb.is-vertical .hlb-row .v-wrong .hlb-card { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.hlb.is-vertical .hlb-row .v-auto .hlb-card,
.hlb.is-vertical .hlb-row .v-auto-new .hlb-card { border-color: var(--gold); }
.hlb.is-vertical .hlb-row .v-pick-on .hlb-card { transform: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--gold-rgb), .3); }
.hlb.is-vertical .hlb-row .is-selected .hlb-card { transform: none; border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-soft); }
.hlb.is-vertical .hlb-row .hlb-ph .hlb-card { min-height: 68px; border: 2px dashed var(--ac); background: var(--ac-soft); box-shadow: none; }
.hlb.is-vertical .hlb-row .hlb-ph .hlb-img { border: 0; background: none; }
/* Lücken als volle Zeilen: groß genug zum Antippen */
.hlb.is-vertical .hlb-gap {
  width: 100%;
  height: 34px;
  align-self: stretch;
  align-items: center;
  justify-content: flex-start;
  padding-left: calc(var(--hl-tick-w) / 2 - 13px);
}
.hlb.is-vertical .hlb-gap::after {
  top: 50%;
  bottom: auto;
  left: calc(var(--hl-tick-w) + 4px);
  right: 6px;
  border-left: 0;
  border-top: 2px dashed var(--ac-line);
}
.hlb.is-vertical .hlb-gap-dot { margin: 0; }
.hlb.is-vertical .hlb-gap-text {
  display: inline;
  position: relative;
  z-index: 1;
  margin-left: 14px;
  padding: 0 8px;
  background: var(--hl-board);
  color: var(--ac);
  font-size: var(--fs-xs);
  font-weight: 700;
}

/* -----------------------------------------------------------------------------
 * Spieler-Kacheln
 * -------------------------------------------------------------------------- */
.hlp { display: flex; flex-wrap: wrap; gap: 10px; }
.hlp-tile {
  position: relative;
  overflow: hidden;
  flex: 1 1 170px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 11px;
  border-radius: 14px;
  border: 2px solid var(--br);
  background: var(--sf);
  box-shadow: var(--edge);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.hlp-tile.is-me { background: var(--sf-grad), var(--sf); }
.hlp-tile.is-active { border-color: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft), var(--edge); }
.hlp-tile.is-winner { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(var(--gold-rgb), .2), var(--edge); }
.hlp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.hlp-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hlp-tile.is-me .hlp-name::after { content: ' (du)'; font-weight: 500; color: var(--tx-dim); }
.hlp-status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ok);
  background: var(--ok-soft);
}
.hlp-tile.is-winner .hlp-status { color: var(--gold); background: rgba(var(--gold-rgb), .16); }
.hlp-status svg { width: 12px; height: 12px; }
.hlp-hearts { display: flex; flex-wrap: wrap; gap: 3px; }
.hl-heart { width: 20px; height: 20px; fill: none; stroke: var(--bad); stroke-width: 2; stroke-linejoin: round; }
.hl-heart.is-full { fill: var(--bad); }
.hl-heart.is-lost { animation: hl-heart-lost .7s var(--ease-out) both; }
.hl-heart.is-gained { animation: hl-heart-gained .5s var(--ease-out) both; }
.hlp-foot { display: flex; align-items: center; gap: 8px; min-height: 18px; font-size: var(--fs-2xs); color: var(--tx-dim); }
.hlp-joker { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); font-weight: 600; }
.hlp-joker.is-used { color: var(--tx-mute); text-decoration: line-through; }
.hlp-joker svg { width: 13px; height: 13px; }
.hlp-offline { color: var(--tx-mute); }
.hlp-tile.is-out > .hlp-head,
.hlp-tile.is-out > .hlp-hearts,
.hlp-tile.is-out > .hlp-foot { filter: grayscale(1); opacity: .6; }
.hlp-outveil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--hl-veil);
  pointer-events: none;
  animation: hl-veil-in .45s var(--ease) both;
}
.hlp-outveil span {
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, .28);
  color: #f3eee4;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.hlp-admin { position: relative; z-index: 2; display: flex; gap: 6px; margin-top: 2px; }
.hlp-adm-btn {
  flex: 1;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 9px;
  border: 1px solid var(--br-strong);
  background: var(--sf);
  font-size: var(--fs-xs);
}
.hlp-adm-btn .hl-heart { width: 14px; height: 14px; }
.hlp-adm-btn:hover:not(:disabled) { border-color: var(--ac-line); }
.hlp.is-compact { gap: 8px; }
.hlp.is-compact .hlp-tile { flex: 1 1 150px; max-width: 240px; padding: 8px 10px; gap: 4px; }
.hlp.is-compact .hl-heart { width: 16px; height: 16px; }

@keyframes hl-heart-lost {
  0% { transform: scale(1); fill: var(--bad); }
  35% { transform: scale(1.35); fill: var(--bad); }
  100% { transform: scale(1); fill: transparent; }
}
@keyframes hl-heart-gained { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes hl-veil-in { from { opacity: 0; } to { opacity: 1; } }

/* -----------------------------------------------------------------------------
 * Aufleuchten + Hinweise
 * -------------------------------------------------------------------------- */
.hl-flash { position: fixed; inset: 0; z-index: 95; pointer-events: none; display: grid; justify-items: center; align-items: start; }
.hl-flash::before {
  content: '';
  position: absolute;
  inset: 0;
  animation: hl-flash 0.9s var(--ease) both;
}
.hl-flash.is-ok::before { background: radial-gradient(ellipse at center, transparent 40%, rgba(var(--ok-rgb), .22)); box-shadow: inset 0 0 0 8px var(--ok); }
.hl-flash.is-bad::before { background: radial-gradient(ellipse at center, transparent 40%, rgba(var(--bad-rgb), .22)); box-shadow: inset 0 0 0 8px var(--bad); }
.hl-flash-pill {
  position: relative;
  margin-top: 18vh;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  background: var(--sf);
  border: 2px solid currentColor;
  box-shadow: var(--shadow-lg);
  animation: hl-pill 1.7s var(--ease-out) both;
}
.hl-flash.is-ok .hl-flash-pill { color: var(--ok); }
.hl-flash.is-bad .hl-flash-pill { color: var(--bad); }
.hl-flash-pill svg { width: 22px; height: 22px; }
.hl-flash-pill b { font-size: clamp(1.1rem, 2.2vw, 1.6rem); letter-spacing: .04em; text-transform: uppercase; }
.hl-flash-pill span { color: var(--tx-dim); font-size: var(--fs-sm); font-weight: 600; }
.hl-notice {
  position: fixed;
  left: 50%;
  top: 16px;
  z-index: 94;
  max-width: min(92vw, 520px);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--sf);
  border: 1px solid var(--br-strong);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-md);
  font-weight: 600;
  text-align: center;
  transform: translateX(-50%);
  animation: hl-notice 3.2s var(--ease-out) both;
}
@keyframes hl-flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hl-pill {
  0% { opacity: 0; transform: translateY(-10px) scale(.96); }
  12% { opacity: 1; transform: none; }
  82% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-6px); }
}
@keyframes hl-notice {
  0% { opacity: 0; transform: translate(-50%, -8px); }
  8%, 88% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -6px); }
}

/* -----------------------------------------------------------------------------
 * Gemeinsame Kopf-/Status-Bausteine
 * -------------------------------------------------------------------------- */
.hl-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ac);
}
.hl-kicker svg { width: 16px; height: 16px; }
.hl-title { margin: 2px 0 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.3rem, 2.4vw, 1.9rem); line-height: 1.15; }
.hl-desc { margin: 4px 0 0; color: var(--tx-dim); max-width: 70ch; }
.hl-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--br);
  background: var(--sf);
  font-weight: 600;
}
.hl-status .icon svg, .hl-status > svg { width: 18px; height: 18px; }
.hl-status.is-you { border-color: var(--ok); background: var(--ok-soft); color: var(--tx); }
.hl-status.is-wait { border-color: rgba(var(--gold-rgb), .5); background: rgba(var(--gold-rgb), .1); }
.hl-status.is-done { border-color: rgba(var(--gold-rgb), .55); background: rgba(var(--gold-rgb), .12); }
.hl-status-sub { font-weight: 400; color: var(--tx-dim); font-size: var(--fs-sm); }
.hl-status > div, .hl-status > :only-child { grid-column: 1 / -1; }
.hl-status > .hl-status-sub, .hl-status > .hl-h-preview { grid-column: 2; justify-self: start; }
.hl-status:empty { display: none; }
.hl-rules { margin: 0; padding-left: 1.1em; color: var(--tx-dim); display: grid; gap: 4px; }
.hl-winners { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.2rem, 2.6vw, 2rem); }
.hl-winners svg { width: 1em; height: 1em; color: var(--gold); }

/* -----------------------------------------------------------------------------
 * Teilnehmer-Ansicht
 * -------------------------------------------------------------------------- */
.hl-p { display: flex; flex-direction: column; gap: 14px; padding-bottom: 84px; }
.hl-p-head { display: flex; flex-direction: column; gap: 2px; }
.hl-p-actions {
  position: sticky;
  bottom: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--br-strong);
  background: var(--sf);
  box-shadow: var(--shadow-lg);
}
.hl-p-actions .hl-grow { flex: 1; min-width: 8rem; color: var(--tx-dim); font-size: var(--fs-sm); }
.hl-p-actions .btn-primary { min-width: 11rem; }
.hl-joker-btn { color: var(--gold); border-color: rgba(var(--gold-rgb), .45); }
.hl-joker-btn:hover:not(:disabled) { border-color: var(--gold); }
.hl-confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}
.hl-confirm p { margin: 0; flex: 1; min-width: 12rem; }
@media (max-width: 719px) {
  .hl-p-actions { bottom: 8px; padding: 8px; gap: 8px; flex-wrap: nowrap; }
  .hl-p-actions:has(.btn-primary) .hl-grow { display: none; }
  .hl-p-actions .btn-primary { flex: 1; min-width: 0; padding: 12px 14px; }
  .hl-p-actions .hl-grow { font-size: var(--fs-xs); min-width: 0; }
  .hl-confirm { flex-wrap: wrap; }
  .hl-confirm p { flex-basis: 100%; min-width: 0; font-size: var(--fs-sm); }
}
.hl-p .hl-intro-grid { display: grid; gap: 14px; }
@media (min-width: 900px) {
  .hl-p .hl-intro-grid { grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); align-items: start; }
}

/* -----------------------------------------------------------------------------
 * Bühne
 * -------------------------------------------------------------------------- */
#phaseHigherLower.phase { max-width: none; }
.hl-s { display: flex; flex-direction: column; gap: clamp(12px, 1.6vw, 22px); width: 100%; }
.hl-s-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hl-s-brand { font-size: clamp(1.8rem, 3.4vw, 3rem); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1; }
.hl-s-brand em { font-style: normal; color: var(--ac); }
.hl-s-cat { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.1rem, 2vw, 1.7rem); color: var(--tx); }
.hl-s-desc { color: var(--tx-dim); font-size: clamp(.95rem, 1.2vw, 1.15rem); }
.hl-s .hl-status { font-size: clamp(1rem, 1.5vw, 1.35rem); padding: 12px 18px; }
.hl-s .hlb {
  --hl-card-min: 60px;
  --hl-card-max: 176px;
  --hl-pool-card: clamp(96px, 8vw, 150px);
  --hl-tick-h: 34px;
  padding: clamp(16px, 2vw, 28px);
}
.hl-s .hlb-tick-num { font-size: 13px; }
.hl-s .hlb-end-label { font-size: var(--fs-sm); }
.hl-s .hlb-end-val { font-size: var(--fs-lg); }
.hl-s .hlp { justify-content: center; gap: 14px; }
.hl-s .hlp-tile { flex: 0 1 250px; max-width: 250px; padding: 12px 16px; }
.hl-s .hl-heart { width: 24px; height: 24px; }
.hl-s .hlp-name { font-size: 1.1rem; }

/* -----------------------------------------------------------------------------
 * Host-Cockpit
 * -------------------------------------------------------------------------- */
.hl-h { display: flex; flex-direction: column; gap: 16px; }
.hl-h-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hl-h-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.hl-h-head h2 .icon { color: var(--ac); }
.hl-h-pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hl-h-pill { font-size: var(--fs-sm); color: var(--ac); background: var(--ac-soft); border: 1px solid var(--ac-line); padding: 4px 12px; border-radius: var(--radius-pill); }
.hl-h-pill.is-muted { color: var(--tx-dim); background: var(--sf-soft); border-color: var(--br); }
.hl-h-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hl-h-actions .hl-h-end { margin-left: auto; }
.hl-h-preview { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: var(--fs-sm); font-weight: 700; }
.hl-h-preview.is-ok { color: var(--ok); background: var(--ok-soft); }
.hl-h-preview.is-bad { color: var(--bad); background: var(--bad-soft); }
.hl-h-preview svg { width: 14px; height: 14px; }
.hl-h .hlb { --hl-card-max: 112px; --hl-pool-card: 86px; }
.hl-h-grid { display: grid; gap: 16px; }
@media (min-width: 1200px) {
  .hl-h-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .hl-h-grid .hlp-tile { flex-basis: 100%; max-width: none; }
}
.hl-h-side { display: flex; flex-direction: column; gap: 10px; }
.hl-h-side h3 { margin: 0; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .12em; color: var(--tx-dim); font-family: var(--font-body); font-weight: 700; }

/* Setup */
.hl-setup { display: flex; flex-direction: column; gap: 16px; }
.hl-setup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.hl-setup-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 14px;
  text-align: left;
  font-weight: 400;
  border-radius: var(--radius);
  border: 2px solid var(--br);
  background: var(--sf-soft);
}
.hl-setup-card:hover:not(:disabled) { border-color: var(--ac-line); }
.hl-setup-card.is-on { border-color: var(--ac); background: var(--ac-soft); }
.hl-setup-card:disabled { opacity: .5; }
.hl-setup-title { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lg); }
.hl-setup-desc { color: var(--tx-dim); font-size: var(--fs-sm); }
.hl-setup-meta { color: var(--tx-mute); font-size: var(--fs-xs); }
.hl-setup-thumbs { display: flex; gap: 6px; }
.hl-setup-thumbs img { width: 38px; height: 38px; object-fit: cover; border-radius: 7px; border: 1px solid var(--br); }
.hl-setup-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tx-dim); margin: 0; }
.hl-part-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.hl-part {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--br-strong);
  background: var(--sf);
  color: var(--tx);
  font-size: var(--fs-md);
  cursor: pointer;
}
.hl-part input { accent-color: var(--ac); }
.hl-part.is-off { color: var(--tx-mute); background: transparent; }

/* -----------------------------------------------------------------------------
 * Baukasten-Editor
 * -------------------------------------------------------------------------- */
.hl-adm-cards { display: flex; flex-direction: column; gap: 10px; }
.hl-adm-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--br); border-radius: var(--radius); background: var(--sf-soft); flex-wrap: wrap; }
.hl-adm-card-title { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lg); }
.hl-adm-card-meta { color: var(--tx-dim); font-size: var(--fs-sm); }
.hl-adm-card-actions { display: flex; gap: 8px; }
.hl-adm-reason { color: var(--tx-mute); }
.hl-adm-box { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--br); border-radius: var(--radius); background: var(--sf-soft); }
.hl-adm-cfg { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.hl-adm-field { display: flex; flex-direction: column; gap: 6px; }
.hl-adm-field label { margin: 0; }
.hl-adm-field input[type=text], .hl-adm-field input[type=number], .hl-adm-field textarea { width: 100%; }
.hl-adm-radios { display: flex; flex-direction: column; gap: 6px; }
.hl-adm-radios label, .hl-adm-check { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--tx); font-size: var(--fs-md); cursor: pointer; }
.hl-adm-radios input, .hl-adm-check input { accent-color: var(--ac); }
.hl-adm-ready { font-size: var(--fs-sm); padding: 4px 12px; border-radius: var(--radius-pill); }
.hl-adm-ready.ok { color: var(--ok); background: var(--ok-soft); }
.hl-adm-ready.warn { color: var(--bad); background: var(--bad-soft); }
.hl-adm-itemshead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hl-adm-itemshead h3 { margin: 0; }
.hl-adm-items { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.hl-adm-editor .admin-head h2 { flex: 1; min-width: 0; }
.hl-adm-editor .sl-title-input { width: min(36rem, 100%); max-width: none; }
.hl-adm-item {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 2px solid var(--br);
  border-radius: var(--radius);
  background: var(--sf);
}
.hl-adm-item.is-anchor { border-color: var(--ac-2); }
.hl-adm-thumb {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  border: 2px solid var(--br-strong);
  background: var(--sf-soft);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--tx-dim);
}
.hl-adm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hl-adm-thumb-hint { position: absolute; inset: auto 0 0 0; padding: 2px 0; font-family: var(--font-body); font-size: 10px; font-weight: 600; background: rgba(0, 0, 0, .45); color: #fff; opacity: 0; transition: opacity var(--t); }
.hl-adm-thumb:hover .hl-adm-thumb-hint, .hl-adm-thumb:focus-visible .hl-adm-thumb-hint { opacity: 1; }
.hl-adm-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hl-adm-fields input { width: 100%; padding: 8px 10px; font-size: var(--fs-md); }
.hl-adm-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hl-adm-row .btn-mini, .hl-adm-mini {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--br);
  background: var(--sf-soft);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--tx-dim);
}
.hl-adm-mini:hover:not(:disabled) { color: var(--tx); border-color: var(--ac-line); }
.hl-adm-mini.danger { color: var(--bad); }
.hl-adm-mini svg { width: 13px; height: 13px; }
.hl-adm-anchor { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--tx-dim); cursor: pointer; }
.hl-adm-anchor input { accent-color: var(--ac-2); }
.hl-adm-item.is-anchor .hl-adm-anchor { color: var(--ac-2); }
.hl-adm-err { color: var(--bad); font-size: var(--fs-xs); min-height: 1em; }
.hl-adm-preview { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hl-adm-preview-item { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid var(--br); background: var(--sf); font-size: var(--fs-sm); }
.hl-adm-preview-item b { font-family: var(--font-mono); color: var(--hl-val); font-size: var(--fs-xs); }
.hl-adm-preview-item.is-anchor { border-color: var(--ac-2); }
.hl-adm-preview-arrow { color: var(--tx-mute); }

@media (prefers-reduced-motion: reduce) {
  .hlb-slot.v-submitted .hlb-img, .hlb-slot.v-wrong .hlb-card, .hl-heart.is-lost, .hl-heart.is-gained,
  .hlb-gap-dot, .hlp-outveil { animation: none; }
  .hl-flash-pill, .hl-notice { animation-duration: 2s; }
}
.hl-p-actions[hidden], .hl-h-actions[hidden] { display: none; }
.hl-status > .hl-winners + .hl-status-sub { grid-column: 1 / -1; }
