/* WebFarkle Main Styles */

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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #ecf0f1;
    min-height: 100vh;
    overflow-x: hidden;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #3498db;
}

.game-header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header-controls {
    display: flex;
    gap: 15px;
}

/* Score Section */
.score-section {
    margin-bottom: 30px;
}

.score-display {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    align-items: center;
    background: rgba(52, 73, 94, 0.8);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.player-score, .ai-score {
    text-align: center;
    padding: 15px;
    background: rgba(44, 62, 80, 0.9);
    border-radius: 10px;
}

.player-score h3, .ai-score h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #3498db;
}

.score-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 5px;
}

.score-label {
    font-size: 0.9rem;
    color: #bdc3c7;
}

.turn-info {
    text-align: center;
    padding: 20px;
}

.current-turn {
    font-size: 1.4rem;
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 15px;
}

.turn-score {
    font-size: 1.2rem;
    color: #27ae60;
}

.turn-score span:last-child {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Status Section */
.status-section {
    margin-bottom: 30px;
    text-align: center;
}

.game-status {
    background: rgba(52, 152, 219, 0.2);
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.1rem;
    border-left: 4px solid #3498db;
    max-width: 600px;
    margin: 0 auto;
}

/* Dice Section */
.dice-section {
    margin-bottom: 30px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    min-height: 120px;
    padding: 20px;
    background: rgba(44, 62, 80, 0.3);
    border-radius: 15px;
    border: 2px dashed #7f8c8d;
}

/* Controls Section */
.controls-section {
    margin-bottom: 20px;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.control-info {
    text-align: center;
    color: #bdc3c7;
    font-size: 0.95rem;
}

/* Target Section */
.target-section {
    text-align: center;
    margin-top: auto;
}

.target-display {
    font-size: 1.1rem;
    color: #f39c12;
    font-weight: bold;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease, background-color 0.3s ease, transform 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #7f8c8d;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #229954;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #e67e22;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.game-container {
    animation: fadeIn 0.6s ease-out;
}

.score-display {
    animation: slideIn 0.8s ease-out;
}

.btn:active {
    transform: translateY(1px);
}

.score-value {
    transition: all 0.3s ease;
}

.score-value.updated {
    animation: pulse 0.6s ease-in-out;
    color: #f39c12;
}

.game-status {
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

.current-turn {
    transition: all 0.3s ease;
}

.current-turn.player-turn {
    color: #3498db;
}

.current-turn.ai-turn {
    color: #e74c3c;
}

/* Loading states */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error states */
.status-success {
    background: rgba(39, 174, 96, 0.2);
    border-left-color: #27ae60;
    animation: bounce 0.6s ease-out;
}

.status-error {
    background: rgba(231, 76, 60, 0.2);
    border-left-color: #e74c3c;
    animation: bounce 0.6s ease-out;
}

.status-warning {
    background: rgba(243, 156, 18, 0.3);
    border-left-color: #f39c12;
    animation: pulse 1.5s ease-in-out 3;
    font-weight: bold;
    font-size: 1.1em;
}

.status-info {
    background: rgba(155, 89, 182, 0.2);
    border-left-color: #9b59b6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .game-header h1 {
        font-size: 2rem;
    }

    .score-display {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .game-controls {
        flex-direction: column;
        align-items: center;
    }

    .btn-large {
        width: 100%;
        max-width: 250px;
    }

    .dice-container {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 15px;
    }

    .game-header h1 {
        font-size: 1.8rem;
    }

    .score-value {
        font-size: 2rem;
    }

    .current-turn {
        font-size: 1.2rem;
    }
}
