/* Mahjong Solitaire - Premium Tile Styles */

.mahjong-tile {
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border-radius: 8px;
    position: absolute;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    line-height: 1;
    color: #1a1a1a;
    user-select: none;
    z-index: 1;
    text-rendering: optimizeLegibility;
    border-bottom: 6px solid #d1d1d1;
    border-right: 4px solid #e0e0e0;
    box-shadow:
        2px 2px 10px rgba(0, 0, 0, 0.2),
        inset 1px 1px 2px rgba(255, 255, 255, 0.8);
    transform-style: preserve-3d;
}

.mahjong-tile:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow:
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 1px 1px 2px rgba(255, 255, 255, 0.9);
    filter: brightness(1.05);
    z-index: 100 !important;
}

.mahjong-tile.selected {
    background: var(--accent-gradient);
    border-bottom-color: rgba(0, 0, 0, 0.2);
    border-right-color: rgba(0, 0, 0, 0.1);
    color: white;
    transform: translateY(-12px) scale(1.1);
    box-shadow:
        var(--shadow-glow-md),
        0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 101 !important;
    animation: floating 2s ease-in-out infinite;
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(-12px) scale(1.1);
    }

    50% {
        transform: translateY(-16px) scale(1.1);
    }
}

.mahjong-tile.blocked {
    opacity: 0.6;
    filter: grayscale(0.5) contrast(0.8);
    cursor: not-allowed;
    pointer-events: none;
}

.mahjong-tile.removed {
    animation: tileRemove 0.4s cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
    pointer-events: none;
    z-index: 200 !important;
}

@keyframes tileRemove {
    0% {
        transform: scale(1.1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(0) rotate(20deg) translateY(-50px);
        opacity: 0;
    }
}

/* Tile Types Colors */
.tile-wan {
    color: #e53935;
}

.tile-tong {
    color: #1e88e5;
}

.tile-tiao {
    color: #43a047;
}

.tile-feng {
    color: #7b1fa2;
}

.tile-jian {
    color: #d32f2f;
}

.tile-hua {
    color: #fb8c00;
}

.tile-season {
    color: #00897b;
}

.mahjong-tile.selected .tile-wan,
.mahjong-tile.selected .tile-tong,
.mahjong-tile.selected .tile-tiao,
.mahjong-tile.selected .tile-feng,
.mahjong-tile.selected .tile-jian,
.mahjong-tile.selected .tile-hua,
.mahjong-tile.selected .tile-season {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hint Animation */
.mahjong-tile.hint {
    animation: hintPulse 1s ease-in-out infinite;
}

@keyframes hintPulse {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(255, 235, 59, 0.5);
        border-color: #ffd600;
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 235, 59, 0.9);
        border-color: #ffea00;
        transform: scale(1.05);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .mahjong-tile {
        width: 36px;
        height: 48px;
        font-size: 24px;
        border-bottom-width: 4px;
        border-right-width: 2px;
    }
}

@media (max-width: 480px) {
    .mahjong-tile {
        width: 30px;
        height: 40px;
        font-size: 20px;
        border-bottom-width: 3px;
        border-right-width: 1px;
    }
}