/* Tower of Hanoi — board only */

.th-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    width: 100%;
    max-width: 560px;
    height: 260px;
}

.th-peg {
    position: relative;
    border: 1px solid rgba(111, 214, 196, 0.2);
    background: linear-gradient(180deg, rgba(111, 214, 196, 0.03), rgba(0, 0, 0, 0.4));
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding-bottom: 16px;
    transition: border-color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.th-peg:hover { border-color: rgba(111, 214, 196, 0.45); }

.th-peg.selected {
    border-color: #ffd166;
    box-shadow: inset 0 0 24px rgba(255, 209, 102, 0.12);
}

.th-peg.valid {
    border-color: rgba(74, 222, 128, 0.7);
}

.th-peg.invalid {
    border-color: #ff5a5a;
    animation: th-shake 0.18s;
}

@keyframes th-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.th-rod {
    position: absolute;
    left: 50%;
    bottom: 14px;
    width: 10px;
    height: calc(100% - 18px);
    transform: translateX(-50%);
    background: rgba(111, 214, 196, 0.12);
    border-radius: 5px;
}

.th-base {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 8px;
    height: 8px;
    background: rgba(111, 214, 196, 0.25);
}

.th-disk {
    position: relative;
    z-index: 1;
    height: 22px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.4);
    background: linear-gradient(180deg, var(--disk-top), var(--disk-bottom));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    transition: transform 0.12s, opacity 0.12s;
}

.th-peg.selected .th-disk.lifted {
    transform: translateY(-10px);
    opacity: 0.85;
}

.th-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.th-actions .gui-action {
    padding: 0.7rem 1.8rem;
    font-size: 1.15rem;
}

@media (max-width: 480px) {
    .th-board { height: 220px; }
    .th-disk { height: 18px; }
}
