/* =========================================================
   THE SHADY DECK OF THINGS
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    overflow-x: hidden;

    color: #e6d5ad;

    background:
        radial-gradient(
            ellipse at center top,
            #33291c 0%,
            #17120e 48%,
            #080706 100%
        );

    font-family:
        Georgia,
        "Times New Roman",
        serif;
}


/* =========================================================
   ATMOSPHERE
   ========================================================= */

.vignette {
    position: fixed;
    inset: 0;
    z-index: 100;

    pointer-events: none;

    box-shadow:
        inset 0 0 180px rgba(0, 0, 0, .9);
}

.rain {
    position: fixed;
    inset: 0;
    z-index: 1;

    pointer-events: none;

    opacity: .14;

    background-image:
        repeating-linear-gradient(
            105deg,
            transparent 0,
            transparent 7px,
            rgba(180, 190, 200, .18) 8px,
            transparent 9px,
            transparent 17px
        );

    background-size: 120px 160px;

    animation: rainMove .8s linear infinite;
}

@keyframes rainMove {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -80px 160px;
    }
}

.fog {
    position: fixed;
    z-index: 2;

    width: 80vw;
    height: 25vh;

    border-radius: 50%;

    filter: blur(40px);

    pointer-events: none;

    opacity: .1;

    background: #b8b0a0;
}

.fog-a {
    left: -25vw;
    bottom: 8vh;

    animation:
        fogOne 18s ease-in-out infinite alternate;
}

.fog-b {
    right: -25vw;
    bottom: 20vh;

    animation:
        fogTwo 22s ease-in-out infinite alternate;
}

@keyframes fogOne {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(35vw);
    }
}

@keyframes fogTwo {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-30vw);
    }
}


/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    position: relative;
    z-index: 10;

    width: min(1100px, calc(100% - 32px));

    margin: 0 auto;
    padding: 28px 0 20px;

    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    gap: 30px;

    border-bottom:
        1px solid rgba(180, 145, 85, .45);
}

.eyebrow {
    margin-bottom: 6px;

    color: #b99558;

    font-size: 12px;
    font-weight: bold;

    letter-spacing: 3px;
    text-transform: uppercase;
}

.site-header h1 {
    margin: 0;

    color: #ead7ad;

    font-size:
        clamp(30px, 5vw, 56px);

    line-height: .95;

    text-shadow:
        0 3px 10px #000;
}

.header-title p {
    max-width: 650px;

    margin: 10px 0 0;

    color: #a99a7c;

    font-size: 14px;
}

.stats {
    display: flex;
    flex-shrink: 0;

    gap: 10px;
}

.stat {
    min-width: 75px;

    padding: 9px 12px;

    text-align: center;

    background:
        rgba(0, 0, 0, .45);

    border:
        1px solid #59452a;
}

.stat span {
    display: block;

    color: #a98a52;

    font-size: 9px;

    letter-spacing: 2px;
}

.stat strong {
    display: block;

    margin-top: 3px;

    color: #ead7ad;

    font-size: 24px;
}


/* =========================================================
   PAGE
   ========================================================= */

.page {
    position: relative;
    z-index: 5;

    width: min(1100px, calc(100% - 32px));

    margin: 0 auto;
}


/* =========================================================
   WANTED POSTER
   ========================================================= */

.wanted-poster {
    position: relative;
    z-index: 20;

    width: min(620px, 100%);

    min-height: 205px;

    margin: 22px auto;
    padding: 12px;

    display: flex;
    align-items: center;

    gap: 18px;

    overflow: hidden;

    color: #2b1a0d;

    background:
        radial-gradient(
            circle at center,
            #e0ca98,
            #c5a86b 80%
        );

    border:
        3px solid #4b321a;

    box-shadow:
        inset 0 0 25px rgba(54, 33, 13, .4),
        0 8px 18px rgba(0, 0, 0, .65);
}

.wanted-portrait {
    flex:
        0 0 165px;

    width: 165px;
    height: 180px;

    overflow: hidden;

    background: #b7965c;

    border:
        2px solid #4b321a;

    box-shadow:
        0 4px 8px rgba(0, 0, 0, .5);
}

.wanted-portrait img {
    display: block;

    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;

    object-fit: cover;

    border: 0;

    filter:
        sepia(.08)
        contrast(1.05);
}

.wanted-details {
    flex: 1;

    min-width: 0;

    text-align: center;
}

.wanted-heading {
    margin: 0;

    color: #351b0d;

    font-size:
        clamp(34px, 5vw, 52px);

    font-weight: 900;

    line-height: .9;

    letter-spacing: 5px;
}

.wanted-name {
    margin: 9px 0 12px;

    font-size:
        clamp(18px, 3vw, 26px);

    font-weight: bold;

    letter-spacing: 1px;
}

.wanted-label {
    margin-top: 5px;

    font-size: 10px;
    font-weight: bold;

    letter-spacing: 2px;

    text-transform: uppercase;
}

.wanted-reward {
    margin: 3px 0 9px;

    color: #701812;

    font-size:
        clamp(21px, 4vw, 32px);

    font-weight: 900;
}

.wanted-reason {
    max-width: 300px;

    margin: 3px auto 0;

    font-size: 13px;

    line-height: 1.3;

    font-style: italic;
}


/* =========================================================
   ALLEY
   ========================================================= */

.alley-scene {
    position: relative;

    min-height: 800px;

    overflow: hidden;

    border:
        1px solid #35291b;

    background:
        linear-gradient(
            to bottom,
            #19140f 0%,
            #100c09 55%,
            #080706 100%
        );

    box-shadow:
        inset 0 0 100px rgba(0, 0, 0, .9);
}


/* =========================================================
   BUILDINGS
   ========================================================= */

.building {
    position: absolute;

    top: 0;

    width: 23%;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            #090806,
            #1b1510,
            #0b0907
        );

    opacity: .9;
}

.building-left {
    left: 0;

    border-right:
        2px solid #302416;
}

.building-right {
    right: 0;

    border-left:
        2px solid #302416;
}

.window {
    position: absolute;

    width: 40px;
    height: 65px;

    background:
        radial-gradient(
            circle,
            #b18a42 0%,
            #5e441f 45%,
            #15100b 75%
        );

    border:
        4px solid #0a0806;

    box-shadow:
        0 0 20px rgba(177, 138, 66, .25);
}

.building-left .window {
    right: 20px;
}

.building-right .window {
    left: 20px;
}

.window-1 {
    top: 17%;
}

.window-2 {
    top: 42%;
}

.window-3 {
    top: 68%;
}


/* =========================================================
   ALLEY DETAILS
   ========================================================= */

.tavern-sign {
    position: absolute;

    top: 100px;
    left: 19%;

    z-index: 3;

    padding: 12px 15px;

    color: #d6b46d;

    background: #17100b;

    border:
        2px solid #65451f;

    box-shadow:
        0 4px 12px #000;

    font-size: 12px;
    font-weight: bold;

    line-height: 1.15;

    text-align: center;
}

.lantern {
    position: absolute;

    top: 110px;

    z-index: 4;

    width: 18px;
    height: 35px;

    background: #a57a2e;

    border:
        2px solid #3c2a15;

    box-shadow:
        0 0 25px rgba(202, 153, 54, .5);
}

.lantern-left {
    left: 25%;
}

.lantern-right {
    right: 25%;
}

.lantern span {
    display: block;

    width: 5px;
    height: 5px;

    margin: 13px auto;

    border-radius: 50%;

    background: #ffe2a0;

    box-shadow:
        0 0 14px 5px #c8943c;
}

.alley-title {
    position: absolute;

    top: 25px;
    left: 50%;

    z-index: 5;

    transform:
        translateX(-50%);

    display: flex;
    align-items: center;

    gap: 14px;

    color: #a98952;

    text-align: center;
}

.alley-title strong {
    display: block;

    font-size: 13px;

    letter-spacing: 3px;
}

.alley-title small {
    display: block;

    margin-top: 4px;

    color: #75684f;

    font-size: 10px;
}


/* =========================================================
   GAME AREA
   ========================================================= */

.game-area {
    position: relative;
    z-index: 10;

    width: min(850px, calc(100% - 40px));

    margin: 145px auto 0;
    padding-bottom: 90px;

    display: grid;

    grid-template-columns:
        210px
        270px
        1fr;

    grid-template-areas:
        "deck card result"
        "deck button button"
        "hint hint hint";

    gap: 22px;

    align-items: center;
}


/* =========================================================
   DECK
   ========================================================= */

.deck {
    grid-area: deck;

    position: relative;

    width: 190px;
    height: 275px;

    margin: 0 auto;
    padding: 0;

    border: 0;

    background: transparent;

    cursor: pointer;

    perspective: 900px;
}

.deck-card {
    position: absolute;

    top: 7px;
    left: 5px;

    width: 180px;
    height: 260px;

    border-radius: 7px;

    background: #251b12;

    border:
        2px solid #b99a61;

    box-shadow:
        0 10px 18px rgba(0, 0, 0, .6);
}

.deck-card-back-3 {
    transform:
        translate(-8px, 8px)
        rotate(-4deg);
}

.deck-card-back-2 {
    transform:
        translate(-3px, 4px)
        rotate(-2deg);
}

.deck-card-main {
    z-index: 3;

    transition:
        transform .25s ease,
        filter .25s ease;
}

.deck:hover .deck-card-main {
    transform:
        translateY(-8px)
        rotate(-1deg);

    filter:
        brightness(1.12);
}

.deck:active .deck-card-main {
    transform:
        translateY(4px)
        rotate(1deg);
}

.deck-inner {
    position: absolute;
    inset: 10px;

    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: center;

    text-align: center;

    border:
        1px solid #947443;

    background:
        repeating-linear-gradient(
            45deg,
            #24190f 0,
            #24190f 5px,
            #2d2115 5px,
            #2d2115 10px
        );
}

.deck-symbol {
    margin-bottom: 10px;

    color: #c8a968;

    font-size: 45px;
}

.deck-inner strong {
    color: #d5bd8c;

    font-size: 20px;

    line-height: 1.05;

    letter-spacing: 3px;
}

.deck-inner small {
    margin-top: 16px;

    color: #967846;

    font-size: 8px;

    letter-spacing: 3px;
}

.deck-corner {
    position: absolute;

    color: #b69760;

    font-size: 18px;
}

.deck-corner.top {
    top: 8px;
    left: 10px;
}

.deck-corner.bottom {
    right: 10px;
    bottom: 8px;
}


/* =========================================================
   DRAWN CARD
   ========================================================= */

.draw-card-container {
    grid-area: card;

    display: flex;

    justify-content: center;
    align-items: center;
}

.drawn-card {
    width: 230px;
    height: 330px;

    overflow: hidden;

    border-radius: 8px;

    background:
        linear-gradient(
            135deg,
            #ded0ad,
            #a99163
        );

    border:
        5px solid #332315;

    box-shadow:
        0 15px 30px rgba(0, 0, 0, .7);
}

.drawn-card-inner {
    position: relative;

    width: calc(100% - 16px);
    height: calc(100% - 16px);

    margin: 8px;
    padding: 16px;

    display: flex;
    flex-direction: column;

    justify-content: space-between;
    align-items: center;

    text-align: center;

    border:
        2px solid #513b21;
}

.drawn-card-type {
    color: #725328;

    font-size: 8px;
    font-weight: bold;

    letter-spacing: 2px;

    text-transform: uppercase;
}

.drawn-card-name {
    margin: auto 0;

    max-width: 100%;

    color: #2b1b0d;

    font-size:
        clamp(20px, 3vw, 28px);

    font-weight: bold;

    line-height: 1.05;

    overflow-wrap: anywhere;
}

.drawn-card-symbol {
    color: #8b682f;

    font-size: 30px;
}

.drawn-card-footer {
    color: #725328;

    font-size: 7px;

    letter-spacing: 2px;
}


/* =========================================================
   RESULT / DESCRIPTION BESIDE CARD
   ========================================================= */

.result {
    grid-area: result;

    min-height: 260px;

    padding: 24px;

    display: flex;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    text-align: center;

    color: #2b1b0d;

    background:
        radial-gradient(
            circle at center,
            #dfc997,
            #b99b63
        );

    border:
        3px solid #4c3219;

    box-shadow:
        inset 0 0 25px rgba(55, 35, 15, .35),
        0 10px 20px rgba(0, 0, 0, .55);
}

.result-content {
    width: 100%;
}

.result-kicker {
    margin: 0;

    color: #725328;

    font-size: 10px;
    font-weight: bold;

    letter-spacing: 2px;
}

.result h2 {
    margin: 12px 0;

    color: #2b1b0d;

    font-size: 28px;

    line-height: 1.05;
}

.divider {
    margin: 12px 0;

    color: #805f32;

    letter-spacing: 7px;
}

.result-description {
    max-height: 155px;

    overflow-y: auto;

    padding: 5px 8px;

    color: #3b2917;

    font-size: 15px;

    line-height: 1.55;

    text-align: left;
}

.result-description::-webkit-scrollbar {
    width: 5px;
}

.result-description::-webkit-scrollbar-track {
    background:
        rgba(60, 40, 20, .15);
}

.result-description::-webkit-scrollbar-thumb {
    background: #806036;
}


/* =========================================================
   DRAW BUTTON
   ========================================================= */

.draw-button {
    grid-area: button;

    justify-self: center;

    min-width: 300px;

    padding: 14px 24px;

    color: #dfc692;

    background:
        linear-gradient(
            #3b2a18,
            #1b130d
        );

    border:
        2px solid #8f6c38;

    font-family: inherit;

    font-size: 13px;
    font-weight: bold;

    letter-spacing: 2px;

    cursor: pointer;

    box-shadow:
        0 5px 12px rgba(0, 0, 0, .55);

    transition:
        transform .15s ease,
        background .15s ease;
}

.draw-button:hover {
    background:
        linear-gradient(
            #4b351e,
            #261a10
        );

    transform:
        translateY(-2px);
}

.draw-button:active {
    transform:
        translateY(2px);
}

.draw-button span {
    margin: 0 10px;

    color: #b9975c;
}

.hint {
    grid-area: hint;

    margin: 0;

    color: #75684f;

    font-size: 11px;

    text-align: center;
}


/* =========================================================
   GROUND OBJECTS
   ========================================================= */

.ground-object {
    position: absolute;
    z-index: 3;
}

.crate {
    width: 65px;
    height: 55px;

    background:
        repeating-linear-gradient(
            90deg,
            #3c2918 0,
            #3c2918 8px,
            #51381e 9px,
            #51381e 12px
        );

    border:
        3px solid #24170c;
}

.crate-one {
    bottom: 35px;
    left: 26%;
}

.crate-two {
    right: 22%;
    bottom: 55px;

    transform:
        rotate(5deg);
}

.barrel {
    right: 31%;
    bottom: 25px;

    width: 45px;
    height: 60px;

    border-radius: 45%;

    background:
        linear-gradient(
            90deg,
            #281a0e,
            #53391e,
            #281a0e
        );

    border:
        3px solid #1b1008;
}


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    position: relative;
    z-index: 10;

    width: min(1100px, calc(100% - 32px));

    margin: 0 auto;
    padding: 18px 0 25px;

    display: flex;

    justify-content: space-between;

    gap: 15px;

    color: #665b47;

    border-top:
        1px solid #302416;

    font-size: 9px;

    letter-spacing: 1px;
}


/* =========================================================
   DRAW EFFECTS
   ========================================================= */

.draw-flash {
    position: fixed;
    inset: 0;
    z-index: 200;

    pointer-events: none;

    opacity: 0;

    background: #e9d6a7;

    transition:
        opacity .1s ease;
}

.draw-flash.active {
    opacity: .65;
}

.omen {
    position: fixed;
    inset: 0;
    z-index: 201;

    pointer-events: none;

    display: flex;

    justify-content: center;
    align-items: center;

    padding: 20px;

    opacity: 0;

    background:
        rgba(0, 0, 0, .7);

    transition:
        opacity .25s ease;
}

.omen.show {
    opacity: 1;
}

.omen-text {
    max-width: 650px;

    padding: 30px;

    color: #e2c88e;

    font-size:
        clamp(22px, 5vw, 42px);

    font-weight: bold;

    text-align: center;

    letter-spacing: 3px;

    text-shadow:
        0 0 20px #000;
}


/* =========================================================
   ANIMATIONS
   ========================================================= */

.drawing .deck-card-main {
    animation:
        deckDraw .7s ease;
}

@keyframes deckDraw {

    0% {
        transform:
            translateY(0)
            rotate(0);
    }

    35% {
        transform:
            translateY(-35px)
            rotate(-4deg);
    }

    70% {
        transform:
            translateY(8px)
            rotate(5deg);
    }

    100% {
        transform:
            translateY(0)
            rotate(0);
    }
}

.card-reveal {
    animation:
        cardReveal .8s cubic-bezier(.2, .8, .2, 1);
}

@keyframes cardReveal {

    0% {
        opacity: 0;

        transform:
            rotateY(90deg)
            scale(.8);
    }

    100% {
        opacity: 1;

        transform:
            rotateY(0)
            scale(1);
    }
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .game-area {
        grid-template-columns:
            180px
            240px;

        grid-template-areas:
            "deck card"
            "result result"
            "button button"
            "hint hint";
    }

    .result {
        width: min(600px, 100%);

        justify-self: center;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .site-header {
        width: calc(100% - 20px);

        padding-top: 18px;

        display: block;

        text-align: center;
    }

    .eyebrow {
        font-size: 9px;

        letter-spacing: 2px;
    }

    .site-header h1 {
        font-size: 31px;
    }

    .header-title p {
        font-size: 12px;
    }

    .stats {
        justify-content: center;

        margin-top: 14px;
    }

    .stat {
        min-width: 90px;
    }


    /* WANTED POSTER */

    .wanted-poster {
        width: calc(100% - 20px);

        height: 125px;

        min-height: 0;

        margin: 12px auto 16px;
        padding: 6px;

        gap: 10px;
    }

    .wanted-portrait {
        flex:
            0 0 100px;

        width: 100px;
        height: 111px;
    }

    .wanted-heading {
        font-size: 25px;

        letter-spacing: 2px;
    }

    .wanted-name {
        margin: 4px 0 6px;

        font-size: 15px;
    }

    .wanted-label {
        margin-top: 2px;

        font-size: 7px;

        letter-spacing: 1px;
    }

    .wanted-reward {
        margin: 2px 0 4px;

        font-size: 19px;
    }

    .wanted-reason {
        max-width: 190px;

        font-size: 9px;

        line-height: 1.1;
    }


    /* ALLEY */

    .alley-scene {
        min-height: 1000px;

        border-left: 0;
        border-right: 0;
    }

    .building {
        width: 15%;
    }

    .tavern-sign {
        display: none;
    }

    .lantern-left {
        left: 17%;
    }

    .lantern-right {
        right: 17%;
    }

    .alley-title {
        top: 20px;

        width: 90%;

        gap: 8px;
    }

    .alley-title strong {
        font-size: 10px;

        letter-spacing: 2px;
    }

    .alley-title small {
        font-size: 8px;
    }


    /* GAME */

    .game-area {
        width: calc(100% - 20px);

        margin-top: 100px;

        padding-bottom: 55px;

        display: flex;
        flex-direction: column;

        gap: 18px;
    }

    .deck {
        order: 1;

        width: 150px;
        height: 220px;
    }

    .deck-card {
        width: 140px;
        height: 205px;
    }

    .deck-inner strong {
        font-size: 16px;
    }

    .deck-symbol {
        font-size: 35px;
    }

    .draw-card-container {
        order: 2;
    }

    .drawn-card {
        width: 190px;
        height: 275px;
    }

    .result {
        order: 3;

        width: 100%;

        min-height: 200px;

        padding: 18px;
    }

    .result-description {
        max-height: 130px;

        font-size: 13px;

        line-height: 1.45;

        text-align: center;
    }

    .draw-button {
        order: 4;

        width: 100%;

        min-width: 0;

        padding: 14px 8px;

        font-size: 11px;
    }

    .hint {
        order: 5;
    }


    /* FOOTER */

    .site-footer {
        width: calc(100% - 20px);

        flex-direction: column;

        align-items: center;

        text-align: center;
    }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 380px) {

    .wanted-poster {
        height: 112px;
    }

    .wanted-portrait {
        flex-basis: 84px;

        width: 84px;
        height: 98px;
    }

    .wanted-heading {
        font-size: 21px;
    }

    .wanted-name {
        font-size: 13px;
    }

    .wanted-reward {
        font-size: 16px;
    }

    .wanted-reason {
        font-size: 8px;
    }

    .drawn-card {
        width: 175px;
        height: 255px;
    }
}