#poker-table {
    position: relative;
    width: 75vw;
    max-width: 1100px;
    height: 40vw;
    max-height: 550px;
    border-radius: 9999px;
    background: var(--rim-color) !important;
    border: none;
    box-shadow:
        inset 0 4px 6px rgba(255, 255, 255, 0.3),
        inset 0 -8px 15px rgba(0, 0, 0, 0.35),
        0 20px 50px rgba(0, 0, 0, 0.7);
}

/* Texture overlay */
#poker-table::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border: 25px solid transparent;
    border-radius: inherit;
    background: var(--rim-texture) border-box;
    -webkit-mask:
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0) border-box;
    mask:
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0) border-box;
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 10;
    opacity: 0.5;
}

/* The Green Felt carved out inside */
#poker-table::before {
    content: "";
    position: absolute;
    top: 25px;
    bottom: 25px;
    left: 25px;
    right: 25px;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    background:
        var(--felt-texture),
        radial-gradient(ellipse at center,
            var(--felt-color-1) 0%,
            var(--felt-color-2) 100%) !important;
    background-blend-mode: soft-light, normal;
    box-shadow:
        inset 0 0 120px rgba(0, 0, 0, 0.85),
        inset 0 0 30px rgba(0, 0, 0, 0.6),
        0 0 0 2px rgba(255, 255, 255, 0.15),
        inset 0 8px 15px rgba(0, 0, 0, 0.6),
        inset 0 0 12px 2px rgba(0, 0, 0, 0.5);
}

/* Pot Area & Board Container */
#center-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 5;
}

#board-container {
    display: flex;
    gap: 10px;
    min-height: 65px;
}

.board-card {
    width: 70px;
    height: 100px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    border: none;
    box-shadow: none;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

#pot-display {
    position: absolute !important;
    left: 50% !important;
    top: 30% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10;
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    white-space: nowrap !important;
    width: fit-content;
    min-width: 80px;
}

#main-pot-stack {
    position: absolute !important;
    left: 50% !important;
    top: 68% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 4;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: flex-end !important;
    gap: 15px !important;
}

#main-pot-stack .chip-stack {
    display: flex !important;
    flex-direction: column-reverse !important;
    align-items: center !important;
    position: relative;
}

/* Puck Assets Styling */
.puck {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 900;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.6),
        inset 0 2px 3px rgba(255, 255, 255, 0.6),
        inset 0 -2px 3px rgba(0, 0, 0, 0.3);
    border: 1px solid #777;
}

.dealer-puck {
    background: #fff;
    color: #000;
    border-color: #ccc;
}

.sb-puck {
    background: #1976d2;
    color: #fff;
    border-color: #0d47a1;
}

.bb-puck {
    background: #d32f2f;
    color: #fff;
    border-color: #9a0007;
}

/* Watermark + tagline are stacked inside a full-size overlay flex
   container that flex-centres them on the felt. Critically the group
   MUST NOT create a stacking context (no transform, no z-index) —
   otherwise it isolates the children's `mix-blend-mode: overlay` from
   the felt backdrop and the text turns into solid bright pixels.
   Painting order is preserved by DOM position (group is the first
   child of #poker-table → behind chips/cards/pot). */
#table-watermark-group {
    position: absolute;
    inset: 0;
    pointer-events: none;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
#table-watermark {
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    font-size: 85px;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.08);
    mix-blend-mode: overlay;
    text-shadow:
        0px -1px 2px rgba(0, 0, 0, 0.3),
        0px 1px 2px rgba(255, 255, 255, 0.1);
    line-height: 1;
    white-space: nowrap;
}
/* Site-level logo as watermark (priority: per-table text >
   logoUrl image > siteName text > hidden). The image lives inside the
   same #table-watermark-group flex column so it inherits the centered
   layout. Same blend-mode as the text watermark for visual cohesion;
   pointer-events:none guarantees clicks pass through to the felt. */
#table-watermark-logo {
    max-width: 240px;
    max-height: 120px;
    object-fit: contain;
    opacity: 0.4;
    mix-blend-mode: overlay;
    pointer-events: none;
    user-select: none;
    /* Admin-tunable logo scale. CSS var set by JS on
       <html> from tableConfig.gameSettings.tableLogoScale (range
       0.5..2.0, default 1.0). Wraps the existing max-w/max-h sizing
       so the proportional shape stays true while operators dial in
       the on-felt size. transform-origin: center keeps the logo
       centered in the watermark slot regardless of scale. */
    transform: scale(var(--table-logo-scale, 1));
    transform-origin: center;
    transition: transform 0.18s ease;
}
#table-watermark-logo[hidden] {
    display: none !important;
}
#table-tagline {
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    font-size: 26px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.08);
    mix-blend-mode: overlay;
    text-shadow:
        0px -1px 1px rgba(0, 0, 0, 0.3),
        0px 1px 1px rgba(255, 255, 255, 0.1);
    line-height: 1;
    white-space: nowrap;
}
/* Empty tagline collapses entirely so the watermark stays vertically
   centered when no sub-line is set. */
#table-tagline:empty {
    display: none;
}

/* Preview mode (iframe inside admin TableBrandingModal).
   Per-table CSS variables (--felt-color-1/2, --felt-texture, --rim-color,
   --rim-texture) already drive the table render via theme.css and the
   rules above, so the preview mode only needs subtle visual cues that
   the embed is not a live, interactive lobby. The body is dimmed
   slightly to signal "preview, not play". */
body[data-preview="true"] {
    background-color: #05070d;
}
