:root {
    --achromatic: 0, 0%;
    --blue: hsl(220, 40%, 30%);
    --blue-darker: hsl(221, 39%, 20%);
    --blue-lighter: hsl(220, 40%, 40%);
    --blue-lightest: hsl(221, 20%, 60%);
    --font-color: hsl(220, 14%, 95%);
    --red-suit: hsl(0, 100%, 50%);
    --black-suit: hsl(var(--achromatic), 0%);
    --shadow: rgba(0, 0, 0, 0.4) 0px 3px 8px;
    --shadow-pressed: rgba(0, 0, 0, 0.6) 0px 2px 8px;
    --shadow-light: rgba(0, 0, 0, 0.2) 0px 3px 8px;
    --shadow-close: hsla(0, 0%, 0%, 0.5) 1px 1px 4px;
    --yellow: hsl(40, 90%, 60%);
    --yellow-active: hsl(40, 100%, 50%);
    --invalid: hsl(0, 100%, 50%)
}

* {
    box-sizing: border-box;
    touch-action: manipulation;
    /* disable double tap to zoom */
}

html {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    background-color: var(--blue);
}

body {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    margin: 0;
    padding: 0;
    color: #fff;
    font-size: 100%;
    font-family: 'Secular One', sans-serif;
    /* Uses dynamic viewport height for better handling of mobile viewports */
    min-height: inherit;
    display: flex;
    flex-direction: column;
    background-image: radial-gradient(var(--blue-lighter) 0%, var(--blue) 50%),
        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUOUhGC6tK4EMtJO0ttC6IBD3kM0ve0tJwMdSfjZo+EEISaeTr9P3wYrGjXqyC1krcKdhMpxEnt5JetoulscpyzhXN5FRpuPHvbeQaKxFAEB6EN+cYN6xD7RYGpXpNndMmZgM5Dcs3YSNFDHUo2LGfZuukSWyUYirJAdYbF3MfqEKmjM+I2EfhA94iG3L7uKrR+GdWD73ydlIB+6hgref1QTlmgmbM3/LeX5GI1Ux1RWpgxpLuZ2+I+IjzZ8wqE4nilvQdkUdfhzI5QDWy+kw5Wgg2pGpeEVeCCA7b85BO3F9DzxB3cdqvBzWcmzbyMiqhzuYqtHRVG2y4x+KOlnyqla8AoWWpuBoYRxzXrfKuILl6SfiWCbjxoZJUaCBj1CjH7GIaDbc9kqBY3W/Rgjda1iqQcOJu2WW+76pZC9QG7M00dffe9hNnseupFL53r8F7YHSwJWUKP2q+k7RdsxyOB11n0xtOvnW4irMMFNV4H0uqwS5ExsmP9AxbDTc9JwgneAT5vTiUSm1E7BSflSt3bfa1tv8Di3R8n3Af7MNWzs49hmauE2wP+ttrq+AsWpFG2awvsuOqbipWHgtuvuaAE+A1Z/7gC9hesnr+7wqCwG8c5yAg3AL1fm8T9AZtp/bbJGwl1pNrE7RuOX7PeMRUERVaPpEs+yqeoSmuOlokqw49pgomjLeh7icHNlG19yjs6XXOMedYm5xH2YxpV2tc0Ro2jJfxC50ApuxGob7lMsxfTbeUv07TyYxpeLucEH1gNd4IKH2LAg5TdVhlCafZvpskfncCfx8pOhJzd76bJWeYFnFciwcYfubRc12Ip/ppIhA1/mSZ/RxjFDrJC5xifFjJpY2Xl5zXdguFqYyTR1zSp1Y9p+tktDYYSNflcxI0iyO4TPBdlRcpeqjK/piF5bklq77VSEaA+z8qmJTFzIWiitbnzR794USKBUaT0NTEsVjZqLaFVqJoPN9ODG70IPbfBHKK+/q/AWR0tJzYHRULOa4MP+W/HfGadZUbfw177G7j/OGbIs8TahLyynl4X4RinF793Oz+BU0saXtUHrVBFT/DnA3ctNPoGbs4hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhS nO3Wp/3fEV5a+4wz //6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==");
    background-repeat: no-repeat, repeat;
    background-size: cover, auto;
    background-blend-mode: overlay;

  background: #1a1a1a;


@supports not (height: 100dvh) {
    html {
        height: -webkit-fill-available;
    }

    body {
        min-height: -webkit-fill-available;
    }
}

h1,
h2,
h3,
h4 {
    font-weight: normal;
    margin: 0;
    padding: 0;
}

a {
    text-decoration-skip-ink: auto;
    color: currentColor;
    text-decoration: none;
}

a:where(:hover, :focus) {
    color: var(--font-color);
}

button {
    width: clamp(71px, 18vw, 138px);
    background-color: var(--yellow);
    color: var(--blue-darker);
    border: none;
    padding: 1.5vmin 3vmin;
    margin: 0 2vmin;
    font-size: 1em;
    font-family: 'Secular One', sans-serif;
    border-radius: 1vmin;
    cursor: pointer;
    box-shadow: var(--shadow);
}

button:active {
    box-shadow: var(--shadow-pressed);
    background-color: var(--yellow-active);
    transform: translateY(1px);
}

button:disabled {
    opacity: 0.7;
    cursor: default;
    box-shadow: var(--shadow-light);
}

.amount-step-button {
    flex: 0 0 45px;
    padding: 1.5vmin 0;
    margin: 0;
    max-height: 25px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
}

.amount-controls {
    flex: 1 1 445px;
    max-width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 2vmin;
    margin: 0 2vmin;
}

.action-link {
    padding: 1vmin 2vmin;
    border-radius: 1vmin;
    border: 1px solid var(--font-color);
    background-color: var(--blue);
    color: var(--font-color);
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    width: max-content;
}

.action-link:where(:hover, :focus) {
    color: var(--yellow);
    border: 1px solid var(--yellow);
}

.action-link:active {
    color: var(--yellow-active);
    border: 1px solid var(--yellow-active);
    box-shadow: var(--shadow-pressed);
    transform: translateY(1px);
}

#start-button,
#instructions-button,
#fast-forward-button {
    width: auto;
}

input[type=range] {
    flex: 1 1 auto;
    min-width: 0;
    margin: 10px 0;
    -webkit-appearance: none;
    appearance: none;
    height: 25px;
    background: var(--yellow);
    outline: none;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 45px;
    height: 45px;
    background: url('../icons/chip.svg'), var(--yellow);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: var(--shadow);
}

input[type=range]::-moz-range-thumb {
    width: 45px;
    height: 45px;
    background: url('../icons/chip.svg'), var(--yellow);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: var(--shadow);
}

input[type=range]:disabled {
    opacity: 0.7;
}

output {
    width: 76px;
    text-align: center;
    background-color: var(--blue);
    box-shadow: inset var(--shadow-pressed);
    color: var(--yellow);
    border-radius: 999px;
    padding: 5px 1rem;
    font-size: 1em;
}

output.invalid {
    color: var(--invalid);
}

.hidden {
    display: none !important;
}

/*
-------------------------------------------------------------------
GRID
-------------------------------------------------------------------
*/
main {
    width: 100vw;
    flex: 1;
    place-items: center;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr auto 1fr;
    grid-column-gap: 0px;
    grid-row-gap: 2vh;
}

main .seat {
    width: 22vmin;
    min-width: 120px;
    transition: all 0.5s;
}

main .seat .hole-cards img {
    transition: all 0.3s;
}

.seat:nth-of-type(1) {
    grid-area: 1 / 1 / 2 / 2;
}

.seat:nth-of-type(2) {
    grid-area: 1 / 2 / 2 / 3;
}

.seat:nth-of-type(3) {
    grid-area: 1 / 3 / 2 / 4;
}

.seat:nth-of-type(6) {
    grid-area: 3 / 1 / 4 / 2;
}

.seat:nth-of-type(5) {
    grid-area: 3 / 2 / 4 / 3;
}

.seat:nth-of-type(4) {
    grid-area: 3 / 3 / 4 / 4;
}

#table-middle {
    grid-area: 2 / 1 / 3 / 4;
}

/*
-------------------------------------------------------------------
SINGLE VIEW
-------------------------------------------------------------------
*/

#hole-cards {
    display: flex;
    justify-content: center;
    flex-direction: initial;
}

/* When a player folds, bring their hole cards closer together with directional shift */
#single.folded .hole-cards img:nth-of-type(1) {
    transform: translateX(6.5vmin) rotate(-0.5deg);
    transition: all 0.3s;
}

#single.folded .hole-cards img:nth-of-type(2) {
    transform: translateX(-6.5vmin) rotate(1deg);
    transition: all 0.3s;
}

#single {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100dvh;
    width: 100vw;
    margin: 3vmin 3vmin 0 3vmin;
    max-width: 830px;
}

#singleview-notifications {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-bottom: 0.5rem;
}

#singleview-notifications div {
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--font-color);
}

#single-action-status {
    color: var(--yellow);
    text-align: center;
}

#single .chips {
    margin-bottom: 1rem;
}

#single .chips :where(.total, .bet) {
    text-align: center;
}

#single .chips .bet::before {
    content: "Bet $ ";
}

#single .chips .total::before {
    content: "Stack $ ";
}

#single .chips #pot::before {
    content: "Pot $ ";
}

#single #pot {
    color: var(--yellow-active);
}

#single-switch-link {
    margin-top: 1rem;
}

/*
-------------------------------------------------------------------
REMOTE TABLE
-------------------------------------------------------------------
*/

#remote-table #notification:has(span) {
    cursor: default;
    padding-right: 20px;
}

#remote-table #notification:has(span)::after {
    content: none;
}

#remote-table #notification:has(span):hover,
#remote-table #notification:has(span):active {
    background-color: var(--blue);
    border: none;
    box-shadow: inset var(--shadow-pressed);
    transform: none;
}

/*
-------------------------------------------------------------------
TABLE-MIDDLE
-------------------------------------------------------------------
*/

#table-middle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3vh;
}

.infos {
    display: flex;
    gap: 2vmin;
    justify-content: center;
    width: 96vmin;
}

.infos div {
    padding: 5px 20px;
    background-color: var(--blue);
    box-shadow: inset var(--shadow-pressed);
    color: var(--yellow);
    border-radius: 999px;
    min-width: 85px;
    text-align: center;
    flex: 0 0 auto;
}

#notification {
    color: var(--blue-lightest);
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
    text-align: left;
    text-overflow: ellipsis;
    overflow-x: hidden;
    white-space: nowrap;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#notification:has(span) {
    cursor: pointer;
    padding-right: 33px;
}

#notification:has(span)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 20px;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--blue-lightest);
    border-right: 2px solid var(--blue-lightest);
    transform: translateY(-50%) rotate(45deg);
}

#notification:has(span):hover {
    background-color: var(--blue);
    border: 1px solid hsla(0, 0%, 100%, 0.15);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

#notification:has(span):active {
    background-color: var(--blue-darker);
    border: none;
    box-shadow: inset var(--shadow-pressed);
    transform: translateY(1px);
}

#notification span:not(:last-child)::after {
    content: " | ";
    color: var(--blue-lightest);
}

#notification span:first-child {
    color: var(--font-color);
}

#pot::before {
    content: "$ ";
}

#community-cards {
    display: flex;
    gap: 1.5vmin;
}

#community-cards div {
    flex: 0 0 auto;
}

.cardslot {
    width: 16vmin;
    height: auto;
    aspect-ratio: 5/7;
    border-radius: 1vmin;
}

.cardslot:empty {
    border: 0.25vmin dashed var(--blue-lightest);
    background-color: hsla(0, 0%, 0%, 5%);
}

.cardslot img {
    width: 100%;
    height: 100%;
    display: block;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 1rem 0;
}

/*
-------------------------------------------------------------------
OVERLAY
-------------------------------------------------------------------
*/

#overlay-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: hsla(0, 0%, 0%, 0.4);
}

.overlay-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 2001;
    transform: translate(-50%, -50%);
    max-width: 96vw;
    max-height: calc(100vh - 5vmin);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
    padding: 1.25rem;
    border-radius: 15px;
    background-color: var(--blue);
    box-shadow: var(--shadow);
    border: 1px solid hsla(0, 0%, 100%, 0.08);
}

.log-panel {
    width: min(720px, 96vw);
    max-height: min(80vh, 860px);
}

.version-panel {
    width: min(720px, 96vw);
    max-height: min(82vh, 860px);
}

.instructions-panel {
    width: min(860px, 96vw);
    max-height: min(84vh, 920px);
}

.overlay-close {
    width: auto;
    margin: 0;
    padding: 0.55rem 1rem;
    align-self: center;
}

.stats-table-wrap {
    overflow: auto;
}

.log-list-wrap {
    overflow: auto;
    min-height: 0;
}

#version-overlay .version-list-wrap {
    overflow: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#instructions-overlay .instructions-content {
    overflow: auto;
}

#version-overlay :where(h2, h3) {
    color: var(--font-color);
    margin: 0;
}

#version-overlay .version-panel-header {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

#instructions-overlay :where(h2, h3, h4) {
    color: var(--font-color);
    margin: 0 0 0.45rem;
}

#instructions-overlay h3 {
    margin-top: 1.5rem;
}

#instructions-overlay h2 {
    font-size: 1.45rem;
}

#instructions-overlay :where(p, li) {
    color: var(--blue-lightest);
    margin: 0;
}

#instructions-overlay .instructions-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

#instructions-overlay .instructions-mode-card {
    background-color: hsla(0, 0%, 0%, 0.12);
    border-radius: 15px;
    padding: 1rem;
}

#instructions-overlay .instructions-note {
    font-style: italic;
    margin-top: 0.5rem;
}

#instructions-overlay .instructions-list {
    padding-left: 1.2rem;
}

#instructions-overlay .instructions-list li+li {
    margin-top: 0.45rem;
}

#stats-table {
    border-collapse: collapse;
}

#stats-table th,
#stats-table td {
    padding: 0.75rem 0.9rem;
    white-space: nowrap;
    text-align: center;
}

#stats-table td,
#stats-table th {
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.1);
}

#stats-table tbody tr:nth-child(even) {
    background-color: hsla(0, 0%, 100%, 0.03);
}

#log-list {
    display: flex;
    flex-direction: column;
}

#log-list div {
    padding: 0.75rem 0.9rem;
    color: var(--blue-lightest);
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.1);
    white-space: normal;
    word-break: break-word;
}

#log-list div:first-child {
    color: var(--font-color);
}

#log-list div:nth-child(even) {
    background-color: hsla(0, 0%, 100%, 0.03);
}

#version-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.version-entry {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.version-entry-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.7rem;
}

.version-entry-version {
    font-size: 1.1rem;
}

.version-entry-title {
    margin: 0;
    color: var(--font-color);
}

.version-entry-meta {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    color: var(--blue-lightest);
    font-size: 0.85rem;
    white-space: nowrap;
    border: 1px solid var(--blue-lightest);
    border-radius: 999px;
    padding: 0 0.5rem;
}

.version-entry-notes {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--blue-lightest);
}

.version-entry-notes li+li {
    margin-top: 0.35rem;
}

/*-------------------------------------------------------------------
FOOTER
-------------------------------------------------------------------*/
footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    font-size: 0.9rem;
    color: var(--blue-lightest);
    padding: 10px 20px;
}

#credit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.version-button {
    width: auto;
    margin: 0;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--blue-lightest);
    background-color: transparent;
    color: var(--blue-lightest);
    font-size: 0.8rem;
    line-height: 1;
    box-shadow: none;
}

.version-button:hover {
    color: var(--font-color);
    border-color: var(--font-color);
    background-color: hsla(0, 0%, 100%, 0.06);
}

.version-button:active {
    background-color: hsla(0, 0%, 100%, 0.08);
    box-shadow: none;
}

#social {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

#social img {
    filter: invert(1) brightness(0.8);
    transition: filter 0.3s;
}

#social img:hover {
    filter: invert(1) brightness(2);
}

/*
-------------------------------------------------------------------
PLAYER
-------------------------------------------------------------------
*/

.seat h3,
#single h3 {
    position: relative;
    border-radius: 30px;
    background-color: var(--blue-lightest);
    padding: 1vmin 2vmin;
    color: var(--blue-darker);
    margin-bottom: 1vmin;
    box-shadow: var(--shadow-light);
    font-size: 1.1em;
    line-height: 1.1;
    -webkit-user-select: auto;
    user-select: auto;
    text-align: center;
}

.seat h3:empty::before {
    content: "Enter Name";
}

.seat h3:focus::before {
    content: "";
}

.active h3 {
    background-color: var(--yellow);
}

.action-label h3 {
    text-transform: uppercase;
    animation: action-bounce 320ms ease-out;
}

@keyframes action-bounce {
    0% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-4px);
    }

    70% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(0);
    }
}

.folded h3 {
    background-color: var(--blue-darker);
    color: var(--blue-lightest);
}

.winner h3 {
    border: 3px solid var(--yellow);
    font-size: 1rem;
}

.hole-cards {
    position: relative;
}

.hole-cards img {
    width: 10vmin;
    margin: 0.5vmin;
}

.hole-cards .big {
    width: 47vmin;
    margin: 4vmin;
    max-width: 350px;
}

.hole-cards img:nth-of-type(1) {
    transform: rotate(-2deg);
    min-width: 70px;
}

.hole-cards img:nth-of-type(2) {
    transform: rotate(3deg);
    position: absolute;
    min-width: 70px;
    right: 0;
}

/* When a player folds, bring their hole cards closer together with directional shift */
main .seat.folded .hole-cards img:nth-of-type(1) {
    margin: 0 0.2vmin;
    transform: translateX(3.5vmin) rotate(-0.5deg);
    transition: all 0.3s;
    filter: brightness(0.5);
}

main .seat.folded .hole-cards img:nth-of-type(2) {
    margin: 0 0.2vmin;
    transform: translateX(-3.5vmin) rotate(1deg);
    transition: all 0.3s;
    filter: brightness(0.5);
}

.hole-cards .qr {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: var(--shadow);
    padding: 5px;
    background-color: #fff;
    width: 12vmin;
    min-height: 12vmin;
    min-width: 80px;
    z-index: 1000;
    border-radius: 5%;
    -webkit-touch-callout: default;
}

.qr .qr-link {
    display: block;
    width: 100%;
    line-height: 0;
    cursor: pointer;
}

.qr canvas {
    width: 100% !important;
    height: auto !important;
}

.remote-table-link {
    color: var(--blue-darker);
    font-size: 0.9rem;
    line-height: 1.1;
    text-decoration: underline;
    text-align: center;
}

.remote-table-link:where(:hover, :focus) {
    color: var(--blue);
}

.chips {
    display: flex;
    justify-content: center;
    gap: 3vmin;
}

.chips .bet {
    color: var(--yellow);
}

.chips .bet::before,
.chips .total::before {
    content: "$ ";
}

.chips .stack-visual {
    --chip-step: max(0.3vmin, 2.5px);
    position: relative;
    width: max(4vmin, 30px);
    height: max(4vmin, 30px);
}

.chips .stack-visual img {
    width: max(4vmin, 30px);
    height: max(4vmin, 30px);
    position: absolute;
    background-color: var(--yellow);
    border-radius: 100%;
    transform: translateY(calc(var(--stack-index, 0) * -1 * var(--chip-step)));

}

.chips .stack-visual img:nth-of-type(1) {
    box-shadow: 1px 2px 10px rgba(0, 0, 0, 1);
}

.chips .stack-values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3vmin;
}

.hole-cards .blind-icons {
    width: 4.5vmin;
    min-width: 35px;
    border-radius: 50%;
    background-color: var(--yellow);
    position: absolute;
    right: 0px;
    bottom: 0px;
    z-index: 1100;
}

.hole-cards .close,
.hole-cards .rotate {
    position: absolute;
    width: 4vmin;
    min-width: 35px;
    border-radius: 100%;
    background-color: #fff;
    cursor: pointer;
    box-shadow: var(--shadow-close);
    z-index: 2000;
}

.hole-cards .close {
    right: 0px;
    top: 0px;

}

.hole-cards .rotate {
    position: absolute;
    top: 0px;
    left: 0px;
    padding: 8px;
}

.winner-reaction {
    position: absolute;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(0);
    font-size: clamp(2.8rem, 10vmin, 5.5rem);
    line-height: 1;
    pointer-events: none;
    z-index: 1400;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.winner-reaction.visible {
    animation: winner-reaction-fade 2000ms ease-out forwards;
}

@keyframes winner-reaction-fade {
    0% {
        opacity: 0;
        transform: translateY(6%) scale(0.85);
    }

    14% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    78% {
        opacity: 1;
        transform: translateY(-8%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-16%) scale(0.96);
    }
}

.pill {
    position: absolute;
    background-color: var(--font-color);
    color: var(--blue-darker);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.9rem;
    box-shadow: var(--shadow-close);
    transition: all 0.3s;
}

.folded .pill {
    filter: brightness(0.6);
}

.win-probability {
    top: 0px;
    right: 0px;
}

.hand-strength {
    left: 0px;
    bottom: 10px;
}

.folded .win-probability {
    transform: translateX(-3.5vmin);
}

.folded .hand-strength {
    transform: translateX(3.5vmin);
}

/*
-------------------------------------------------------------------
MODAL
-------------------------------------------------------------------
*/

aside {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/*
-------------------------------------------------------------------
MEDIA QUERIES
-------------------------------------------------------------------
*/
@media (prefers-color-scheme: dark) {
    :root {
        --blue: hsl(220, 40%, 20%);
        --blue-darker: hsl(220, 40%, 15%);
        --yellow: hsl(40, 90%, 50%);
        --yellow-active: hsl(40, 100%, 40%);
        --font-color: hsl(var(--achromatic), 80%);
    }

    img {
        filter: brightness(0.8);
    }
}

@media (max-width: 820px) and (orientation: portrait) {
    .cardslot {
        width: 18vmin;
    }

    .seat .chips {
        align-items: flex-end;
        gap: 3vmin;
    }

    .seat .chips .stack-values {
        flex-direction: column;
        gap: 0;
    }

    .hole-cards .rotate {
        display: none;
    }

    .chips :where(.total, .bet) {
        min-width: 56px;
    }
}

* { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
body { background: #1a1a1a; }
main { padding: 0 10px; }
main .seat { max-width: 110px; }
main .seat h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
main::before { width: min(90%, 500px); height: min(55vh, 380px); border-radius: 20px; pointer-events: none; }
.infos { font-size: 0.7rem; max-height: 24px; overflow: hidden; opacity: 0.8; }
.pot img, .pot-image img, img[src*="chip"], img[src*="pot"] { max-width: 40px; max-height: 40px; }
.actions, .action, .controls, .buttons { background: rgba(26,26,26,0.95); z-index: 100; padding: 8px; }
@media (max-width: 768px) {
  footer { display: none; }
  main { grid-template-columns: minmax(90px, 110px) 1fr minmax(90px, 110px); padding: 0 10px; }
  .actions, .action, .controls, .buttons { position: sticky; bottom: 0; }
}


/* mobile scale fix: cards, felt, seats */
.seat img[src*="cards"],
.seat .card img,
.seat picture img,
.hole-cards img,
img[src*="card"] {
  max-width: 38px !important;
  height: auto !important;
}

#table-middle img,
.cardslot img,
.cardslots img,
#community-cards img {
  max-width: 48px !important;
  height: auto !important;
}

.cardslots,
#community-cards {
  display: flex !important;
  justify-content: center !important;
  gap: 4px !important;
  flex-wrap: nowrap !important;
}

.cardslot {
  width: 50px !important;
  flex-shrink: 0 !important;
}

main::before {
  width: min(92vw, 520px) !important;
  height: min(70vh, 500px) !important;
  border-radius: 20px !important;
  pointer-events: none !important;
}

.seat {
  max-width: 120px !important;
  padding: 4px !important;
  font-size: 0.75rem !important;
}

.seat h3 {
  font-size: 0.7rem !important;
  padding: 2px 4px !important;
  margin: 2px 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.seat img[src*="chips"],
.seat img[src*="coin"],
.chips img {
  max-width: 20px !important;
  height: auto !important;
}

#pot, .pot {
  font-size: 0.85rem !important;
  padding: 3px 10px !important;
  background: rgba(0,0,0,0.6) !important;
  border-radius: 12px !important;
  display: inline-block !important;
}

.infos, #infos {
  font-size: 0.65rem !important;
  max-height: 22px !important;
  overflow: hidden !important;
  opacity: 0.7 !important;
}

.actions, #actions, [class*="action"] {
  z-index: 100 !important;
  position: relative !important;
}

.actions button, #actions button {
  padding: 8px 14px !important;
  font-size: 0.85rem !important;
  border-radius: 8px !important;
}

@media (max-width: 768px) {
  footer { display: none !important; }
}


/* mobile polish v2: transparent seats, fixed card sizes, larger felt */
.seat {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.seat h3 {
  background: rgba(0,0,0,0.65) !important;
  border-radius: 4px !important;
  padding: 2px 8px !important;
  font-size: 0.72rem !important;
  display: inline-block !important;
  border: none !important;
  box-shadow: none !important;
}

.seat .chips,
.seat .total,
.seat .bet {
  background: none !important;
  border: none !important;
  font-size: 0.75rem !important;
}

.seat img,
.seat picture img,
.hole-cards img {
  width: 32px !important;
  max-width: 32px !important;
  height: auto !important;
}

#table-middle img:not([src*="chip"]):not([src*="coin"]):not([src*="dealer"]),
.cardslot img,
.cardslots img {
  width: 45px !important;
  max-width: 45px !important;
  height: auto !important;
}

.cardslot {
  width: 48px !important;
  max-width: 48px !important;
  flex: 0 0 48px !important;
}

main::before {
  width: min(96vw, 540px) !important;
  height: min(78vh, 600px) !important;
  border-radius: 24px !important;
  pointer-events: none !important;
  background: linear-gradient(160deg, #2d8a50, #1e6e3e) !important;
  box-shadow: inset 0 2px 20px rgba(0,0,0,0.3), 0 0 0 4px #1a5c35 !important;
}

img[src*="chip"],
img[src*="coin"],
.chips img {
  width: 22px !important;
  max-width: 22px !important;
  height: auto !important;
}

img[src*="dealer"],
img[src*="blind"],
.dealer-button img {
  width: 28px !important;
  max-width: 28px !important;
}

.infos, #infos {
  font-size: 0.6rem !important;
  max-height: 20px !important;
  overflow: hidden !important;
  opacity: 0.6 !important;
}

@media (max-width: 768px) {
  footer { display: none !important; }
}
