.tangram-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
}

.tangram-hint {
 
    flex: 1;
}

.tangram-board-svg {
    display: block;
    width: 100%;
    max-width: 500px;
    height: auto;
    aspect-ratio: 1 / 1;
    overflow: visible;
    margin: 12px auto 0;
}

.tangram-snap-grid-bg {
    fill: #13243f;
    stroke: #0d1424;
    stroke-width: 2;
}

.tangram-snap-grid-line {
    stroke: rgba(12, 18, 31, 0.8);
    stroke-width: 1;
}

.tangram-placed-piece {
    cursor: grab;
}

.tangram-placed-piece:active {
    cursor: grabbing;
}

.tangram-placement-preview {
    opacity: 0.34;
    stroke: rgba(255, 255, 255, 0.75);
    stroke-width: 1.5;
    stroke-dasharray: 5 5;
    pointer-events: none;
}

.tangram-undo-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tangram-tray {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
    min-height: 124px;
    width: 100%;
    margin-top: 18px;
    padding: 12px 0 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tangram-tray-empty {
    font-size: 2.5rem;
    color: #4ECDC4;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes popIn {
    from {
        transform: scale(0) rotate(-20deg);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.tangram-piece-slot {
    animation: pieceAppear 0.25s ease-out both;
}

.tangram-piece-svg {
    cursor: grab;
    touch-action: none;
    user-select: none;
    overflow: visible;
}

.tangram-piece-svg:active {
    cursor: grabbing;
}

.tangram-drag-ghost {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    overflow: visible;
    opacity: 0.95;
}

@keyframes pieceAppear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.85);
    }

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

@media (max-width: 520px) {
    .tangram-tray {
        gap: 12px;
    }

    .tangram-piece-svg {
        max-width: 88px;
        max-height: 88px;
    }
}




.tangram-piece-face,
.tangram-placed-piece {
    stroke: rgba(255, 255, 255, 0.45);
    stroke-width: 2;
    stroke-linejoin: round;

    filter:
        drop-shadow(0 2px 0 rgba(255, 255, 255, 0.35))
        drop-shadow(0 6px 8px rgba(0, 0, 0, 0.22));

    transition:
        filter 0.18s ease,
        transform 0.18s ease,
        opacity 0.18s ease;
}
