:root {
    --primary-blue: #fa0623;
    --secondary-green: #000512;
    --accent-orange: #F59E0B;
    --danger-red: #EF4444;
    --warning-yellow: #F59E0B;
    --light-gray: #F8FAFC;
    --medium-gray: #1a2d45;
    --dark-gray: #475569;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--medium-gray) 100%);
    min-height: 100vh;
    color: var(--dark-gray);
    line-height: 1.6;
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    overflow-y: auto;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* Landing Screen */
.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
}

.main-title {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1.5rem;
    color: var(--dark-gray);
    margin-bottom: 3rem;
    font-weight: 300;
}

.landing-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Buttons */
.primary-btn, .secondary-btn, .success-btn, .danger-btn, .warning-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    min-width: 150px;
}

.primary-btn {
    background: var(--primary-blue);
    color: var(--white);
}

.primary-btn:hover {
    background: #0c0206;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.secondary-btn {
    background: var(--white);
    color: var(--dark-gray);
    border: 2px solid var(--medium-gray);
}

.secondary-btn:hover {
    background: var(--light-gray);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.success-btn {
    background: var(--secondary-green);
    color: var(--white);
}

.success-btn:hover {
    background: #19c54c;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.danger-btn {
    background: var(--danger-red);
    color: var(--white);
}

.danger-btn:hover {
    background: #DC2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.warning-btn {
    background: var(--warning-yellow);
    color: var(--white);
}

.warning-btn:hover {
    background: #D97706;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Customize Screen */
.customize-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.customize-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.customize-header h2 {
    color: var(--primary-blue);
    font-size: 2.5rem;
    font-weight: 700;
}

.customize-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.question-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.question-card h4 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.question-card .points {
    color: var(--secondary-green);
    font-weight: 700;
    margin-bottom: 1rem;
}

.question-card .question {
    margin-bottom: 1rem;
    color: var(--dark-gray);
}

.question-card .answer {
    margin-bottom: 1rem;
    color: var(--dark-gray);
    font-style: italic;
}

.question-card .actions {
    display: flex;
    gap: 0.5rem;
}

.question-card button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-width: auto;
}

/* Game Screen */
.admin-panel {
    background: var(--white);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--medium-gray);
}

.admin-panel h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.admin-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-controls button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    min-width: auto;
}

.game-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
    min-height: calc(100vh - 120px);
}

/* Gameboard */
.gameboard-container {
    flex: 1;
    min-width: 800px;
}

.gameboard {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.category-header {
    background: var(--primary-blue);
    color: var(--white);
    padding: 1rem;
    text-align: center;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: var(--shadow);
}

.question-card-board {
    background: var(--light-gray);
    border: 2px solid var(--medium-gray);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-gray);
}

.question-card-board:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.question-card-board.answered {
    background: var(--medium-gray);
    color: #94A3B8;
    cursor: not-allowed;
    transform: none;
}

.question-card-board.answered:hover {
    background: var(--medium-gray);
    color: #94A3B8;
    transform: none;
    box-shadow: var(--shadow);
}

/* Scoreboard */
.scoreboard-container {
    width: 350px;
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    height: fit-content;
}

.scoreboard h3 {
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-align: center;
}

.add-team-section {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.add-team-section input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 1rem;
}

.add-team-section input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.add-team-section button {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    min-width: auto;
}

.teams-list {
    margin-bottom: 2rem;
}

.team-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.team-item.current-turn {
    background: linear-gradient(135deg, var(--primary-blue), #6366F1);
    color: var(--white);
    box-shadow: var(--shadow);
}

.team-name {
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.team-name:hover {
    background: rgba(255, 255, 255, 0.1);
}

.team-name:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
}

.team-score {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--secondary-green);
    min-width: 80px;
    text-align: left;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
}

.team-item.current-turn .team-score {
    color: var(--white);
}

.team-actions {
    display: flex;
    gap: 0.5rem;
}

.team-actions button {
    padding: 0.5rem;
    font-size: 0.8rem;
    min-width: auto;
    border-radius: 6px;
}

.current-turn {
    text-align: center;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 8px;
    font-weight: 600;
    color: var(--dark-gray);
}

.current-turn span {
    color: var(--primary-blue);
    font-weight: 700;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 2rem 2rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--medium-gray);
    position: relative;
}

.modal-header h3 {
    color: var(--primary-blue);
    font-size: 1.8rem;
    flex: 1;
}

#modal-points {
    color: var(--secondary-green);
    font-size: 2rem;
    font-weight: 700;
}

.hidden-challenge-tag {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--accent-orange);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.hidden-challenge-tag.hidden {
    display: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.modal-body {
    padding: 2rem;
}

#question-text {
    font-size: 1.5rem;
    color: var(--dark-gray);
    margin-bottom: 2rem;
    line-height: 1.5;
    text-align: center;
}

.answer-section {
    text-align: center;
}

.answer-text {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 8px;
    font-size: 1.3rem;
    color: var(--primary-blue);
    font-weight: 600;
    border-left: 4px solid var(--secondary-green);
}

.answer-text.hidden {
    display: none;
}

.modal-footer {
    padding: 1rem 2rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-footer button {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-width: 120px;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-gray);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }
    
    .scoreboard-container {
        width: 100%;
        max-width: 800px;
    }
    
    .gameboard-container {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 3rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .landing-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .gameboard {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .question-card-board {
        font-size: 1.2rem;
        padding: 1rem;
        min-height: 80px;
    }
    
    .category-header {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    #question-text {
        font-size: 1.2rem;
    }
    
    .customize-controls {
        justify-content: center;
    }
    
    .questions-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-controls {
        justify-content: center;
    }
}