/* Base styles */
body {
    font-family: 'Noto Naskh Arabic', Arial, sans-serif;
    text-align: center;
    background: url('https://images.pexels.com/photos/7130498/pexels-photo-7130498.jpeg') center/cover fixed;
    color: #2a2a2a;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    box-sizing: border-box;
    direction: rtl;
}

.hidden {
    display: none;
}

h2 {
    color: #1a1a1a;
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.5);
}

/* Language selector */
#language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #2a2a2a;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.lang-btn .primary-lang {
    font-size: 20px;
    margin-bottom: 2px;
    font-weight: 700;
}

.lang-btn .secondary-lang {
    font-size: 14px;
    opacity: 0.6;
}

.lang-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.2);
}

.lang-btn:active {
    transform: translateY(1px);
}

/* Section icons */
.section-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

/* Button styles */
button {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    margin: 15px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-family: 'Noto Naskh Arabic', Arial, sans-serif;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

button:active {
    transform: translateY(1px);
}

input {
    padding: 15px 25px;
    margin: 10px;
    border-radius: 25px;
    border: 2px solid #4CAF50;
    font-size: 1.1rem;
    width: 280px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    font-family: 'Noto Naskh Arabic', Arial, sans-serif;
}

input:focus {
    outline: none;
    border-color: #45a049;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

/* Card styles */
.card-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
    margin: 40px 0;
    perspective: 1000px;
}

.card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 280px;
    background: #fff;
    border-radius: 20px;
    transition: all 0.4s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    margin: 0 20px;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.card:hover {
    transform: translateY(-10px) rotate(2deg);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

/* Selectable card styles */
.selectable-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 280px;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    transform-style: preserve-3d;
    margin: 0 20px;
}

.selectable-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.selectable-card:hover {
    transform: translateY(-10px) rotate(2deg);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.selectable-card.selected {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(76, 175, 80, 0.4);
    border: 4px solid #ffd700;
    animation: selectedPulse 2s infinite;
}

@keyframes selectedPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

/* Game boards */
#game-board, #winner-board, #player-info, 
#player1-confirm, #player2-confirm, 
#player1-reconfirm, #player2-reconfirm,
#reveal-confirm {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 30px;
    max-width: 800px;
    margin: 40px auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Reveal screen styles */
.reveal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.reveal-icon {
    width: 120px;
    height: 120px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Draw animation */
#draw-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.draw-icon {
    width: 100px;
    height: 100px;
    animation: spinDraw 2s infinite;
}

@keyframes spinDraw {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Winner styles */
.trophy-container {
    margin: 30px 0;
}

.trophy {
    width: 150px;
    height: 150px;
    animation: floatTrophy 3s ease-in-out infinite;
}

@keyframes floatTrophy {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

#winner-name {
    font-size: 3.5rem;
    margin: 30px 0;
    color: #1a1a2e;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: winnerAppear 1s ease-out;
}

@keyframes winnerAppear {
    0% { transform: scale(0.5) translateY(-100px); opacity: 0; }
    50% { transform: scale(1.2) translateY(0); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Responsive design */
@media (max-width: 768px) {
    h2 { font-size: 2rem; }
    
    .card, .selectable-card {
        width: 160px;
        height: 220px;
    }
    
    #winner-name {
        font-size: 2.5rem;
    }
    
    .reveal-icon, .draw-icon {
        width: 80px;
        height: 80px;
    }
    
    .trophy {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .card, .selectable-card {
        width: 130px;
        height: 180px;
        margin: 10px;
    }
    
    #game-board, #winner-board, #player-info {
        padding: 20px;
        margin: 20px auto;
    }
    
    input {
        width: 80%;
        max-width: 280px;
    }
    
    .reveal-icon, .draw-icon {
        width: 60px;
        height: 60px;
    }
    
    .trophy {
        width: 80px;
        height: 80px;
    }
}
