* {
    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;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.screen {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Welcome Screen */
.welcome-content {
    text-align: center;
}

.welcome-content h1 {
    font-size: 3.5em;
    color: #333;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 40px;
}

.welcome-actions {
    max-width: 400px;
    margin: 0 auto;
}

.join-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.join-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.join-form {
    display: flex;
    gap: 10px;
}

.join-form input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-large {
    padding: 18px 36px;
    font-size: 18px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.answer-slot.team1 {
    border-left: 4px solid #007bff;
}

.answer-slot.team2 {
    border-left: 4px solid #28a745;
}

.answer-slot.revealed.team1 {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.answer-slot.revealed.team2 {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.btn-warning:hover {
    background: #e0a800;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Lobby Screen */
.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.game-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.game-id {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: monospace;
    font-weight: bold;
    border: 2px solid #dee2e6;
}

.teams-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.team-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #dee2e6;
}

.team-section h3 {
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.team-players {
    min-height: 80px;
    margin-bottom: 15px;
}

.player-tag {
    display: inline-block;
    background: white;
    padding: 6px 12px;
    margin: 4px;
    border-radius: 20px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.player-tag.host {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.moderator-section {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #f39c12;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.2);
    transition: all 0.3s ease;
}

.moderator-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.3);
}

.moderator-section h3 {
    margin-bottom: 15px;
    color: #856404;
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.moderator-section h3::before {
    content: "👨‍💼";
    font-size: 1.2em;
}

#moderator-info {
    background: rgba(255, 255, 255, 0.7);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
    color: #856404;
    border-left: 4px solid #f39c12;
}

#host-controls {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    align-items: center;
    flex-wrap: wrap;
}

#host-controls select {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #f39c12;
    border-radius: 8px;
    background: white;
    color: #856404;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

#host-controls select:focus {
    outline: none;
    border-color: #e67e22;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
}

#host-controls select option {
    padding: 10px;
    background: white;
    color: #856404;
}

#set-moderator-btn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#set-moderator-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

.lobby-actions {
    text-align: center;
    margin-bottom: 30px;
}

/* Game Screen */
.game-interface {
    padding: 0;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.game-status {
    display: flex;
    gap: 30px;
    font-weight: 600;
    font-size: 18px;
}

.scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.team-score {
    text-align: center;
}

.team-score h3 {
    margin-bottom: 10px;
    color: #333;
}

.team-score .score {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.team-score .sets {
    color: #666;
    font-size: 14px;
}

.strikes-display {
    text-align: center;
}

#strikes {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.strike {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    transition: all 0.3s;
}

.strike.active {
    background: #dc3545;
    animation: pulse 0.5s;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.question-section {
    text-align: center;
    margin-bottom: 30px;
}

.question-display {
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    border: 3px solid #667eea;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answers-board {
    margin-bottom: 30px;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.answer-slot {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

.answer-slot.revealed {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    animation: reveal 0.5s;
}

@keyframes reveal {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.answer-text {
    font-weight: 600;
}

.answer-points {
    font-size: 1.2em;
    font-weight: bold;
}

.player-input {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #dee2e6;
}

.input-group {
    display: flex;
    gap: 15px;
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

/* Moderator Controls */
.moderator-panel {
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.moderator-panel h3 {
    color: #856404;
    margin-bottom: 20px;
}

.moderator-answers {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.moderator-answer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.pending-answer {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #ffc107;
}

.answer-validation {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.validation-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.correct-answers-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.moderator-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Messages */
.messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
}

.message {
    background: white;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    animation: slideIn 0.3s;
}

.message.error {
    border-left-color: #dc3545;
}

.message.success {
    border-left-color: #28a745;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* End Screen */
.end-content {
    text-align: center;
}

.end-content h1 {
    font-size: 3em;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.winner-display {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 40px;
    border: 3px solid #667eea;
}

.winner-display h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
}

.winner-display p {
    font-size: 1.3em;
    color: #666;
}

.end-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* Spectator Banner */
.spectator-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffc107;
    color: #212529;
    text-align: center;
    padding: 10px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Join Request Modal */
.modal-body {
    padding: 20px 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.team-selection {
    margin-top: 15px;
}

.team-selection label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.team-selection select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* Incorrect Answers */
.incorrect-answers {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.incorrect-answers h3 {
    color: #721c24;
    margin-bottom: 15px;
}

.incorrect-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.incorrect-answer {
    background: #f5c6cb;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid #f1b0b7;
}

.incorrect-answer.team1 {
    border-left: 4px solid #007bff;
}

.incorrect-answer.team2 {
    border-left: 4px solid #28a745;
}

/* Round Summary */
.round-summary {
    text-align: left;
}

.found-answers-summary,
.missed-answers-summary {
    margin-bottom: 20px;
}

.summary-answer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    font-weight: 600;
}

.summary-answer.found {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.summary-answer.found.team1 {
    border-left: 4px solid #007bff;
}

.summary-answer.found.team2 {
    border-left: 4px solid #28a745;
}

.summary-answer.missed {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

/* Join Request Notification */
.join-request-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 999;
    max-width: 300px;
}

.join-request-notification h4 {
    margin-bottom: 10px;
    color: #856404;
}

.join-request-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .screen {
        padding: 20px;
    }
    
    .welcome-content h1 {
        font-size: 2.5em;
    }
    
    .join-form {
        flex-direction: column;
    }
    
    .teams-container {
        grid-template-columns: 1fr;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .game-status {
        flex-direction: column;
        gap: 10px;
    }
    
    .scoreboard {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .moderator-actions {
        flex-direction: column;
    }
    
    .validation-buttons {
        flex-direction: column;
    }
}