/* ==================================================
   RUDENS TAKELIS
   Pagrindinis stilius
================================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    font-family: Arial, Helvetica, sans-serif;
    color: #4a321f;

    background:
        linear-gradient(
            180deg,
            #fff8e9 0%,
            #f8e6c7 100%
        );
}


/* ==================================================
   PAGRINDINĖ ŽAIDIMO SRITIS
================================================== */

.game-container {
    width: min(1100px, 94%);
    margin: auto;
    padding: 20px 0;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}


/* ==================================================
   PRADŽIOS EKRANAS
================================================== */

.start-content {
    min-height: 620px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 45px;

    padding: 35px 45px;

    background: rgba(255, 253, 246, 0.94);

    border: 3px solid #d69a55;
    border-radius: 32px;

    box-shadow:
        0 12px 30px rgba(92, 58, 25, 0.13);
}

.robot-box {
    flex: 0 1 42%;

    display: flex;
    align-items: center;
    justify-content: center;
}

.robot-image {
    display: block;

    width: min(380px, 100%);
    max-height: 500px;

    object-fit: contain;
}

.story-box {
    flex: 1;
    max-width: 520px;
}

.story-box h1 {
    margin: 0 0 28px;

    font-size: clamp(2.5rem, 5vw, 4.2rem);
    line-height: 1;

    color: #a65324;
}

.story-box p {
    margin: 12px 0;

    font-size: clamp(1.25rem, 2vw, 1.6rem);
    line-height: 1.45;
}

.story-question {
    margin-top: 24px !important;

    font-weight: 700;
    color: #7b451f;
}


/* ==================================================
   MYGTUKAI
================================================== */

.main-button {
    min-width: 190px;
    min-height: 62px;

    margin-top: 25px;
    padding: 14px 28px;

    border: 0;
    border-radius: 18px;

    background: #b9672c;
    color: #ffffff;

    font-size: 1.3rem;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 6px 0 #88471f,
        0 9px 16px rgba(84, 48, 20, 0.18);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.main-button:hover {
    transform: translateY(-2px);
}

.main-button:active {
    transform: translateY(3px);

    box-shadow:
        0 3px 0 #88471f,
        0 5px 10px rgba(84, 48, 20, 0.15);
}

.main-button:focus-visible {
    outline: 4px solid #3c6e91;
    outline-offset: 5px;
}


/* ==================================================
   ŽAIDIMO EKRANAS
================================================== */

.game-header {
    margin-bottom: 16px;

    display: flex;
    justify-content: center;
}

#progress {
    padding: 10px 24px;

    border-radius: 999px;

    background: #fffaf0;
    border: 2px solid #d69a55;

    font-size: 1.1rem;
    font-weight: 700;

    color: #75461f;
}

.task-box {
    min-height: 570px;

    padding: 28px 30px 34px;

    text-align: center;

    background: rgba(255, 253, 246, 0.95);

    border: 3px solid #d69a55;
    border-radius: 30px;

    box-shadow:
        0 12px 30px rgba(92, 58, 25, 0.13);
}

.task-box h2 {
    margin: 4px 0 30px;

    font-size: clamp(1.8rem, 3vw, 2.5rem);

    color: #87491f;
}


/* ==================================================
   PAVEIKSLĖLIŲ SEKA
================================================== */

.sequence {
    min-height: 180px;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;

    gap: 14px;

    margin: 0 auto 32px;
}

.sequence-item {
    width: 135px;
    height: 135px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 8px;

    background: #ffffff;

    border: 3px solid #e4c38e;
    border-radius: 22px;

    box-shadow:
        0 5px 12px rgba(86, 57, 29, 0.1);
}

.sequence-item img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}


/* ==================================================
   ATSAKYMŲ PASIRINKIMAI
================================================== */

.choices {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 22px;
}

.choice-button {
    width: 155px;
    height: 155px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 10px;

    background: #fffdf8;

    border: 4px solid #c47a39;
    border-radius: 25px;

    cursor: pointer;

    box-shadow:
        0 7px 0 #a45c27,
        0 10px 18px rgba(78, 48, 22, 0.14);

    transition:
        transform 0.15s ease,
        border-color 0.15s ease;
}

.choice-button:hover {
    transform: translateY(-4px);
}

.choice-button:focus-visible {
    outline: 4px solid #3c6e91;
    outline-offset: 5px;
}

.choice-button img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    pointer-events: none;
}


/* ==================================================
   TEISINGAS / NETEISINGAS PASIRINKIMAS
================================================== */

.choice-button.correct {
    border-color: #54834d;

    animation: correctPulse 0.45s ease;
}

.choice-button.incorrect {
    border-color: #b75b4b;

    animation: incorrectShake 0.35s ease;
}

@keyframes correctPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes incorrectShake {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-7px);
    }

    75% {
        transform: translateX(7px);
    }
}


/* ==================================================
   GRĮŽTAMOJO RYŠIO EKRANAS
================================================== */

.feedback-content {
    min-height: 590px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 30px;

    text-align: center;

    background: rgba(255, 253, 246, 0.95);

    border: 3px solid #d69a55;
    border-radius: 30px;

    box-shadow:
        0 12px 30px rgba(92, 58, 25, 0.13);
}

.feedback-robot {
    width: min(245px, 55vw);
    max-height: 300px;

    object-fit: contain;

    margin-bottom: 15px;
}

#feedback-message {
    max-width: 650px;

    margin: 8px 0;

    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.3;

    color: #7d471f;
}


/* ==================================================
   PABAIGOS EKRANAS
================================================== */

.finish-content {
    min-height: 620px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 30px;

    text-align: center;

    background: rgba(255, 253, 246, 0.95);

    border: 3px solid #d69a55;
    border-radius: 30px;

    box-shadow:
        0 12px 30px rgba(92, 58, 25, 0.13);
}

.finish-robot {
    width: min(260px, 58vw);
    max-height: 315px;

    object-fit: contain;

    margin-bottom: 5px;
}

.finish-content h1 {
    margin: 5px 0 14px;

    font-size: clamp(2.6rem, 5vw, 4rem);

    color: #a65324;
}

.finish-content p {
    max-width: 680px;

    margin: 7px 0;

    font-size: clamp(1.25rem, 2.3vw, 1.6rem);
    line-height: 1.4;
}


/* ==================================================
   ATSARGINIS TEKSTAS, JEI NEUŽSIKRAUNA PAVEIKSLĖLIS
================================================== */

.image-fallback {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    padding: 8px;

    text-align: center;

    font-size: 1rem;
    font-weight: 700;

    color: #68401f;
}


/* ==================================================
   PORAŠTĖ
================================================== */

footer {
    padding: 8px 15px 14px;

    text-align: center;

    color: #75583c;

    font-size: 0.88rem;
    line-height: 1.3;
}

footer p {
    margin: 2px 0;
}


/* ==================================================
   MAŽESNI EKRANAI
================================================== */

@media (max-width: 800px) {

    .game-container {
        width: 95%;
        padding: 12px 0;
    }

    .start-content {
        min-height: auto;

        flex-direction: column;

        gap: 10px;

        padding: 24px 20px;

        text-align: center;
    }

    .robot-image {
        width: min(220px, 65vw);
        max-height: 260px;
    }

    .story-box h1 {
        margin-bottom: 18px;
    }

    .story-box p {
        margin: 8px 0;
    }

    .task-box {
        min-height: auto;
        padding: 22px 14px 28px;
    }

    .sequence {
        gap: 9px;
        margin-bottom: 25px;
    }

    .sequence-item {
        width: 105px;
        height: 105px;
    }

    .choice-button {
        width: 125px;
        height: 125px;
    }

    .feedback-content,
    .finish-content {
        min-height: auto;
        padding: 25px 18px;
    }

    .feedback-robot,
    .finish-robot {
        width: min(200px, 55vw);
        max-height: 230px;
    }
}


/* ==================================================
   LABAI MAŽI EKRANAI
================================================== */

@media (max-width: 480px) {

    .sequence-item {
        width: 82px;
        height: 82px;

        border-radius: 16px;
    }

    .choice-button {
        width: 105px;
        height: 105px;

        border-radius: 19px;
    }

    .choices {
        gap: 12px;
    }

    .main-button {
        width: 100%;
        max-width: 280px;
    }
}


/* ==================================================
   SUMAŽINTAS JUDESYS
================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}