/* ---------- fonts ---------- */

@font-face {
    font-family: "Sora";
    src: url("fonts/Sora-Bold.ttf") format("truetype");
    font-weight: 700;
}

@font-face {
    font-family: "Sora";
    src: url("fonts/Sora-ExtraBold.ttf") format("truetype");
    font-weight: 800;
}

@font-face {
    font-family: "DM Sans";
    src: url("fonts/DMSans-Regular.ttf") format("truetype");
    font-weight: 400;
}

@font-face {
    font-family: "DM Sans";
    src: url("fonts/DMSans-Medium.ttf") format("truetype");
    font-weight: 500;
}

@font-face {
    font-family: "DM Sans";
    src: url("fonts/DMSans-Bold.ttf") format("truetype");
    font-weight: 700;
}

@font-face {
    font-family: "Fragment Mono";
    src: url("fonts/FragmentMono-Regular.ttf") format("truetype");
    font-weight: 400;
}

/* ---------- colours ---------- */

:root {
    --paper: #f7f4ee;
    --ink: #15131a;
    --violet: #5b3df5;
    --lilac: #ece8ff;
    --sun: #ffd84d;
    --mint: #14b87a;
    --mint-text: #0a7a4b;
    --mint-tint: #e3f8ee;
    --coral: #ff5a4e;
    --coral-text: #be1e13;
    --coral-tint: #ffe9e6;
    --grey: #5f5b6c;
    --display: "Sora", "Arial Black", sans-serif;
    --body: "DM Sans", Arial, sans-serif;
    --mono: "Fragment Mono", "Courier New", monospace;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--paper);
}

body {
    min-height: 100vh;
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.5;
    color: var(--ink);
    background-color: var(--paper);
    background-image: url("img/background.svg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

button {
    font-family: inherit;
    color: inherit;
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

.hidden {
    display: none !important;
}

button:focus-visible {
    outline: 4px solid var(--violet);
    outline-offset: 3px;
}

.eyebrow,
.side-label,
.board-label,
.client-label,
.type-chip,
.file-tab,
.verdict-topic,
.verdict-points,
.stat span,
.report-stats span {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


.btn {
    padding: 14px 24px;
    background: var(--violet);
    color: #fff;
    border: 3px solid var(--ink);
    border-radius: 12px;
    font-family: var(--display);
    font-weight: 700;
    font-size: 16px;
    box-shadow: 4px 4px 0 var(--ink);
    transition: transform 0.12s, box-shadow 0.12s;
}

.btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--ink);
}

.btn:active {
    transform: translate(3px, 3px);
    box-shadow: 1px 1px 0 var(--ink);
}

.btn-ghost {
    background: #fff;
    color: var(--ink);
}

.logo-box {
    display: inline-block;
    width: 22px;
    height: 22px;
    background: var(--violet);
    border: 3px solid var(--ink);
    border-radius: 6px;
    box-shadow: 3px 3px 0 var(--ink);
}

/* ================= 1. the lobby ================= */

.lobby {
    position: relative;
    background: var(--paper) url("img/background-home.svg") center / cover no-repeat;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
}

.lobby-head {
    position: relative;
    z-index: 2;
    max-width: 960px;
    margin: 0 auto;
    padding: clamp(20px, 4vh, 48px) 24px 26px;
    text-align: center;
}

.logo-line {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-family: var(--display);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.16em;
}

.lobby h1 {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(44px, 7vw, 92px);
    line-height: 1;
    letter-spacing: -0.035em;
}

.lobby h1 span {
    display: inline-block;
    padding: 0 0.12em;
    background: var(--sun);
    border-radius: 10px;
    transform: rotate(-1.5deg);
}

.lobby-intro {
    max-width: 640px;
    margin: 22px auto 0;
    font-size: 19px;
    color: var(--grey);
}

.lobby-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 14px;
    margin-top: 24px;
    list-style: none;
}

.lobby-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    background: #fff;
    border: 2.5px solid var(--ink);
    border-radius: 99px;
    font-weight: 700;
    font-size: 15px;
}

.lobby-steps b {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    background: var(--ink);
    color: var(--sun);
    border-radius: 50%;
    font-family: var(--display);
    font-size: 13px;
}


.note-sticker {
    position: absolute;
    z-index: 1;
    left: 4vw;
    top: 170px;
    width: 200px;
    padding: 14px 16px;
    background: var(--sun);
    border: 2.5px solid var(--ink);
    box-shadow: 5px 5px 0 var(--ink);
    transform: rotate(-6deg);
    font-size: 14px;
    line-height: 1.4;
}

.note-sticker b {
    display: block;
    margin-bottom: 4px;
    font-family: var(--display);
    font-size: 16px;
}


.stairs {
    position: relative;
    z-index: 2;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    width: 100%;
    max-width: 1100px;
    margin: 40px auto 0;
    padding: 0 24px;
}

.stair {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: -3px;
    padding: 22px 24px 24px;
    border: 3px solid var(--ink);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stair:first-child {
    margin-left: 0;
}

.stair:hover,
.stair:focus-visible {
    transform: translateY(-10px);
    box-shadow: 0 -6px 0 var(--sun);
}

.stair1 {
    min-height: 250px;
    background: var(--lilac);
}

.stair2 {
    min-height: 310px;
    background: var(--violet);
    color: #fff;
}

.stair3 {
    min-height: 370px;
    background: var(--ink);
    color: #fff;
}

.stair-number {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(70px, 9vw, 130px);
    line-height: 0.85;
    letter-spacing: -0.04em;
}

.stair2 .stair-number,
.stair3 .stair-number {
    color: var(--sun);
}

.stair-name {
    margin-top: 12px;
    font-family: var(--display);
    font-weight: 800;
    font-size: 26px;
}

.stair-text {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.45;
}

.stair-best {
    margin-top: 14px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.04em;
}

.stair-go {
    margin-top: auto;
    padding-top: 18px;
    font-family: var(--display);
    font-weight: 700;
    font-size: 17px;
    text-decoration: underline;
    text-underline-offset: 5px;
}

.lobby-note {
    position: relative;
    z-index: 3;
    padding: 14px 24px;
    background: var(--ink);
    color: #d9d4e8;
    font-size: 13px;
    text-align: center;
}

/* ================= 2. the game screen ================= */

.game {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
}

/* side panel */

.side {
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 22px;
    height: 100vh;
    padding: 26px;
    overflow: auto;
    background: var(--violet);
    color: #fff;
    border-right: 3px solid var(--ink);
}

.side-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--display);
    font-weight: 800;
    font-size: 17px;
    letter-spacing: 0.16em;
}

.logo-box.small {
    width: 18px;
    height: 18px;
    background: var(--sun);
    border-width: 2.5px;
    border-radius: 5px;
    box-shadow: none;
}

.side-label {
    color: #d8d0ff;
}

.side-level {
    font-family: var(--display);
    font-weight: 800;
    font-size: 28px;
    line-height: 1.1;
}

.side-case b {
    font-family: var(--display);
    font-weight: 800;
    font-size: 66px;
    line-height: 1;
}

.side-case span {
    font-family: var(--display);
    font-weight: 700;
    font-size: 20px;
    color: #d8d0ff;
}

.progress {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.cell {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 9px;
    font-family: var(--mono);
    font-size: 13px;
    color: #eae6ff;
}

.cell.right {
    background: var(--mint);
    border-color: var(--ink);
    color: var(--ink);
    font-weight: 700;
}

.cell.wrong {
    background: var(--coral);
    border-color: var(--ink);
    color: var(--ink);
    font-weight: 700;
}

.cell.now {
    background: var(--sun);
    border-color: var(--ink);
    color: var(--ink);
    font-weight: 700;
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.side-stats {
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid transparent;
    border-radius: 12px;
    transition: background 0.2s;
}

.stat b {
    font-family: var(--display);
    font-weight: 800;
    font-size: 28px;
}

.stat.hot {
    background: var(--sun);
    border-color: var(--ink);
    color: var(--ink);
}

.side-exit {
    padding: 6px 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 4px;
}


.desk {
    width: 100%;
    max-width: 1400px;
    padding: 40px clamp(18px, 3vw, 44px) 70px;
}


.file {
    position: relative;
    margin-top: 31px;
}

.file-tab {
    position: absolute;
    left: 24px;
    top: -31px;
    padding: 8px 16px 6px;
    background: var(--ink);
    color: var(--sun);
    border-radius: 10px 10px 0 0;
}

.file-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 34px;
    padding: clamp(20px, 2.4vw, 30px);
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 4px 18px 18px 18px;
    box-shadow: 8px 8px 0 var(--ink);
}

.file-main {
    flex: 1;
    min-width: 0;
}

.type-chip {
    display: inline-block;
    margin-bottom: 12px;
    padding: 2px 12px;
    background: var(--lilac);
    border: 2px solid var(--ink);
    border-radius: 99px;
}

.file-question {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(21px, 2.1vw, 28px);
    line-height: 1.25;
}

.client-note {
    flex: 0 0 min(100%, 390px);
    padding: 14px 18px 16px;
    background: var(--sun);
    border: 2.5px solid var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
    transform: rotate(1.2deg);
}

.client-label {
    margin-bottom: 4px;
}

.client-text {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
}


.options-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 38px;
}

.board-label {
    color: var(--grey);
}

.options {
    display: grid;
    gap: 30px;
    margin-top: 22px;
}

.options.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.options.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.option {
    position: relative;
    display: block;
    padding: 10px;
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 18px;
    box-shadow: 6px 6px 0 var(--ink);
    transition: transform 0.12s, box-shadow 0.12s, opacity 0.2s;
    animation: rise 0.4s both;
    animation-delay: calc(var(--i) * 90ms);
}

.option:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 var(--ink);
}

.option:active {
    transform: translate(3px, 3px);
    box-shadow: 2px 2px 0 var(--ink);
}

.option-pic {
    display: block;
    overflow: hidden;
    background: var(--lilac);
    border-radius: 10px;
}

.option-pic img {
    width: 100%;
    height: auto;
}

.option-letter {
    position: absolute;
    left: -14px;
    top: -14px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    background: var(--ink);
    color: #fff;
    border: 3px solid #fff;
    border-radius: 50%;
    font-family: var(--display);
    font-weight: 800;
    font-size: 18px;
}

.option-mark {
    position: absolute;
    right: -12px;
    top: -14px;
    z-index: 2;
    display: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 3px solid var(--ink);
    border-radius: 50%;
    font-family: var(--display);
    font-weight: 800;
    font-size: 20px;
}

.options.locked .option {
    pointer-events: none;
}

.option.is-right {
    background: var(--mint-tint);
    border-color: var(--mint-text);
    box-shadow: 6px 6px 0 var(--mint-text);
}

.option.is-right .option-letter {
    background: var(--mint-text);
}

.option.is-right .option-mark {
    display: grid;
    background: var(--mint);
    border-color: var(--mint-text);
    color: var(--ink);
}

.option.is-wrong {
    background: var(--coral-tint);
    border-color: var(--coral-text);
    box-shadow: 6px 6px 0 var(--coral-text);
}

.option.is-wrong .option-letter {
    background: var(--coral-text);
}

.option.is-wrong .option-mark {
    display: grid;
    background: var(--coral);
    border-color: var(--coral-text);
    color: var(--ink);
}

.option.is-dim {
    opacity: 0.5;
    box-shadow: none;
    animation: none;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* the right / wrong message */

.verdict {
    display: grid;
    grid-template-columns: minmax(230px, 0.8fr) minmax(0, 1.7fr);
    align-items: start;
    gap: 20px 40px;
    margin-top: 36px;
    padding: 22px 26px 26px;
    border: 3px solid var(--ink);
    border-radius: 16px;
    animation: rise 0.4s both;
}

.verdict.good {
    background: var(--mint-tint);
    border-color: var(--mint-text);
}

.verdict.bad {
    background: var(--coral-tint);
    border-color: var(--coral-text);
}

.verdict-title {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(26px, 2.8vw, 36px);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.verdict.good .verdict-title {
    color: var(--mint-text);
}

.verdict.bad .verdict-title {
    color: var(--coral-text);
}

.verdict-points {
    margin: 8px 0 14px;
}

.verdict-topic {
    display: inline-block;
    padding: 4px 12px;
    background: var(--ink);
    color: var(--sun);
    border-radius: 6px;
}

.verdict-why {
    margin-bottom: 18px;
    font-size: 17px;
    line-height: 1.55;
}

/* ================= 3. the report card ================= */

.report {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 60px 18px 60px;
}

.paper {
    position: relative;
    width: min(100%, 820px);
    padding: clamp(28px, 4vw, 52px);
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 20px;
    box-shadow: 10px 10px 0 var(--ink);
    animation: rise 0.5s both;
}

.stamp {
    position: absolute;
    top: -28px;
    right: clamp(14px, 3vw, 36px);
    padding: 10px 18px;
    background: #fff;
    color: var(--violet);
    border: 4px solid var(--violet);
    border-radius: 10px;
    box-shadow: 4px 4px 0 var(--sun);
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(15px, 2.2vw, 22px);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transform: rotate(6deg);
}

.eyebrow {
    color: var(--grey);
}

.report-title {
    margin: 10px 0 12px;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

.report-message {
    max-width: 52ch;
    font-size: 19px;
    color: var(--grey);
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 26px 0 22px;
}

.report-stats div {
    padding: 12px 16px;
    background: var(--lilac);
    border: 2.5px solid var(--ink);
    border-radius: 12px;
}

.report-stats b {
    display: block;
    font-family: var(--display);
    font-weight: 800;
    font-size: 32px;
    line-height: 1.1;
}

.strip {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 5px;
    margin-bottom: 28px;
}

.strip .cell {
    border-color: rgba(21, 19, 26, 0.25);
    border-radius: 6px;
    font-size: 11px;
    color: var(--grey);
}

.strip .cell.right,
.strip .cell.wrong {
    border-color: var(--ink);
    color: var(--ink);
}

.study h3 {
    margin-bottom: 10px;
    font-family: var(--display);
    font-weight: 700;
    font-size: 18px;
}

.study ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.study li {
    padding: 3px 12px;
    background: var(--sun);
    border: 2px solid var(--ink);
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
}

.study li.all-clear {
    background: var(--mint-tint);
    border-color: var(--mint-text);
    color: var(--mint-text);
}

.report-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

/* ================= small screens ================= */

@media (max-width: 1150px) {

    .note-sticker {
        display: none;
    }
}

@media (max-width: 960px) {

    .game {
        display: block;
    }

    .side {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 14px 26px;
        height: auto;
        padding: 16px 18px;
        border-right: none;
        border-bottom: 3px solid var(--ink);
    }

    .side-case b {
        font-size: 38px;
    }

    .side-level {
        font-size: 22px;
    }

    .progress {
        grid-template-columns: repeat(15, 1fr);
        gap: 4px;
        order: 5;
        width: 100%;
    }

    .cell {
        border-radius: 5px;
        font-size: 9px;
    }

    .side-stats {
        grid-auto-flow: column;
        margin: 0 0 0 auto;
    }

    .side-exit {
        order: 6;
    }

    .desk {
        padding-top: 28px;
    }

    .file-body {
        flex-direction: column;
        align-items: stretch;
    }

    .client-note {
        flex: none;
    }

    .options.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .verdict {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {

    .options.two,
    .options.three {
        grid-template-columns: minmax(0, 1fr);
    }

    .stairs {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 14px;
        padding-bottom: 28px;
    }

    .stair,
    .stair1,
    .stair2,
    .stair3 {
        min-height: 0;
        margin-left: 0;
        border-bottom: 3px solid var(--ink);
        border-radius: 18px;
    }

    .stair-number {
        font-size: 64px;
    }

    .report-stats {
        grid-template-columns: 1fr;
    }

    .strip {
        grid-template-columns: repeat(8, 1fr);
    }

    .side-stats {
        margin: 0;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {

    * {
        animation: none !important;
        transition: none !important;
    }
}
