/**
 * Styles for CSS Playing Cards
 *
 * @OriginalAuthor   Anika Henke <anika@selfthinker.org>
 * @author           Lucas Willemsens <geobawz@gmail.com>
 * @license          CC BY-SA [http://creativecommons.org/licenses/by-sa/3.0]
 * @version          2026-06-01
 * @link             http://selfthinker.github.com/CSS-Playing-Cards/
 */

/* card itself
********************************************************************/
:root{
    --card-background: #c7dce0;
    --card-background-highlight: #d1e1ea;
    --card-font-size: 1.2em; /* @change: adjust this value to make bigger or smaller cards */
}

.playingCards .card {
    display: inline-block;
    width: 4.25rem;
    height: 6rem;
    border: 1px solid #666;
    border-radius: .3em;
    -moz-border-radius: .3em;
    -webkit-border-radius: .3em;
    -khtml-border-radius: .3em;
    padding: .25em;
    margin: 0 .5em .5em 0;
    text-align: center;
    font-size: var(--card-font-size, 1.2em);
    font-weight: normal;
    font-family: Arial, sans-serif;
    position: relative;
    background-color: var(--card-background);
}

.playingCards a.card {
    text-decoration: none;
}

.playingCards li.cardContainer{
    user-select: none;
}

.playingCards li.cardContainer:active, .playingCards li.cardContainer:focus-within,
.playingCards strong .cardContainer {
    margin-top: -30px;
}

.playingCards li.cardContainer.card-hover,
.playingCards li.cardContainer.card-hover:focus-within:active {
    --card-hover-lift: -30px;
    margin-top: 0;
}
    .playingCards li.cardContainer:focus-within:active
    {
        margin-top: -25px;
    }
    .playingCards li.cardContainer:focus-within{
        outline-offset: 4px;
        outline: 3px solid;
    }
    .playingCards li.cardContainer:focus-within:active{
        outline-offset: -1px;
        outline-width: 1px;
    }

    .playerScreen li.cardContainer.ghost{
        box-shadow: none;
        filter: none;
    }   
    li.cardContainer:not(.blocked).card-hover {
        z-index: 1000;
        box-shadow: none;
        filter: drop-shadow(0.1em 0.1em 0.15em #333);
    }
    li.cardContainer:not(.blocked):focus-within.card-hover {
        z-index: 1000;
        box-shadow: .1em .1em 0.15em #333;
        filter: none;
    }
    .playingCards ul.cardRow li.cardContainer:not(.blocked).card-hover {
        z-index: 1000;
        transform: translateY(calc(var(--card-hover-lift, 0px) - 1.5em)) rotate(var(--card-rotation, 0deg));
        filter: drop-shadow(0.2em 0.2em 0.3em rgba(0,0,0,0.4));
        transition: transform 0.15s ease-out, filter 0.15s ease-out;
    }
    .playingCards ul.cardRow[title="cards"] li.cardContainer:not(.blocked):focus-within {
        z-index: 999;
        transform: translateY(calc(var(--card-hover-lift, 0px) - 1.5em)) rotate(var(--card-rotation, 0deg));
    }
    .playingCards ul.cardRow li.cardContainer.ghost.card-hover {
        z-index: 999;
        transform: none;
        filter: none;
    }
    li.cardContainer:not(.blocked).card-hover:active {
        box-shadow: unset;
        filter: none;
    }

    li.cardContainer:active{
        /* box-shadow: unset;
        transform: translate(2.5px,2.5px);
        padding:23px;
        margin-top:-10px;
        margin-left:-10px; */
    }

    .playerScreen .deckHand .hand:focus-within :not(li.cardContainer:focus-within *)
       {
        opacity: 0.6;
        filter:none;
    }
    .playerScreen .deckHand .hand:has(li.cardContainer.card-hover) :not(li.cardContainer.card-hover *, li.cardContainer:focus-within *)
       {
        opacity: 0.6;
        filter:none;
    }
        ul.hand li.cardContainer.blocked::after{
        cursor: not-allowed !important;
    }
    .playerScreen .deckHand .hand li.cardContainer:not(.blocked).card-hover{
        opacity: 1 !important;
        z-index: 1000;
    }

    .playerScreen .deckHand .hand li.cardContainer:not(.blocked):focus-within{
        opacity: 1 !important;
        z-index: 2;
    }

    .playerScreen .deckHand .hand li.cardContainer.blocked.card-hover {
        opacity: 0.55 !important;
        z-index: 999;
    }
    li.cardContainer:not(.blocked):not(.faceDown).card-hover > .smallCard{
        background: var(--card-background-highlight);
    }
    li.cardContainer:not(.blocked):not(.faceDown):focus-within
    {
        & .smallCard{
            background: var(--card-background-highlight);
        }
    }

.playingCards label.card {
    cursor: pointer;
}

.playingCards .card.back,
.duplicate-deck-flight .card.back {
    text-indent: -4000px;
    background-color: #ccc;
    background-repeat: repeat;
    background-image: url(data:image/gif;base64,R0lGODlhJAAkAJEAAOjFsezdztOKbL5QKCH5BAAAAAAALAAAAAAkACQAAAL/HC4RAqm/mmLHyHmAbczB11Ea8ombJKSgKo6Z17pXFznmS1JptiX0z3vVhpEKDoUIkoa0olGIUeZUk1RI6Yn2mh/FDAt6frOrRRTqXPpsVLYugzxaVy+YcBdnoWPZOT0E4eckQtZFZBjWoHixQFWl6Nhol6R2p1Okt5TGaEWZA6fjiMdhZgPHeWrTWGVq+jTZg1HYyAEWKLYzmyiGKoUimilz+YYryyTlg5RcDJSAbNx0Q7lMcbIGEyzTK8zVdfVaImzs/QV+prYqWWW2ObkoOApM/Em/rUlIm7fijs8a2EEKEaZ3AsMUgneEU6RcpJbZ27aGHkAO2Ors8xQH1IR0Bn5YnOtVAAA7); /* image is "Pattern 069" from http://www.squidfingers.com/patterns/ */
    background-image: -moz-repeating-linear-gradient(34% 6% 135deg,#0F1E59, #75A1BF, #3E3E63 50%);
    background-image: -webkit-gradient(radial, center center, 20, center center, 80, from(#3c3), color-stop(0.4, #363), to(#030));
    /* yes, it's intentional that Mozilla, Webkit, Opera and IE all will get different backgrounds ... why not? :) */
}

/* suit colours
********************************************************************/

.playingCards .card.diams {
    color: #f00 !important;
}
.playingCards .card.hearts {
    color: #f00 !important;
}
.playingCards .card.spades {
    color: #000 !important;
}
.playingCards .card.clubs {
    color: #000 !important;
}

/* inner bits
********************************************************************/

.playingCards .card .rank,
.playingCards .card .suit {
    display: block;
    line-height: 1;
    text-align: left;
    align-self: start;
    justify-self: start;
}
.playingCards .card .suit {
    line-height: .7;
    width: 100%;
}

/* checkbox */
.playingCards .card input {
    margin-top: -.05em;
    font: inherit;
}
.playingCards .card.rank-j input,
.playingCards .card.rank-q input,
.playingCards .card.rank-k input,
.playingCards .card.rank-a input {
    margin-top: 2.4em;
}

/* different rank letters for different languages */
.playingCards .card .rank:after {
    position: absolute;
    top: .25em;
    left: .25em;
    background: #fff;
}
[lang=de] .playingCards .card.rank-j .rank:after {
    content: "B";
}
[lang=fr] .playingCards .card.rank-j .rank:after {
    content: "V";
}
[lang=de] .playingCards .card.rank-q .rank:after,
[lang=fr] .playingCards .card.rank-q .rank:after {
    content: "D";
}
[lang=fr] .playingCards .card.rank-k .rank:after {
    content: "R";
}

/* inner multiple suits */
.playingCards .card .suit:after {
    display: block;
    margin-top: -.8em;
    text-align: center;
    white-space: pre;
    line-height: .9;
    font-size: 1.3em;
    word-spacing: -.05em;
}

/* make the hearts and clubs symbols fit, because they are a bit bigger than the others */
.playingCards .card.hearts .suit:after {
    word-spacing: -.15em;
}
.playingCards .card.hearts.rank-10 .suit:after {
    word-spacing: -.05em;
    letter-spacing: -.1em;
}
.playingCards .card.clubs.rank-10 .suit:after {
    word-spacing: -.15em;
}

/* 8, 9, 10 are the most crowded */
.playingCards .card.rank-8 .suit:after,
.playingCards .card.rank-9 .suit:after {
    letter-spacing: -.075em;
}
.playingCards .card.rank-10 .suit:after {
    letter-spacing: -.1em;
}
.playingCards .card.clubs .suit:after {
    letter-spacing: -.125em;
}

/*____________ symbols in the middle (suits, full) ____________*/

/* diamonds */
.playingCards .card.rank-2.diams .suit:after {
    content: "\2666 \A\A\2666";
}
.playingCards .card.rank-3.diams .suit:after {
    content: "\2666 \A\2666 \A\2666";
}
.playingCards .card.rank-4.diams .suit:after {
    content: "\2666\00A0\00A0\00A0\2666 \A\A\2666\00A0\00A0\00A0\2666";
}
.playingCards .card.rank-5.diams .suit:after {
    content: "\2666\00A0\00A0\00A0\2666 \A\2666 \A\2666\00A0\00A0\00A0\2666";
}
.playingCards .card.rank-6.diams .suit:after {
    content: "\2666\00A0\00A0\00A0\2666 \A\2666\00A0\00A0\00A0\2666 \A\2666\00A0\00A0\00A0\2666";
}
.playingCards .card.rank-7.diams .suit:after {
    content: "\2666\00A0\00A0\2666 \A\2666\00A0\2666\00A0\2666 \A\2666\00A0\00A0\2666";
}
.playingCards .card.rank-8.diams .suit:after {
    content: "\2666\00A0\2666\00A0\2666 \A\2666\00A0\00A0\2666 \A\2666\00A0\2666\00A0\2666";
}
.playingCards .card.rank-9.diams .suit:after {
    content: "\2666\00A0\2666\00A0\2666 \A\2666\00A0\2666\00A0\2666 \A\2666\00A0\2666\00A0\2666";
}
.playingCards .card.rank-10.diams .suit:after {
    content: "\2666\00A0\2666\00A0\2666 \A\2666\00A0\2666\00A0\2666\00A0\2666 \A\2666\00A0\2666\00A0\2666";
}

/* hearts */
.playingCards .card.rank-2.hearts .suit:after {
    content: "\2665 \A\A\2665";
}
.playingCards .card.rank-3.hearts .suit:after {
    content: "\2665 \A\2665 \A\2665";
}
.playingCards .card.rank-4.hearts .suit:after {
    content: "\2665\00A0\00A0\00A0\2665 \A\A\2665\00A0\00A0\00A0\2665";
}
.playingCards .card.rank-5.hearts .suit:after {
    content: "\2665\00A0\00A0\00A0\2665 \A\2665 \A\2665\00A0\00A0\00A0\2665";
}
.playingCards .card.rank-6.hearts .suit:after {
    content: "\2665\00A0\00A0\00A0\2665 \A\2665\00A0\00A0\00A0\2665 \A\2665\00A0\00A0\00A0\2665";
}
.playingCards .card.rank-7.hearts .suit:after {
    content: "\2665\00A0\00A0\2665 \A\2665\00A0\2665\00A0\2665 \A\2665\00A0\00A0\2665";
}
.playingCards .card.rank-8.hearts .suit:after {
    content: "\2665\00A0\2665\00A0\2665 \A\2665\00A0\00A0\2665 \A\2665\00A0\2665\00A0\2665";
}
.playingCards .card.rank-9.hearts .suit:after {
    content: "\2665\00A0\2665\00A0\2665 \A\2665\00A0\2665\00A0\2665 \A\2665\00A0\2665\00A0\2665";
}
.playingCards .card.rank-10.hearts .suit:after {
    content: "\2665\00A0\2665\00A0\2665 \A\2665\00A0\2665\00A0\2665\00A0\2665 \A\2665\00A0\2665\00A0\2665";
}

/* spades */
.playingCards .card.rank-2.spades .suit:after {
    content: "\2660 \A\A\2660";
}
.playingCards .card.rank-3.spades .suit:after {
    content: "\2660 \A\2660 \A\2660";
}
.playingCards .card.rank-4.spades .suit:after {
    content: "\2660\00A0\00A0\00A0\2660 \A\A\2660\00A0\00A0\00A0\2660";
}
.playingCards .card.rank-5.spades .suit:after {
    content: "\2660\00A0\00A0\00A0\2660 \A\2660 \A\2660\00A0\00A0\00A0\2660";
}
.playingCards .card.rank-6.spades .suit:after {
    content: "\2660\00A0\00A0\00A0\2660 \A\2660\00A0\00A0\00A0\2660 \A\2660\00A0\00A0\00A0\2660";
}
.playingCards .card.rank-7.spades .suit:after {
    content: "\2660\00A0\00A0\2660 \A\2660\00A0\2660\00A0\2660 \A\2660\00A0\00A0\2660";
}
.playingCards .card.rank-8.spades .suit:after {
    content: "\2660\00A0\2660\00A0\2660 \A\2660\00A0\00A0\2660 \A\2660\00A0\2660\00A0\2660";
}
.playingCards .card.rank-9.spades .suit:after {
    content: "\2660\00A0\2660\00A0\2660 \A\2660\00A0\2660\00A0\2660 \A\2660\00A0\2660\00A0\2660";
}
.playingCards .card.rank-10.spades .suit:after {
    content: "\2660\00A0\2660\00A0\2660 \A\2660\00A0\2660\00A0\2660\00A0\2660 \A\2660\00A0\2660\00A0\2660";
}

/* clubs */
.playingCards .card.rank-2.clubs .suit:after {
    content: "\2663 \A\A\2663";
}
.playingCards .card.rank-3.clubs .suit:after {
    content: "\2663 \A\2663 \A\2663";
}
.playingCards .card.rank-4.clubs .suit:after {
    content: "\2663\00A0\00A0\00A0\2663 \A\A\2663\00A0\00A0\00A0\2663";
}
.playingCards .card.rank-5.clubs .suit:after {
    content: "\2663\00A0\00A0\00A0\2663 \A\2663 \A\2663\00A0\00A0\00A0\2663";
}
.playingCards .card.rank-6.clubs .suit:after {
    content: "\2663\00A0\00A0\00A0\2663 \A\2663\00A0\00A0\00A0\2663 \A\2663\00A0\00A0\00A0\2663";
}
.playingCards .card.rank-7.clubs .suit:after {
    content: "\2663\00A0\00A0\2663 \A\2663\00A0\2663\00A0\2663 \A\2663\00A0\00A0\2663";
}
.playingCards .card.rank-8.clubs .suit:after {
    content: "\2663\00A0\2663\00A0\2663 \A\2663\00A0\00A0\2663 \A\2663\00A0\2663\00A0\2663";
}
.playingCards .card.rank-9.clubs .suit:after {
    content: "\2663\00A0\2663\00A0\2663 \A\2663\00A0\2663\00A0\2663 \A\2663\00A0\2663\00A0\2663";
}
.playingCards .card.rank-10.clubs .suit:after {
    content: "\2663\00A0\2663\00A0\2663 \A\2663\00A0\2663\00A0\2663\00A0\2663 \A\2663\00A0\2663\00A0\2663";
}

/*____________ symbols in the middle (faces as dingbat symbols) ____________*/

.playingCards .card.rank-j .suit:after,
.playingCards .card.rank-q .suit:after,
.playingCards .card.rank-k .suit:after,
.playingCards .card.rank-a .suit:after {
    font-family: Georgia, serif;
    position: absolute;
    font-size: 3em;
    right: .1em;
    bottom: .25em;
    word-spacing: normal;
    letter-spacing: normal;
    line-height: 1;
}
.playingCards .card.rank-j .suit:after {
    content: "\265F";
    right: .15em;
}
.playingCards .card.rank-q .suit:after {
    content: "\265B";
}
.playingCards .card.rank-k .suit:after {
    content: "\265A";
}

/* big suits in middle */
.playingCards .card.rank-a .suit:after {
    font-family: Arial, sans-serif;
    line-height: .9;
    bottom: .35em;
}
.playingCards .card.rank-a.diams .suit:after {
    content: "\2666";
    right: .4em;
}
.playingCards .card.rank-a.hearts .suit:after {
    content: "\2665";
    right: .35em;
}
.playingCards .card.rank-a.spades .suit:after {
    content: "\2660";
    right: .35em;
}
.playingCards .card.rank-a.clubs .suit:after {
    content: "\2663";
    right: .3em;
}

/*in play */

.playingCards ul.table,
.playingCards ul.hand,
.playingCards ul.deck {
    list-style-type: none;
    padding: 0;
    /* margin: 0 0 0.5rem 0; */
    position: relative;
    clear: both;
}
.playingCards ul.hand {
    margin-bottom: 3.5em;
}
.playingCards ul.table li,
.playingCards ul.hand li,
.playingCards ul.deck li {
    padding: 0;
    list-style-type: none;
    float: left;
}

.playingCards ul.hand,
.playingCards ul.deck {
    height: 8em;
}
.playingCards ul.hand li,
.playingCards ul.deck li {
    position: absolute;
}
.playingCards ul.hand li {
    bottom: 0;
}

.playingCards .hand-scroll {
    --hand-fan-width: calc(8.8em + 5.25rem);
    display: flex;
    flex: 1 1 60%;
    align-items: flex-end;
    gap: 1rem;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
}

.playingCards .hand-scroll .hand-fan {
    flex: 0 0 var(--hand-fan-width);
    width: var(--hand-fan-width);
    min-width: var(--hand-fan-width);
    height: var(--hand-row-height, 8em);
    margin: 0;
    clear: none;
    overflow: visible;
}


ul.basic-mat{
    padding: 0;

    & li.cardContainer{
        margin: 0;
        padding: 0;
    }
}
ul.basic-mat li.cardContainer:active{
        padding: 2.5px;
        margin: -2.5px;
        padding-right: 2.5px;
        padding-bottom: 2.5px;
    }
ul.basic-mat .card{
    margin:0;
    border: 3px solid black;
}


ul.cardRow{    
    position: relative;
    padding: 0;
    margin: 0;
    min-width: 5rem;
    min-height: 7.5rem;
}

.playingCards ul.cardRow li.cardContainer {
    position: absolute;
    bottom: 0;
    left: 0;
}

.playingCards ul.cardRow li.cardContainer {
    transform: translateY(var(--card-hover-lift, 0px)) rotate(var(--card-rotation, 0deg));
}

.playingCards ul.cardRow li.cardContainer:not(.duplicate) {
    transition: transform 0.15s ease-out, filter 0.3s ease, box-shadow 0.3s ease;
}

.playingCards ul.cardRow li.cardContainer:nth-child(1) { left: 0; z-index: 1; }
.playingCards ul.cardRow li.cardContainer:nth-child(2) { left: 3.2em; z-index: 2; }
.playingCards ul.cardRow li.cardContainer:nth-child(3) { left: 4.6em; z-index: 3; }
.playingCards ul.cardRow li.cardContainer:nth-child(4) { left: 6.0em; z-index: 4; }
.playingCards ul.cardRow li.cardContainer:nth-child(5) { left: 7.4em; z-index: 5; }
.playingCards ul.cardRow li.cardContainer:nth-child(6) { left: 8.8em; z-index: 6; }
.playingCards ul.cardRow li.cardContainer:nth-child(7) { left: 10.2em; z-index: 7; }
.playingCards ul.cardRow li.cardContainer:nth-child(8) { left: 11.6em; z-index: 8; }
.playingCards ul.cardRow li.cardContainer:nth-child(9) { left: 13.0em; z-index: 9; }
.playingCards ul.cardRow li.cardContainer:nth-child(10) { left: 14.4em; z-index: 10; }
.playingCards ul.cardRow li.cardContainer:nth-child(11) { left: 15.8em; z-index: 11; }
.playingCards ul.cardRow li.cardContainer:nth-child(12) { left: 17.2em; z-index: 12; }
.playingCards ul.cardRow li.cardContainer:nth-child(13) { left: 18.6em; z-index: 13; }
.playingCards ul.cardRow li.cardContainer:nth-child(14) { left: 20.0em; z-index: 14; }
.playingCards ul.cardRow li.cardContainer:nth-child(15) { left: 21.4em; z-index: 15; }
.playingCards ul.cardRow li.cardContainer:nth-child(16) { left: 22.8em; z-index: 16; }
.playingCards ul.cardRow li.cardContainer:nth-child(17) { left: 24.2em; z-index: 17; }
.playingCards ul.cardRow li.cardContainer:nth-child(18) { left: 25.6em; z-index: 18; }
.playingCards ul.cardRow li.cardContainer:nth-child(19) { left: 27.0em; z-index: 19; }
.playingCards ul.cardRow li.cardContainer:nth-child(20) { left: 28.4em; z-index: 20; }
.playingCards ul.cardRow li.cardContainer:nth-child(21) { left: 29.8em; z-index: 21; }
.playingCards ul.cardRow li.cardContainer:nth-child(22) { left: 31.2em; z-index: 22; }
.playingCards ul.cardRow li.cardContainer:nth-child(23) { left: 32.6em; z-index: 23; }
.playingCards ul.cardRow li.cardContainer:nth-child(24) { left: 34.0em; z-index: 24; }
.playingCards ul.cardRow li.cardContainer:nth-child(25) { left: 35.4em; z-index: 25; }

.playingCards ul.cardRow + ul.cardRow.overflow-row {
    margin-top: 0.5rem;
}

.playingCards ul.hologramRow + ul.hologramRow.overflow-row {
    margin-top: 0.5rem;
}

.playingCards .hand-scroll .hand-fan > li.cardContainer {
    left: 0;
}

.playingCards .hand-scroll .hand-fan > li:not(.cardContainer) {
    left: 0;
    bottom: 0;
}

.playingCards .hand-scroll .hand-fan > li.cardContainer:nth-child(1)  { left: 0; }
.playingCards .hand-scroll .hand-fan > li.cardContainer:nth-child(2)  { left: 1.1em; }
.playingCards .hand-scroll .hand-fan > li.cardContainer:nth-child(3)  { left: 2.2em; }
.playingCards .hand-scroll .hand-fan > li.cardContainer:nth-child(4)  { left: 3.3em; }
.playingCards .hand-scroll .hand-fan > li.cardContainer:nth-child(5)  { left: 4.4em; }
.playingCards .hand-scroll .hand-fan > li.cardContainer:nth-child(6)  { left: 5.5em; }
.playingCards .hand-scroll .hand-fan > li.cardContainer:nth-child(7)  { left: 6.6em; }
.playingCards .hand-scroll .hand-fan > li.cardContainer:nth-child(8)  { left: 7.7em; }
.playingCards .hand-scroll .hand-fan > li.cardContainer:nth-child(9)  { left: 8.8em; }

.playingCards.rotateHand .hand-scroll .hand-fan > li.cardContainer:nth-child(1),
.playingCards.rotateHand .hand-scroll .hand-fan > li:not(.cardContainer) { --hand-tx: 1.9em; --hand-ty: .9em; --hand-rot: -42deg; }
.playingCards.rotateHand .hand-scroll .hand-fan > li.cardContainer:nth-child(2) { --hand-tx: 1.5em; --hand-ty: .5em; --hand-rot: -33deg; }
.playingCards.rotateHand .hand-scroll .hand-fan > li.cardContainer:nth-child(3) { --hand-tx: 1.1em; --hand-ty: .3em; --hand-rot: -24deg; }
.playingCards.rotateHand .hand-scroll .hand-fan > li.cardContainer:nth-child(4) { --hand-tx: .7em;  --hand-ty: .2em; --hand-rot: -15deg; }
.playingCards.rotateHand .hand-scroll .hand-fan > li.cardContainer:nth-child(5) { --hand-tx: .3em;  --hand-ty: .1em; --hand-rot: -6deg; }
.playingCards.rotateHand .hand-scroll .hand-fan > li.cardContainer:nth-child(6) { --hand-tx: -.1em; --hand-ty: .1em; --hand-rot: 3deg; }
.playingCards.rotateHand .hand-scroll .hand-fan > li.cardContainer:nth-child(7) { --hand-tx: -.5em; --hand-ty: .2em; --hand-rot: 12deg; }
.playingCards.rotateHand .hand-scroll .hand-fan > li.cardContainer:nth-child(8) { --hand-tx: -.9em; --hand-ty: .3em; --hand-rot: 21deg; }
.playingCards.rotateHand .hand-scroll .hand-fan > li.cardContainer:nth-child(9) { --hand-tx: -1.3em; --hand-ty: .6em; --hand-rot: 30deg; }

.playingCards.rotateHand .hand-scroll .hand-fan > li.cardContainer,
.playingCards.rotateHand .hand-scroll .hand-fan > li:not(.cardContainer) {
    transform: translate(var(--hand-tx), calc(var(--hand-ty) + var(--card-hover-lift, 0px))) rotate(var(--hand-rot));
}

.playingCards.rotateHand .hand-scroll .hand-fan > li.cardContainer:not(.duplicate) {
    transition: transform 0.15s ease-out;
}

.playingCards.rotateHand .hand-scroll .hand-fan > li.cardContainer.ghost {
    transform: translate(var(--hand-tx), calc(calc(var(--hand-ty) - 20px) * 1.2 + var(--card-hover-lift, 0px))) rotate(var(--hand-rot));
}

 
li.cardContainer{
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    width: calc(4.75rem + 6px);
    height: calc(6.5rem + 6px);
    border-radius: 0.5rem;
    margin: 0;
    box-shadow: .1em .1em 0.15em #333;
    position: relative;

}
.playerScreen li.cardContainer::after{
       content:"";
       top:0;
       right:0;
       width:100%;
       height:100%;
       position: absolute;
}

.hand li.cardContainer{
    box-shadow: 0.2em 0.2em 0.15em #333;
    position: absolute;
}

.cardInfo{
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: center;
    align-self: center;
    justify-self: center;
    width: 100%;
    gap: 0.2rem;
}
    
    .cardInfo .cardType{
        padding: 0;
        margin-block-start: 0;
        margin-bottom: 0.25rem;
        font-size: 1.25rem;
        font-weight: 600;
        text-transform: uppercase;
    }
    .cardInfo h2{
        padding:0;
        margin-block-start: 0;
        margin: 0;
    }

    .smallCardInfo{
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: center;
    align-self: center;
    justify-self: center;
    text-align: center;
    gap: 0.2rem;
    cursor:inherit;
}
    
    .smallCardInfo .cardType{
        padding: 0;
        margin-block-start: 0;
        margin-bottom: 0.25rem;
        font-size: .75rem;
        font-weight: 600;
        text-transform: uppercase;
        cursor:inherit;
    }

    .cardsText{
        height: fit-content;
        display: flex;
        flex-direction: column;
        max-width: 100%;
        gap: 0.35rem;
        justify-content: flex-start;
        align-items: flex-start;
        padding-top: 1rem;
        cursor:inherit;
    }
    .cardsText h3{
        margin:0;
    }
    ul.hand li.cardContainer{
        &::after{
            cursor: grab;
        }
    }
    ul.hand li.cardContainer.ghost{
        cursor: default;
        &::after{
            cursor: default;
        }
    }
    li.cardContainer > .smallCard{
        background: var(--card-background);
        position: relative;
        border-radius: 0.5rem;
        border: 3px solid black;
        max-height: 6rem;
        max-width: 10rem;
    }
    li.cardContainer > .smallCard a{
        text-align: center;
    }
    li.cardContainer > .smallCard a::before{
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        border-radius: 0.5rem;
    }

.playingCards li.cardContainer > .card.smallCard {
    border-radius: 0.5rem;
    border: 3px solid black;
    overflow: hidden;
}
.playingCards ul.cardRow li.cardContainer > .card.smallCard {
    border: 3px solid black;
}
    li.cardContainer > .smallCard a:focus{
        outline:0;
    }

.cardContainer:focus-within *{
    outline:0;
}


li.cardContainer > .smallCard button {
    border: none;
    padding-block: 0;
    padding-inline: 0;
    width: 100%;
    justify-self: center;
    background: transparent;
    font-size: inherit;
    justify-content: start;
    display: flex;
    flex-direction: column;
    color:inherit;
}

li.cardContainer > .smallCard a, li.cardContainer > .smallCard p:is(:not(.cardType)){
    text-align: center;
    line-height: 0.6rem;
    height: 1.25rem;
    overflow: hidden;
    font-size: 0.73rem;
    margin-block-start: 0;
    margin-block-end: 0;
}

.playerScreen li.cardContainer.card-hover > .smallCard a::after{
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.3);
}

ul.hand li.cardContainer > .card.smallCard::after{
    content:"";
    position: absolute;
    z-index: 2;
    background-image: -webkit-gradient(radial, center center, 20, center center, 80, from(#3c3), color-stop(0.4, #363), to(#030));
    right: 100%;
    top: 100%;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 0.5rem;
    border: 3px solid black;
    transition: all 0.25s ease-in-out;
}

.duplicate {
    pointer-events: none;
    user-select: none;
    z-index: 999;
    transition: transform var(--move-duration, 0.45s) cubic-bezier(.2, .8, .2, 1);
    will-change: transform;
}

    .duplicate-deck-flight {
        overflow: hidden;
    }

        .duplicate-deck-flight > .card.back {
            display: block;
            box-sizing: border-box;
            width: 100%;
            height: 100%;
            max-width: none;
            max-height: none;
            margin: 0;
        }

    .duplicate.to-original {
        transform: translate(var(--move-x, 0px), var(--move-y, 0px)) !important;
    }

    .duplicate.flipFaceUp.to-original {
        transform: rotateY(90deg) !important;
    }

.playerScreen .cardContainer.loading:not(.duplicate) {
    visibility: hidden;
}

.playerScreen li.cardContainer.blocked {
    filter: grayscale(0.85) !important;
    box-shadow: none;
    cursor: not-allowed;
}

.playerScreen ul.deck.blocked {
    filter: grayscale(0.85);
    cursor: not-allowed;
}

    .playerScreen ul.deck.blocked button.draw:disabled {
        filter: grayscale(0.85);
        cursor: not-allowed;
    }

.playerScreen li.cardContainer.blocked.card-hover {
    z-index: 999;
    box-shadow: none;
}

.playerScreen ul.hand li.cardContainer:not(.blocked).card-hover > .card.smallCard::after {
    right: 80%;
    top: 80%;
    filter: drop-shadow(4px 4px 4px #000);
}

.smallCardInfo{
    font-size: 14px;
}

    .smallCardInfo .cardType{
        padding: 0;
        margin-block-start: 0px;
        margin-bottom: -2.75rem;
        font-size: 7px;
        font-weight: 800;
        text-transform: uppercase;
        align-self: center;
        justify-self: flex-end;
        cursor:inherit;
    }


.cards,
.decks{
    align-items: end;
    display:flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0;
    margin: 0;
    height: fit-content;
    width:100%;
}
    .cards h2,
    .decks h2{
        margin:0;
    }
    .cards p,
    .decks p{
        margin: 0;
        padding-left: 0.5rem;
    }

.cardOptions{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: stretch;
    justify-content: space-evenly;
}
    .cardOptions .smallCard{
        display: flex;
        flex-direction: column-reverse;
        height: 9rem;
        align-items: center;
        align-content: center;
        justify-content: space-between;
        width: 5rem;
    }

        .cardOptions .smallCard label{
            display: flex;
            flex-direction: column;
        }
            .cardOptions .smallCard label .fit-picture {
                margin:0;
            }

.card.back.emptyDeck, .card.back.emptyHand  {
    border-style: dashed;
    border-width: thick;
    background: transparent;
    box-shadow: none;
    top: 4px;
    left: -4px;
}

/* large screen and boards */
div.playerScreen{
    width: 100%;
    /* width: 100vw; */
    height: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
}
    .playerScreen .players{
        z-index: 3;
        position: absolute;
        height: 0;
    }
    .playerScreen > ul{
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    .playerScreen > ul:not(.enemyBoards){
        margin:0;
        padding:0;
        position: fixed;
        bottom: 0;
        gap: 0;
    }
    .playerScreen ul.enemyBoards {
        display: flex;
        width: 100%;
        height: fit-content;
        flex-direction: column;
        flex-wrap: nowrap;
        padding-top: 1rem;
    }
        .playerScreen ul.enemyBoards li.enemyBoard {
            display: flex;
            max-width: 100%;
            max-height: 40%;
            flex-direction: row;
        }
        .playerScreen ul.enemyBoards li.enemyBoard > p{        
            margin-top: -1rem;
            margin-left: -1rem;
            position: absolute;
        }

    .playerScreen .playerBoard{
        /* --player-board-min-height: 50%;
        min-height: var(--player-board-min-height); */
        width: 100%;
        position: relative;
        display: flex;
        flex-direction: row;
    }
        .playerScreen li.playerBoard h2, .playerScreen li.enemyBoard h2{
            position: absolute;
            left: 9%;
            height: 0;
            margin: 0;
            width: 0;
            z-index: 1;
            opacity: 0.15;
            color: #114503;
            transform: rotate(-16deg);
            pointer-events: none;
            user-select: none;
            top: 10%;
        }
            .playerScreen li.enemyBoard h2{
                top: unset;
                bottom: 13%;
            }

/* deckhands */
.playerScreen .enemyDeckHand {
    z-index: 1;
    position: relative;
    min-height: 8em;
    width: 8.5%;
    display: flex;
    flex-direction: column-reverse;
    padding-top: 2%;
}
.playerScreen .enemyDeckHand > .hand {
    display: none;
}
 .playerScreen .enemyDeckHand > .hand > li.cardContainer {
    /* position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto !important;
    float: none;
    flex: 0 0 calc(4.75rem + 6px); */
}    

.playerScreen .enemyDeckHand,
.playerScreen .enemyDeckHand * {
    pointer-events: none;
    user-select: none;
    cursor: default;
}
    .playerScreen .enemyDeckHand .enemy-deck-stack {
        position: relative;
        left: 0;
        bottom: 0;
        z-index: 2;
        width: 100%;
        height: var(--hand-row-height, 8em);
    }

    .playerScreen .enemyDeckHand .deck-stack > ul.deck {
        cursor: default;
    }

    .playerScreen .enemyDeckHand .enemy-targeting{
        padding-left: 2rem;
        padding-right: 1rem;
        height: 100%;
        display: none;
        flex-direction: column;
        
        & > p{        
            margin-block-start: 0;
            margin-block-end: 0;
            justify-self: center;
            align-self: center;
        }
        & .small-buttons{        
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
        }
        & .small-buttons button{
            pointer-events: all;
            user-select: none;
            cursor: pointer;
        }
        & .small-buttons button:last-child{
            right: 0;
        }
        & .small-buttons button:disabled{
            cursor: not-allowed;
        }
    }

li.playerBoard > ul.basic-mat{
    display: flex;
    flex-direction: column;
    width: 100%;
}

.playerScreen > .deckHand{
    --hand-row-height: 8em;
    z-index: 1;
    display: flex;
    width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-end;
    min-height: var(--hand-row-height);
    height: 25%;
    position: absolute;
    bottom: 0;
}
.playerScreen .deckHand > .deck {
    max-width: 20%;
    max-height: 100%;
}

.playerScreen .deckHand > .hand,
.playerScreen .deckHand > .hand-scroll,
.playerScreen .deckHand > .hand-fan {
    align-self: flex-end;
    height: var(--hand-row-height);
    margin-bottom: 0;
    width: 60%;
    margin: 0 20%;
}

.playerScreen .deckHand > .hand-scroll {
    height: var(--hand-row-height, 8em);
    overflow: visible;
}
    .playerScreen .deckHand > .hand-scroll > .cardActionForm {
        position: absolute;
        right: 0;
        bottom: 0;    
        margin-bottom: 1em;
        margin-right: 1em;
    }

.playerScreen.enemyTurnFocus .deckHand,
.playerScreen.enemyTurnFocus .playerBoard {
    opacity: 0.3;
    filter: grayscale(0.9);
    pointer-events: none;
    user-select: none;
    transition: opacity 0.4s ease-in-out, filter 0.4s ease-in-out;
}

@media (max-width: 700px) {
    .playerScreen .deckHand > .hand-scroll {
        width: calc(100% - 6.5rem);
        max-width: calc(100% - 6.5rem);
        flex-basis: calc(100% - 6.5rem);
        margin-right: 0;
        margin-left: 6.5rem;
    }

    .playerScreen .deckHand > .deck-stack {
        width: 6.5rem;
    }

    .playerScreen .deckHand .deck-stack > ul.deck {
        left: calc(.75rem + var(--deck-indicator-count, 0) * .45rem);
        width: calc(5.75rem - var(--deck-indicator-count, 0) * .45rem);
    }

    .playerScreen .deck-stack > ul.deck-indicator li {
        width: 1.3rem;
        height: .95rem;
    }
}
.playingCards ul.deck li:nth-child(1)  { left: 0;    bottom: 0; }
.playingCards ul.deck li:nth-child(2)  { left: 2px;  bottom: 1px; }
.playingCards ul.deck li:nth-child(3)  { left: 4px;  bottom: 2px; }
.playingCards ul.deck li:nth-child(4)  { left: 6px;  bottom: 3px; }
.playingCards ul.deck li:nth-child(5)  { left: 8px;  bottom: 4px; }
.playingCards ul.deck li:nth-child(6)  { left: 10px; bottom: 5px; }
.playingCards ul.deck li:nth-child(7)  { left: 12px; bottom: 6px; }
.playingCards ul.deck li:nth-child(8)  { left: 14px; bottom: 7px; }
.playingCards ul.deck li:nth-child(9)  { left: 16px; bottom: 8px; }
.playingCards ul.deck li:nth-child(10) { left: 18px; bottom: 9px; }
.playingCards ul.deck li:nth-child(11) { left: 20px; bottom: 10px; }
.playingCards ul.deck li:nth-child(12) { left: 22px; bottom: 11px; }
.playingCards ul.deck li:nth-child(13) { left: 24px; bottom: 12px; }
.playingCards ul.deck li:nth-child(14) { left: 26px; bottom: 13px; }
.playingCards ul.deck li:nth-child(15) { left: 28px; bottom: 14px; }
.playingCards ul.deck li:nth-child(16) { left: 30px; bottom: 15px; }
.playingCards ul.deck li:nth-child(17) { left: 32px; bottom: 16px; }
.playingCards ul.deck li:nth-child(18) { left: 34px; bottom: 17px; }
.playingCards ul.deck li:nth-child(19) { left: 36px; bottom: 18px; }
.playingCards ul.deck li:nth-child(20) { left: 38px; bottom: 19px; }
.playingCards ul.deck li:nth-child(21) { left: 40px; bottom: 20px; }
.playingCards ul.deck li:nth-child(22) { left: 42px; bottom: 21px; }
.playingCards ul.deck li:nth-child(23) { left: 44px; bottom: 22px; }
.playingCards ul.deck li:nth-child(24) { left: 46px; bottom: 23px; }
.playingCards ul.deck li:nth-child(25) { left: 48px; bottom: 24px; }
.playingCards ul.deck li:nth-child(26) { left: 50px; bottom: 25px; }
.playingCards ul.deck li:nth-child(27) { left: 52px; bottom: 26px; }
.playingCards ul.deck li:nth-child(28) { left: 54px; bottom: 27px; }
.playingCards ul.deck li:nth-child(29) { left: 56px; bottom: 28px; }
.playingCards ul.deck li:nth-child(30) { left: 58px; bottom: 29px; }
.playingCards ul.deck li:nth-child(31) { left: 60px; bottom: 30px; }
.playingCards ul.deck li:nth-child(32) { left: 62px; bottom: 31px; }

.playingCards ul.deck-indicator {
    list-style-type: none;
    padding: 0;
    margin: 0;
    position: absolute;
    height: 8em;
    width: 8em;
}
    .playingCards ul.deck-indicator li {
        padding: 0;
        list-style-type: none;
        position: absolute;
        height: 8em;
        width: 8em;
    }

.playerScreen .deck-stack {
    position: relative;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 8.5%;
    height: var(--hand-row-height, 8em);
}
   .playerScreen .deck-stack > ul.deck {
    position: relative;
    left: 2rem;
   }
        .playerScreen .deck-stack > ul.deck.active-deck {
            z-index: 10;
        }

    .playerScreen .deck-stack > ul.deck-indicator {
        left: var(--deck-indicator-offset, 0);
        bottom: 0;
        z-index: 1;
        pointer-events: none;
        user-select: none;
        cursor: default;
    }

        .playerScreen .deck-stack > ul.deck-indicator li {
            left: 0;
            bottom: 0;
        }
            .deck-indicator-face {
                display: block;
                width: 100%;
                height: 100%;
            }

/* lanes and fieldcards */
.enemyBoard ul.lanes{
    padding-top: 2%;
}
ul.lanes {    
    align-self: center;
    justify-self: center;
    display: flex;
    flex-wrap: nowrap;
    flex-direction: row;
    align-items: stretch;
    width: 82vw;
    gap: 0.5rem;
}
    ul.lanes li.lane {
        flex: 1;
        min-width: 8rem;
        position: relative;
    }
    ul.lanes li.lane.Intelligence {
        background-color: 
        rgb(213 193 235);
    }
    ul.lanes li.lane.Speed {
        background-color: 
        rgb(252 247 207);
    }
    ul.lanes li.lane.Visciousness {
        background-color: 
        rgb(215 155 155);
    }
    ul.lanes li.lane.Resolve {
        background-color: 
        rgb(178 193 180);
    }
    ul.lanes li.lane > p {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 5;
        pointer-events: none;
        user-select: none;
        margin: 0;
        padding: 0 .5em;
    }
    ul.lanes li.lane > p::before{
        content: "";
        display: block;
        width: 100%;
        height: 2px;
        background-color: black;
        margin-bottom: 5px;
    }
    ul.lanes li.lane > p::after{
        content: "";
        display: block;
        width: 100%;
        height: 2px;
        background-color: black;
        margin-top: 5px;
    }

    ul.lanes li.lane > ul.cardRow,
    ul.lanes li.lane > ul.hologramRow {
        position: relative;
    }

    ul.lanes li.lane > ul.cardRow.overflow-row,
    ul.lanes li.lane > ul.hologramRow.overflow-row {
        position: absolute;
        left: 0;
        right: 0;
        bottom: calc(100% - var(--lane-row-height, 7.5rem) * var(--overflow-row-index, 1));
    }

    .playingCards ul.cardRow .card {
        margin:0;
        border: 3px solid black;
    }

button.end-turn{
    cursor: pointer;
    display: inline-block;
    width: 4.25rem;
    height: 6rem;
    border: 1px solid #666;
    border-radius: .3em;
    -moz-border-radius: .3em;
    -webkit-border-radius: .3em;
    -khtml-border-radius: .3em;
    padding: .25em;
    margin: 0 .5em .5em 0;
    text-align: center;
    font-size: 1.2em;
    font-weight: normal;
    font-family: Arial, sans-serif;
    position: relative;
    background-color: #fff;
    box-shadow: .2em .2em .35em #333;
}

button.draw{
    letter-spacing: normal;
    box-sizing: unset;
    line-height: unset;
    text-rendering: unset;
    text-shadow: unset;
    unicode-bidi: isolate;
    cursor: pointer;
    pointer-events: inherit;
}

.playerBoard .deck-stack .active-deck:not(.blocked) button.draw:not(.blocked):not(:disabled) {
    transition: transform 0.15s ease-out;
}

.playerBoard .deck-stack .active-deck:not(.blocked) button.draw:not(.blocked):not(:disabled):focus-visible {
    transform: rotate(3deg);
}

.playerBoard .deck-stack .active-deck:not(.blocked) button.draw:not(.blocked):not(:disabled).card-hover {
    transform: rotate(3deg);
}


.fit-picture{
    object-fit: cover;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    background: #ddd;
}
.playerInfo .fit-picture{
    margin: 0 1rem;
    width: 4rem;
}
.players .fit-picture, .cards .fit-picture,  .decks .fit-picture{
    width: 4rem;
}
.smallCard .fit-picture{
    width: 4rem;
    height: 4rem;
    align-self: center;
}

/* =============================================
   Special draw sequence — timeline animations
   ============================================= */

.lane-highlight {
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.5);
    border-color: gold;
    transition: box-shadow 0.3s ease;
}

.card-highlight {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    filter: brightness(1.2);
    transition: all 0.3s ease;
}

.trust-glow {
    animation: trustPulse 1.5s ease-in-out 3;
    border-color: gold !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

@keyframes trustPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
    50% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.9); }
}

.board-dimmed {
    opacity: 0.5;
    filter: grayscale(0.6);
    pointer-events: none;
    user-select: none;
    transition: all 0.5s ease;
}

.deck-shuffle {
    animation: deckWiggle 0.5s ease-in-out;
}

@keyframes deckWiggle {
    0% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-5px) rotate(-3deg); }
    50% { transform: translateX(5px) rotate(3deg); }
    75% { transform: translateX(-3px) rotate(-1deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

.shuffle-flying {
    z-index: 1000;
    pointer-events: none;
    user-select: none;
}

.timeline-banner {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.pauseIndicator {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4em 1em;
    background: rgba(20, 20, 30, 0.85);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 0.5em;
    z-index: 1001;
    font-weight: bold;
    pointer-events: none;
    user-select: none;
}

.pauseIndicator.visible {
    display: block;
}

.playingCards .card.smallCard[class*="rank-"] {
    background-color: var(--card-background);
    overflow: hidden;
}

.playingCards .card.smallCard[class*="rank-"] .smallCardInfo {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    background: transparent;
}

.cardOptions .card.smallCard[class*="rank-"] {
    display: inline-block;
    width: 4.25rem;
    height: 6rem;
}

.spotlight.playing-card-spotlight .rank,
.spotlight.playing-card-spotlight .suit {
    position: absolute;
    left: 0.75rem;
    font-weight: bold;
}

.spotlight.playing-card-spotlight .rank {
    top: 0.5rem;
}

.spotlight.playing-card-spotlight .suit {
    top: 2rem;
}

.playingCards .card.staticCard .smallCardInfo .cardType {
    margin-bottom: -1px;
    background: transparent;
}

.playerScreen .cardActionForm {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

.playingCards .card.back .rank,
.playingCards .card.back .suit,
.playingCards .card.back .smallCardInfo,
.playingCards .card.back .fit-picture {
    visibility: hidden;
}

.playingCards .card.back .suit::after {
    content: none !important;
}

.debug-overlay{
    display:none;
    position: absolute;
    background: white;
    z-index: 3;
    padding: 0.25rem 0.5rem;
    border: 1px solid #000;
}
.debug-overlay-visible {
    display:block;
}

.mouse-preview-cursor {
    position: fixed;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
    user-select: none;
    z-index: 999;
}