.rps-game {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f0f8ff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.language-toggle {
    text-align: right;
    margin-bottom: 15px;
}

.language-btn {
    margin-left: 5px;
}

.game-title {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

#how-to-play-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.scoreboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 20px;
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.total-score-item {
    text-align: center;
    min-width: 150px;
    margin-bottom: 10px;
}

.total-score-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    width: 100%;
}

.score-label {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.score-value {
    font-size: 28px;
    font-weight: bold;
    color: #4a77a8;
}

.winner-name {
    font-size: 24px;
    font-weight: bold;
    color: #28a745;
}

.game-container {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 20px;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.game-area {
    margin-bottom: 20px;
}

.game-hands {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 20px;
}

.hand-container {
    text-align: center;
    margin-bottom: 15px;
}

.hand-label {
    margin-bottom: 10px;
    font-size: 16px;
}

.hand {
    width: 100px;
    height: 100px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px;
    color: #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    margin: 0 auto;
}

.hand.shake {
    animation: shake 0.5s;
}

.versus {
    font-size: 24px;
    font-weight: bold;
    margin: 0 10px;
}

.result-display {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin: 20px 0;
    min-height: 36px;
}

.win {
    color: #4caf50;
}

.lose {
    color: #f44336;
}

.draw {
    color: #ff9800;
}

.choice-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.choice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    width: 90px;
    margin-bottom: 10px;
}

.choice-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.choice-btn i {
    font-size: 36px;
    margin-bottom: 10px;
    color: #333;
}

.choice-label {
    color: #333;
    font-weight: bold;
    font-size: 14px;
}

.game-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.game-mode {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.mode-label {
    margin-right: 10px;
    margin-bottom: 10px;
}

.form-select {
    width: 100%;
    max-width: 300px;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.extended-rules {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    display: none;
}

.extended-rules h4 {
    margin-top: 0;
}

.extended-rules ul {
    columns: 1;
    margin-bottom: 0;
    padding-left: 20px;
}

.extended-rules.active {
    display: block;
}

/* Language display styles */
.lang-en, .lang-vi {
    display: none;
}

.lang-en.active, .lang-vi.active {
    display: block;
}

.lang-en {
    display: block;
}

/* Prize animation */
.prize-animation {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.ice-cream-icon {
    animation: sway 2s infinite alternate;
}

.trophy-icon {
    animation: pulse 1.5s infinite;
}

@keyframes sway {
    0% { transform: rotate(-10deg); }
    100% { transform: rotate(10deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Score update animation */
@keyframes score-update {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); color: #ffc107; }
    100% { transform: scale(1); }
}

.score-update {
    animation: score-update 0.5s ease;
}

/* Milestone achievement animation */
@keyframes milestone {
    0% { color: #28a745; }
    50% { color: #ffc107; }
    100% { color: #28a745; }
}

.milestone {
    animation: milestone 1s ease infinite;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: rotate(0); }
    20%, 60% { transform: rotate(-10deg); }
    40%, 80% { transform: rotate(10deg); }
}

@keyframes winner {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.winner {
    animation: winner 0.5s infinite;
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.7);
}

/* Medium screens and up */
@media (min-width: 768px) {
    .total-score-item {
        margin-bottom: 0;
    }
    
    .total-score-reset {
        width: auto;
        margin-top: 0;
    }
    
    .hand {
        width: 120px;
        height: 120px;
        font-size: 60px;
    }
    
    .versus {
        margin: 0 20px;
    }
    
    .choice-btn {
        width: 100px;
    }
    
    .game-mode {
        flex-wrap: nowrap;
    }
    
    .mode-label {
        margin-bottom: 0;
    }
    
    .game-controls {
        flex-direction: row;
        justify-content: center;
    }
    
    .extended-rules ul {
        columns: 2;
    }
}

/* New animations for computer thinking and new round */
.thinking {
    animation: thinking 1s infinite;
}

.new-round {
    animation: pulse 1s infinite;
    color: #ff9800;
}

@keyframes thinking {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Add this section to existing animations */
@keyframes rotate {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
    100% { transform: rotate(0deg); }
}

/* Add these to the hand class for hover effect */
.hand:hover {
    transform: scale(1.1);
    cursor: pointer;
}

/* New game starting animation */
.new-game {
    animation: scale-bounce 1s ease;
    color: #28a745;
    font-weight: bold;
}

/* Reset score animation */
.reset-animate {
    animation: fade-out-in 0.5s ease;
}

@keyframes fade-out-in {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes scale-bounce {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.2); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* Confetti animation */
@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Trophy and ice cream animations in the prize display */
.prize-animation .trophy-icon {
    animation: prize-bounce 1.5s infinite alternate, glow 2s infinite;
}

.prize-animation .ice-cream-icon {
    animation: prize-sway 2s infinite alternate, glow 2s infinite;
}

@keyframes prize-bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-15px); }
}

@keyframes prize-sway {
    0% { transform: rotate(-10deg); }
    100% { transform: rotate(10deg); }
}

@keyframes glow {
    0% { filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7)); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.9)); }
    100% { filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7)); }
}

/* Make the prizes appear in a more exciting way */
.big-win-message h3 {
    animation: text-glow 2s infinite;
}

@keyframes text-glow {
    0% { text-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
    50% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.9), 0 0 30px rgba(255, 215, 0, 0.7); }
    100% { text-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
}

/* Additional prize icon styles */
.prize-icon {
    font-size: 2.5rem;
    margin: 0.5rem;
    display: inline-block;
}

/* Loser styles */
.loser-message {
    text-align: center;
    margin-top: 20px;
    animation: appear 0.5s ease-in;
}

.loser-icon {
    animation: sad-bounce 2s infinite alternate;
}

.loser-message p {
    font-size: 1.2rem;
    font-weight: bold;
    color: #6c757d;
    margin-top: 10px;
}

@keyframes sad-bounce {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-5px) rotate(-10deg); }
}

@keyframes appear {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

/* Additional styling for the big win modal */
.modal-header.winner {
    background-color: #28a745;
    color: white;
    border-bottom: 4px solid #1e7e34;
}

.modal-header.loser {
    background-color: #dc3545;
    color: white;
    border-bottom: 4px solid #bd2130;
}

/* Winner/Loser Modal Styling */
.modal-content {
    border-radius: 15px;
    overflow: hidden;
}

.modal-header {
    background-color: #28a745;
    color: white;
}

.winner-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #28a745;
}

.prize-animation {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.ice-cream-icon, .trophy-icon {
    animation: bounce 1s infinite alternate;
}

.loser-message {
    display: none;
}

.winner-text, .loser-text {
    display: none;
}

/* For loser modal */
.modal-content.loser .modal-header {
    background-color: #dc3545;
}

.modal-content.loser .big-win-message {
    display: none;
}

.modal-content.loser .loser-message {
    display: block;
}

.modal-content.loser .winner-text {
    display: none;
}

.modal-content.loser .loser-text {
    display: block;
}

.modal-content.winner .big-win-message {
    display: block;
}

.modal-content.winner .loser-message {
    display: none;
}

.modal-content.winner .winner-text {
    display: block;
}

.modal-content.winner .loser-text {
    display: none;
}

.loser-animation {
    animation: shakeHead 2s ease-in-out;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-10px);
    }
}

@keyframes shakeHead {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Responsive design for mobile devices */
@media (max-width: 768px) {
    .rps-container {
        padding: 10px;
    }
    
    .game-area {
        flex-direction: column;
    }
    
    .choice-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .choice-button {
        margin: 5px;
    }
    
    .scoreboard {
        flex-direction: column;
        align-items: center;
    }
    
    .player-score, .computer-score {
        margin: 5px 0;
    }
}

/* New animation and modal styles */
.bounce-animation {
    animation: bounce 0.8s ease infinite;
}

.bounce {
    animation: bounce 0.8s ease;
    animation-iteration-count: 3;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.winner-text {
    color: #28a745;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.loser-text {
    color: #dc3545;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.shake-head {
    animation: shake 0.8s ease;
    animation-iteration-count: 2;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    50% {
        transform: translateX(0);
    }
    75% {
        transform: translateX(5px);
    }
}

#bigWinModal .modal-header.winner {
    background-color: #28a745;
    color: white;
}

#bigWinModal .modal-header.loser {
    background-color: #dc3545;
    color: white;
}

#bigWinModal .modal-content * {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.prize-animation {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.prize-icon {
    text-align: center;
    margin: 15px 0;
}

/* Mobile responsiveness improvements */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .choice-buttons button {
        padding: 8px;
        margin: 5px;
    }
    
    .player-choice, .computer-choice {
        transform: scale(0.8);
    }
    
    #bigWinModal .modal-dialog {
        margin: 1rem;
    }
    
    .score-display {
        font-size: 0.9rem;
    }
}

/* Modal styling for big win/lose */
.modal-header.winner {
    background-color: #28a745;
    color: white;
    border-bottom: 4px solid #1e7e34;
}

.modal-header.loser {
    background-color: #dc3545;
    color: white;
    border-bottom: 4px solid #bd2130;
}

.winner-text {
    color: #28a745;
    font-weight: bold;
    font-size: 1.2em;
}

.loser-text {
    color: #dc3545;
    font-weight: bold;
    font-size: 1.2em;
}

/* Animations */
.bounce {
    animation: bounce-animation 1s infinite;
}

@keyframes bounce-animation {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

.bounce-animation {
    animation: bounce-animation 1.5s ease;
}

.shake-head {
    animation: shake-animation 1s infinite;
}

@keyframes shake-animation {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.prize-icon {
    text-align: center;
    margin: 20px 0;
}

/* Modal body styling */
.modal-body p {
    text-align: center;
    margin-top: 15px;
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .winner-text, .loser-text {
        font-size: 1em;
    }
    
    .modal-title {
        font-size: 1.2em;
    }
    
    .prize-icon i {
        font-size: 2em !important;
    }
} 