* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    min-height: 100vh;
    padding: 20px;
    color: #fff;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.back-btn, .logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.back-btn:hover, .logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.screen {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mode Selection */
.mode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.mode-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.mode-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.mode-card h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
}

.mode-card p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Setup Screens */
.setup-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 50px;
    max-width: 600px;
    margin: 50px auto;
    text-align: center;
}

.setup-box h2 {
    font-size: 2em;
    margin-bottom: 15px;
}

.setup-box p {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.hint {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px !important;
}

.number-input, .code-input {
    width: 100%;
    max-width: 300px;
    padding: 15px;
    font-size: 1.3em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-align: center;
    margin: 20px 0;
}

.number-input::placeholder, .code-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.number-input:focus, .code-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.2);
}

.btn-primary, .btn-secondary, .btn-copy {
    padding: 15px 40px;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    margin: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.btn-copy {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.9em;
    padding: 10px 20px;
}

/* Battle Arena (Solo Mode) */
.battle-arena {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: start;
    margin-top: 30px;
}

.player-side, .ai-side {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 25px;
}

.side-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.side-header h3 {
    font-size: 1.5em;
}

.attempts-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

.game-box {
    text-align: center;
}

.target-info {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.secret-num {
    font-size: 1.5em;
    font-weight: bold;
    color: #fbbf24;
}

.vs-divider {
    font-size: 3em;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.feedback {
    min-height: 40px;
    margin: 20px 0;
    font-size: 1.2em;
    font-weight: bold;
}

.feedback.win {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.feedback.hint {
    color: #fbbf24;
}

.history {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
}

.history-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    margin: 5px 0;
    border-radius: 8px;
    font-size: 0.9em;
}

/* Co-op Screens */
.coop-options {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: center;
    margin-top: 30px;
}

.option-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.option-box h3 {
    margin-bottom: 10px;
}

.option-box p {
    font-size: 0.9em;
    margin-bottom: 20px;
}

.divider-text {
    font-size: 1.5em;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
}

.code-display {
    margin: 30px 0;
}

.party-code {
    font-size: 3em;
    font-weight: bold;
    letter-spacing: 8px;
    color: #fbbf24;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.waiting-area {
    margin: 30px 0;
}

.waiting-text {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.number-setup {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.coop-arena {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    max-width: 700px;
    margin: 30px auto;
}

.coop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.party-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.party-label {
    color: rgba(255, 255, 255, 0.7);
}

.party-code-small {
    font-weight: bold;
    font-size: 1.2em;
    color: #fbbf24;
}

.role-badge {
    background: rgba(102, 126, 234, 0.5);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
}

.attempts-display {
    margin: 20px 0;
    font-size: 1.1em;
}

.attempts-label {
    color: rgba(255, 255, 255, 0.7);
}

.attempts-count {
    font-weight: bold;
    font-size: 1.3em;
    color: #fbbf24;
}

/* Result Screen */
.result-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 60px;
    max-width: 600px;
    margin: 50px auto;
    text-align: center;
}

.trophy {
    font-size: 5em;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.result-box h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.result-message {
    font-size: 1.3em;
    margin-bottom: 30px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

/* Responsive */
@media (max-width: 768px) {
    .battle-arena {
        grid-template-columns: 1fr;
    }
    
    .vs-divider {
        transform: rotate(90deg);
        margin: 20px 0;
    }
    
    .coop-options {
        grid-template-columns: 1fr;
    }
    
    .divider-text {
        margin: 20px 0;
    }
    
    .header h1 {
        font-size: 1.5em;
    }
    
    .mode-cards {
        grid-template-columns: 1fr;
    }
}
