* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --orange: #ff8a00;
    --purple: #8d55ff;
    --dark: #09070e;
    --panel: #17121f;
    --panel2: #21182b;
    --text: #f4edf8;
    --muted: #b9a9c6;
    --green: #72db75;
}

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

body {
    min-height: 100vh;

    background:
        radial-gradient(
            circle at top,
            #28143d 0%,
            #0d0913 45%,
            #050407 100%
        );

    color: var(--text);

    font-family:
        Arial,
        Helvetica,
        sans-serif;
}

button {
    font: inherit;
}


/* =========================
   GAME WRAPPER
========================= */

.game-shell {
    width: min(920px, 100%);
    margin: 0 auto;
    padding: 16px;
}


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

.game-header {
    text-align: center;
    margin-bottom: 18px;
}

.game-header h1 {
    margin: 6px 0 2px;

    color: var(--orange);

    font-size:
        clamp(28px, 6vw, 46px);

    text-shadow:
        0 0 18px
        rgba(255, 138, 0, .25);
}

.game-header p {
    margin: 0 0 14px;
    color: #d7c4e6;
}

.header-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.header-buttons button {
    border: 1px solid #49365d;

    background: #17101f;
    color: white;

    border-radius: 9px;

    padding: 10px 14px;

    cursor: pointer;
}

.header-buttons button:hover {
    background: #261832;
}


/* =========================
   SCREENS
========================= */

.screen {
    display: none;
}

.screen.active {
    display: block;
}


/* =========================
   INTRO
========================= */

.intro-frame {
    width: 100%;
    max-width: 760px;

    margin: auto;

    overflow: hidden;

    border-radius: 16px;

    border:
        2px solid #5b3b72;

    background: black;
}

.intro-frame img {
    width: 100%;
    display: block;

    aspect-ratio: 16 / 9;

    object-fit: cover;
}

.story-box {
    max-width: 760px;

    margin:
        14px auto;

    min-height: 84px;

    padding: 17px;

    background:
        rgba(20, 14, 27, .94);

    border:
        1px solid #443151;

    border-radius: 12px;

    line-height: 1.6;

    text-align: center;
}

.story-box p {
    margin: 0;
}


/* =========================
   MAIN BUTTON
========================= */

.main-button {
    display: block;

    width:
        min(320px, 100%);

    margin:
        14px auto;

    padding: 15px;

    border: 0;

    border-radius: 12px;

    background:
        var(--orange);

    color: #1b0e00;

    font-weight: 800;

    cursor: pointer;
}

.main-button:hover {
    filter: brightness(1.08);
}

.main-button:active {
    transform: scale(.98);
}


/* =========================
   STATUS BAR
========================= */

.status-bar {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 8px;

    margin-bottom: 12px;
}

.status-bar > div {
    background: #120e18;

    border:
        1px solid #34283e;

    border-radius: 10px;

    padding: 10px;
}

.status-label {
    display: block;

    color: var(--muted);

    font-size: 12px;

    margin-bottom: 4px;

    text-transform: uppercase;
}


/* =========================
   ROOM
========================= */

.room-card {
    background:
        linear-gradient(
            180deg,
            var(--panel2),
            var(--panel)
        );

    border:
        1px solid #473552;

    border-radius: 16px;

    padding: 24px;

    text-align: center;
}

.room-icon {
    font-size: 58px;
    margin-bottom: 5px;
}

.room-card h2 {
    color: var(--orange);

    margin:
        4px 0 12px;
}

.room-card > p {
    max-width: 680px;

    margin:
        0 auto;

    color: #ddd2e5;

    line-height: 1.65;
}


/* =========================
   MESSAGE
========================= */

.message-box {
    min-height: 48px;

    max-width: 680px;

    margin:
        18px auto 0;

    padding: 12px;

    background: #0c0910;

    border:
        1px solid #302638;

    border-radius: 10px;

    color: #e9dff0;

    line-height: 1.45;
}


/* =========================
   ACTIONS
========================= */

.actions {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;

    max-width: 650px;

    margin:
        18px auto 0;
}

.action-button {
    min-height: 54px;

    border:
        1px solid #59406c;

    border-radius: 11px;

    background: #261832;

    color: white;

    padding: 12px;

    cursor: pointer;

    transition:
        transform .12s,
        background .12s;
}

.action-button:hover {
    background: #352044;
}

.action-button:active {
    transform: scale(.98);
}


/* =========================
   MODALS
========================= */

.modal {
    position: fixed;

    inset: 0;

    z-index: 20;

    display: grid;

    place-items: center;

    padding: 16px;

    background:
        rgba(0, 0, 0, .82);
}

.modal.hidden {
    display: none;
}

.modal-card {
    position: relative;

    width:
        min(620px, 100%);

    max-height: 90vh;

    overflow-y: auto;

    background: #181020;

    border:
        2px solid #513966;

    border-radius: 16px;

    padding: 24px;

    text-align: center;
}

.modal-card h2 {
    color: var(--orange);
}

.close-button {
    position: absolute;

    right: 10px;
    top: 8px;

    border: 0;

    background: transparent;

    color: white;

    font-size: 30px;

    cursor: pointer;
}


/* =========================
   PUZZLES
========================= */

.puzzle-input {
    width:
        min(300px, 100%);

    display: block;

    margin:
        15px auto;

    padding: 14px;

    border:
        1px solid #59446a;

    border-radius: 9px;

    background: #0d0911;

    color: white;

    text-align: center;

    font-size: 18px;
}

.puzzle-button {
    border: 0;

    border-radius: 10px;

    padding:
        13px 20px;

    background:
        var(--orange);

    color: #1c1000;

    font-weight: bold;

    cursor: pointer;
}

.puzzle-button:hover {
    filter: brightness(1.08);
}

.clue {
    margin:
        15px 0;

    padding: 15px;

    border:
        1px dashed #76558c;

    background: #100b16;

    border-radius: 10px;

    line-height: 1.6;
}


/* =========================
   SLIDING PUZZLE
========================= */

.slide-grid {
    width:
        min(390px, 100%);

    aspect-ratio: 1;

    margin:
        18px auto;

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 3px;

    background: #08060a;

    border:
        4px solid #33243d;
}

.slide-tile {
    border: 0;

    cursor: pointer;

    background-image:
        url("../images/computer-cat.png");

    background-size:
        300% 300%;

    min-width: 0;

    padding: 0;
}

.slide-tile.empty {
    background-image: none;

    background-color: #09070c;

    cursor: default;
}

.slide-help {
    color: var(--muted);

    font-size: 14px;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 560px) {

    .game-shell {
        padding: 10px;
    }

    .room-card {
        padding:
            18px 12px;
    }

    .actions {
        grid-template-columns: 1fr;
    }

    .status-bar {
        grid-template-columns: 1fr;
    }

    .modal-card {
        padding:
            20px 12px;
    }

    .header-buttons button {
        flex:
            1 1 auto;
    }
}
