/* =========================================================
   GAME DIARY — GAME ROOM
   ========================================================= */


/* =========================================================
   SETTINGS
   ========================================================= */

:root {

    /*
       Replace these with your own room artwork later.

       Example:

       --room-background: url("gameroom/wallpaper.png");
       --shelf-background: url("gameroom/shelf.png");
    */

    --room-background:
        url("gameroom/wall.png");

    --shelf-background:
        linear-gradient(
            to bottom,
            #8b5e3c 0%,
            #70472e 45%,
            #56351f 100%
        );


    --paper: #fffaf0;
    --paper-dark: #eee3d0;

    --ink: #332b25;
    --muted: #75695e;

    --wood-dark: #40291b;
    --wood-mid: #6f482d;
    --wood-light: #986b45;

    --accent-red: #9b4e51;
    --accent-green: #55755e;

    --shadow:
        0 12px 25px rgba(35, 21, 12, 0.28);
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    color: var(--ink);

    background-color: #38271d;
}


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

.game-room {
    min-height: 100vh;

    /*
       Your current carpet remains as a background layer.

       When you have a room image, you can replace this with:

       background-image:
           linear-gradient(...),
           url("gameroom/room.jpg");
    */

    background-image:
    url("/gameroom/wall.jpg");
        

    background-repeat: repeat;
    background-size: auto;

    position: relative;

    overflow: hidden;
}


/*
   Subtle atmospheric lighting.
*/

.game-room::before {
    content: "";

    position: fixed;

    inset: 0;

    pointer-events: none;

    background:
        radial-gradient(
            ellipse at 50% 0%,
            rgba(255, 246, 219, 0.25),
            transparent 60%
        );

    z-index: 0;
}


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

.site-header {
    position: relative;

    z-index: 2;

    padding:
        55px
        20px
        35px;
}


.header-inner {
    width:
        min(
            900px,
            calc(100% - 20px)
        );

    margin: 0 auto;

    padding:
        34px
        40px;

    text-align: center;

    background:
        rgba(
            255,
            250,
            240,
            0.96
        );

    border:
        2px solid #d4c4aa;

    box-shadow:
        0 10px 25px rgba(30, 18, 10, 0.25),
        inset 0 0 0 5px rgba(255,255,255,0.25);

    position: relative;
}


/*
   Decorative little "framing" marks.
*/

.header-decoration {
    display: flex;

    justify-content: center;

    gap: 7px;

    margin-bottom: 13px;
}


.header-decoration span {
    display: block;

    width: 5px;
    height: 5px;

    background: #8d7157;

    transform: rotate(45deg);
}


.eyebrow {
    margin: 0 0 7px;

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

    font-size: 0.7rem;

    letter-spacing: 0.25em;

    text-transform: uppercase;

    color: #887668;
}


.site-header h1 {
    margin: 0;

    font-size:
        clamp(
            2.3rem,
            6vw,
            4.5rem
        );

    line-height: 1;

    font-weight: normal;

    letter-spacing: -0.03em;
}


.header-subtitle {
    margin:
        13px
        0
        0;

    color: var(--muted);

    font-size: 1.05rem;

    font-style: italic;
}


/* =========================================================
   MAIN CONTAINER
   ========================================================= */

.container {
    width:
        min(
            1180px,
            calc(100% - 40px)
        );

    margin:
        0
        auto
        70px;

    position: relative;

    z-index: 2;
}


/* =========================================================
   FILTERS
   ========================================================= */

.filters {
    padding: 19px 22px;

    margin-bottom: 24px;

    background:
        rgba(
            255,
            250,
            240,
            0.94
        );

    border:
        1px solid #d3c3ae;

    box-shadow:
        0 7px 18px rgba(30, 18, 10, 0.18);
}


.filter-heading {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-bottom: 14px;

    color: #66594e;

    font-size: 0.78rem;

    text-transform: uppercase;

    letter-spacing: 0.13em;
}


.filter-icon {
    color: #9a7959;
}


.filter-controls {
    display: flex;

    flex-wrap: wrap;

    align-items: flex-end;

    gap: 13px;
}


.filter-group {
    display: flex;

    flex-direction: column;

    gap: 5px;

    flex: 1 1 140px;
}


.filter-group label {
    color: #796d62;

    font-size: 0.7rem;

    text-transform: uppercase;

    letter-spacing: 0.08em;
}


.filter-group select {
    width: 100%;

    min-width: 0;

    padding:
        9px
        30px
        9px
        10px;

    border:
        1px solid #cbbba5;

    border-radius: 0;

    background: #fffdf8;

    color: #3c342e;

    font-family: inherit;

    font-size: 0.9rem;

    cursor: pointer;
}


.filter-group select:focus {
    outline: 2px solid #9c8267;

    outline-offset: 2px;
}


.clear-button {
    padding:
        10px
        16px;

    border:
        1px solid #ad9b85;

    background: #e6d9c7;

    color: #4d4239;

    font-family: inherit;

    font-size: 0.9rem;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        background 0.18s ease;
}


.clear-button:hover {
    background: #d8c7b0;

    transform:
        translateY(-1px);
}


/* =========================================================
   RESULTS BAR
   ========================================================= */

.results-bar {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    margin:
        0
        4px
        16px;

    color: #f3e8d7;

    text-shadow:
        0 1px 2px rgba(0,0,0,0.4);

    font-size: 0.88rem;
}


.results-hint {
    opacity: 0.72;

    font-style: italic;
}


/* =========================================================
   SHELF AREA
   ========================================================= */

.games-container {
    display: flex;

    flex-direction: column;

    gap: 42px;
}


/*
   Each .shelf-row contains exactly five games
   on desktop.

   The board is generated with pseudo-elements,
   so you can later replace it with your own
   shelf artwork.
*/

.shelf-row {
    position: relative;

    display: grid;

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

    align-items: end;

    gap: 25px;

    padding:
        35px
        28px
        20px;

    min-height: 370px;

    /*
       Gives the shelf some breathing room against
       the room background.
    */
    margin:
        0
        auto;

    width: 100%;
}


/*
   Main wooden shelf board.
*/

.shelf-row::before {
    content: "";

    position: absolute;

    z-index: 0;

    left: 0;
    right: 0;

    bottom: 22px;

    height: 43px;

    background:
        var(--shelf-background);

    border:
        2px solid #4b2f1d;

    border-radius: 2px;

    box-shadow:
        0 13px 18px rgba(25, 14, 8, 0.35),
        inset 0 4px 0 rgba(255,255,255,0.08),
        inset 0 -7px 0 rgba(0,0,0,0.15);
}


/*
   Front lip of the shelf.
*/

.shelf-row::after {
    content: "";

    position: absolute;

    z-index: 4;

    left: -6px;
    right: -6px;

    bottom: 13px;

    height: 18px;

    background:
        linear-gradient(
            to bottom,
            #8f6140,
            #56351f
        );

    border:
        2px solid #3d2618;

    box-shadow:
        0 6px 9px rgba(0,0,0,0.3);

    pointer-events: none;
}


/* =========================================================
   GAME ITEM
   ========================================================= */

.game-item {
    position: relative;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
}


/* =========================================================
   BOX ART BUTTON
   ========================================================= */

.game-cover-button {
    appearance: none;

    border: 0;

    padding: 0;

    margin: 0;

    width: 100%;

    height: 100%;

    display: flex;

    align-items: flex-end;

    justify-content: center;

    background: transparent;

    cursor: pointer;

    perspective: 800px;
}


.game-cover {
    display: block;
    width: auto;
    height: 285px;
    max-width: 100%;
    object-fit: contain;
    object-position: center bottom;
    margin: 0;

    /*
       Lean the whole case backwards slightly.
    */
    transform:
        perspective(400px)
        rotateX(2deg)
        skewX(0deg)
        scaleX(0.95);

    transform-origin: center bottom;

    filter:
        saturate(0.93)
        brightness(0.94);

    box-shadow:
        5px 8px 12px rgba(0, 0, 0, 0.32);

    transition:
        transform 0.28s cubic-bezier(.2,.8,.2,1),
        filter 0.28s ease,
        box-shadow 0.28s ease;
}


/*
   Hover:
   the box stands upright.
*/

.game-cover-button:hover .game-cover,
.game-cover-button:focus-visible .game-cover {

    transform:
        perspective(800px)
        rotateX(0deg)
        rotateY(0deg)
        translateY(-13px)
        scale(1);

    filter:
        saturate(1)
        brightness(1);

    box-shadow:
        8px 18px 25px rgba(0,0,0,0.38);
}


/* =========================================================
   GAME INFO HOVER PLAQUE
   ========================================================= */

.game-hover-info {
    position: absolute;

    z-index: 10;

    left: 50%;

    bottom: calc(100% - 5px);

    width:
        min(
            230px,
            90vw
        );

    padding:
        12px
        14px;

    background:
        rgba(
            255,
            250,
            240,
            0.98
        );

    border:
        1px solid #cdbca5;

    box-shadow:
        0 8px 20px rgba(30,18,10,0.28);

    pointer-events: none;

    opacity: 0;

    transform:
        translate(
            -50%,
            10px
        );

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}


.game-item:hover .game-hover-info,
.game-cover-button:focus-visible + .game-hover-info {

    opacity: 1;

    transform:
        translate(
            -50%,
            0
        );
}


.game-hover-info::after {
    content: "";

    position: absolute;

    left: 50%;

    bottom: -8px;

    width: 14px;
    height: 14px;

    background:
        #fffaf0;

    border-right:
        1px solid #cdbca5;

    border-bottom:
        1px solid #cdbca5;

    transform:
        translateX(-50%)
        rotate(45deg);
}


.hover-title {
    margin: 0 0 5px;

    font-size: 1rem;

    line-height: 1.15;
}


.hover-console {
    margin: 0;

    color: #786b60;

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

    font-size: 0.72rem;

    text-transform: uppercase;

    letter-spacing: 0.07em;
}


.hover-status {
    display: flex;

    flex-wrap: wrap;

    gap: 5px;

    margin-top: 8px;
}


.hover-badge {
    display: inline-block;

    padding:
        3px
        6px;

    background: #e8dfd2;

    border: 1px solid #d4c6b5;

    color: #685d53;

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

    font-size: 0.64rem;

    text-transform: uppercase;

    letter-spacing: 0.04em;
}


.hover-badge.liked {
    background: #f0dfe0;

    border-color: #dfc2c4;

    color: #87464b;
}


.hover-badge.replayed {
    background: #dfe9e1;

    border-color: #c5d7c9;

    color: #4f6d58;
}


/* =========================================================
   EMPTY / ERROR STATE
   ========================================================= */

.no-results {
    padding:
        70px
        30px;

    text-align: center;

    background:
        rgba(
            255,
            250,
            240,
            0.96
        );

    border:
        1px solid #d4c5b0;

    box-shadow:
        0 8px 20px rgba(30,18,10,0.18);
}


.no-results h2 {
    margin:
        0
        0
        8px;

    font-weight: normal;
}


.no-results p {
    margin: 0;

    color: var(--muted);
}


/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
    display: flex;

    justify-content: center;

    align-items: center;

    gap: 8px;

    margin-top: 42px;
}


.page-button,
.page-number {
    min-width: 42px;

    height: 42px;

    border:
        1px solid #c7b69f;

    background:
        rgba(
            255,
            250,
            240,
            0.95
        );

    color: #4d4239;

    font-family: inherit;

    cursor: pointer;

    transition:
        background 0.18s ease,
        transform 0.18s ease;
}


.page-button {
    padding:
        0
        15px;
}


.page-button:hover:not(:disabled),
.page-number:hover:not(.active) {
    background: #e7dac8;

    transform:
        translateY(-1px);
}


.page-button:disabled {
    opacity: 0.4;

    cursor: not-allowed;
}


.page-numbers {
    display: flex;

    gap: 5px;
}


.page-number.active {
    background: #4d4036;

    border-color: #4d4036;

    color: white;
}


/* =========================================================
   MODAL
   ========================================================= */

.game-modal {
    position: fixed;

    inset: 0;

    z-index: 100;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 25px;

    opacity: 0;

    visibility: hidden;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}


.game-modal.open {
    opacity: 1;

    visibility: visible;
}


.modal-backdrop {
    position: absolute;

    inset: 0;

    background:
        rgba(
            22,
            14,
            10,
            0.76
        );

    backdrop-filter:
        blur(4px);
}


.modal-window {
    position: relative;

    z-index: 2;

    width:
        min(
            900px,
            100%
        );

    max-height:
        min(
            850px,
            90vh
        );

    display: grid;

    grid-template-columns:
        minmax(230px, 34%)
        1fr;

    overflow: auto;

    background:
        #fffaf0;

    border:
        2px solid #cdbb9f;

    box-shadow:
        0 25px 60px rgba(0,0,0,0.45);

    transform:
        translateY(15px)
        scale(0.98);

    transition:
        transform 0.25s ease;
}


.game-modal.open .modal-window {
    transform:
        translateY(0)
        scale(1);
}


.modal-close {
    position: absolute;

    z-index: 5;

    top: 12px;
    right: 12px;

    width: 38px;
    height: 38px;

    border:
        1px solid #bca990;

    background:
        rgba(255,250,240,0.92);

    color: #493d34;

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

    font-size: 1.7rem;

    line-height: 1;

    cursor: pointer;
}


.modal-close:hover {
    background: #eadfce;
}


/* =========================================================
   MODAL IMAGE
   ========================================================= */

.modal-image-area {
    min-height: 500px;

    padding: 35px;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        linear-gradient(
            135deg,
            #e4d8c5,
            #c9b79e
        );

    border-right:
        1px solid #d0c0a8;
}


.modal-image {
    display: block;

    width: 100%;

    max-height: 600px;

    object-fit: contain;

    box-shadow:
        7px 10px 18px rgba(40,25,15,0.28);
}


/* =========================================================
   MODAL CONTENT
   ========================================================= */

.modal-content {
    padding:
        48px
        45px
        45px;
}


.modal-heading {
    display: flex;

    justify-content: space-between;

    gap: 20px;
}


.modal-console {
    margin: 0 0 7px;

    color: #8a725b;

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

    font-size: 0.7rem;

    text-transform: uppercase;

    letter-spacing: 0.12em;
}


.modal-heading h2 {
    margin: 0;

    font-size:
        clamp(
            2rem,
            4vw,
            3.2rem
        );

    line-height: 1.05;

    font-weight: normal;
}


.modal-date {
    margin:
        9px
        0
        0;

    color: #887b70;

    font-style: italic;
}


.modal-status {
    display: flex;

    flex-direction: column;

    align-items: flex-end;

    gap: 5px;

    flex-shrink: 0;
}


.modal-status-badge {
    padding:
        5px
        8px;

    border:
        1px solid #d4c4b0;

    background: #e9dfd2;

    color: #62574d;

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

    font-size: 0.65rem;

    text-transform: uppercase;

    letter-spacing: 0.06em;

    white-space: nowrap;
}


.modal-status-badge.liked {
    background: #f1dfe0;

    border-color: #dfc2c4;

    color: #89474c;
}


.modal-status-badge.replayed {
    background: #dfe9e1;

    border-color: #c6d8ca;

    color: #506d59;
}


/* =========================================================
   MODAL TAGS
   ========================================================= */

.modal-tags {
    display: flex;

    flex-wrap: wrap;

    gap: 6px;

    margin-top: 25px;
}


.modal-tag {
    padding:
        5px
        8px;

    background: #e9e0d3;

    border:
        1px solid #d5c8b8;

    color: #655a51;

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

    font-size: 0.7rem;
}


/* =========================================================
   MODAL DIVIDER
   ========================================================= */

.modal-divider {
    height: 1px;

    margin:
        27px
        0;

    background:
        #d9ccba;
}


/* =========================================================
   MODAL THOUGHTS
   ========================================================= */

.modal-section-label {
    margin:
        0
        10px;

    color: #8b7560;

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

    font-size: 0.68rem;

    letter-spacing: 0.16em;

    font-weight: bold;
}


.modal-thoughts-text,
#modal-thoughts-text {
    margin: 0;

    color: #433a34;

    font-size: 1.05rem;

    line-height: 1.75;

    white-space: pre-wrap;
}


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    position: relative;

    z-index: 2;

    width:
        min(
            1100px,
            calc(100% - 40px)
        );

    margin:
        0
        auto;

    padding:
        15px
        0
        55px;

    text-align: center;

    color: rgba(255,247,231,0.8);

    text-shadow:
        0 1px 3px rgba(0,0,0,0.5);
}


.site-footer p {
    margin:
        0
        0
        3px;
}


.site-footer span {
    font-size: 0.78rem;

    font-style: italic;

    opacity: 0.7;
}


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

@media (max-width: 950px) {

    .shelf-row {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 20px;

        padding-left: 20px;
        padding-right: 20px;
    }

}


@media (max-width: 700px) {

    .site-header {
        padding:
            25px
            12px
            20px;
    }


    .header-inner {
        width: 100%;

        padding:
            27px
            20px;
    }


    .container {
        width:
            calc(100% - 20px);
    }


    .filter-controls {
        display: grid;

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


    .clear-button {
        width: 100%;
    }


    .results-bar {
        align-items: flex-start;

        flex-direction: column;

        gap: 4px;
    }


    /*
       Two covers per shelf on smaller screens.
    */

    .shelf-row {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 15px;

        padding:
            25px
            15px
            52px;

        min-height: 300px;
    }


    .game-item {
        height: 245px;
    }


        .game-cover {
    height: 230px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}


    .game-hover-info {
        width: 190px;
    }


    /*
       Modal becomes a vertical layout.
    */

    .modal-window {
        display: block;

        max-height: 92vh;

        overflow-y: auto;
    }


    .modal-image-area {
        min-height: 300px;

        max-height: 420px;

        padding: 25px;
    }


    .modal-image {
        max-height: 360px;
    }


    .modal-content {
        padding:
            30px
            25px
            35px;
    }


    .modal-heading {
        display: block;
    }


    .modal-status {
        flex-direction: row;

        align-items: flex-start;

        margin-top: 15px;
    }

}


@media (max-width: 450px) {

    .filter-controls {
        grid-template-columns: 1fr;
    }


    .shelf-row {
        grid-template-columns: 1fr 1fr;

        gap: 11px;

        padding-left: 10px;
        padding-right: 10px;
    }


    .game-item {
        height: 215px;
    }


.game-cover {
    height: 205px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}


    .game-hover-info {
        display: none;
    }


    /*
       On very small screens the cover itself is enough
       as the interaction cue.
    */

    .game-cover-button:focus-visible .game-cover {
        transform:
            translateY(-8px)
            scale(1);
    }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
    }

}