/* =========================================================
   STICKMAN: THE TYPING FIGHTER
   DIFFICULTY SCREEN
   ========================================================= */

.difficulty-screen {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;

    background:
        radial-gradient(
            circle at 50% 45%,
            #292c30 0%,
            #1c1f22 45%,
            #111315 100%
        );

    color: var(--white);
}


/* =========================================================
   HEADER
   ========================================================= */

.difficulty-header {
    position: absolute;

    top: 55px;
    left: 7vw;

    z-index: 5;
}

.difficulty-number {
    margin-bottom: 8px;

    font-size: 16px;
    font-weight: 700;
    letter-spacing: 4px;

    color: rgba(255, 255, 255, 0.55);
}

.difficulty-header h1 {
    font-size: clamp(32px, 4vw, 58px);
    font-weight: 900;
    letter-spacing: 5px;
    line-height: 1;

    color: #f5f5f5;
}

.difficulty-subtitle {
    margin-top: 14px;

    font-size: 15px;
    font-weight: 500;
    letter-spacing: 2px;

    color: rgba(255, 255, 255, 0.45);
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.difficulty-content {
    position: absolute;

    top: 56%;
    left: 7vw;
    right: 7vw;

    transform: translateY(-50%);

    display: grid;

    grid-template-columns:
        minmax(0, 1.45fr)
        minmax(380px, 1fr);

    align-items: center;

    gap: 42px;

    z-index: 5;
}


/* =========================================================
   DIFFICULTY OPTIONS
   ========================================================= */

.difficulty-options {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 16px;
}


/* =========================================================
   DIFFICULTY CARD
   ========================================================= */

.difficulty-card {
    position: relative;

    width: 100%;
    height: 105px;

    padding: 0 34px;

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

    border:
        1px solid rgba(255, 255, 255, 0.28);

    border-radius: 6px;

    background:
        rgba(255, 255, 255, 0.045);

    color: var(--white);

    cursor: pointer;

    overflow: hidden;

    transition:
        transform 180ms ease,
        background 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}


/* =========================================================
   TOP HIGHLIGHT
   ========================================================= */

.difficulty-card::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 2px;

    background:
        rgba(255, 255, 255, 0.55);

    transform: scaleX(0);
    transform-origin: left;

    transition:
        transform 300ms ease;
}


/* =========================================================
   RIGHT ARROW
   ========================================================= */

.difficulty-card::after {
    content: "›";

    position: absolute;

    right: 32px;
    top: 50%;

    transform:
        translateY(-50%);

    font-size: 42px;
    font-weight: 300;

    line-height: 1;

    color:
        rgba(255, 255, 255, 0.55);

    transition:
        transform 180ms ease,
        color 180ms ease;
}


/* =========================================================
   HOVER
   ========================================================= */

.difficulty-card:hover {
    transform:
        translateX(7px);

    background:
        rgba(255, 255, 255, 0.09);

    border-color:
        rgba(255, 255, 255, 0.72);

    box-shadow:
        0 16px 35px rgba(0, 0, 0, 0.35);
}

.difficulty-card:hover::before {
    transform:
        scaleX(1);
}

.difficulty-card:hover::after {
    transform:
        translateY(-50%)
        translateX(5px);

    color:
        #ffffff;
}


/* =========================================================
   CLICK
   ========================================================= */

.difficulty-card:active {
    transform:
        translateX(3px)
        scale(0.985);
}


/* =========================================================
   CARD TEXT
   ========================================================= */

.difficulty-name {
    font-size: 21px;
    font-weight: 900;

    letter-spacing: 3px;

    color: #f5f5f5;
}

.difficulty-description {
    margin-top: 9px;

    font-size: 11px;
    font-weight: 500;

    letter-spacing: 1.2px;
    line-height: 1.5;

    color:
        rgba(255, 255, 255, 0.42);
}


/* =========================================================
   BACK BUTTON
   ========================================================= */

.difficulty-back-button {
    position: fixed;

    left: 7vw;
    bottom: 42px;

    z-index: 6;

    padding: 12px 18px;

    border:
        1px solid rgba(255, 255, 255, 0.32);

    border-radius: 4px;

    background:
        transparent;

    color:
        rgba(255, 255, 255, 0.72);

    font-size: 12px;
    font-weight: 800;

    letter-spacing: 2px;

    transition:
        background 180ms ease,
        color 180ms ease,
        border-color 180ms ease,
        transform 180ms ease;
}

.difficulty-back-button:hover {
    background:
        rgba(255, 255, 255, 0.08);

    color:
        #ffffff;

    border-color:
        rgba(255, 255, 255, 0.75);

    transform:
        translateX(-3px);
}

.difficulty-back-button:active {
    transform:
        translateX(0)
        scale(0.97);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {

    .difficulty-content {
        grid-template-columns:
            minmax(0, 1.3fr)
            minmax(300px, 0.9fr);

        gap: 28px;
    }
}


@media (max-width: 800px) {

    .difficulty-screen {
        overflow-y: auto;
    }

    .difficulty-header {
        position: relative;

        top: auto;
        left: auto;

        padding:
            45px 7vw 0;
    }

    .difficulty-content {
        position: relative;

        top: auto;
        left: auto;
        right: auto;

        transform: none;

        margin:
            45px 7vw 100px;

        display: flex;
        flex-direction: column;

        align-items: stretch;
    }

    .difficulty-options {
        width: 100%;
    }
.difficulty-back-button {
        left: 7vw;
        bottom: 25px;
    }
}


@media (max-width: 500px) {

    .difficulty-header h1 {
        font-size: 28px;
        letter-spacing: 3px;
    }

    .difficulty-subtitle {
        font-size: 12px;
    }

    .difficulty-card {
        height: 92px;
        padding: 0 24px;
    }

    .difficulty-name {
        font-size: 18px;
    }

    .difficulty-description {
        font-size: 10px;
    }

    .difficulty-card::after {
        right: 22px;
        font-size: 34px;
    }
}

/* =========================================================
   INFORMATIONAL DIFFICULTY CONTENT
   Keeps the original selection layout in the first viewport,
   while providing useful content below it for scrolling.
   ========================================================= */

.difficulty-information {
    position: relative;
    z-index: 4;
    margin-top: 100vh;
    padding: 44px 7vw 110px;
    background: #101214;
    color: #f5f5f5;
}

.difficulty-information-inner {
    width: min(1100px, 100%);
    margin: 0 auto;
}

.difficulty-information h2 {
    margin: 0 0 12px;
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 800;
    letter-spacing: 1px;
}

.difficulty-information-lead {
    max-width: 900px;
    margin: 0 0 26px;
    color: rgba(255,255,255,.76);
    line-height: 1.75;
    font-size: 15px;
}

.difficulty-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.difficulty-info-grid article {
    padding: 20px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 6px;
    background: rgba(255,255,255,.035);
}

.difficulty-info-grid h3,
.difficulty-section-heading {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 750;
}

.difficulty-info-grid p,
.difficulty-information-inner > p:not(.difficulty-information-lead) {
    margin: 0;
    color: rgba(255,255,255,.76);
    line-height: 1.75;
    font-size: 14px;
}

.difficulty-section-heading {
    margin-top: 28px;
}

.difficulty-information a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 700px) {
    .difficulty-information {
        padding: 36px 7vw 100px;
    }

    .difficulty-info-grid {
        grid-template-columns: 1fr;
    }
}


/* The informational section follows the normal-flow layouts used on
   short monitors and mobile screens, so it should not add a full
   viewport-sized gap there. */
@media (min-width: 801px) and (max-height: 820px) {
    .difficulty-information {
        margin-top: 40px;
    }
}

@media (max-width: 800px) {
    .difficulty-information {
        margin-top: 40px;
    }
}

/* =========================================================
   DESKTOP DIFFICULTY LAYOUT FIX
   Keep the original first-viewport selection UI intact and
   place the informational content safely below it. The
   informational section must never overlap the difficulty cards.
   ========================================================= */
@media (min-width: 801px) {
    .difficulty-screen {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .difficulty-header {
        position: absolute;
        top: 55px;
        left: 7vw;
        padding: 0;
    }

    .difficulty-content {
        position: absolute;
        top: 56%;
        left: 7vw;
        right: 7vw;
        margin: 0;
        transform: translateY(-50%);
    }

    .difficulty-options {
        width: 100%;
    }

    .difficulty-information {
        position: relative;
        z-index: 4;
        margin-top: 100vh;
    }
}

/* Extra-short desktop screens: retain the compact card sizing,
   but do not switch the selection layout into normal flow. */
@media (min-width: 801px) and (max-height: 700px) {
    .difficulty-header {
        top: 20px;
        left: 7vw;
        padding: 0;
    }

    .difficulty-content {
        top: 56%;
        left: 7vw;
        right: 7vw;
        margin: 0;
        transform: translateY(-50%);
    }

    .difficulty-information {
        margin-top: 100vh;
    }
}

/* =========================================================
   FINAL SCROLL-SAFE DIFFICULTY LAYOUT
   The selection UI must scroll together with the informational
   content. The first viewport keeps the original centered look,
   but the cards are kept in normal document flow so they can
   never remain behind the content while scrolling.
   ========================================================= */
@media (min-width: 801px) {
    .difficulty-screen {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .difficulty-header {
        position: absolute;
        top: 55px;
        left: 7vw;
        padding: 0;
    }

    .difficulty-content {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        transform: none;

        margin: 0 7vw;
        min-height: 100vh;
        padding-top: 120px;
        padding-bottom: 70px;

        box-sizing: border-box;
    }

    .difficulty-options {
        width: 100%;
    }

    .difficulty-information {
        position: relative;
        z-index: 4;
        margin-top: 0;
    }
}

@media (min-width: 801px) and (max-height: 700px) {
    .difficulty-header {
        top: 20px;
    }

    .difficulty-content {
        min-height: 100vh;
        padding-top: 95px;
        padding-bottom: 55px;
    }
}
