/* Box-Layout wie layout3, aber NICHT zentrieren */
.applet-hanoi {
  width: 100%;
  max-width: 960px;
  /* layout3 überschreiben: */
  align-items: stretch;
  text-align: left;
}

/* Kopfzeile: Zähler links, Reset rechts */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--gray);
  padding-bottom: 10px;
  width: 100%;
}
.right-controls { margin-left: auto; }

.stats {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-secondary);
}

/* Infotext linksbündig */
.explain {
  margin-bottom: 15px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  text-align: left;
}

/* Spielbrett: volle Breite, 3 Pegs + 2 Pfeilspalten */
.board {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr; /* A | ↔ | B | ↔ | C */
  align-items: end;
  gap: 10px 14px;
  min-height: 300px;
}

/* Pegs */
.peg {
  position: relative;
  height: 300px;
  background: linear-gradient(to top, #f3f4f6 0, #f9fafb 40%, transparent 40%);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  outline: 1px dashed var(--gray);
  outline-offset: -6px;
}

.peg-label {
  position: absolute;
  top: 10px;
  left: 10px;
  font-weight: 700;
  background: var(--color-text-inverse);
  border: 1px solid var(--gray);
  border-radius: 6px;
  padding: 2px 8px;
}

/* Stapel und Säulen-Zeichnung */
.stack {
  position: relative;
  z-index: 3;                    /* Scheiben über Pole/Basis */
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 10px 22px;
}

.pole {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  width: 10px;
  height: 230px;
  background: var(--gray);
  border: 1px solid #0b0b0b;
  border-radius: 6px;
  z-index: 1;
}

.base {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 12px;
  background: var(--gray-dark);
  border: 1px solid #0b0b0b;
  border-radius: 6px;
  z-index: 1;
}

/* Scheiben – wieder sichtbar (z-index/position wie im alten Applet) */
.disk {
  position: relative;
  z-index: 4;
  height: 28px;
  margin: 0 auto;
  border: 1px solid #000;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.size-1 { width: 38%; background: #f59e0b; }
.size-2 { width: 60%; background: #22c55e; }
.size-3 { width: 82%; background: #60a5fa; }

/* Pfeilspalten */
.arrows {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding-bottom: 22px;
}

.arrow {
  width: 46px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--gray);
  background: var(--color-text-inverse);
	color: var(--color-text-primary);  /* wichtig: Glyphen sichtbar */
  font-size: var(--font-size-lg);
  line-height: 1;
  cursor: pointer;
}
.arrow:hover { background-color: var(--color-buchner-light); }


/* sichtbare Pfeilsymbole über data-Attribut-Kombinationen */
.arrows-ab .arrow[data-from="A"][data-to="B"]::after { content: "→"; }
.arrows-ab .arrow[data-from="B"][data-to="A"]::after { content: "←"; }
.arrows-bc .arrow[data-from="B"][data-to="C"]::after { content: "→"; }
.arrows-bc .arrow[data-from="C"][data-to="B"]::after { content: "←"; }

/* A↔C Schnellpfeile oben */
.arrow.ac {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
}
.arrow.ac.ac-right::after { content: "↗"; }
.arrow.ac.ac-left::after  { content: "↖"; }

/* Feedback */
.shake { animation: shake .18s linear 0s 2; will-change: transform; }
@keyframes shake {
  0% { transform: translateX(0) }
  25% { transform: translateX(-3px) }
  50% { transform: translateX(3px) }
  75% { transform: translateX(-3px) }
  100% { transform: translateX(0) }
}
.win     { color: #16a34a; font-weight: 700; }
.invalid { color: var(--color-buchner); font-weight: 600; }

/* Responsiv wie zuvor */
@media (max-width: 720px) {
  .board { grid-template-columns: 1fr; gap: 10px; }
  .arrows { position: static; padding-bottom: 0; }
  .arrow.ac { position: static; transform: none; }
  .peg { height: 240px; }
  .pole { height: 180px; }
}
