* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

:root {
    --primary-color: #7d2ae8;
    --background-color: #f6f7fb;
    --white: #ffffff;
    
    /* Responsive font size */
    font-size: 16px;
}

body {
    background: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.rules-btn-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

#rules-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: 0.313rem;
    cursor: pointer;
    font-size: 1rem;
}

.modal, .game-result-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
}

.modal-content, .game-result-content {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.875rem;
    max-width: 31.25rem;
    width: 90%;
    text-align: center;
    position: relative;
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 0.625rem;
    right: 0.938rem;
    font-size: 1.75rem;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: black;
}

.modal-content ul {
    list-style-type: none;
    padding: 0.938rem 0;
}

.modal-content li {
    margin: 0.625rem 0;
    font-size: 1.125rem;
}

.game {
    width: 100%;
    max-width: 37.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.scoreboard {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    background-color: var(--white);
    padding: 0.938rem;
    border-radius: 0.625rem;
    box-shadow: 0 0.25rem 0.375rem rgba(0,0,0,0.1);
}

.scoreboard div {
    text-align: center;
}

.scoreboard h3 {
    color: var(--primary-color);
    margin-bottom: 0.313rem;
    font-size: 1.125rem;
}

.scoreboard span {
    font-size: 1.5rem;
    font-weight: bold;
}

.contain {
    width: 100%;
    padding: 2rem;
    border-radius: 0.875rem;
    background: var(--white);
    box-shadow: 0 0.313rem 0.625rem rgba(0, 0, 0, 0.1);
}

.result_images {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 1.25rem;
}

.result_images img {
    width: 6.25rem;
    height: 6.25rem;
    object-fit: contain;
}

.user_result img {
    transform: rotate(90deg);
}

.cpu_result img {
    transform: rotate(-90deg) rotateY(180deg);
}

.result {
    text-align: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
}

.option_images {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option_image {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.625rem;
    border-radius: 0.625rem;
}
 
.option_image:hover {
    opacity: 1;
    background-color: rgba(125, 42, 232, 0.1);
}

.option_image.active {
    opacity: 1;
    background-color: rgba(125, 42, 232, 0.2);
}

.option_image img {
    width: 3.125rem;
    height: 3.125rem;
    object-fit: contain;
    pointer-events: none;
}

.option_image p {
    color: var(--primary-color);
    font-size: 1rem;
    margin-top: 0.625rem;
    pointer-events: none;
}

.contain.start .user_result {
    transform-origin: left;
    animation: userShake 0.7s ease infinite;
}

@keyframes userShake {
    50% {
        transform: rotate(10deg);
    }
}

.contain.start .cpu_result {
    transform-origin: right;
    animation: cpuShake 0.7s ease infinite;
}

@keyframes cpuShake {
    50% {
        transform: rotate(-10deg);
    }
}

#reset-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.313rem;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 0.938rem;
}

/* Responsive Design */
@media screen and (min-width: 1200px) {
    :root {
        font-size: 20px; 
    }
}

@media screen and (max-width: 768px) {
    :root {
        font-size: 14px; 
    }

    .rules-btn-container {
        top: 0.625rem;
        right: 0.625rem;
    }

    .contain {
        padding: 1rem;
    }

    .option_images {
        flex-direction: column;
    }

    .option_image {
        margin-bottom: 0.938rem;
        width: 100%;
    }

    .result_images {
        display: flex;
        flex-direction: row;
    }

    .result_images span {
        margin-bottom: 0.938rem;
    }

    .scoreboard {
        flex-direction: column;
    }

    .scoreboard div {
        margin-bottom: 0.625rem;
    }
}

@media screen and (min-width: 768px) and (max-width: 1199px) {
    :root {
        font-size: 18px; 
    }
}