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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #ffffff;
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 700px;
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 1rem;
}

.logo {
    max-width: 200px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.screen {
    text-align: center;
    animation: fadeIn 0.3s ease-in;
}

.hidden {
    display: none;
}

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

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 2rem;
    line-height: 1.6;
}

p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1rem;
}

.timer-info {
    font-size: 1rem;
    color: #999;
    margin-bottom: 2rem;
}

.cta-btn {
    background-color: #bc1e2c;
    color: #ffffff;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cta-btn:hover {
    background-color: #9a1923;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(188, 30, 44, 0.3);
}

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

/* Quiz Screen */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.progress {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.timer {
    font-size: 1.5rem;
    font-weight: 700;
    color: #bc1e2c;
    min-width: 60px;
}

.quiz-content {
    margin-top: 2rem;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.option-btn {
    background-color: #ffffff;
    border: 2px solid #eee;
    padding: 1.2rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    color: #333;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.option-btn:focus {
    outline: none;
}

.option-btn:active {
    outline: none;
}

/* Only apply hover effects on devices that support hover (not touch screens) */
@media (hover: hover) and (pointer: fine) {
    .option-btn:hover {
        border-color: #bc1e2c;
        background-color: #fef8f8;
    }
}

.option-btn.selected {
    background-color: #bc1e2c;
    color: #ffffff;
    border-color: #bc1e2c;
}

.option-btn.correct {
    background-color: #4CAF50;
    color: #ffffff;
    border-color: #4CAF50;
}

.option-btn.incorrect {
    background-color: #f44336;
    color: #ffffff;
    border-color: #f44336;
}

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

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

/* Result Screen */
.score-container {
    margin: 3rem 0;
    position: relative;
    z-index: 1;
}

.score-text {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.score {
    font-size: 4rem;
    font-weight: 700;
    color: #bc1e2c;
    margin-bottom: 1rem;
}

#result-message {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Share Button */
.share-container {
    margin: 2rem 0;
    text-align: center;
}

.share-btn {
    background: linear-gradient(135deg, #bc1e2c 0%, #9a1923 100%);
    color: #ffffff;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(188, 30, 44, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(188, 30, 44, 0.4);
}

.share-btn:active {
    transform: translateY(-1px);
}

.share-feedback {
    margin-top: 1rem;
    color: #4CAF50;
    font-weight: 600;
    font-size: 1rem;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* ELO Score Display */
.elo-info {
    margin: 2rem 0;
    padding: 2rem;
    border: 2px solid #eee;
    border-radius: 12px;
    background-color: #fafafa;
}

.elo-score-display {
    text-align: center;
}

.elo-label {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.elo-value {
    font-size: 3rem;
    font-weight: 700;
    color: #333;
    margin: 0.5rem 0;
}

.elo-change {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Leaderboard */
.leaderboard-container {
    margin: 3rem 0 2rem;
}

.leaderboard-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
}

.leaderboard {
    background-color: #fafafa;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background-color: #ffffff;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.leaderboard-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leaderboard-item:last-child {
    margin-bottom: 0;
}

.leaderboard-item.top-three {
    border: 2px solid #bc1e2c;
    background: linear-gradient(135deg, #fff 0%, #fef8f8 100%);
}

.leaderboard-item .rank {
    font-size: 1.2rem;
    font-weight: 700;
    color: #666;
    text-align: center;
}

.leaderboard-item.top-three .rank {
    color: #bc1e2c;
    font-size: 1.5rem;
}

.leaderboard-item .player-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.leaderboard-item .player-elo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #bc1e2c;
}

.leaderboard .loading,
.leaderboard .no-data,
.leaderboard .error {
    text-align: center;
    color: #999;
    padding: 2rem;
}

/* Authentication Screens */
.form-container {
    max-width: 400px;
    margin: 2rem auto 0;
}

.input-field {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #eee;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: #bc1e2c;
}

.input-field::placeholder {
    color: #999;
}

.error-message {
    color: #f44336;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.email-display {
    font-weight: 600;
    color: #bc1e2c;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.link-btn {
    background: none;
    border: none;
    color: #666;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0;
    transition: color 0.2s ease;
}

.link-btn:hover {
    color: #bc1e2c;
}

.input-hint {
    font-size: 0.85rem;
    color: #999;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

/* Answers Recap */
.recap-container {
    margin: 3rem 0 2rem;
}

.recap-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
}

.answers-recap {
    max-width: 600px;
    margin: 0 auto;
}

.recap-item {
    background-color: #fafafa;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.recap-item.correct {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #fff 0%, #f0fdf4 100%);
}

.recap-item.incorrect {
    border-color: #f44336;
    background: linear-gradient(135deg, #fff 0%, #fef2f2 100%);
}

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

.recap-number {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.recap-result {
    font-size: 1.5rem;
    font-weight: 700;
}

.recap-item.correct .recap-result {
    color: #4CAF50;
}

.recap-item.incorrect .recap-result {
    color: #f44336;
}

.recap-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.recap-answers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recap-option {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    background-color: #ffffff;
    border: 1px solid #eee;
    font-size: 0.95rem;
    color: #666;
}

.recap-option.correct-answer {
    background-color: #4CAF50;
    color: #ffffff;
    border-color: #4CAF50;
    font-weight: 600;
}

.recap-option.wrong-answer {
    background-color: #f44336;
    color: #ffffff;
    border-color: #f44336;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
    .logo {
        max-width: 160px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .score {
        font-size: 3rem;
    }

    .cta-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }

    .form-container {
        max-width: 100%;
    }
}
