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

body {
    font-family: 'Baloo 2', cursive, sans-serif;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    min-height: 100vh;
    color: white;
}

h1, h2, h3 {
    font-family: 'Fredoka', sans-serif;
}

.back-link {
    position: fixed;
    top: 16px;
    left: 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 1rem;
    z-index: 100;
}

.back-link:hover { color: white; }

.page {
    max-width: 700px;
    margin: 0 auto;
    padding: 50px 20px 60px;
}

.screen { display: none; }
.screen.active { display: block; }

/* Name Input */
.name-input-area {
    text-align: center;
    margin-bottom: 28px;
}

.name-input-area label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 6px;
}

.name-input-area input {
    padding: 10px 20px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.12);
    color: white;
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.1rem;
    text-align: center;
    width: 220px;
    outline: none;
}

.name-input-area input::placeholder { color: rgba(255,255,255,0.4); }
.name-input-area input:focus { border-color: rgba(255,255,255,0.6); }

/* Select Screen */
#select-screen { text-align: center; }

#select-screen h1 {
    font-size: 2.5rem;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 24px;
}

.sport-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.sport-card {
    background: rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.15);
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.sport-card:hover {
    transform: translateY(-6px);
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

.sport-icon {
    font-size: 2.8rem;
    display: block;
    margin-bottom: 6px;
}

.sport-card h3 { font-size: 1.2rem; margin-bottom: 2px; }
.sport-card p { opacity: 0.6; font-size: 0.85rem; }

.sport-card.cricket:hover { border-color: #00b894; }
.sport-card.football:hover { border-color: #fdcb6e; }
.sport-card.badminton:hover { border-color: #fd79a8; }
.sport-card.olympics:hover { border-color: #74b9ff; }
.sport-card.tennis:hover { border-color: #a3cb38; }
.sport-card.general:hover { border-color: #e17055; }

/* How it works */
.how-it-works {
    background: rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.how-it-works h3 { font-size: 1rem; margin-bottom: 6px; opacity: 0.7; }
.how-it-works p { font-size: 0.95rem; opacity: 0.8; margin-bottom: 12px; }

.difficulty-badges { display: flex; align-items: center; justify-content: center; gap: 8px; }

.diff-badge {
    padding: 4px 14px;
    border-radius: 20px;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
}

.diff-badge.easy { background: #00b894; color: #1a1a2e; }
.diff-badge.medium { background: #fdcb6e; color: #1a1a2e; }
.diff-badge.hard { background: #d63031; color: white; }
.diff-arrow { opacity: 0.4; }

/* Quiz Header */
.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
    flex-wrap: wrap;
}

.quiz-sport {
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    background: rgba(255,255,255,0.15);
    padding: 5px 14px;
    border-radius: 20px;
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.progress-bar {
    width: 100px;
    height: 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #55efc4;
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 10%;
}

.quiz-score {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.95rem;
    background: rgba(255,255,255,0.15);
    padding: 5px 14px;
    border-radius: 20px;
}

/* Difficulty Indicator */
.difficulty-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.diff-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all 0.3s;
}

.diff-dot.active[data-level="easy"] { background: #00b894; box-shadow: 0 0 10px #00b894; }
.diff-dot.active[data-level="medium"] { background: #fdcb6e; box-shadow: 0 0 10px #fdcb6e; }
.diff-dot.active[data-level="hard"] { background: #d63031; box-shadow: 0 0 10px #d63031; }

.diff-label {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 12px;
    border-radius: 12px;
    transition: all 0.3s;
}

.diff-label.easy { background: #00b894; color: #1a1a2e; }
.diff-label.medium { background: #fdcb6e; color: #1a1a2e; }
.diff-label.hard { background: #d63031; color: white; }

/* Question Card */
.question-card {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 28px 24px;
    border: 2px solid rgba(255,255,255,0.12);
}

.question-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    margin-bottom: 8px;
}

.question-card h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

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

.option-btn {
    font-family: 'Baloo 2', sans-serif;
    font-size: 1rem;
    padding: 12px 18px;
    border-radius: 14px;
    border: 2px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: white;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-btn:hover:not(.disabled) {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.4);
}

.option-btn .option-letter {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
}

.option-btn.correct {
    background: rgba(0, 184, 148, 0.3);
    border-color: #00b894;
}

.option-btn.correct .option-letter { background: #00b894; }

.option-btn.wrong {
    background: rgba(214, 48, 49, 0.3);
    border-color: #d63031;
}

.option-btn.wrong .option-letter { background: #d63031; }
.option-btn.disabled { cursor: default; opacity: 0.5; }

/* Explanation Card */
.explanation-card {
    display: none;
    margin-top: 16px;
    border-radius: 16px;
    padding: 20px;
    animation: slideUp 0.3s ease;
}

.explanation-card.show { display: block; }

.explanation-card.correct-exp {
    background: rgba(0, 184, 148, 0.15);
    border: 2px solid rgba(0, 184, 148, 0.3);
}

.explanation-card.wrong-exp {
    background: rgba(214, 48, 49, 0.15);
    border: 2px solid rgba(214, 48, 49, 0.3);
}

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

.explanation-header {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.explanation-text {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 12px;
}

.learning-fact {
    display: none;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-bottom: 14px;
    border-left: 3px solid #fdcb6e;
}

.learning-fact.show { display: block; }

.btn-next {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    width: 100%;
}

.btn-next:hover { background: rgba(255,255,255,0.3); }

/* Results */
.results-card {
    text-align: center;
    background: rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 36px 24px;
    border: 2px solid rgba(255,255,255,0.15);
    margin-top: 30px;
}

.results-emoji { font-size: 3.5rem; margin-bottom: 6px; }

.results-card h2 { font-size: 1.6rem; margin-bottom: 12px; }

.results-score { margin-bottom: 12px; }

.big-score {
    font-family: 'Fredoka', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: #ffeaa7;
}

.out-of {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    opacity: 0.5;
}

.results-card > p { font-size: 1.05rem; opacity: 0.8; margin-bottom: 20px; }

.difficulty-summary {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.diff-stat {
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 8px 16px;
    text-align: center;
}

.diff-stat .diff-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.6;
    letter-spacing: 0.5px;
}

.diff-stat .diff-stat-value {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
}

.results-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn:hover { transform: scale(1.05); }
.btn:active { transform: scale(0.98); }

.btn-retry {
    background: linear-gradient(135deg, #00b894, #55efc4);
    color: #2d3436;
}

.btn-home {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
}

/* Certificate */
.certificate {
    margin-top: 20px;
    perspective: 1000px;
}

.cert-border {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e, #f9ca24, #ffeaa7);
    border-radius: 20px;
    padding: 6px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.cert-inner {
    background: linear-gradient(180deg, #fffef5, #fff8e1);
    border-radius: 16px;
    padding: 36px 28px;
    text-align: center;
    color: #2d3436;
}

.cert-trophy { font-size: 3.5rem; margin-bottom: 4px; }

.cert-title {
    font-size: 1.8rem;
    color: #b8860b;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cert-line {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #b8860b, transparent);
    margin: 12px auto;
}

.cert-presented {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-bottom: 4px;
}

.cert-name {
    font-size: 2.2rem;
    color: #6c5ce7;
    margin-bottom: 8px;
}

.cert-desc { font-size: 0.95rem; opacity: 0.7; margin-bottom: 2px; }

.cert-sport {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #b8860b;
    margin-bottom: 16px;
}

.cert-details {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 16px;
}

.cert-detail {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

.cert-detail span:first-child {
    opacity: 0.5;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
}

.cert-detail span:last-child {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
}

.cert-stars { font-size: 1.5rem; margin-bottom: 12px; }

.cert-footer {
    font-size: 0.8rem;
    opacity: 0.4;
    font-style: italic;
}

.cert-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 500px) {
    #select-screen h1 { font-size: 2rem; }
    .sport-cards { grid-template-columns: repeat(2, 1fr); }
    .question-card h2 { font-size: 1.1rem; }
    .quiz-header { justify-content: center; }
    .cert-name { font-size: 1.6rem; }
    .cert-title { font-size: 1.4rem; }
}
