
/* ========================================
   1. GLOBAL SETTINGS
======================================== */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

body {
    background: #10052b;
}

#gameApp {
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ========================================
   2. SCREEN NAVIGATION
======================================== */

.screen {
    display: none;
    width: 100%;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.screen.active {
    display: flex;
}

/* ========================================
   3. WELCOME SCREEN
======================================== */

#introScreen {
    position: relative;
    justify-content: center;
    align-items: center;
    padding: 0;
    background: #0647bd;
}

#introScreen.active {
    display: flex;
}

.welcome-container {
    position: relative;
    width: min(100vw, 150vh);
    aspect-ratio: 3 / 2;
    flex-shrink: 0;
    margin: auto;
}

.welcome-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Play button */

.play-image-button {
    position: absolute;
    left: 50%;
    bottom: 12%;
    transform: translateX(-50%);
    width: clamp(65px, 8vw, 110px);
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 10;
}

.play-image-button img {
    display: block;
    width: 100%;
    height: auto;
}

.play-image-button:hover {
    filter: brightness(1.15);
}

.play-image-button:active {
    transform: translateX(-50%) scale(0.95);
}

/* ========================================
   4. LEVEL 1 INTRO SCREEN
======================================== */

#levelIntroScreen {
    position: relative;
    justify-content: center;
    align-items: center;
    background: #10052b;
}

.full-screen-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
}

/* Level 1 image button */

.image-play-button {
    position: absolute;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.image-play-button img {
    display: block;
    width: 280px;
    max-width: 80vw;
    height: auto;
}

/* ========================================
   5. LEVEL INTRO / COMPLETE / FINAL SCREENS
======================================== */

.themed-screen {
    min-height: 0;
    padding: 25px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at center, #39206b, #10052b);
}

.themed-screen.active {
    display: flex;
}

.instruction-window {
    width: 100%;
    max-width: 700px;
    max-height: 95vh;
    overflow: hidden;
    border: 3px solid #a65cff;
    border-radius: 15px;
    background: #1b0c37;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.window-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #35205d;
    border-bottom: 2px solid #7045a8;
    color: #00e5ff;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

.instruction-content {
    padding: 40px 30px;
    text-align: center;
}

.eyebrow {
    color: #ff43d0;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 3px;
    margin: 0 0 20px;
}

.instruction-content h1 {
    color: #00e5ff;
    font-size: clamp(28px, 5vw, 45px);
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 4px 4px 0 #531b91;
    margin: 0 0 25px;
}

.intro-copy {
    color: #d9c8ff;
    font-size: 18px;
    line-height: 1.6;
    max-width: 450px;
    margin: 20px auto 30px;
    text-align: center;
}

/* ========================================
   6. PIXEL BUTTONS
======================================== */

.pixel-button {
    border: none;
    border-radius: 8px;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1px;
    color: white;
    cursor: pointer;
    transition: 0.2s ease;
}

.primary-button {
    background: linear-gradient(135deg, #9b42ff, #e03bc8);
    box-shadow: 0 5px 0 #531b91;
}

.pixel-button:hover:not(:disabled) {
    filter: brightness(1.2);
    transform: translateY(-3px);
}

.pixel-button:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #531b91;
}

.pixel-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ========================================
   7. QUESTION SCREEN
======================================== */

#questionScreen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100vh;
    padding: 18px 5%;
    background:
        radial-gradient(circle at top, #382064 0%, #190b37 50%, #0b041c 100%);
}

#questionScreen.active {
    display: flex;
}

/* Top navigation */

.game-topbar {
    width: 100%;
    max-width: 1150px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.brand-mark {
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #00e5ff;
}

#levelLabel {
    font-size: 15px;
    font-weight: bold;
    color: #d9c8ff;
    letter-spacing: 1px;
}

.quit-button {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border: 2px solid #a65cff;
    border-radius: 8px;
    background: #281347;
    color: white;
    font-size: 25px;
    cursor: pointer;
}

/* Question number and score */

.question-meta {
    width: 100%;
    max-width: 1150px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: white;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Progress bar */

.progress-track {
    width: 100%;
    max-width: 1150px;
    height: 12px;
    flex-shrink: 0;
    background: #38265c;
    border: 1px solid #9b61e8;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00e5ff, #ff43d0);
    transition: width 0.4s ease;
}

/* Question heading */

.question-title {
    width: 100%;
    max-width: 1000px;
    text-align: center;
    font-size: 26px;
    line-height: 1.3;
    color: white;
    margin: 0 0 8px;
}

.question-instruction {
    text-align: center;
    font-size: 15px;
    color: #c9b9ed;
    margin: 0 0 15px;
}

/* ========================================
   8. QUESTION IMAGE
======================================== */

.visual-question {
    position: relative;
    width: 100%;
    max-width: 1000px;
    max-height: 55vh;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.visual-question img {
    display: block;
    max-width: 100%;
    max-height: 55vh;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: auto;
}

/* ========================================
   9. CLICKABLE IMAGE ANSWERS
======================================== */

.answer-hotspot {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    z-index: 5;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.answer-hotspot.answer-a {
    left: 0;
}

.answer-hotspot.answer-b {
    right: 0;
}

.answer-hotspot:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 25px rgba(255, 255, 255, 0.08);
}

.answer-hotspot.correct {
    background: rgba(64, 255, 145, 0.18);
    box-shadow: inset 0 0 25px rgba(64, 255, 145, 0.2);
    border: 2px solid rgba(64, 255, 145, 0.75);
}

.answer-hotspot.wrong {
    background: rgba(255, 71, 126, 0.18);
    box-shadow: inset 0 0 25px rgba(255, 71, 126, 0.2);
    border: 2px solid rgba(255, 71, 126, 0.75);
}

.answer-hotspot:disabled {
    cursor: default;
}

/* ========================================
   10. FEEDBACK
======================================== */

.feedback-box {
    width: 100%;
    max-width: 800px;
    padding: 12px 20px;
    margin: 12px auto;
    border-radius: 10px;
    text-align: center;
    font-size: 17px;
    font-weight: 900;
}

.feedback-box[hidden] {
    display: none;
}

.feedback-box.correct {
    color: #40ff91;
    background: rgba(64, 255, 145, 0.12);
    border: 2px solid #40ff91;
}

.feedback-box.incorrect {
    color: #ff8cac;
    background: rgba(255, 71, 126, 0.12);
    border: 2px solid #ff477e;
}

/* ========================================
   11. QUESTION ACTIONS
======================================== */

.question-actions {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 12px;
}

.keyboard-hint {
    color: #b6a4d7;
    font-size: 12px;
    letter-spacing: 2px;
}

/* ========================================
   12. LEVEL COMPLETE SCREEN
======================================== */

#levelCompleteScreen {
    text-align: center;
}

#levelCompleteTitle {
    color: #00e5ff;
    font-size: clamp(28px, 5vw, 40px);
    margin: 0 0 25px;
}

.big-score {
    color: #ff43d0;
    font-size: 55px;
    font-weight: 900;
    margin: 20px 0;
}

/* ========================================
   13. FINAL RESULTS SCREEN
======================================== */

#finalScreen {
    text-align: center;
}

#finalScreen h1 {
    color: #00e5ff;
    font-size: clamp(28px, 5vw, 40px);
    margin: 0 0 25px;
}

.final-score {
    color: #ff43d0;
    font-size: 65px;
    font-weight: 900;
    margin: 20px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.stats-grid div {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 10px;
    border: 2px solid #7045a8;
    border-radius: 10px;
    background: #241344;
}

.stats-grid strong {
    font-size: 28px;
    color: #00e5ff;
}

.stats-grid span {
    font-size: 11px;
    color: #c9b9ed;
    letter-spacing: 1px;
}



   /* DESKTOP - 1025px and above */


@media screen and (min-width: 1025px) {

    .welcome-container {
        width: min(100vw, 150vh);
    }

    .instruction-window {
        max-width: 700px;
    }

    #questionScreen {
        padding: 18px 5%;
    }

    .visual-question {
        max-width: 1000px;
        max-height: 55vh;
    }

    .visual-question img {
        max-height: 55vh;
    }

}


 /* TABLET - 768px to 1024px */


@media screen and (min-width: 768px) and (max-width: 1024px) {

    .welcome-container {
        width: 100vw;
        max-width: 100%;
    }

    .play-image-button {
        width: 95px;
        bottom: 12%;
    }

    .themed-screen {
        padding: 25px;
    }

    .instruction-window {
        width: 90%;
        max-width: 650px;
    }

    .instruction-content {
        padding: 35px 25px;
    }

    .instruction-content h1 {
        font-size: 36px;
    }

    .intro-copy {
        font-size: 17px;
    }

    #questionScreen {
        height: 100vh;
        padding: 18px 4%;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .game-topbar,
    .question-meta,
    .progress-track,
    .question-title,
    .question-actions {
        width: 100%;
    }

    .brand-mark {
        font-size: 15px;
    }

    .question-title {
        font-size: 23px;
    }

    .visual-question {
        max-width: 100%;
        max-height: 48vh;
    }

    .visual-question img {
        max-width: 100%;
        max-height: 48vh;
    }

    .question-actions {
        gap: 15px;
    }

    .pixel-button {
        padding: 12px 24px;
        font-size: 15px;
    }

    .stats-grid {
        gap: 10px;
    }

}

/* MOBILE - 767px and below */


@media screen and (max-width: 767px) {

    html,
    body {
        width: 100%;
        min-height: 100%;
        overflow-x: hidden;
    }

    #gameApp {
        width: 100%;
        min-height: 100dvh;
        height: auto;
        overflow: visible;
    }

    .screen {
        width: 100%;
        min-height: 100dvh;
        height: auto;
        overflow: visible;
    }

    /* WELCOME SCREEN */

    #introScreen {
        min-height: 100dvh;
        padding: 0;
        overflow: hidden;
    }

    .welcome-container {
        width: 100vw;
        max-width: 100%;
        aspect-ratio: 3 / 2;
    }

    .welcome-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .play-image-button {
        width: 75px;
        bottom: 12%;
    }


    /* LEVEL INTRO SCREENS */

    #levelIntroScreen,
    #level2IntroScreen,
    #level3IntroScreen {
        min-height: 100dvh;
        padding: 20px 15px;
        justify-content: center;
    }

    .instruction-window {
        width: 100%;
        max-width: 450px;
        max-height: none;
    }

    .window-bar {
        padding: 12px 14px;
        font-size: 11px;
    }

    .instruction-content {
        padding: 30px 18px;
    }

    .eyebrow {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .instruction-content h1 {
        font-size: clamp(24px, 7vw, 32px);
        letter-spacing: 1px;
        margin-bottom: 18px;
    }

    .intro-copy {
        font-size: 15px;
        line-height: 1.5;
        margin: 15px auto 25px;
    }

    .pixel-button {
        max-width: 100%;
        padding: 12px 18px;
        font-size: 13px;
    }


    /* QUESTION SCREEN */

    #questionScreen {
        width: 100%;
        min-height: 100dvh;
        height: auto;
        padding: 15px 12px 25px;
        overflow-x: hidden;
        overflow-y: auto;
        justify-content: flex-start;
    }

    .game-topbar {
        gap: 8px;
        margin-bottom: 15px;
    }

    .brand-mark {
        font-size: 11px;
        letter-spacing: 1px;
    }

    #levelLabel {
        font-size: 10px;
        letter-spacing: 0;
        text-align: center;
    }

    .quit-button {
        width: 32px;
        height: 32px;
        font-size: 21px;
    }


    /* QUESTION NUMBER AND SCORE */

    .question-meta {
        font-size: 11px;
        letter-spacing: 0;
        gap: 8px;
        margin-bottom: 10px;
    }

    .progress-track {
        height: 9px;
        margin-bottom: 15px;
    }


    /* QUESTION TEXT */

    .question-title {
        font-size: clamp(17px, 5vw, 22px);
        line-height: 1.35;
        margin-bottom: 8px;
    }

    .question-instruction {
        font-size: 12px;
        margin-bottom: 12px;
    }


    /* QUESTION IMAGE */

    .visual-question {
        width: 100%;
        max-width: 100%;
        max-height: none;
        flex-shrink: 0;
        margin: 5px auto;
    }

    .visual-question img {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: none;
        object-fit: contain;
    }


    /* ANSWER HOTSPOTS */

    .answer-hotspot {
        width: 50%;
        height: 100%;
    }


    /* FEEDBACK */

    .feedback-box {
        width: 100%;
        padding: 10px;
        margin: 10px auto;
        font-size: 13px;
    }


    /* QUESTION ACTIONS */

    .question-actions {
        width: 100%;
        gap: 10px;
        margin-top: 15px;
        flex-wrap: wrap;
    }

    .question-actions .pixel-button {
        padding: 11px 14px;
        font-size: 12px;
    }

    .keyboard-hint {
        font-size: 9px;
        letter-spacing: 1px;
    }


    /* RESULTS SCREENS */

    .themed-screen {
        padding: 15px;
    }

    #levelCompleteTitle,
    #finalScreen h1 {
        font-size: 27px;
    }

    .big-score {
        font-size: 42px;
    }

    .final-score {
        font-size: 48px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 18px 0;
    }

    .stats-grid div {
        padding: 15px;
        gap: 6px;
    }

    .stats-grid strong {
        font-size: 23px;
    }

    .stats-grid span {
        font-size: 10px;
    }

}



   /* SMALL MOBILE - 480px and below */


@media screen and (max-width: 480px) {

    .play-image-button {
        width: 65px;
    }

    .instruction-content {
        padding: 25px 14px;
    }

    .instruction-content h1 {
        font-size: 23px;
    }

    .game-topbar {
        gap: 5px;
    }

    .brand-mark {
        font-size: 9px;
    }

    #levelLabel {
        font-size: 9px;
    }

    .question-title {
        font-size: 18px;
    }

    .question-actions {
        justify-content: center;
    }

}