* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Login/Register Pages */
.container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 100%;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    color: #333;
    font-size: 2em;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-size: 0.95em;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    color: #333;
    font-weight: 600;
    font-size: 0.9em;
}

input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

small {
    color: #999;
    font-size: 0.85em;
}

.btn {
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.link-section {
    margin-top: 25px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.link-section p {
    color: #666;
    font-size: 0.9em;
}

.link-section a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.link-section a:hover {
    text-decoration: underline;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #c33;
    display: none;
    font-size: 0.9em;
}

/* Lobby Page */
.lobby-container {
    min-height: 100vh;
    padding: 20px;
}

.lobby-header {
    background: white;
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lobby-header h1 {
    margin: 0;
    font-size: 1.8em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lobby-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.game-selection, .active-games {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.game-selection h2, .active-games h2 {
    margin-bottom: 20px;
    color: #333;
}

.game-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.game-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 15px;
    padding: 30px 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.3);
}

.game-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.game-card h3 {
    margin: 10px 0 5px;
    font-size: 1.3em;
}

.game-card p {
    font-size: 0.9em;
    opacity: 0.9;
}

.games-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-info h3 {
    margin-bottom: 8px;
    color: #667eea;
}

.game-info p {
    margin: 3px 0;
    color: #666;
    font-size: 0.9em;
}

.no-games {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* Game Page */
.game-container {
    min-height: 100vh;
    padding: 20px;
}

.game-header {
    background: white;
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-header h1 {
    margin: 0;
    font-size: 1.5em;
}

.game-code {
    font-size: 1.1em;
    color: #667eea;
}

.game-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto 1fr;
    gap: 20px;
    height: calc(100vh - 150px);
}

.players-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    grid-row: 1 / 3;
}

.players-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-item {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
}

.player-name {
    font-weight: 600;
    color: #667eea;
}

.game-area {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.game-status {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 20px;
}

.game-status.active {
    background: #d4edda;
    color: #155724;
}

.game-board {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-game {
    text-align: center;
    color: #666;
}

.placeholder-game h2 {
    margin-bottom: 15px;
    color: #667eea;
}

.game-controls {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.game-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .lobby-content {
        grid-template-columns: 1fr;
    }
    
    .game-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr auto;
    }
    
    .players-section {
        grid-row: auto;
    }
}

@media (max-width: 768px) {
    .game-types {
        grid-template-columns: 1fr;
    }
    
    .lobby-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .game-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}