/* Sword Tiles */
.grid-cell {
    position: relative;
    width: var(--tile-size);
    height: var(--tile-size);
    background: var(--empty-slot);
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.grid-cell.empty {
    background: var(--empty-slot);
    cursor: default;
}

.grid-cell.selected {
    border-color: var(--selected-border);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.grid-cell.dragging {
    opacity: 0.5;
    transform: scale(0.9);
}

.grid-cell.drag-over {
    border-color: #4CAF50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

/* Sword Tile */
.sword-tile {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    transition: transform var(--transition-fast);
}

.sword-tile:active {
    transform: scale(0.95);
}

/* Sword Icon (CSS로 검 모양 생성) */
.sword-icon {
    position: relative;
    width: 40px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

/* 칼날 (삼각형) */
.sword-icon::before {
    content: '';
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 35px solid var(--sword-color);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* 손잡이 */
.sword-icon::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 24px;
    height: 12px;
    background: #8B4513;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Sword Info */
.sword-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
}

.sword-level {
    font-size: 13px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.sword-upgrade {
    font-size: 13px;
    color: var(--text-gold);
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.sword-level-combined {
    font-size: 13px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.sword-level-combined .upgrade-part {
    color: var(--text-gold);
}

.sword-dps {
    font-size: 10px;
    color: #4CAF50;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Level-based backgrounds */
.grid-cell[data-level="1"] {
    background: linear-gradient(135deg, var(--sword-lv1) 0%, rgba(139, 69, 19, 0.6) 100%);
}

.grid-cell[data-level="1"] .sword-icon::before {
    border-bottom-color: var(--sword-lv1);
}

.grid-cell[data-level="2"] {
    background: linear-gradient(135deg, var(--sword-lv2) 0%, rgba(160, 82, 45, 0.6) 100%);
}

.grid-cell[data-level="2"] .sword-icon::before {
    border-bottom-color: var(--sword-lv2);
}

.grid-cell[data-level="3"] {
    background: linear-gradient(135deg, var(--sword-lv3) 0%, rgba(192, 192, 192, 0.6) 100%);
}

.grid-cell[data-level="3"] .sword-icon::before {
    border-bottom-color: var(--sword-lv3);
}

.grid-cell[data-level="4"] {
    background: linear-gradient(135deg, var(--sword-lv4) 0%, rgba(255, 215, 0, 0.6) 100%);
}

.grid-cell[data-level="4"] .sword-icon::before {
    border-bottom-color: var(--sword-lv4);
}

.grid-cell[data-level="5"] {
    background: linear-gradient(135deg, var(--sword-lv5) 0%, rgba(135, 206, 235, 0.6) 100%);
}

.grid-cell[data-level="5"] .sword-icon::before {
    border-bottom-color: var(--sword-lv5);
}

.grid-cell[data-level="6"] {
    background: linear-gradient(135deg, var(--sword-lv6) 0%, rgba(65, 105, 225, 0.6) 100%);
}

.grid-cell[data-level="6"] .sword-icon::before {
    border-bottom-color: var(--sword-lv6);
}

.grid-cell[data-level="7"] {
    background: linear-gradient(135deg, var(--sword-lv7) 0%, rgba(147, 112, 219, 0.6) 100%);
}

.grid-cell[data-level="7"] .sword-icon::before {
    border-bottom-color: var(--sword-lv7);
}

.grid-cell[data-level="8"] {
    background: linear-gradient(135deg, var(--sword-lv8) 0%, rgba(255, 20, 147, 0.6) 100%);
}

.grid-cell[data-level="8"] .sword-icon::before {
    border-bottom-color: var(--sword-lv8);
}

.grid-cell[data-level="9"] {
    background: linear-gradient(135deg, var(--sword-lv9) 0%, rgba(255, 69, 0, 0.6) 100%);
}

.grid-cell[data-level="9"] .sword-icon::before {
    border-bottom-color: var(--sword-lv9);
}

.grid-cell[data-level="10"] {
    background: linear-gradient(135deg, var(--sword-lv10) 0%, rgba(255, 0, 0, 0.6) 100%);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.grid-cell[data-level="10"] .sword-icon::before {
    border-bottom-color: var(--sword-lv10);
    animation: pulse 2s ease-in-out infinite;
}

/* Ghost element for drag */
.ghost-sword {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.8;
    transform: scale(1.1);
    transition: none;
}
