/* ===== Huckepack ===== */

.h-board-wrap {
  background: linear-gradient(160deg, rgba(76, 217, 123, 0.1), rgba(0, 0, 0, 0.15)), var(--bg-card);
  border-radius: var(--radius);
  padding: 8px;
}
.h-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, 104px);
  gap: 5px;
}
.h-cell {
  position: relative;
  background: #c9a46a;
  background: linear-gradient(180deg, #d8b679, #b98f55);
  border-radius: 9px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
  overflow: visible;
}
.h-cell.start {
  background: repeating-conic-gradient(#e9e2d2 0 25%, #c9c0ae 0 50%) 0 0 / 14px 14px;
}
.h-cell.pick {
  cursor: pointer;
  outline: 3px solid var(--accent);
  animation: h-pick 1.2s ease-in-out infinite alternate;
}
@keyframes h-pick {
  from { box-shadow: 0 0 0 0 rgba(255, 184, 48, 0.6); }
  to { box-shadow: 0 0 12px 3px rgba(255, 184, 48, 0.6); }
}
.h-num {
  position: absolute;
  top: 3px;
  left: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  color: rgba(40, 25, 5, 0.65);
}
.h-tile {
  position: absolute;
  top: 2px;
  right: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.05rem;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 6px;
}
.h-tile.plus {
  background: rgba(76, 217, 123, 0.85);
}
.h-tile.minus {
  background: rgba(90, 150, 255, 0.85);
}
.h-tile small {
  font-size: 0.5rem;
  color: #10122a;
  font-weight: 700;
  max-width: 42px;
  overflow: hidden;
  white-space: nowrap;
}

/* Stapel: unten fängt an, jede weitere Figur sitzt huckepack darüber */
.h-stack {
  position: absolute;
  inset: 0;
}
.h-slot {
  position: absolute;
  left: 50%;
  bottom: calc(4px + var(--i) * 17px);
  margin-left: -21px;
  z-index: calc(1 + var(--i));
}
.h-slot.inline {
  position: static;
  margin: 0;
  display: inline-block;
}
.h-token {
  display: inline-flex;
  align-items: flex-start;
  padding-top: 1px;
  justify-content: center;
  width: 42px;
  height: 27px;
  border-radius: 14px 14px 8px 8px;
  background: var(--c);
  border: 2px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
  font-size: 1.05rem;
  line-height: 1;
}
.h-token.small {
  width: 32px;
  height: 22px;
  font-size: 0.9rem;
}

.h-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.h-cup strong {
  color: var(--text);
  font-size: 1.1rem;
}
.h-dice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.h-die {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c);
  color: #10122a;
  font-weight: 900;
  font-size: 1.1rem;
  border: 2px solid rgba(0, 0, 0, 0.35);
}
.h-die.fresh {
  animation: h-roll 0.6s ease-out;
}
@keyframes h-roll {
  0% { transform: rotate(-200deg) scale(0.3); }
  70% { transform: rotate(15deg) scale(1.2); }
  100% { transform: rotate(0) scale(1); }
}
.h-finish,
.h-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.h-finish {
  color: var(--accent);
  font-weight: 700;
}

/* Aktionen */
.h-roll small {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
}
.h-section {
  margin-top: 14px;
}
.h-section h4 {
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.h-racer-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.h-racer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  min-width: 0;
  flex: 1 1 56px;
  justify-content: center;
}
.h-racer-btn.active {
  outline: 2px solid var(--accent);
  background: var(--bg-input);
}
.h-overall-btns {
  margin-top: 8px;
}
.btn-group button.active {
  outline: 2px solid var(--accent);
}

/* Etappenwetten-Übersicht */
.h-bets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.h-bet-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
}
.h-bet-left {
  display: inline-flex;
  gap: 3px;
  min-width: 70px;
}
.h-chip {
  display: inline-block;
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--bg-input);
  font-weight: 700;
  text-align: center;
}
.h-bet-left .h-chip:first-child {
  background: var(--accent);
  color: #10122a;
}

/* Abrechnung */
.h-ranking {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.h-rank {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.h-leg-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.h-leg-row {
  display: grid;
  grid-template-columns: minmax(70px, auto) 1fr auto;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.85rem;
}
.h-leg-row.you {
  outline: 1px solid var(--accent);
}
.h-leg-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.h-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.h-item.ok strong {
  color: var(--good);
}
.h-item.bad strong {
  color: var(--bad);
}
.h-piles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 10px 0;
}
.h-pile h4 {
  margin-bottom: 6px;
}
.h-pile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--bg-input);
  margin-bottom: 4px;
  font-size: 0.85rem;
}
.h-pile-row.ok strong {
  color: var(--good);
}
.h-pile-row.bad strong {
  color: var(--bad);
}
.h-pile-row.you {
  outline: 1px solid var(--accent);
}

@media (max-width: 420px) {
  .h-board {
    grid-template-rows: repeat(5, 92px);
    gap: 3px;
  }
  .h-token {
    width: 34px;
    height: 23px;
    font-size: 0.9rem;
  }
  .h-slot {
    margin-left: -17px;
    bottom: calc(3px + var(--i) * 14px);
  }
  .h-center {
    font-size: 0.75rem;
    gap: 6px;
  }
  .h-die {
    width: 26px;
    height: 26px;
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .h-cell.pick,
  .h-die.fresh {
    animation: none;
  }
}
