* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    position: relative;
    display: inline-block;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #6e8efb, #a777e3);
    border-radius: 2px;
}

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

.mode-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: white;
    flex: 1;
    max-width: 180px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.mode-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #3498db, #2c3e50);
}

.mode-btn.active {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.game-screen {
    display: none;
    margin-top: 20px;
}

.active-screen {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.choices {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.choice {
    font-size: 3.5rem;
    background: white;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.choice::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, #6e8efb, #a777e3, #6e8efb);
    z-index: -1;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.choice:hover {
    transform: scale(1.1);
    border-color: #3498db;
}

.choice:hover::before {
    opacity: 1;
}

.vs-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.player-choice, .opponent-choice {
    font-size: 4rem;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.player-choice::after, .opponent-choice::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #6e8efb, #a777e3, #6e8efb);
    z-index: -1;
    border-radius: 50%;
    opacity: 0.7;
}

.vs-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #7f8c8d;
    padding: 10px 15px;
    background: rgba(255,255,255,0.8);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.result {
    font-size: 2rem;
    font-weight: bold;
    margin: 20px 0;
    min-height: 70px;
    color: #2c3e50;
    padding: 15px;
    border-radius: 15px;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scores {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.score {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: white;
    padding: 12px 25px;
    border-radius: 15px;
    min-width: 120px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.multiplayer-setup {
    margin: 20px 0;
}

.setup-options {
    display: flex;
    flex-direction: row !important;
    gap: 5px;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* Updated join-section styles */
.join-section {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

input {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin: 10px 0;
    width: 200px;
    font-size: 1rem;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2), inset 0 2px 5px rgba(0,0,0,0.1);
}

button {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

button:hover {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.share-section {
    margin: 20px 0;
    padding: 20px;
    background: #e8f4fc;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.share-options {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #2c3e50, #1a2530);
}

.share-btn:hover {
    background: linear-gradient(135deg, #3498db, #2c3e50);
}

.game-code-display {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 15px 0;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.game-history {
    margin-top: 30px;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
}

.winner {
    color: #27ae60;
    font-weight: 600;
}

.loser {
    color: #e74c3c;
    font-weight: 600;
}

.status-message {
    font-size: 1.2rem;
    margin: 15px 0;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.connected {
    background: #d4edda;
    color: #155724;
}

.waiting {
    background: #fff3cd;
    color: #856404;
}

.instructions {
    background: #e9ecef;
    padding: 20px;
    border-radius: 15px;
    margin: 15px 0;
    text-align: left;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s ease;
}

@keyframes reveal {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.reveal {
    animation: reveal 0.5s ease;
}

.footer {
    margin-top: 30px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.footer a {
    text-decoration: none !important;
    color: #7f8c8d;
}

.choice.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.status-message.playing {
    background: #d1ecf1;
    color: #0c5460;
}

.countdown {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 10px 0;
    color: #2c3e50;
}

.next-round-btn {
    background: linear-gradient(135deg, #27ae60, #219653);
    padding: 15px 30px;
    font-size: 1.2rem;
    margin-top: 20px;
    display: none;
}

.next-round-btn:hover {
    background: linear-gradient(135deg, #219653, #1e8449);
}

.countdown-container {
    margin-top: 15px;
    font-size: 1.2rem;
    color: #2c3e50;
}

/* Improved mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        width: 95%;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .mode-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
        max-width: 150px;
    }
    
    .choice {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
    
    .player-choice, .opponent-choice {
        width: 90px;
        height: 90px;
        font-size: 3rem;
    }
    
    .result {
        font-size: 1.5rem;
        padding: 10px;
    }
    
    .score {
        font-size: 1.2rem;
        padding: 10px 15px;
        min-width: 100px;
    }
    
    .vs-container {
        gap: 15px;
    }
    
    .vs-text {
        font-size: 1.2rem;
        padding: 8px 12px;
    }
    
    .setup-options {
        flex-direction: column;
    }
    
    button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .share-options {
        flex-direction: column;
        align-items: center;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile adjustments for join section */
    .join-section {
        flex-direction: column;
    }
    
    input {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .mode-btn {
        max-width: 130px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .choice {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .player-choice, .opponent-choice {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
    
    .result {
        font-size: 1.3rem;
        min-height: 60px;
    }
    
    .score {
        font-size: 1.1rem;
        padding: 8px 12px;
        min-width: 90px;
    }
    
    .scores {
        gap: 15px;
    }
    
    .game-history {
        padding: 15px;
        max-height: 150px;
    }
    
    .instructions {
        padding: 15px;
    }
    
    .status-message {
        font-size: 1rem;
        padding: 12px;
    }
}

@media (max-width: 360px) {
    .choices {
        gap: 10px;
    }
    
    .choice {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .player-choice, .opponent-choice {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .vs-text {
        font-size: 1rem;
        padding: 6px 10px;
    }
    
    .result {
        font-size: 1.1rem;
    }
    
    .score {
        font-size: 1rem;
        padding: 6px 10px;
        min-width: 80px;
    }
}