/* Pieces */
.pieces-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10;
}

.piece {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    transition: top 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), 
                left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.15s;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Directional Wedges */
.piece::before {
    content: '';
    position: absolute;
    width: 0; height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}
.piece.p1::before {
    right: -10px;
    border-left: 8px solid var(--p1-color);
    filter: drop-shadow(2px 0px 1px rgba(0,0,0,0.3));
}
.piece.p2::before {
    left: -10px;
    border-right: 8px solid var(--p2-color);
    filter: drop-shadow(-2px 0px 1px rgba(0,0,0,0.3));
}

.piece.p1 {
    background: var(--p1-color);
    border: 2px solid #ffffff;
}

.piece.p2 {
    background: var(--p2-color);
    border: 2px solid #ffffff;
}

.piece:hover {
    transform: translate(-50%, -50%) scale(1.08);
}

.piece.selected {
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 20;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.9), 0 8px 16px rgba(0,0,0,0.4);
}

/* Soccer Ball */
.piece .ball {
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: -8px;
    right: -8px;
    border: 1px solid #1f1f1f;
    z-index: 25;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.piece .ball::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #1f1f1f;
    clip-path: polygon(50% 0%, 100% 38%, 81% 100%, 19% 100%, 0% 38%);
    position: static;
}

/* Status Badges */
.status-badge {
    position: absolute;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    color: white;
    pointer-events: none;
    white-space: nowrap;
    z-index: 30;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.press-badge {
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: #f57c00;
}
.iso-badge {
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: #d32f2f;
}

/* Canvas for drawing lines (passes) */
.overlay-canvas {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Mobile responsive styling overrides for pieces */
@media (max-width: 950px) {
    .piece {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.1rem !important;
    }
    
    /* Directional Wedges for Vertical Layout */
    .piece::before {
        content: '' !important;
        position: absolute !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    /* Blue piece points UP on mobile (vertical layout) */
    .piece.p1::before {
        right: auto !important;
        left: 50% !important;
        top: -9px !important;
        transform: translateX(-50%) !important;
        border-left: 6px solid transparent !important;
        border-right: 6px solid transparent !important;
        border-bottom: 7px solid var(--p1-color) !important;
        border-top: none !important;
        filter: drop-shadow(0px -2px 1px rgba(0,0,0,0.3)) !important;
    }

    /* Red piece points DOWN on mobile (vertical layout) */
    .piece.p2::before {
        left: 50% !important;
        bottom: -9px !important;
        top: auto !important;
        transform: translateX(-50%) !important;
        border-left: 6px solid transparent !important;
        border-right: 6px solid transparent !important;
        border-top: 7px solid var(--p2-color) !important;
        border-bottom: none !important;
        filter: drop-shadow(0px 2px 1px rgba(0,0,0,0.3)) !important;
    }

    .piece .ball {
        width: 16px !important;
        height: 16px !important;
        top: -6px !important;
        right: -6px !important;
    }
    
    .piece .ball::after {
        width: 6px !important;
        height: 6px !important;
    }
    
    .status-badge {
        font-size: 0.55rem !important;
        padding: 2px 4px !important;
    }
    
    .press-badge {
        bottom: -18px !important;
    }
    
    .iso-badge {
        top: -18px !important;
    }
}
