:root {
    --primary-color: #6c5ce7;
    --secondary-color: #00cec9;
    --accent-color: #fdcb6e;
    --bg-dark: #0f0c29;
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #b2bec3;
    --font-main: 'Outfit', sans-serif;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    background-attachment: fixed; /* Fix gradient on scroll */
    color: var(--text-main);
    height: 100vh;
    overflow: hidden; /* Prevent scrolling usually */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Animation */
.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.background-animation::before, .background-animation::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    filter: blur(80px); /* Orbs effect */
    border-radius: 50%;
    opacity: 0.4;
    animation: orbFloat 10s infinite alternate;
}

.background-animation::after {
    background: var(--secondary-color);
    right: 10%;
    bottom: 10%;
    animation-delay: -5s;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 50px); }
}

.app-container {
    width: 100%;
    max-width: 900px;
    height: 90%;
    max-height: 800px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Screens */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
    padding: 2rem;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
    z-index: 0;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
    z-index: 1;
}

/* Main Menu */
.game-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(108, 92, 231, 0.5);
    text-align: center;
}

.game-title .highlight {
    color: var(--secondary-color);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 300px;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: inherit;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn.primary {
    background: linear-gradient(45deg, var(--primary-color), #8e44ad);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.6);
}

.btn.secondary {
    background: linear-gradient(45deg, var(--secondary-color), #0984e3);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 206, 201, 0.4);
}

.btn.secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 206, 201, 0.6);
}

.btn.outline {
    background: transparent;
    border: 2px solid var(--text-muted);
    color: var(--text-main);
}

.btn.outline:hover {
    border-color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.btn.small {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

/* Settings Screen */
.setting-group {
    background: var(--glass-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    margin-bottom: 2rem;
    text-align: center;
}

.setting-group label {
    display: block;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.sel-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    background: rgba(255,255,255,0.02);
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.sel-btn.active, .sel-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Game Screen */
.game-header {
    position: absolute;
    top: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.3s;
}

.icon-btn:hover {
    opacity: 1;
}

.score-board {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: var(--glass-bg);
    padding: 0.5rem 2rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
}

.player-score {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score {
    font-size: 2rem;
    font-weight: 800;
}

.score-divider {
    font-size: 2rem;
    opacity: 0.5;
}

.game-arena {
    display: flex;
    width: 100%;
    justify-content: space-around;
    align-items: center;
    margin-top: 3rem;
}

.player-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 40%;
}

.hand-container {
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Removed background circle for cleaner look, just the icon */
}

.hand-icon {
    font-size: 8rem;
    color: var(--text-main);
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
    transition: transform 0.2s; /* for subtle movement */
}

/* Animation Check */
.shake-animation {
    animation: shake 0.5s ease-in-out 3; /* Shake 3 times */
}

@keyframes shake {
    0% { transform: rotate(0deg) translateY(0); }
    25% { transform: rotate(-20deg) translateY(0); }
    50% { transform: rotate(0deg) translateY(0); }
    75% { transform: rotate(20deg) translateY(0); }
    100% { transform: rotate(0deg) translateY(0); }
}

.result-area {
    width: 10%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#round-result {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-color);
    text-align: center;
    min-width: 100px;
}

.controls {
    display: flex;
    gap: 1rem;
}

.controls.hidden {
    display: none;
}

.choice-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--glass-bg);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    border: 2px solid var(--glass-border);
    transition: 0.3s;
}

.choice-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.1);
}

.choice-btn.rock:hover { border-color: #e17055; color: #e17055; }
.choice-btn.paper:hover { border-color: #0984e3; color: #0984e3; }
.choice-btn.scissors:hover { border-color: #00b894; color: #00b894; }

.turn-indicator {
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.turn-indicator:not(.hidden) { /* Use class to toggle visibility but keep layout */
    opacity: 1;
}

/* Winner Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 12, 41, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.5s;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    padding: 3rem;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.trophy-icon {
    font-size: 5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}

/* Responsive */
@media (max-width: 768px) {
    .game-arena {
        flex-direction: column;
        gap: 2rem;
    }
    .player-area {
        width: 100%;
        gap: 1rem;
    }
    .game-title {
        font-size: 2.5rem;
    }
    .hand-container {
        width: 120px;
        height: 120px;
    }
    .hand-icon {
        font-size: 5rem;
    }
}
