
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    direction: rtl;
}

#game-container {
    width: 95%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    padding: 20px;
    backdrop-filter: blur(10px);
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

#game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

#game-info div {
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    color: #495057;
}

#audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
}

#mute-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#mute-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

#volume-slider {
    width: 80px;
    height: 5px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

#volume-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

#new-game-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#new-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(238, 90, 36, 0.4);
}

#game-board {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 20px;
    min-height: 600px;
}

#opponent-area, #player-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hand {
    width: 100%;
    text-align: center;
}

.player-label {
    background: #6c757d;
    color: white;
    padding: 8px 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    font-weight: bold;
    display: inline-block;
}

.cards-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 120px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 15px;
}

#center-area {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: center;
    justify-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pile {
    text-align: center;
}

.pile-label {
    background: #495057;
    color: white;
    padding: 5px 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 0.9em;
    font-weight: bold;
}

.card-stack {
    position: relative;
    width: 120px;
    height: 180px;
}

.card {
    width: 120px;
    height: 180px;
    border-radius: 15px;
    border: 3px solid #333;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.back-card {
    background-image: url('cards/Card_Back.png');
    cursor: pointer;
}

.back-card:hover {
    transform: scale(1.05);
}

#game-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.color-indicator {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.color-indicator.red { background-color: #e74c3c; }
.color-indicator.blue { background-color: #3498db; }
.color-indicator.green { background-color: #2ecc71; }
.color-indicator.yellow { background-color: #f1c40f; }

#direction-indicator {
    font-size: 2em;
    background: #34495e;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

#action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

#action-buttons button {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

#draw-card-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
}

#draw-card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

#uno-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
}

#uno-btn:enabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

#uno-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.color-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 15px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1em;
}

.color-btn.red { background-color: #e74c3c; }
.color-btn.blue { background-color: #3498db; }
.color-btn.green { background-color: #2ecc71; }
.color-btn.yellow { background-color: #f1c40f; color: #333; }

.color-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#game-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 300px;
    z-index: 999;
}

.message {
    background: #2ecc71;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

.message.error {
    background: #e74c3c;
}

.message.warning {
    background: #f39c12;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #game-container {
        width: 98%;
        padding: 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    #game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    #center-area {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 20px;
    }
    
    .card {
        width: 80px;
        height: 120px;
    }
    
    .card-stack {
        width: 80px;
        height: 120px;
    }
    
    #action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    #action-buttons button {
        width: 100%;
    }
}



/* Additional animations and interactions */
.card.played {
    animation: cardPlay 0.5s ease-out;
}

.card.drawn {
    animation: cardDraw 0.3s ease-out;
}

@keyframes cardPlay {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes cardDraw {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card.highlight {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

.direction-change {
    animation: spin 0.5s ease-in-out;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.color-indicator.changing {
    animation: colorChange 0.5s ease-in-out;
}

@keyframes colorChange {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Improved button interactions */
button:active {
    transform: scale(0.95);
}

.card:active {
    transform: scale(0.95);
}

/* Loading animation for AI thinking */
.ai-thinking::after {
    content: '...';
    animation: thinking 1s infinite;
}

@keyframes thinking {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* Improved modal animations */
.modal {
    animation: modalFadeIn 0.3s ease-out;
}

.modal.hidden {
    animation: modalFadeOut 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Card shuffle animation */
.deck-shuffle {
    animation: shuffle 0.5s ease-in-out;
}

@keyframes shuffle {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Win celebration */
.celebration {
    animation: celebrate 2s ease-in-out;
}

@keyframes celebrate {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(5deg);
    }
    75% {
        transform: scale(1.1) rotate(-5deg);
    }
}

