* {
    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;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1000px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
}

/* Score Tracker Header */
.score-tracker {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-bottom: 3px solid #667eea;
}

.score-tracker h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-align: center;
}

.scores-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.score-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.score-item .team-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.score-item .team-score {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
}

.progress {
    text-align: center;
    font-size: 1rem;
    opacity: 0.9;
}

/* Screen Management */
.screen {
    display: none;
    padding: 40px 30px;
    min-height: 600px;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.hidden {
    display: none !important;
}

/* Setup Screen */
.setup-container {
    max-width: 500px;
    margin: 0 auto;
}

.setup-container h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-align: center;
}

.form-group {
    margin-bottom: 25px;
}

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

.form-group input[type="number"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input[type="number"]:focus,
.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    font-size: 1rem;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Question Screen */
.question-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.category-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 0 0 8px 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.question-number {
    position: absolute;
    top: 0;
    right: 0;
    background: #764ba2;
    color: white;
    padding: 8px 16px;
    border-radius: 0 0 0 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.question-content {
    margin-bottom: 30px;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-text {
    font-size: 2.5rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    max-width: 90%;
}

/* Timer Display */
.timer-display {
    margin: 30px 0;
    text-align: center;
    animation: pulseTimer 1s ease-in-out infinite;
}

.timer-value {
    font-size: 4rem;
    font-weight: bold;
    color: #667eea;
    line-height: 1;
}

.timer-value.warning {
    color: #ff6b6b;
    animation: pulse 0.5s ease-in-out infinite;
}

.timer-label {
    font-size: 1.2rem;
    color: #666;
    margin-top: 5px;
}

@keyframes pulseTimer {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

/* Answer Box */
.answer-box {
    background: #f0f4ff;
    border: 4px solid #667eea;
    border-radius: 10px;
    padding: 30px;
    margin: 30px 0;
    min-width: 300px;
    max-width: 600px;
    animation: slideIn 0.4s ease-out;
}

.answer-box h3 {
    color: #667eea;
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.answer-text {
    font-size: 2.2rem;
    font-weight: 700;
    color: #333;
    line-height: 1.4;
}

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

/* Score Buttons */
.score-buttons-container {
    margin-top: 30px;
    text-align: center;
    animation: fadeIn 0.3s ease-in;
}

.team-prompt {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 15px;
    font-weight: 500;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Results Screen */
.results-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.results-container h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 30px;
}

.results-container h2 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.results-list {
    margin-bottom: 40px;
}

.result-item {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 5px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.3rem;
}

.result-item.first-place {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    color: white;
    border-left-color: #ffd89b;
}

.result-item.second-place {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-left-color: #a8edea;
}

.result-item.third-place {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6a88 100%);
    color: white;
    border-left-color: #ff9a56;
}

.result-rank {
    font-weight: 600;
    font-size: 1.5rem;
    margin-right: 20px;
    min-width: 40px;
}

.result-name {
    flex: 1;
    text-align: left;
    font-weight: 600;
}

.result-score {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.btn:active {
    transform: translateY(0);
}

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

.btn-secondary {
    background: #f0f4ff;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-success {
    background: #51cf66;
    color: white;
}

.btn-success:hover {
    background: #40c057;
}

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

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

.btn-large {
    padding: 16px 40px;
    font-size: 1.2rem;
    width: 100%;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
        max-width: 100%;
        min-height: 100vh;
    }

    .screen {
        padding: 30px 20px;
        min-height: 100vh;
    }

    .setup-container h1 {
        font-size: 1.8rem;
    }

    .question-text {
        font-size: 2rem;
    }

    .answer-text {
        font-size: 1.8rem;
    }

    .timer-value {
        font-size: 3rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .btn-success,
    .btn-danger {
        width: 100%;
    }

    .result-item {
        flex-direction: column;
        gap: 10px;
    }

    .result-name {
        text-align: center;
    }

    .score-tracker {
        padding: 15px;
    }

    .scores-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .question-text {
        font-size: 1.5rem;
    }

    .answer-text {
        font-size: 1.4rem;
    }

    .timer-value {
        font-size: 2.5rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .btn-large {
        padding: 14px 20px;
        font-size: 1rem;
    }
}
