﻿/* ========================================
   ROCK PAPER SCISSORS STYLES
   rps-game.css
   ======================================== */

/* ========================================
   GAME CONTAINER
   ======================================== */
.rps-display-area {
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid #dee2e6;
    min-height: 450px;
}

.rps-game-area {
    max-width: 800px;
    margin: 0 auto;
}

/* ========================================
   CHOICE BUTTONS
   ======================================== */
.player-section {
    margin-bottom: 40px;
}

.choice-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.choice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-width: 120px;
    background: #fff;
    border: 3px solid #dee2e6;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

    .choice-btn:hover:not(:disabled) {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        border-color: #007bff;
        background: #f0f8ff;
    }

    .choice-btn:active:not(:disabled) {
        transform: translateY(-2px);
    }

    .choice-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    .choice-btn.selected {
        border-color: #007bff;
        background: #e3f2fd;
        transform: scale(1.05);
    }

.choice-icon {
    font-size: 3.5rem;
    margin-bottom: 8px;
    display: block;
    transition: transform 0.2s ease;
}

.choice-btn:hover:not(:disabled) .choice-icon {
    transform: scale(1.1);
}

.choice-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: #495057;
}

/* ========================================
   BATTLE AREA
   ======================================== */
.battle-area {
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.battle-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
}

.battle-player,
.battle-computer {
    text-align: center;
}

.battle-choice {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    font-size: 4rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .battle-choice.revealing {
        animation: revealShake 0.5s ease;
    }

    .battle-choice.win {
        box-shadow: 0 0 30px rgba(40, 167, 69, 0.5);
        background: linear-gradient(135deg, #d4edda, #c3e6cb);
    }

    .battle-choice.lose {
        box-shadow: 0 0 30px rgba(220, 53, 69, 0.5);
        background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    }

    .battle-choice.draw {
        box-shadow: 0 0 30px rgba(255, 193, 7, 0.5);
        background: linear-gradient(135deg, #fff3cd, #ffeeba);
    }

@keyframes revealShake {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.05) rotate(-5deg);
    }

    75% {
        transform: scale(1.05) rotate(5deg);
    }
}

.waiting-icon {
    font-size: 3rem;
    opacity: 0.5;
    animation: waitingPulse 1.5s infinite;
}

@keyframes waitingPulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.battle-label {
    margin-top: 12px;
    font-weight: 600;
    color: #6c757d;
    font-size: 0.95rem;
}

.battle-versus {
    font-weight: bold;
    color: #dc3545;
    font-size: 1.8rem;
    position: relative;
}

.vs-text {
    display: inline-block;
    animation: vsPulse 2s infinite;
}

@keyframes vsPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ========================================
   RESULT DISPLAY
   ======================================== */
.result-area {
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-message {
    font-size: 2rem;
    font-weight: bold;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

    .result-message.show {
        opacity: 1;
        transform: translateY(0);
    }

    .result-message.win {
        color: #28a745;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }

    .result-message.lose {
        color: #dc3545;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }

    .result-message.draw {
        color: #ffc107;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }

/* ========================================
   PLAY BUTTON
   ======================================== */
.btn-play {
    font-size: 1.3rem;
    padding: 12px 50px;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 1px;
}

    .btn-play:hover:not(:disabled) {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    }

    .btn-play:disabled {
        cursor: not-allowed;
        opacity: 0.7;
    }

/* ========================================
   SCORE DISPLAY
   ======================================== */
.score-display {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.score-item {
    text-align: center;
    padding: 10px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 100px;
}

.score-label {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
}

    .score-value.win {
        color: #28a745;
    }

    .score-value.lose {
        color: #dc3545;
    }

    .score-value.draw {
        color: #ffc107;
    }

/* ========================================
   STATS CARDS
   ======================================== */
.stat-card {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    background: #fff;
    transition: box-shadow 0.2s ease;
}

    .stat-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .stat-card h5 {
        font-size: 1.5rem;
        font-weight: bold;
        margin-bottom: 0;
    }

    .stat-card small {
        color: #6c757d;
        font-size: 0.8rem;
    }

/* ========================================
   HISTORY LOG
   ======================================== */
.game-history {
    max-height: 300px;
    overflow-y: auto;
}

    .game-history::-webkit-scrollbar {
        width: 8px;
    }

    .game-history::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .game-history::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }

        .game-history::-webkit-scrollbar-thumb:hover {
            background: #a1a1a1;
        }

.history-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    transition: background 0.15s ease;
}

    .history-entry:hover {
        background: #f8f9fa;
    }

    .history-entry:last-child {
        border-bottom: none;
    }

    .history-entry .game-number {
        color: #6c757d;
        font-size: 0.85rem;
        min-width: 45px;
        font-family: 'Consolas', 'Monaco', monospace;
    }

    .history-entry .game-moves {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 1.2rem;
    }

    .history-entry .game-result {
        font-weight: bold;
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 0.85rem;
    }

        .history-entry .game-result.win {
            background: #d4edda;
            color: #155724;
        }

        .history-entry .game-result.lose {
            background: #f8d7da;
            color: #721c24;
        }

        .history-entry .game-result.draw {
            background: #fff3cd;
            color: #856404;
        }

    .history-entry.new-entry {
        animation: highlightNew 1s ease;
    }

@keyframes highlightNew {
    0% {
        background: #e3f2fd;
    }

    100% {
        background: transparent;
    }
}

/* ========================================
   CHOICE DISTRIBUTION
   ======================================== */
.choice-stats {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    flex-wrap: wrap;
}

.choice-stat {
    text-align: center;
    flex: 1;
    min-width: 80px;
}

.choice-stat-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.choice-stat-count {
    font-size: 1.3rem;
    font-weight: bold;
    color: #495057;
}

.choice-stat-label {
    font-size: 0.8rem;
    color: #6c757d;
}

/* ========================================
   STREAK DISPLAY
   ======================================== */
.streak-display {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.streak-item {
    text-align: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    min-width: 100px;
    border: 1px solid #e9ecef;
}

.streak-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #007bff;
}

.streak-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    margin-top: 3px;
}

/* ========================================
   KEYBOARD HINTS
   ======================================== */
.keyboard-hints kbd {
    background: #212529;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ========================================
   LOADING STATE
   ======================================== */
.rps-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 576px) {
    .rps-display-area {
        padding: 20px;
    }

    .choice-buttons {
        gap: 15px;
    }

    .choice-btn {
        min-width: 100px;
        padding: 15px;
    }

    .choice-icon {
        font-size: 2.5rem;
    }

    .choice-label {
        font-size: 1rem;
    }

    .battle-display {
        gap: 20px;
    }

    .battle-choice {
        width: 90px;
        height: 90px;
        font-size: 3rem;
    }

    .battle-versus {
        font-size: 1.4rem;
    }

    .result-message {
        font-size: 1.5rem;
    }

    .score-display {
        gap: 15px;
    }

    .score-item {
        min-width: 80px;
        padding: 8px 15px;
    }

    .score-value {
        font-size: 1.5rem;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .choice-icon {
        font-size: 3rem;
    }

    .battle-choice {
        width: 100px;
        height: 100px;
    }
}

/* ========================================
   SIDEBAR SCORE DISPLAY
   ======================================== */
.score-display-sidebar {
    padding: 10px 0;
}

.score-item-sidebar {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.2s ease;
}

    .score-item-sidebar:hover {
        background: #e9ecef;
    }

.score-label-sidebar {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #495057;
}

.score-display-sidebar .score-value {
    font-size: 1.8rem;
    font-weight: bold;
}

    .score-display-sidebar .score-value.win {
        color: #28a745;
    }

    .score-display-sidebar .score-value.lose {
        color: #dc3545;
    }

    .score-display-sidebar .score-value.draw {
        color: #ffc107;
    }

/* Remove the original score display CSS since we're not using it anymore */
.score-display {
    display: none;
}

/* Mobile responsiveness */
@media (max-width: 991px) {
    /* On tablets and below, the score card will appear above the other sidebar cards */
    .score-display-sidebar .score-value {
        font-size: 1.5rem;
    }
}