/* Huarong Pass Game Styles */

.game-board {
    position: relative;
    width: min(80vw, 400px);
    height: min(100vw, 500px);
    background: #8B4513;
    border: 8px solid #654321;
    border-radius: 15px;
    margin: 0 auto 20px auto;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    max-height: 500px;
}

.piece {
    position: absolute;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border: 3px solid #B8860B;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: #8B4513;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    touch-action: none;
}

.piece:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.piece.selected {
    border-color: #FF6B6B;
    background: linear-gradient(45deg, #FF6B6B, #FF8E8E);
    color: white;
    z-index: 10;
}

.piece.caocao {
    background: linear-gradient(45deg, #FF6B6B, #FF8E8E);
    border-color: #DC143C;
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.piece.generals {
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    border-color: #2E8B57;
    color: white;
}

.piece.soldiers {
    background: linear-gradient(45deg, #45B7D1, #2E86AB);
    border-color: #1E6091;
    color: white;
}

/* Enhanced mobile feedback */
.piece.mobile-selected {
    border-color: #FF6B6B !important;
    background: linear-gradient(45deg, #FF6B6B, #FF8E8E) !important;
    color: white !important;
    z-index: 15 !important;
    box-shadow: 0 8px 16px rgba(255, 107, 107, 0.4) !important;
    transform: scale(1.05) !important;
}

.piece.mobile-dragging {
    z-index: 20 !important;
    opacity: 0.9 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Direction buttons for mobile */
.direction-controls {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 8px;
    max-width: 150px;
    margin-left: auto;
    margin-right: auto;
}

.direction-btn {
    background: #4a5568;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    min-height: 36px;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
}

.direction-btn:hover {
    background: #2d3748;
}

.direction-btn:disabled {
    background: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
}

/* Desktop optimizations */
@media (min-width: 768px) {
    .game-board {
        width: 500px;
        height: 625px;
        border: 10px solid #654321;
        border-radius: 20px;
        box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.3);
    }
    
    .piece {
        border: 4px solid #B8860B;
        border-radius: 10px;
        font-size: 16px;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    }
    
    .piece:hover {
        transform: scale(1.02);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
    }
    
    .piece.caocao {
        font-size: 18px;
    }
    
    .direction-controls {
        max-width: 180px;
        gap: 8px;
        margin-top: 15px;
    }
    
    .direction-btn {
        padding: 10px;
        font-size: 16px;
        min-height: 40px;
        border-radius: 8px;
    }
}

/* Tablet/iPad Responsive */
@media (min-width: 601px) and (max-width: 1024px) {
    .game-board {
        width: min(60vw, 450px);
        height: min(75vw, 560px);
        border-width: 10px;
        border-radius: 20px;
        margin-bottom: 25px;
        box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.4);
    }

    .piece {
        font-size: 16px;
        border-width: 4px;
        border-radius: 10px;
        transition: all 0.3s ease;
    }

    .piece:hover {
        transform: scale(1.08);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    }

    .piece.caocao {
        font-size: 18px;
        border-width: 5px;
    }

    .game-info {
        padding: 25px;
        border-radius: 20px;
    }

    .control-section {
        margin: 25px 0;
    }

    .primary-controls {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn {
        padding: 15px 25px;
        font-size: 1.1em;
        min-width: 140px;
        border-radius: 25px;
    }

    .moves-counter {
        font-size: 1.1em;
        padding: 12px 20px;
        border-radius: 20px;
    }
}

/* Large Desktop/Monitor Responsive */
@media (min-width: 1025px) {
    .game-board {
        width: min(45vw, 550px);
        height: min(56vw, 690px);
        border-width: 12px;
        border-radius: 25px;
        margin-bottom: 30px;
        box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
        background: linear-gradient(135deg, #8B4513, #A0522D);
    }

    .piece {
        font-size: 18px;
        border-width: 5px;
        border-radius: 12px;
        transition: all 0.3s ease;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    }

    .piece:hover {
        transform: scale(1.1);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
        z-index: 5;
    }

    .piece:active {
        transform: scale(1.05);
    }

    .piece.selected {
        transform: scale(1.08);
        box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
        animation: pulse 1.5s infinite;
    }

    @keyframes pulse {
        0%, 100% { transform: scale(1.08); }
        50% { transform: scale(1.12); }
    }

    .piece.caocao {
        font-size: 22px;
        border-width: 6px;
        background: linear-gradient(135deg, #FF6B6B, #FF8E8E, #FFB6B6);
    }

    .piece.caocao:hover {
        background: linear-gradient(135deg, #FF5252, #FF7979, #FFA8A8);
    }

    .game-info {
        padding: 40px;
        border-radius: 25px;
        max-width: 800px;
        margin: 0 auto;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

    .game-header {
        margin-bottom: 30px;
    }

    .game-title-section h1 {
        font-size: 2.5em;
        margin-bottom: 10px;
    }

    .game-subtitle {
        font-size: 1.3em;
    }

    .control-section {
        margin: 30px 0;
    }

    .primary-controls {
        gap: 25px;
        margin: 25px 0;
    }

    .btn {
        padding: 18px 35px;
        font-size: 1.2em;
        min-width: 160px;
        border-radius: 30px;
        transition: all 0.3s ease;
        box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    }

    .btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    }

    .status-info {
        gap: 30px;
        margin: 25px 0;
    }

    .moves-counter {
        font-size: 1.2em;
        padding: 15px 25px;
        border-radius: 25px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .difficulty-selector {
        gap: 20px;
        margin: 20px 0;
    }

    .difficulty-btn {
        padding: 15px 30px;
        font-size: 1.2em;
        min-width: 120px;
        border-radius: 30px;
        transition: all 0.3s ease;
    }

    .difficulty-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
}