/* Disable text selection and touch callouts for draggable elements */
.player-item {
    -webkit-user-select: none;  /* Safari */
    -ms-user-select: none;      /* IE 10+ */
    user-select: none;          /* Standard */
    -webkit-touch-callout: none; /* Disable touch callout on iOS */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on iOS */
}

/* Ensure images within draggable elements also don't get selected */
.player-item img {
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.container {
    width: 100%; /* Ensure container takes full width up to max-width */
}

.description {
    text-align: center;
    margin-bottom: 30px;
    color: #555;
    font-size: 1.1em;
}

.tier-list {
    display: flex;
    flex-direction: column;
    /* gap: 15px; /* Removed to eliminate gap between rows */
    margin-bottom: 30px;
}

.tier-row {
    display: flex;
    align-items: flex-start;
    /* border: 1px solid #ddd; /* Removed border */
    border: none; /* Explicitly remove borders */
    border-radius: 0; /* Remove individual row radius to allow continuous look */
    background-color: transparent; /* Background will come from tier-items */
    min-height: 100px;
    transition: background-color 0.2s ease-in-out;
    margin-bottom: 0; /* Ensure no gap between rows */
}

/* Remove border-radius for first and last tier rows to maintain overall container radius */
.tier-row:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    overflow: hidden; /* Clip content at top corners */
}

.tier-row:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: hidden; /* Clip content at bottom corners */
}


.tier-row.drag-over .tier-items { /* Apply drag-over to tier-items */
    background-color: #e6f7ff; /* Background color when dragging item over tier */
    /* border-color: #007bff; /* No border, so no border-color */
}

.tier-label {
    flex-shrink: 0;
    width: 100px;
    padding: 15px 10px;
    /* background-color: #007bff; /* Default removed */
    color: white;
    font-weight: bold;
    text-align: center;
    border-radius: 0; /* Remove individual label radius for continuous look */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    height: 100%; /* Ensure full height */
    box-sizing: border-box;
    /* Remove border-right that might have been present */
    border-right: none;
}

/* Specific background colors for tier labels */
.tier-row[data-tier="S"] .tier-label {
    background-color: #e74c3c; /* Red */
}

.tier-row[data-tier="A"] .tier-label {
    background-color: #f39c12; /* Orange */
}

.tier-row[data-tier="B"] .tier-label {
    background-color: #f1c40f; /* Yellow */
}

.tier-row[data-tier="C"] .tier-label {
    background-color: #2ecc71; /* Green */
}

.tier-row[data-tier="D"] .tier-label {
    background-color: #3498db; /* Blue */
}

.tier-items {
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    min-height: 80px; /* Minimum height to drop items */
    /* Remove borders */
    border: none;
}

/* Alternating background colors for tier item containers */
.tier-row:nth-child(odd) .tier-items {
    background-color: #ffffff; /* White for odd rows */
}

.tier-row:nth-child(even) .tier-items {
    background-color: #f8f8f8; /* Light grey for even rows */
}


/* --- Player Item Styles (Reverted to your previous version) --- */
.player-item {
    cursor: grab;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative; /* For player name display on hover */
    overflow: hidden; /* To clip name if it goes outside */
}

.player-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

.player-item img {
    max-width: 80px; /* Max width for player image */
    height: auto; /* Maintain aspect ratio */
    display: block;
    border-radius: 3px;
}

/* Player name overlay */
.player-item .player-name {
        user-select: none;
    -webkit-user-select: none;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 2px;
    font-size: 0.75em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateY(100%); /* Start hidden below */
    transition: transform 0.2s ease-out;
    pointer-events: none; /* Allows clicks to pass through to the image below */
    box-sizing: border-box;
}

.player-item:hover .player-name {
    transform: translateY(0); /* Slide up on hover */
}
/* --- End Player Item Styles --- */


.share-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
}

#copySidButton {
    padding: 12px 25px;
    font-size: 1.1em;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#copySidButton:hover {
    background-color: #218838;
}

#copySidButton:active {
    background-color: #1e7e34;
}

#sidLink {
    width: 100%;
    max-width: 600px;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    background-color: #e9ecef;
    text-align: center;
}

#copyMessage {
    color: #28a745;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

/* For smaller devices */
@media (max-width: 768px) {
    .tier-row {
        flex-direction: row; /* حفظ ردیف افقی */
        align-items: flex-start;
        flex-wrap: nowrap;
    }

    .tier-label {
        width: 40px; /* کاهش عرض برای صرفه‌جویی در فضا */
        font-size: 0.9em;
        padding: 8px;
        border-radius: 5px 0 0 5px; /* گرد کردن گوشه سمت چپ */
    }

    .tier-items {
        overflow-x: auto; /* اسکرول افقی */
        flex-wrap: wrap; /* جلوگیری از رفتن به خط بعد */
        gap: 8px;
        padding: 10px;
    }

    .tier-items::-webkit-scrollbar {
        height: 6px;
    }

    .tier-items::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }

    .player-item img {
        max-width: 54px; /* کاهش اندازه تصاویر */
    }

    .player-item {
        flex-shrink: 0; /* جلوگیری از فشرده شدن */
    }
    .player-item .player-name {
        display: none;
    }
    
.tier-row {

  min-height: 0px;

}
}
