/* Reset and Base Styles */
* {
    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;
    overflow-x: hidden;
}

/* Screen Management - Only show active screen */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

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

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.container.centered {
    text-align: center;
}

/* Typography */
h1 {
    color: #764ba2;
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
}

h2 {
    color: #667eea;
    font-size: 1.5em;
    margin: 20px 0 15px 0;
}

h3 {
    color: #555;
    font-size: 1.2em;
    margin-bottom: 10px;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:active {
    transform: scale(0.95);
}

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

.btn-primary:hover {
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

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

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

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

.large-btn {
    font-size: 20px;
    padding: 20px 40px;
    margin-top: 20px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

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

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

/* Info Boxes */
.info-box {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

.info-box ul {
    margin-left: 20px;
    margin-top: 10px;
}

.info-box li {
    margin: 8px 0;
    line-height: 1.5;
}

.warning-box {
    background: #fff3cd;
    border: 3px solid #ffc107;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
}

.warning-text {
    color: #e67e22;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
}

.info-text {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    margin: 10px 0;
}

.large-text {
    font-size: 1.3em;
    font-weight: bold;
    margin: 15px 0;
}

.saboteur-info {
    background: #ffe6e6;
    border-left: 4px solid #e74c3c;
}

/* Game Header */
.game-header {
    background: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.score-display,
.game-code-display {
    font-size: 18px;
    color: #555;
}

.score-display strong,
.game-code-display strong {
    color: #764ba2;
    font-size: 24px;
}

/* Players Display */
.players-list,
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.player-card {
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
}

.player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.player-card.eliminated {
    opacity: 0.5;
    background: #e0e0e0;
}

.player-card.you {
    border-color: #667eea;
    background: #e8eaf6;
}

.player-card .player-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.player-card .player-score {
    color: #764ba2;
    font-size: 20px;
    font-weight: bold;
}

.player-card.clickable {
    cursor: pointer;
    border-color: #667eea;
}

.player-card.clickable:hover {
    background: #667eea;
    color: white;
}

.player-card.clickable:hover .player-name,
.player-card.clickable:hover .player-score {
    color: white;
}

/* Assignment Display */
.assignment-box {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border: 3px solid #f39c12;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

#assignment-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#assignment-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.assignment-details {
    text-align: center;
    width: 100%;
}

.assignment-code {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    font-size: 24px;
}

.timer-display {
    background: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    margin-top: 10px;
}

/* Enter Code Section */
.enter-code-section {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

#enter-code-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

#code-input,
#sabotage-code-input {
    flex: 1;
    padding: 15px;
    font-size: 20px;
    text-align: center;
    letter-spacing: 3px;
    border: 2px solid #4caf50;
    border-radius: 8px;
}

#code-input:focus,
#sabotage-code-input:focus {
    outline: none;
    border-color: #2e7d32;
}

/* Guess Section */
.guess-section {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #ffebee;
    border-radius: 10px;
}

/* Saboteur Button (Hidden) */
#saboteur-button {
    position: fixed;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    cursor: pointer;
    z-index: 1000;
    /* Completely invisible but clickable */
}

/* Messages */
.message-icon {
    max-width: 200px;
    margin: 20px auto;
}

.message-box {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    font-size: 18px;
    line-height: 1.6;
}

#message-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Assignment Notification */
.assignment-notification-box {
    background: #fff9e6;
    border: 3px solid #f39c12;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
}

#notification-assignment-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Game Over */
.game-over-box {
    background: #f8f9fa;
    border: 3px solid #764ba2;
    padding: 25px;
    margin: 20px 0;
    border-radius: 10px;
    font-size: 18px;
    line-height: 1.8;
}

.final-scores {
    margin: 20px 0;
}

.final-scores .player-card {
    margin: 10px 0;
}

/* Games List */
.games-list {
    margin-top: 30px;
}

.game-item {
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.3s;
}

.game-item:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.spinner {
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.2em;
    }

    .game-header {
        flex-direction: column;
        gap: 10px;
    }

    .players-list,
    .players-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    #enter-code-form {
        flex-direction: column;
    }
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 5px;
}

.status-badge.active {
    background: #4caf50;
    color: white;
}

.status-badge.eliminated {
    background: #e74c3c;
    color: white;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}
