/* Page CSS */
#s0-content-layout {
    display: grid;
    grid-template-columns: minmax(auto, 1200px);
    gap: 20px;
    place-content: center;
    justify-items: center;
    margin: 50px 0;
    padding: 0 20px;
}

.s0-two-column {
    display: grid;
    grid-template-columns: 1fr max-content;
    width: 100%;
    gap: 20px;
}

#s0-sidebar {
    justify-self: center;
}

#s0-sidebar>div {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#s0-main {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}


/* Poker Odds App */
#poker-odds-app {
    position: relative;
    display: grid;
    grid-template-columns: minmax(auto, 1000px) auto;
    /*grid-template-rows: minmax(auto, 480px) auto minmax(auto, 160px);*/
    place-content: center;
    place-items: center;
    gap: 10px 20px;
    margin-bottom: 20px;
    padding: 30px 20px 20px 20px;
    background-color: rgb(28, 28, 28);
}

[data-player]:hover {
    cursor: pointer;
}

[data-player]:hover .add-text {
    fill: white;
}

#dealer-cards:hover {
    cursor: pointer;
}

.selected-player .player-frame {
    fill: rgb(248, 147, 13);
}

.selected-player .player-body {
    fill: rgb(255, 255, 255);
}

/*.active-player .player-stats {*/
/*    display: block;*/
/*}*/

.active-player .player-add {
    display: none;
}

.active-player .player-cards {
    display: inherit;
}

.svg-card {
    fill: white;
}

/* Game Stats */
#stat-container {
    width: 100%;
}

#app-logo {
    margin-bottom: 20px;
}

#game-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    place-content: center;
    place-items: center;
    padding: 20px 20px 10px 20px;
    color: rgb(255, 255, 255);
    background-color: rgb(38, 38, 38);
    border: 1px solid rgb(56, 56, 56);
    border-radius: 5px;
}

#game-stats p {
    margin: 5px 0;
}

#p1-header,
#p2-header {
    font-size: 1.5em;
    border-bottom: 1px solid rgb(248, 147, 13);
}

#p1-win,
#p2-win {
    font-size: 2em;
}

/* Status Display */
#status-display {
    grid-column: 1 / 3;
}

#status-display #status-text {
    visibility: hidden;
    min-height: 30px;
    margin: 0;
    padding: 0;
    color: white;
}

#status-calculating {
    visibility: hidden;
    grid-column: 1 / 4;
    min-height: 25px;
    margin: 0;
}

/* Card Display */
#card-container {
    grid-column: 1 / 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(auto, 600px));
    /*grid-template-rows: repeat(2, 80px);*/
    gap: 10px;
}

#card-container .card-suit {
    display: flex;
    gap: 2px;
    padding: 5px;
    background-color: rgb(38, 38, 38);
    border: 1px solid rgb(56, 56, 56);
    border-radius: 5px;
}

#card-container [data-card] {
    height: 100%;
    max-width: 100%;
    width: 100%;
}

#card-container [data-card]:hover {
    transition: scale 0.2s;
    transform: scale(1.1);
    cursor: pointer;
}

#card-container .card-suit [data-owner]:not([data-owner="0"]) {
    opacity: 0.3;
}

#card-container #mobile-cards {
    display: none;
}

#card-container #suit-selector {
    display: none;
}

#card-container #card-control {
    display: none;
}

.control-button {
    width: 100%;
    margin-top: 20px;
    padding: 20px;
    font-size: 1.2em;
    color: rgb(0, 0, 0);
    background-color: rgb(248, 147, 13);
    border-radius: 5px;
    transition: opacity 0.5s;
    white-space: nowrap;
}

#table-wrapper {
    width: 100%;
    height: 100%;
}

.control-button{
    border: none;
}

.control-button:hover {
    opacity: 0.8;
    cursor: pointer;
}

/* Mobile CSS */
#mobile-players {
    display: none;
    padding: 20px;
    background-color: rgb(38, 38, 38);
    border: 1px solid rgb(56, 56, 56);
    border-radius: 5px;
}

#mobile-cards svg {
    max-height: 150px;
}

#mobile-card-one, #mobile-card-two {
    max-height: 150px;
    width: 100%;
}

/*#mobile-card-one {*/
/*    justify-self: flex-end;*/
/*}*/
/**/
/*#mobile-card-two {*/
/*    justify-self: flex-start;*/
/*}*/

.mobile-player {
    display: grid;
    grid-template-columns: 1fr 1fr max-content;
    gap: 20px;
    padding: 20px;
    background-color: rgb(63, 63, 63);
    border-radius: 5px;
}

.mobile-cards {
    /* display: grid; */
    /* grid-template-columns: repeat(2, minmax(auto, 1fr)); */
    display: flex;
    place-content: center;
    place-items: center;
    gap: 10px;
}

.mobile-cards:hover {
    cursor: pointer;
}

.mobile-stats {
    color: white;
}

.mobile-stats p {
    margin: 0;
}

.mobile-stats p:first-child {
    font-size: 2em;
}

.mobile-win {
    font-size: 1.5em;
    color: rgb(248, 147, 13);
}

.mobile-remove {
    display: block;
    width: 25px;
    height: 25px;
    line-height: 25px;
    text-align: center;
    color: white;
    background-color: rgb(0, 0, 0);
    border-radius: 50%;
}

.mobile-remove:hover {
    cursor: pointer;
}

#mobile-controls {
    display: flex;
    gap: 20px;
}

@media screen and (min-width: 861px) {
    [data-cardvalue]:not([data-cardvalue="0"]):hover {
        transform: translate(0, -5px);
    }
}

@media screen and (max-width: 860px) {

    .s0-two-column {
        grid-template-columns: 1fr;
        padding: 0 5px;
    }

    #s0-sidebar {
        grid-row: 1;
    }

    #s0-content-layout {
        padding: 0 10px;
    }

    #s0-main {
        width: 100%;
    }

    #poker-odds-app {
        overflow: hidden;
        display: grid;
        grid-template-columns: 1fr;
        padding: 40px 5px;
    }

    #table-svg {
        transform: scale(1.2);
    }

    [data-player]:not([data-player="dealer"]) {
        display: none;
    }

    [data-dealer] {
        transform: scale(1.4) translate(-11%, -12%);
    }

    #stat-container {
        display: none;
    }

    .toggle-cards #mobile-players {
        display: none;
    }

    .toggle-cards #card-container {
        display: flex;
        min-width: 95%;
    }

    #mobile-players {
        display: flex;
        flex-direction: column;
        min-width: 95%;
        gap: 10px;
    }

    #card-container {
        grid-column: unset;
        grid-template-columns: unset;
        display: none;
        flex-direction: column;
        place-content: center;
        gap: 0;
        padding: 0px 20px;
    }

    #card-container .card-suit {
        display: none;
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: unset;
        place-content: center;
        gap: 5px;
        padding: 20px;
        border-top: unset;
        border-bottom: unset;
        border-left: 2px solid rgb(56, 56, 56);
        border-right: 2px solid rgb(56, 56, 56);
        border-radius: 0;
    }

    #card-container .active-suit {
        display: grid;
        justify-items: center;
    }

    #card-container [data-card] {
        max-height: 120px;
    }

    #card-container [data-card]:hover {
        transform: none;
    }

    #card-container [data-card^="4"] {
        grid-column: 2;
    }

    #card-container [data-card^="3"] {
        grid-column: 3;
    }

    #card-container [data-card^="2"] {
        grid-column: 4;
    }

    #card-container #mobile-cards,
    #card-container #suit-selector {
        place-content: center;
        place-items: center;
        gap: 20px;
        padding: 20px;
        color: white;
        background-color: rgb(38, 38, 38);
        border-left: 2px solid rgb(56, 56, 56);
        border-right: 2px solid rgb(56, 56, 56);
        border-radius: 5px;
    }

    #card-container #mobile-cards {
        display: flex;
    }

    #card-container #suit-selector {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
    }

    #card-container #card-control {
        display: flex;
        gap: 20px;
    }

    #card-container #mobile-cards {
        border-top: 2px solid rgb(56, 56, 56);
        border-bottom-left-radius: 0px;
        border-bottom-right-radius: 0px;
    }

    #card-container.hide-displaycards #mobile-cards {
        display: none;
    }

    #card-container.hide-displaycards .card-suit {
        border-top: 2px solid rgb(56, 56, 56);
        border-bottom-left-radius: 0px;
        border-bottom-right-radius: 0px;
    }

    #card-container #suit-selector {
        border-bottom: 2px solid rgb(56, 56, 56);
        border-top-left-radius: 0px;
        border-top-right-radius: 0px;
    }

    #card-container #suit-selector img {
        opacity: 0.3;
    }

    #card-container #suit-selector img:hover {
        cursor: pointer;
        transform: scale(1.1);
        transition: scale 0.2s;
    }

    #card-container #suit-selector img.show-icon {
        opacity: 1;
    }

    #mobile-players .mobile-cards svg {
        max-height: 130px;
        min-height: 80px;
    }

    #status-display {
        grid-column: unset;
        margin: 10px 0;
    }

    #mobile-controls .control-button {
        margin-top: 10px;
    }
}

@media screen and (max-width: 480px) {
    #mobile-players {
        padding: 10px;
    }

    .mobile-player {
        padding: 5px;
        gap: 10px;
    }

    .mobile-stats p:first-child {
        font-size: 1.1em;
    }

    .mobile-win {
        font-size: 1em;
    }
}

.flipped {
    transform-box: fill-box;    /* Use the element's bounding box */
    transform-origin: center;    /* Rotate around the element's center */
    transform: rotate(180deg);
}