/* =========================================================
   SHARP YOUR MIND GAME
   JOYFUL • COLORFUL • RESPONSIVE • CLASS 5–12
========================================================= */


/* =========================================================
   1. GLOBAL RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --secondary: #7c3aed;
    --blue: #2563eb;
    --cyan: #06b6d4;
    --green: #10b981;
    --orange: #f59e0b;
    --pink: #ec4899;
    --red: #ef4444;
    --background: #f3f6ff;
    --surface: #ffffff;
    --surface-light: #f8faff;
    --text: #1e293b;
    --text-light: #64748b;
    --text-white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 12px 35px rgba(79, 70, 229, 0.12);
    --shadow-hover: 0 18px 40px rgba(79, 70, 229, 0.20);
    --radius-small: 10px;
    --radius-medium: 16px;
    --radius-large: 24px;
    --transition: all 0.25s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 10%, rgba(129, 140, 248, 0.25), transparent 30%),
        radial-gradient(circle at 90% 20%, rgba(251, 191, 36, 0.18), transparent 30%),
        linear-gradient(135deg, #eef2ff, #fdf4ff, #ecfeff);
    padding: 25px 15px;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

button:disabled,
select:disabled {
    cursor: not-allowed;
}


/* =========================================================
   2. MAIN APP CONTAINER
========================================================= */

.app {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    position: relative;
}


/* =========================================================
   3. SCREEN SYSTEM
========================================================= */

.screen {
    display: none;
    width: 100%;
    background: var(--surface);
    border-radius: var(--radius-large);
    padding: clamp(20px, 4vw, 42px);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: screenEnter 0.45s ease both;
}

.screen--active {
    display: block;
}

@keyframes screenEnter {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   4. SETUP HEADER
========================================================= */

.setup-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-title {
    font-size: clamp(1.65rem, 4vw, 2.5rem);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.8px;
    background: linear-gradient(90deg, #4f46e5, #9333ea, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-title::before {
    content: "🚀 ";
}

.game-subtitle {
    margin-top: 12px;
    color: var(--text-light);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 600;
    letter-spacing: 2px;
}


/* =========================================================
   5. SETUP FORM
========================================================= */

#setup-form {
    display: flex;
    flex-direction: column;
    gap: 19px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.form-group label::first-letter {
    color: var(--primary);
}


/* =========================================================
   6. INPUT AND SELECT
========================================================= */

.form-group input,
.form-group select {
    width: 100%;
    min-height: 52px;
    padding: 13px 16px;
    border-radius: var(--radius-small);
    border: 2px solid var(--border);
    background: var(--surface-light);
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
    transform: translateY(-1px);
}

.form-group select {
    appearance: auto;
}

.form-group select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
}

.form-group select:not(:disabled) {
    border-color: #c7d2fe;
    background: #f8faff;
}


/* =========================================================
   7. BUTTON SYSTEM
========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 22px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-white);
    background: #64748b;
    transition: var(--transition);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}

.btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 7px 0 rgba(0, 0, 0, 0.12);
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

.btn:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 3px;
}

.btn--primary {
    width: 100%;
    margin-top: 8px;
    min-height: 58px;
    font-size: 1.05rem;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow:
        0 5px 0 #3730a3,
        0 10px 25px rgba(79, 70, 229, 0.20);
}

.btn--primary::before {
    content: "🎮 ";
}

.btn--primary:hover:not(:disabled) {
    box-shadow:
        0 7px 0 #3730a3,
        0 14px 30px rgba(79, 70, 229, 0.25);
}

.btn--primary:disabled {
    opacity: 0.5;
    background: #cbd5e1;
    color: #64748b;
    box-shadow: none;
}

.btn--accent {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    box-shadow: 0 4px 0 #c2410c;
}

.btn--accent:hover:not(:disabled) {
    background: linear-gradient(135deg, #fbbf24, #fb923c);
}


/* =========================================================
   8. SETUP NOTE
========================================================= */

.note {
    margin-top: 28px;
    padding: 16px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eff6ff, #f5f3ff);
    border-left: 5px solid var(--primary);
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.7;
}

.note strong {
    color: var(--primary-dark);
}


/* =========================================================
   8A. DEVELOPER CREDIT
========================================================= */

.developer-credit {
    position: relative;
    margin-top: 24px;
    padding: 12px 18px;
    text-align: center;

    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 1px;

    color: #64748b;

    background:
        linear-gradient(
            135deg,
            rgba(238, 242, 255, 0.75),
            rgba(245, 243, 255, 0.75),
            rgba(236, 254, 255, 0.75)
        );

    border: 1px solid #e0e7ff;
    border-radius: 14px;

    box-shadow:
        0 6px 18px rgba(79, 70, 229, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);

    overflow: hidden;
}

/* Small decorative line */
.developer-credit::before {
    content: "";
    position: absolute;

    left: 15%;
    right: 15%;
    top: 0;

    height: 2px;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            transparent,
            #6366f1,
            #a855f7,
            #ec4899,
            transparent
        );

    opacity: 0.8;
}

/* "Developed By" */
.developer-credit {
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.developer-credit:hover {
    transform: translateY(-2px);

    box-shadow:
        0 10px 25px rgba(79, 70, 229, 0.13),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* Developer name */
.developer-credit strong {
    display: inline-block;

    margin-left: 5px;

    font-size: 0.9rem;
    font-weight: 850;
    letter-spacing: 0.7px;

    background:
        linear-gradient(
            90deg,
            #4f46e5,
            #7c3aed,
            #db2777
        );

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    transition: transform 0.25s ease;
}

.developer-credit:hover strong {
    transform: scale(1.04);
}


/* =========================================================
   DEVELOPER CREDIT — MOBILE
========================================================= */

@media (max-width: 420px) {

    .developer-credit {
        margin-top: 20px;
        padding: 11px 14px;

        font-size: 0.76rem;
        letter-spacing: 0.7px;
    }

    .developer-credit strong {
        font-size: 0.84rem;
    }
}




/* =========================================================
   9. GAME SCREEN
========================================================= */

#game-screen {
    position: relative;
    padding-top: clamp(65px, 8vw, 82px);
}


/* =========================================================
   10. FULLSCREEN BUTTON
========================================================= */

.fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 9px 14px;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.82rem;
    font-weight: 700;
    transition: var(--transition);
}

.fullscreen-btn:hover {
    background: #e0e7ff;
    transform: translateY(-2px);
}


/* =========================================================
   11. STATUS BAR
========================================================= */

.status-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 13px 7px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.status-label {
    color: var(--text-light);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.status-value {
    width: 100%;
    color: var(--primary-dark);
    font-size: clamp(0.9rem, 2.5vw, 1.15rem);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.status-item:nth-child(1) {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.status-item:nth-child(2) {
    background: #ecfeff;
    border-color: #a5f3fc;
}

.status-item:nth-child(3) {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.status-item:nth-child(4) {
    background: #fff1f2;
    border-color: #fecdd3;
}

.status-item:nth-child(5) {
    background: #fffbeb;
    border-color: #fde68a;
}


/* =========================================================
   12. TIMER
========================================================= */

.timer-track {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 100px;
    background: #e2e8f0;
    margin-bottom: 25px;
}

.timer-fill {
    height: 100%;
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #10b981, #facc15, #f97316);
    transition: width 0.3s linear;
}


/* =========================================================
   13. QUESTION CARD
========================================================= */

.question-card {
    min-height: 145px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 5vw, 35px);
    border-radius: 20px;
    border: 2px solid #c7d2fe;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    color: #312e81;
    text-align: center;
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    line-height: 1.6;
    font-weight: 750;
    overflow-wrap: anywhere;
    margin-bottom: 22px;
    position: relative;
}

.question-card::before {
    content: "💡";
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fef3c7;
    border: 3px solid #ffffff;
    font-size: 1.3rem;
}


/* =========================================================
   14. MCQ OPTIONS — A, B, C, D
========================================================= */

.options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 18px;
}

.option {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 12px 16px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-left: 5px solid #6366f1;
    border-radius: 14px;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.option-number {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.45;
    word-break: break-word;
}

/* A / B / C / D color coding */
.option:nth-child(1) {
    border-left-color: #6366f1;
}

.option:nth-child(2) {
    border-left-color: #06b6d4;
}

.option:nth-child(3) {
    border-left-color: #10b981;
}

.option:nth-child(4) {
    border-left-color: #f59e0b;
}

.option:nth-child(1) .option-number {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.option:nth-child(2) .option-number {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.option:nth-child(3) .option-number {
    background: linear-gradient(135deg, #10b981, #059669);
}

.option:nth-child(4) .option-number {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}


/* =========================================================
   15. CORRECT / WRONG ANSWER STATES
========================================================= */

.option.correct {
    background: #ecfdf5;
    border-color: #10b981;
    border-left-color: #059669;
    box-shadow:
        0 0 0 3px rgba(16, 185, 129, 0.10),
        0 6px 18px rgba(16, 185, 129, 0.15);
    animation: correctPulse 1s ease-out 2;
}

.option.correct .option-number {
    background: linear-gradient(135deg, #10b981, #059669);
}

.option.correct .option-text {
    color: #047857;
}

.option.incorrect {
    background: #fef2f2;
    border-color: #ef4444;
    border-left-color: #dc2626;
    box-shadow:
        0 0 0 3px rgba(239, 68, 68, 0.10),
        0 6px 18px rgba(239, 68, 68, 0.15);
    animation: incorrectPulse 1s ease-out 2;
}

.option.incorrect .option-number {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.option.incorrect .option-text {
    color: #b91c1c;
}

.option.disabled {
    pointer-events: none;
    cursor: default;
}

.option.correct.disabled {
    background: #ecfdf5;
}

.option.incorrect.disabled {
    background: #fef2f2;
}

@keyframes correctPulse {
    0% {
        box-shadow:
            0 0 0 0 rgba(16, 185, 129, 0.55),
            0 6px 18px rgba(16, 185, 129, 0.18);
    }

    50% {
        box-shadow:
            0 0 0 12px rgba(16, 185, 129, 0),
            0 6px 22px rgba(16, 185, 129, 0.40);
    }

    100% {
        box-shadow:
            0 0 0 0 rgba(16, 185, 129, 0.55),
            0 6px 18px rgba(16, 185, 129, 0.18);
    }
}

@keyframes incorrectPulse {
    0% {
        box-shadow:
            0 0 0 0 rgba(239, 68, 68, 0.55),
            0 6px 18px rgba(239, 68, 68, 0.18);
    }

    50% {
        box-shadow:
            0 0 0 12px rgba(239, 68, 68, 0),
            0 6px 22px rgba(239, 68, 68, 0.40);
    }

    100% {
        box-shadow:
            0 0 0 0 rgba(239, 68, 68, 0.55),
            0 6px 18px rgba(239, 68, 68, 0.18);
    }
}


/* =========================================================
   16. ANSWER BLOCK
========================================================= */

.answer-block {
    margin-top: 20px;
    padding: 20px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.answer-block label {
    display: block;
    margin-bottom: 10px;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 750;
}

.answer-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

#answer-input {
    flex: 1;
    min-width: 0;
    min-height: 52px;
    padding: 13px 16px;
    border-radius: 12px;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

#answer-input::placeholder {
    color: #94a3b8;
}

#answer-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}

/* ---- INPUT GLOW (correct / wrong) ---- */
#answer-input.is-correct {
    background: #ecfdf5 !important;
    border: 2px solid #10b981 !important;
    color: #047857 !important;
    font-weight: 800;
    letter-spacing: 0.3px;
    box-shadow:
        0 0 0 4px rgba(16, 185, 129, 0.25),
        0 0 25px 4px rgba(16, 185, 129, 0.55),
        inset 0 0 12px rgba(16, 185, 129, 0.10) !important;
    animation: inputCorrectGlow 1.2s ease-in-out infinite alternate;
}

#answer-input.is-incorrect {
    background: #fef2f2 !important;
    border: 2px solid #ef4444 !important;
    color: #b91c1c !important;
    font-weight: 800;
    letter-spacing: 0.3px;
    box-shadow:
        0 0 0 4px rgba(239, 68, 68, 0.25),
        0 0 25px 4px rgba(239, 68, 68, 0.60),
        inset 0 0 12px rgba(239, 68, 68, 0.12) !important;
    animation: inputIncorrectGlow 1.2s ease-in-out infinite alternate;
}

#answer-input.is-suggestion {
    font-style: italic;
    letter-spacing: 0.3px;
}

#answer-input:disabled {
    cursor: not-allowed;
    opacity: 1;
}

#answer-input.is-correct:disabled {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border-color: #10b981 !important;
}

#answer-input.is-incorrect:disabled {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border-color: #ef4444 !important;
}

@keyframes inputCorrectGlow {
    from {
        box-shadow:
            0 0 0 4px rgba(16, 185, 129, 0.20),
            0 0 18px 3px rgba(16, 185, 129, 0.45),
            inset 0 0 10px rgba(16, 185, 129, 0.10);
    }

    to {
        box-shadow:
            0 0 0 6px rgba(16, 185, 129, 0.30),
            0 0 32px 6px rgba(16, 185, 129, 0.75),
            inset 0 0 14px rgba(16, 185, 129, 0.18);
    }
}

@keyframes inputIncorrectGlow {
    from {
        box-shadow:
            0 0 0 4px rgba(239, 68, 68, 0.20),
            0 0 18px 3px rgba(239, 68, 68, 0.50),
            inset 0 0 10px rgba(239, 68, 68, 0.12);
    }

    to {
        box-shadow:
            0 0 0 6px rgba(239, 68, 68, 0.32),
            0 0 32px 6px rgba(239, 68, 68, 0.80),
            inset 0 0 14px rgba(239, 68, 68, 0.20);
    }
}

#submit-btn {
    min-width: 105px;
    border-radius: 12px;
    font-weight: 750;
}

#submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}


/* =========================================================
   17. GAME FOOTER
========================================================= */

.game-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.feedback {
    flex: 1;
    min-width: 160px;
    font-size: 0.95rem;
    font-weight: 750;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.feedback.is-good {
    color: #059669;
}

.feedback.is-bad {
    color: #dc2626;
}

#next-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 4px 0 #3730a3;
}

#next-btn:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}


/* =========================================================
   18. RESULT SCREEN — PREMIUM GAME COMPLETION
========================================================= */

#result-screen {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: clamp(18px, 4vw, 38px);
    background:
        radial-gradient(circle at 5% 5%, rgba(99, 102, 241, 0.22), transparent 28%),
        radial-gradient(circle at 95% 8%, rgba(236, 72, 153, 0.20), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(168, 85, 247, 0.16), transparent 35%),
        linear-gradient(145deg, #f8faff 0%, #ffffff 45%, #f8fafc 100%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 34px;
    box-shadow:
        0 30px 70px rgba(79, 70, 229, 0.15),
        0 10px 30px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
}

/* Decorative glow */
#result-screen::before {
    content: "✦";
    position: absolute;
    top: 18px;
    left: 25px;
    font-size: 2.4rem;
    color: #f59e0b;
    filter:
        drop-shadow(0 0 8px rgba(245, 158, 11, 0.65))
        drop-shadow(0 4px 12px rgba(245, 158, 11, 0.3));
    animation: resultSparkle 2.5s ease-in-out infinite;
    pointer-events: none;
}

/* Decorative sparkle */
#result-screen::after {
    content: "✦";
    position: absolute;
    right: 28px;
    bottom: 25px;
    font-size: 2.5rem;
    color: #a855f7;
    filter:
        drop-shadow(0 0 10px rgba(168, 85, 247, 0.6))
        drop-shadow(0 4px 12px rgba(168, 85, 247, 0.3));
    animation: resultSparkle 3s ease-in-out infinite reverse;
    pointer-events: none;
}

@keyframes resultSparkle {
    0%,
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.65;
    }

    50% {
        transform: scale(1.25) rotate(15deg);
        opacity: 1;
    }
}


/* =========================================================
   RESULT INNER BOX
========================================================= */

.result-box {
    position: relative;
    z-index: 1;
    padding: clamp(20px, 4vw, 34px);
    border-radius: 28px;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,0.94),
            rgba(248,250,252,0.82)
        );

    border: 1px solid rgba(255,255,255,0.95);

    box-shadow:
        0 20px 45px rgba(79,70,229,0.08),
        inset 0 1px 0 rgba(255,255,255,1);

    backdrop-filter: blur(16px);
}


/* =========================================================
   RESULT TITLE
========================================================= */

.result-title {
    position: relative;
    margin-bottom: 8px;

    font-size: clamp(2rem, 6vw, 3.1rem);
    font-weight: 950;
    letter-spacing: -1.8px;
    line-height: 1.05;

    background:
        linear-gradient(
            135deg,
            #4f46e5 0%,
            #7c3aed 38%,
            #db2777 72%,
            #f97316 100%
        );

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    filter:
        drop-shadow(0 5px 12px rgba(79,70,229,0.18));

    animation: resultTitleIn 0.8s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes resultTitleIn {
    0% {
        opacity: 0;
        transform: translateY(-18px) scale(0.92);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* =========================================================
   RESULT REASON / SUBTITLE
========================================================= */

.result-reason {
    margin-bottom: 26px;

    font-size: 1.05rem;
    font-weight: 650;
    color: #64748b;
    letter-spacing: 0.2px;

    animation: fadeUpResult 0.7s ease 0.15s both;
}

@keyframes fadeUpResult {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   PLAYER NAME
========================================================= */

.player-name {
    position: relative;
    display: inline-block;

    margin: 0 7px;

    font-size: clamp(1.65rem, 4.8vw, 2.35rem);
    font-weight: 950;
    letter-spacing: -0.7px;

    background:
        linear-gradient(
            135deg,
            #4f46e5,
            #7c3aed 45%,
            #db2777
        );

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    filter:
        drop-shadow(0 4px 10px rgba(79,70,229,0.25));

    animation:
        playerNamePop
        0.8s
        cubic-bezier(0.16,1,0.3,1)
        both;
}

.player-name::after {
    content: "";
    position: absolute;

    left: 3%;
    right: 3%;
    bottom: -6px;

    height: 4px;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            transparent,
            #7c3aed,
            #db2777,
            transparent
        );

    opacity: 0.7;

    box-shadow:
        0 2px 8px rgba(124,58,237,0.25);
}

@keyframes playerNamePop {
    0% {
        opacity: 0;
        transform: scale(0.65) translateY(-12px);
    }

    60% {
        transform: scale(1.08);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}


/* =========================================================
   19. RESULT STATS — 3 × 2 PREMIUM GRID
========================================================= */

.result-stats,
.result-stats--6 {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
    margin: 28px 0 24px !important;
}

.result-stats .stat-card,
.result-stats--6 .stat-card {
    position: relative;
    overflow: hidden;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;

    min-height: 115px;

    padding: 18px 10px !important;

    border-radius: 20px !important;

    background: rgba(255, 255, 255, 0.92);

    border: 1px solid rgba(255, 255, 255, 0.95);

    box-shadow:
        0 8px 22px rgba(15, 23, 42, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);

    transition:
        transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.3s ease;
}

.result-stats .stat-card:hover,
.result-stats--6 .stat-card:hover {
    transform: translateY(-7px) scale(1.025);
    box-shadow:
        0 18px 35px rgba(79, 70, 229, 0.14),
        0 5px 12px rgba(15, 23, 42, 0.06);
}

.result-stats .stat-card .num,
.result-stats--6 .stat-card .num {
    position: relative;
    z-index: 1;

    font-size: clamp(1.55rem, 4vw, 2.15rem) !important;
    font-weight: 950 !important;

    line-height: 1;

    margin-bottom: 9px;

    letter-spacing: -0.7px;
}

.result-stats .stat-card .lbl,
.result-stats--6 .stat-card .lbl {
    position: relative;
    z-index: 1;

    font-size: 0.68rem !important;
    font-weight: 850 !important;

    color: #64748b;

    text-transform: uppercase;

    letter-spacing: 1.3px;
}


/* ---------- Score ---------- */
.result-stats .stat-card--score,
.result-stats--6 .stat-card--score {
    background: linear-gradient(145deg, #eef2ff, #e0e7ff) !important;
    border-color: #c7d2fe !important;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.12) !important;
}

.result-stats .stat-card--score .num,
.result-stats--6 .stat-card--score .num {
    color: #4f46e5 !important;
}


/* ---------- Correct ---------- */
.result-stats .stat-card--correct,
.result-stats--6 .stat-card--correct {
    background: linear-gradient(145deg, #ecfdf5, #d1fae5) !important;
    border-color: #a7f3d0 !important;
}

.result-stats .stat-card--correct .num,
.result-stats--6 .stat-card--correct .num {
    color: #059669 !important;
}


/* ---------- Mistakes ---------- */
.result-stats .stat-card--mistakes,
.result-stats--6 .stat-card--mistakes {
    background: linear-gradient(145deg, #fff1f2, #ffe4e6) !important;
    border-color: #fecdd3 !important;
}

.result-stats .stat-card--mistakes .num,
.result-stats--6 .stat-card--mistakes .num {
    color: #e11d48 !important;
}


/* ---------- Percent ---------- */
.result-stats .stat-card--percent,
.result-stats--6 .stat-card--percent {
    background: linear-gradient(145deg, #eff6ff, #dbeafe) !important;
    border-color: #bfdbfe !important;
}

.result-stats .stat-card--percent .num,
.result-stats--6 .stat-card--percent .num {
    color: #2563eb !important;
}


/* ---------- GPA ---------- */
.result-stats .stat-card--gpa,
.result-stats--6 .stat-card--gpa {
    background: linear-gradient(145deg, #fffbeb, #fef3c7) !important;
    border-color: #fde68a !important;
}

.result-stats .stat-card--gpa .num,
.result-stats--6 .stat-card--gpa .num {
    color: #d97706 !important;
}


/* ---------- Grade ---------- */
.result-stats .stat-card--grade,
.result-stats--6 .stat-card--grade {
    background: linear-gradient(145deg, #f5f3ff, #ede9fe) !important;
    border-color: #ddd6fe !important;
}

.result-stats .stat-card--grade .num,
.result-stats--6 .stat-card--grade .num {
    color: #7c3aed !important;
}


/* =========================================================
   GRADE VARIANTS
========================================================= */

.result-stats .stat-card--grade-Aplus,
.result-stats .stat-card--grade-A,
.result-stats--6 .stat-card--grade-Aplus,
.result-stats--6 .stat-card--grade-A {
    background: linear-gradient(145deg, #ecfdf5, #d1fae5) !important;
    border-color: #6ee7b7 !important;
}

.result-stats .stat-card--grade-Aplus .num,
.result-stats .stat-card--grade-A .num,
.result-stats--6 .stat-card--grade-Aplus .num,
.result-stats--6 .stat-card--grade-A .num {
    color: #059669 !important;
}

.result-stats .stat-card--grade-Bplus,
.result-stats .stat-card--grade-B,
.result-stats--6 .stat-card--grade-Bplus,
.result-stats--6 .stat-card--grade-B {
    background: linear-gradient(145deg, #eff6ff, #dbeafe) !important;
    border-color: #93c5fd !important;
}

.result-stats .stat-card--grade-Bplus .num,
.result-stats .stat-card--grade-B .num,
.result-stats--6 .stat-card--grade-Bplus .num,
.result-stats--6 .stat-card--grade-B .num {
    color: #2563eb !important;
}

.result-stats .stat-card--grade-Cplus,
.result-stats .stat-card--grade-C,
.result-stats--6 .stat-card--grade-Cplus,
.result-stats--6 .stat-card--grade-C {
    background: linear-gradient(145deg, #fffbeb, #fef3c7) !important;
    border-color: #fcd34d !important;
}

.result-stats .stat-card--grade-Cplus .num,
.result-stats .stat-card--grade-C .num,
.result-stats--6 .stat-card--grade-Cplus .num,
.result-stats--6 .stat-card--grade-C .num {
    color: #d97706 !important;
}

.result-stats .stat-card--grade-D,
.result-stats--6 .stat-card--grade-D {
    background: linear-gradient(145deg, #fff7ed, #ffedd5) !important;
    border-color: #fdba74 !important;
}

.result-stats .stat-card--grade-D .num,
.result-stats--6 .stat-card--grade-D .num {
    color: #ea580c !important;
}

.result-stats .stat-card--grade-NG,
.result-stats--6 .stat-card--grade-NG {
    background: linear-gradient(145deg, #fef2f2, #fee2e2) !important;
    border-color: #fca5a5 !important;
}

.result-stats .stat-card--grade-NG .num,
.result-stats--6 .stat-card--grade-NG .num {
    color: #dc2626 !important;
}


/* =========================================================
   20. RESULT ACTION BUTTONS
   PLAY AGAIN + GO HOME
========================================================= */

.result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    margin-top: 24px;
}


/* =========================================================
   BOTH RESULT BUTTONS
========================================================= */

.result-actions button {
    position: relative;
    overflow: hidden;

    min-height: 60px;
    padding: 15px 22px;

    border: none;
    border-radius: 18px;

    color: #ffffff;

    font-size: 1rem;
    font-weight: 850;
    letter-spacing: 0.2px;

    cursor: pointer;

    isolation: isolate;

    transition:
        transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.25s ease,
        filter 0.25s ease;
}


/* =========================================================
   BUTTON TOP SHINE
========================================================= */

.result-actions button::after {
    content: "";

    position: absolute;
    top: 1px;
    left: 10%;
    right: 10%;

    height: 2px;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.55);

    pointer-events: none;
}


/* =========================================================
   MOVING LIGHT EFFECT
========================================================= */

.result-actions button::before {
    content: "";

    position: absolute;

    top: 0;
    left: -130%;

    width: 70%;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.38),
            transparent
        );

    transform: skewX(-22deg);

    transition: left 0.65s ease;

    pointer-events: none;

    z-index: 2;
}

.result-actions button:hover::before {
    left: 150%;
}


/* =========================================================
   PLAY AGAIN BUTTON
========================================================= */

.result-actions button:first-child {
    background:
        linear-gradient(
            135deg,
            #4f46e5 0%,
            #6366f1 42%,
            #7c3aed 100%
        );

    box-shadow:
        0 6px 0 #3730a3,
        0 12px 25px rgba(79, 70, 229, 0.25);
}

.result-actions button:first-child:hover {
    transform: translateY(-5px);

    background:
        linear-gradient(
            135deg,
            #6366f1 0%,
            #7c3aed 50%,
            #8b5cf6 100%
        );

    box-shadow:
        0 8px 0 #3730a3,
        0 20px 35px rgba(79, 70, 229, 0.34);

    filter: brightness(1.04);
}

.result-actions button:first-child:active {
    transform: translateY(3px);

    box-shadow:
        0 2px 0 #3730a3,
        0 7px 14px rgba(79, 70, 229, 0.20);
}


/* =========================================================
   GO HOME BUTTON
========================================================= */

.result-actions button:last-child {
    background:
        linear-gradient(
            135deg,
            #0891b2 0%,
            #06b6d4 45%,
            #2563eb 100%
        );

    box-shadow:
        0 6px 0 #0e7490,
        0 12px 25px rgba(6, 182, 212, 0.23);
}

.result-actions button:last-child:hover {
    transform: translateY(-5px);

    background:
        linear-gradient(
            135deg,
            #06b6d4 0%,
            #0ea5e9 50%,
            #2563eb 100%
        );

    box-shadow:
        0 8px 0 #0e7490,
        0 20px 35px rgba(6, 182, 212, 0.32);

    filter: brightness(1.04);
}

.result-actions button:last-child:active {
    transform: translateY(3px);

    box-shadow:
        0 2px 0 #0e7490,
        0 7px 14px rgba(6, 182, 212, 0.18);
}


/* =========================================================
   RESULT BUTTON FOCUS
========================================================= */

.result-actions button:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 4px;
}


/* =========================================================
   RESULT BUTTON DISABLED STATE
========================================================= */

.result-actions button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(0.25);
}


/* =========================================================
   MOBILE RESULT BUTTONS
========================================================= */

@media (max-width: 600px) {

    .result-actions {
        grid-template-columns: 1fr;
        gap: 13px;
        margin-top: 20px;
    }

    .result-actions button {
        width: 100%;
        min-height: 58px;
        border-radius: 16px;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    .result-actions {
        gap: 11px;
    }

    .result-actions button {
        min-height: 56px;
        padding: 13px 18px;
        font-size: 0.95rem;
    }
}