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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

/* Welcome screen */
.welcome-screen {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.8s ease-in-out;
}

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

.welcome-screen h1,
.player-setup-screen h1,
.results-screen h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #6e8efb;
    font-weight: 700;
}

.welcome-screen p,
.player-setup-screen p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #666;
}

/* Features section */
.features {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: rgba(110, 142, 251, 0.1);
    padding: 12px 20px;
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.feature:hover {
    transform: translateX(5px);
}

.feature .icon {
    font-size: 1.5rem;
}

/* Button styles */
.primary-button {
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(110, 142, 251, 0.4);
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(110, 142, 251, 0.6);
}

.primary-button:active:not(:disabled) {
    transform: translateY(1px);
}

.primary-button:disabled {
    background: linear-gradient(135deg, #c1c8e4, #d8d8d8);
    cursor: not-allowed;
    box-shadow: none;
}

.primary-button.active {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(110, 142, 251, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(110, 142, 251, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(110, 142, 251, 0);
    }
}

.secondary-button {
    background-color: #f5f5f5;
    color: #6e8efb;
    border: 2px solid #6e8efb;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.secondary-button:hover:not(:disabled) {
    background-color: #6e8efb;
    color: white;
}

.secondary-button:disabled {
    border-color: #c1c8e4;
    color: #c1c8e4;
    cursor: not-allowed;
}

/* Player setup screen */
.player-setup-screen {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.8s ease-in-out;
}

.players-container {
    margin: 30px 0;
}

.players-list {
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.player-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-radius: 10px;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.player-color {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    margin-right: 15px;
}

.player-name {
    flex-grow: 1;
    text-align: left;
    font-weight: 500;
}

.remove-player-btn {
    background: none;
    border: none;
    color: #ff5252;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.add-player-form {
    margin-bottom: 20px;
}

.add-player-form.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.form-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

input[type="text"],
select {
    flex-grow: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
select:focus {
    border-color: #6e8efb;
    outline: none;
}

.color-select-container {
    position: relative;
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.color-preview {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    position: absolute;
    right: 40px;
    pointer-events: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e8efb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 15px;
    padding-right: 30px;
    transition: all 0.3s ease;
    width: 100%;
}

/* Game screen */
.game-screen {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.8s ease-in-out;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.player-info {
    display: flex;
    align-items: center;
}

.player-color {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    margin-right: 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: inline-block; /* Ensure it's displayed */
}

.current-player {
    font-weight: 600;
    font-size: 1.2rem;
}

.question-number {
    background-color: rgba(110, 142, 251, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6e8efb;
}

.question-container {
    margin-bottom: 25px;
}

.question-text {
    font-size: 1.4rem;
    margin-bottom: 25px;
    line-height: 1.4;
    color: #333;
}

.options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.option {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: transparent; /* Remove blue highlight on mobile */
    outline: none; /* Remove outline on focus */
}

.option:focus {
    outline: none; /* Ensure no outline on focus */
}

.option:hover {
    background-color: #eef1ff;
    border-color: #d4dbff;
}

.option.selected {
    border-color: #6e8efb;
}

.option.correct {
    background-color: rgba(15, 157, 88, 0.1);
    border-color: #0f9d58;
}

.option.incorrect {
    background-color: rgba(255, 82, 82, 0.1);
    border-color: #ff5252;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background-color: #e0e0e0;
    border-radius: 50%;
    margin-right: 15px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.option.correct .option-letter {
    background-color: #0f9d58;
    color: white;
}

.option.incorrect .option-letter {
    background-color: #ff5252;
    color: white;
}

.option-text {
    font-size: 1.1rem;
}

.game-footer {
    text-align: center;
    margin-top: 20px;
}

.hint {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}

.current-score {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #6e8efb;
}

#end-turn-btn {
    margin-top: 10px;
}

/* Points animation */
.points-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 700;
    z-index: 100;
    animation: pointsAnimation 1.5s ease-out forwards;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@keyframes pointsAnimation {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* Results screen */
.results-screen {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.8s ease-in-out;
}

.winner-container {
    background: linear-gradient(135deg, rgba(110, 142, 251, 0.1), rgba(167, 119, 227, 0.1));
    border-radius: 15px;
    padding: 25px;
    margin: 30px 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.winner-trophy {
    font-size: 3rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.winner-info {
    text-align: left;
}

.winner-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.winner-name-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.winner-name {
    font-size: 1.5rem;
    font-weight: 600;
}

.winner-score-container {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.winner-score {
    font-size: 2rem;
    font-weight: 700;
    color: #6e8efb;
}

.winner-points {
    font-size: 1rem;
    color: #666;
}

.scores-container {
    margin-bottom: 30px;
}

.scores-container h3 {
    margin-bottom: 15px;
    color: #666;
}

.scores-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-score-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: #f5f5f5;
    border-radius: 10px;
}

.player-score {
    font-weight: 600;
    margin-left: auto;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .welcome-screen,
    .player-setup-screen,
    .game-screen,
    .results-screen {
        padding: 30px 20px;
    }
    
    .welcome-screen h1,
    .player-setup-screen h1,
    .results-screen h1 {
        font-size: 2.5rem;
    }
    
    .primary-button {
        padding: 12px 30px;
    }
    
    .form-group {
        flex-direction: column;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .option {
        padding: 10px;
    }
    
    .option-text {
        font-size: 0.9rem;
    }
    
    /* Keep two columns for options even on mobile */
    .options-container {
        grid-template-columns: 1fr 1fr;
    }
}
