/**
 * Shogi Game Styles - Minimalist Japanese Design
 */

/* Shogi Game Container - 2 columns optimized */
.shogi-game-container {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1rem;
    max-width: 1000px;
    min-width: 800px;
    margin: 0 auto;
    padding: 1rem 0.5rem;
}

/* Shogi Board Section */
.shogi-board-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.shogi-board-container {
    background: #f5f5dc; /* Beige wood color */
    border: 2px solid #8b4513;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.2);
    width: 100%;
    max-width: 600px;
}

/* Shogi Player Web Component */
#shogiPlayer {
    width: 100%;
    height: auto;
    min-height: 400px;
}

/* Game Status */
.shogi-status-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.75rem;
    text-align: center;
}

.shogi-status {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.shogi-status.thinking {
    color: var(--warning-color);
    animation: pulse 1.5s infinite;
}

.shogi-status.player-turn {
    color: var(--success-color);
}

.shogi-status.new-game {
    color: var(--info-color);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Game Controls Section */
.shogi-controls-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shogi-control-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem;
}

.shogi-control-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

/* Game Action Buttons */
.shogi-game-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shogi-btn {
    background: #8b4513;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    font-size: 0.9rem;
}

.shogi-btn:hover {
    background: #a0522d;
    color: white;
}

.shogi-btn.success {
    background: #5a7c3e;
}

.shogi-btn.success:hover {
    background: #6b8f47;
}

.shogi-btn.switch {
    background: #4a6741;
}

.shogi-btn.switch:hover {
    background: #5a7c4f;
}

/* Difficulty Selector */
.shogi-difficulty-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.shogi-difficulty-btn {
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.85rem;
}

.shogi-difficulty-btn:hover {
    border-color: #8b4513;
    color: #8b4513;
}

.shogi-difficulty-btn.active {
    background: #8b4513;
    border-color: #8b4513;
    color: white;
}

/* Game Description */
.shogi-description {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.shogi-description-content h2 {
    color: #8b4513;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #8b4513;
    padding-bottom: 0.5rem;
}

.shogi-description-content h3 {
    color: #333;
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem 0;
}

.shogi-description-content p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.shogi-description-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.shogi-description-content li {
    color: #555;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.shogi-description-content strong {
    color: #8b4513;
}

/* Messages */
.shogi-message {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-weight: 500;
    display: none;
}

.shogi-message.error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.shogi-message.success {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

/* Game Over Modal */
.shogi-game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.shogi-game-over-content {
    background: var(--bg-primary);
    border-radius: 25px;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.shogi-game-over-content.win {
    border: 3px solid var(--success-color);
}

.shogi-game-over-content.lose {
    border: 3px solid var(--danger-color);
}

.shogi-game-over-content.draw {
    border: 3px solid var(--warning-color);
}

.game-over-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.game-over-title {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-accent);
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.game-over-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Instructions Panel */
.shogi-instructions {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.shogi-instructions-title {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-accent);
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shogi-instructions-content {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.9rem;
}

.shogi-instructions-content h4 {
    color: var(--primary-color);
    font-family: var(--font-accent);
    margin: 1rem 0 0.5rem 0;
    font-size: 1rem;
}

.shogi-instructions-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.shogi-instructions-content li {
    margin-bottom: 0.3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .shogi-game-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.5rem 0.25rem;
        min-width: unset;
    }
    
    .shogi-board-container {
        max-width: 100%;
        padding: 0.25rem;
    }
    
    #shogiPlayer {
        min-height: 350px;
    }
    
    .shogi-controls-section {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .shogi-control-card {
        flex: 1;
        min-width: 140px;
        padding: 0.75rem;
    }
    
    .shogi-difficulty-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.25rem;
    }
    
    .shogi-difficulty-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .shogi-game-container {
        padding: 0.25rem;
    }
    
    .shogi-board-container {
        padding: 0.125rem;
        border-radius: 4px;
    }
    
    #shogiPlayer {
        min-height: 320px;
    }
    
    .shogi-controls-section {
        flex-direction: column;
    }
    
    .shogi-control-card {
        min-width: unset;
        padding: 0.5rem;
    }
    
    .shogi-control-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .shogi-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}
