* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    padding: 30px 25px;
    max-width: 450px;
    width: 100%;
    backdrop-filter: blur(10px);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
    font-size: 2rem;
}

.tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 2px solid #ddd;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #4a90e2;
    border-bottom-color: #4a90e2;
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 15px;
}

.auth-form.active {
    display: flex;
}

.auth-form h2 {
    text-align: center;
    color: #444;
    margin-bottom: 10px;
}

input {
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 1rem;
    transition: 0.2s;
    outline: none;
}

input:focus {
    border-color: #4a90e2;
}

button[type="submit"], #logout-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 5px 0 #2c3e50;
    margin-top: 10px;
}

button[type="submit"]:active, #logout-btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #2c3e50;
}

button[type="submit"]:hover, #logout-btn:hover {
    background: #357abD;
}

.message {
    text-align: center;
    min-height: 40px;
    color: #e74c3c;
    font-weight: 500;
}

#user-section {
    text-align: center;
}

#user-section h2 {
    margin-bottom: 20px;
    color: #333;
}

#user-section p {
    margin: 20px 0;
    color: #666;
}

#logout-btn {
    background: #e74c3c;
    box-shadow: 0 5px 0 #c0392b;
    width: 100%;
}

/* Лобби */
.lobby-actions {
    margin: 20px 0;
}
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    background: #4a90e2;
    color: white;
    margin: 5px;
}
.btn-secondary {
    background: #2c3e50;
}
.join-by-code {
    margin: 20px 0;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 16px;
}
#game-code-input {
    padding: 8px;
    font-size: 1rem;
    width: 150px;
}
.error-message {
    color: red;
    margin-top: 5px;
}
#games-list {
    margin-top: 20px;
}
.game-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ccc;
}
.game-item button {
    padding: 5px 15px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

/* Комната */
#players-list {
    list-style: none;
    padding: 0;
}
#players-list li {
    padding: 8px;
    background: #ecf0f1;
    margin: 5px 0;
    border-radius: 12px;
}