/* Blackjack table. The stage is a fixed 1280x800 canvas, scaled as a whole to fit the window. */

:root {
    --gold: #e0bd67;
    --gold-dim: #a9863a;
    --ink: #1b1b1f;
    --cream: #fbf3d5;
    --card-red: #c3172b;
    --plate-top: #f2f4f6;
    --plate-bottom: #b4bac2;
    --font-display: Georgia, 'Times New Roman', serif;
    --font-ui: 'Segoe UI', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #030304;
}

/* Fixed, not absolute: a 1280px-wide page would make phone browsers zoom out to fit it. */
#stage {
    position: fixed;
    left: 0;
    top: 0;
    width: 1280px;
    height: 800px;
    overflow: hidden;
    transform-origin: 0 0;
    perspective: 1600px;
    perspective-origin: 50% 515px;
    font-family: var(--font-ui);
    color: var(--ink);
    user-select: none;
}

/* The tabletop. It pivots at y=600, so the far side recedes and the rail comes toward the player.
   It's also shifted up 85px to leave the rail clear for the chip tray. preserve-3d lets chip stacks
   rise out of the felt. */
.plane {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform-origin: 50% 600px;
    transform: translateY(-85px) rotateX(28deg);
}

.seats {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

/* A fixed height, so the drawing keeps its shape when phones make the stage taller. */
.table-art {
    position: absolute;
    left: 0;
    top: 0;
    width: 1280px;
    height: 800px;
    overflow: visible;
}

.felt-text text {
    font-family: var(--font-display);
    font-weight: 700;
    text-anchor: middle;
    fill: url(#feltGold);
}

.felt-big { font-size: 52px; letter-spacing: 3px; }

/* SkylineCloud.AI built into the table: a line on the felt and a brass plate in the rail. */
.felt-brand { font-size: 42px; letter-spacing: 3px; }

.rail-plate-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    text-anchor: middle;
    fill: #2a1a02;
}

/* The dealer's chip rack: a steel bank drawn as SVG by buildRack in blackjack.js, plus a front wall
   that stands up off the table in 3D. */
.rack {
    position: absolute;
    left: 340px;
    top: -200px;
    width: 600px;
    height: 175px;
    transform-style: preserve-3d;
}

/* Drawn at double size and scaled down, which keeps the fine chip edges sharp on the tilted table. */
.rack-art {
    position: absolute;
    left: 0;
    top: 0;
    width: 1200px;
    height: 350px;
    transform: scale(.5);
    transform-origin: 0 0;
    filter: drop-shadow(0 16px 14px rgba(0, 0, 0, .7));
}

.rack-front {
    position: absolute;
    left: 6px;
    top: 157px;
    width: 588px;
    height: 18px;
    transform-origin: 50% 100%;
    transform: rotateX(-90deg);
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 3px),
        linear-gradient(#9ca3ab, #6d737b 35%, #474c53 75%, #2b2e33);
    border-top: 1.5px solid #c9ced4;
    border-radius: 3px 3px 0 0;
    box-shadow: inset 0 -3px 4px rgba(0, 0, 0, .5);
}

/* Two rivets on the front wall. */
.rack-front::before,
.rack-front::after {
    content: '';
    position: absolute;
    top: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff, #8d939b 55%, #3a3e44);
}

.rack-front::before { left: 14px; }
.rack-front::after { right: 14px; }

/* The card shoe: a 3D box whose front is lower than its back. Sizes: footprint 150 x 104, front
   26 high, back 54 high, so the glass top slopes 15 degrees toward the slot. */
.shoe {
    position: absolute;
    left: 1150px;
    top: -40px;
    width: 150px;
    height: 104px;
    transform: rotate(14deg);
    transform-style: preserve-3d;
}

.shoe > div { position: absolute; }

.shoe-shadow {
    inset: 0;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 16px 26px 6px rgba(0, 0, 0, .8);
}

/* The next card, half out of the slot and lying on the felt. */
.shoe-card {
    left: 40px;
    top: 82px;
    width: 70px;
    height: 54px;
    border-radius: 5px;
    transform: translateZ(1px) rotate(-3deg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, .6);
}

.shoe-side {
    top: 0;
    width: 54px;
    height: 104px;
    transform-origin: 0 50%;
    transform: rotateY(-90deg);
    clip-path: polygon(0 0, 100% 0, 48% 100%, 0 100%);
    background:
        linear-gradient(90deg, transparent 94%, var(--gold-dim) 94%),
        linear-gradient(180deg, #3b3e46, #1d1f24 60%, #121317);
}

.shoe-left { left: 0; }
.shoe-right { left: 150px; filter: brightness(.6); }

.shoe-front {
    left: 0;
    top: 78px;
    width: 150px;
    height: 26px;
    transform-origin: 50% 100%;
    transform: rotateX(-90deg);
    background:
        radial-gradient(ellipse 26px 11px at 50% 0, #0a0a0c 62%, rgba(10, 10, 12, .6) 70%, transparent 76%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px),
        linear-gradient(#4a4e57, #2a2c32 55%, #18191d);
    border-top: 2px solid var(--gold);
    border-radius: 3px 3px 0 0;
}

/* The slot the cards come out of. */
.shoe-slot {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 3px;
    height: 5px;
    border-radius: 3px;
    background: #000;
    box-shadow: 0 -1px 0 rgba(255, 255, 255, .15);
}

.shoe-top {
    left: 0;
    top: 0;
    width: 150px;
    height: 108px;
    transform-origin: 0 0;
    transform: translateZ(54px) rotateX(-15.07deg);
    padding: 8px;
    background: linear-gradient(135deg, #2c2f36, #111215);
    border: 1.5px solid var(--gold-dim);
    border-radius: 7px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}

/* Smoked glass, with the cards inside showing through faintly and a streak of reflected light. */
.shoe-glass {
    position: relative;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(224, 189, 103, .6);
    border-radius: 4px;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, .5) 0, rgba(255, 255, 255, .12) 18%, transparent 34%),
        linear-gradient(150deg, transparent 58%, rgba(255, 255, 255, .14) 64%, transparent 70%),
        linear-gradient(rgba(6, 9, 16, .72), rgba(6, 9, 16, .72)),
        radial-gradient(circle at 50% 50%, var(--gold) 0 2.5px, transparent 3px) 0 0 / 12px 12px,
        #15295c;
    box-shadow: inset 0 0 12px 4px rgba(0, 0, 0, .7);
}

/* Cards */
.card {
    position: absolute;
    width: 84px;
    height: 118px;
    background: linear-gradient(160deg, #fff, #f2efe6);
    border: 1px solid #8b8b84;
    border-radius: 7px;
    box-shadow: -2px 2px 5px rgba(0, 0, 0, .4);
    color: var(--ink);
    font-family: var(--font-display);
}

.card.red { color: var(--card-red); }

.corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 19px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

.corner b { letter-spacing: -1px; font-weight: 700; }
.corner span { font-size: 14px; margin-top: 1px; }
.corner.tl { left: 3px; top: 4px; }
.corner.br { right: 3px; bottom: 4px; transform: rotate(180deg); }

.pip {
    position: absolute;
    font-size: 17px;
    line-height: 1;
    transform: translate(-50%, -50%);
}

.pip.flip { transform: translate(-50%, -50%) rotate(180deg); }
.pip.ace { font-size: 44px; }

.face {
    position: absolute;
    inset: 15px 19px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    background: repeating-linear-gradient(45deg, transparent 0 5px, rgba(195, 150, 40, .16) 5px 6px);
    line-height: 1;
}

.face b { font-size: 32px; }
.face span { font-size: 19px; margin-top: 2px; }

.card-back,
.card.back {
    background:
        radial-gradient(circle at 50% 50%, var(--gold) 0 3px, transparent 3.5px) 0 0 / 14px 14px,
        repeating-linear-gradient(45deg, rgba(255, 255, 255, .13) 0 2px, transparent 2px 7px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, .13) 0 2px, transparent 2px 7px),
        #15295c;
    border: 4px solid #fff;
    outline: 1px solid #55555a;
    outline-offset: -1px;
}

.dealing { animation: deal .3s cubic-bezier(.2, .75, .3, 1) both; }
.revealing { animation: reveal .36s ease-out both; }

@keyframes deal {
    from {
        transform: translate(var(--from-x), var(--from-y)) rotate(-24deg) scale(.7);
        opacity: .6;
    }
    to { transform: none; opacity: 1; }
}

@keyframes reveal {
    0% { transform: scaleX(1); }
    50% { transform: scaleX(.04); }
    100% { transform: scaleX(1); }
}

/* Hands */
.dealer {
    position: absolute;
    top: 2px;
    height: 118px;
    transition: left .25s ease;
}

.hand {
    position: absolute;
    width: 84px;
    height: 118px;
    transform-origin: 0 100%;
}

.hand.dim .card { filter: brightness(.68); }

.total {
    position: absolute;
    min-width: 40px;
    padding: 2px 8px;
    background: var(--cream);
    border: 1px solid #8a7c4f;
    border-radius: 3px;
    box-shadow: 1px 2px 4px rgba(0, 0, 0, .4);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.dealer .total { right: calc(100% + 8px); top: 0; }

.result {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: 48px;
    min-width: 108px;
    padding: 5px 14px;
    transform: translateX(-50%);
    background: linear-gradient(#123d22, #0a2a17);
    border: 2px solid var(--gold-dim);
    outline: 2px solid #4a1414;
    color: var(--cream);
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .55);
    animation: pop .22s ease-out both;
}

.result.good { background: linear-gradient(#1c8a45, #0f5d2c); border-color: var(--gold); }
.result.bad { background: linear-gradient(#651a1f, #3c0d11); }

@keyframes pop {
    from { transform: translateX(-50%) scale(.7); opacity: 0; }
    to { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Betting circles */
.circle {
    position: absolute;
    width: 84px;
    height: 84px;
    margin: -42px 0 0 -42px;
    border: 3px solid rgba(224, 189, 103, .7);
    border-radius: 50%;
    transform-style: preserve-3d;
}

.circle.active { border-color: var(--gold); box-shadow: 0 0 16px var(--gold); }

.stack {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
}

.stack .chip {
    position: absolute;
    left: -31px;
    top: -31px;
    width: 62px;
    height: 62px;
}

.bet-label {
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    padding: 0 6px;
    background: rgba(0, 0, 0, .7);
    border: 1px solid rgba(224, 189, 103, .55);
    border-radius: 3px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* Chips. A chip is a pile of thin discs at rising heights, with a detailed face on the top one. Seen on
   the tilted table, the discs' striped edges line up into the chip's side. --c and --a are the chip's
   base and accent colors, set from the CHIPS list in blackjack.js. */
.chip {
    position: relative;
    width: 62px;
    height: 62px;
    transform-style: preserve-3d;
}

.chip {
    /* Lights the chip's side from left to right, so it looks round instead of flat. */
    --side-shade: linear-gradient(90deg, rgba(0, 0, 0, .62), rgba(255, 255, 255, .16) 32%, rgba(0, 0, 0, .1) 58%, rgba(0, 0, 0, .66));
}

.slice {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        var(--side-shade),
        repeating-conic-gradient(var(--a) 0 22.5deg, var(--c) 22.5deg 45deg);
}

/* The dark line between one chip and the next in a stack. */
.slice.groove {
    background:
        linear-gradient(rgba(0, 0, 0, .58), rgba(0, 0, 0, .58)),
        var(--side-shade),
        repeating-conic-gradient(var(--a) 0 22.5deg, var(--c) 22.5deg 45deg);
}

/* Double size here, then scale(.5) from drawChip, so the face stays sharp on the tilted table. */
.slice.top {
    inset: auto;
    left: 0;
    top: 0;
    width: 200%;
    height: 200%;
    transform-origin: 0 0;
    background: var(--c);
}

/* Polished metal reflects in sharp bands, not a smooth fade, so these faces use conic gradients.
   The sides get bright streaks to match. */
.finish-gold {
    --metal-face: conic-gradient(from 35deg, #fff5b8, #dcaa24 9%, #8e6410 19%, #f8d95e 29%, #fff9d2 37%, #c8931a 49%, #7c570c 59%, #f0ca4d 69%, #fff2ad 79%, #b98714 90%, #fff5b8);
    --metal-center: conic-gradient(from 210deg, #fff8c9, #d7a322 12%, #9a7012 24%, #f5d254 38%, #fff6c0 50%, #c28e17 62%, #8a6210 74%, #f3cf50 88%, #fff8c9);
    --side-shade: linear-gradient(90deg, rgba(50, 30, 0, .72), rgba(255, 244, 190, .62) 20%, rgba(90, 60, 0, .3) 38%, rgba(255, 250, 215, .78) 56%, rgba(90, 60, 0, .35) 74%, rgba(40, 24, 0, .74));
}

.finish-platinum {
    --metal-face: conic-gradient(from 18deg, #ffffff, #ffffff 5%, #79828f 8%, #f4f7fb 13%, #ffffff 19%, #4c5460 24%, #cfd6df 28%, #ffffff 36%, #ffffff 41%, #66707c 46%, #eef2f6 51%, #ffffff 58%, #3f4651 64%, #d9dfe6 68%, #ffffff 76%, #ffffff 81%, #737c89 86%, #f7f9fc 91%, #ffffff);
    --metal-center: conic-gradient(from 200deg, #ffffff, #8b94a1 10%, #ffffff 20%, #fbfcfe 30%, #58616d 38%, #e8edf2 46%, #ffffff 56%, #79828f 66%, #ffffff 76%, #5f6874 88%, #ffffff);
    --side-shade: linear-gradient(90deg, rgba(10, 14, 20, .82), rgba(255, 255, 255, .85) 14%, rgba(30, 36, 44, .55) 27%, rgba(255, 255, 255, .95) 44%, rgba(40, 46, 54, .5) 60%, rgba(255, 255, 255, .8) 76%, rgba(10, 14, 20, .85));
}

.finish-gold .slice.top,
.finish-platinum .slice.top { background: var(--metal-face); }

/* Bright chips glow in their own color against the black felt. */
.finish-neon .slice.top { box-shadow: 0 0 20px color-mix(in srgb, var(--c) 60%, transparent); }

.chip-metal-center {
    position: absolute;
    inset: 22.4%;
    border-radius: 50%;
    background: var(--metal-center);
}

/* A band of light that sweeps across metal chips every few seconds. */
.chip-glint {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(115deg, transparent 43%, rgba(255, 255, 255, .55) 48%, #fff 50%, rgba(255, 255, 255, .55) 52%, transparent 57%) no-repeat;
    background-size: 320% 320%;
    background-position: 110% 110%;
    pointer-events: none;
    animation: chip-glint 5.2s ease-in-out infinite;
}

.finish-platinum .chip-glint { animation-duration: 3.4s; }

@keyframes chip-glint {
    0% { background-position: 110% 110%; }
    34% { background-position: -10% -10%; }
    100% { background-position: -10% -10%; }
}

.chip-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.chip-defs { position: absolute; }

.chip-ring-text {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 8.3px;
    font-weight: 700;
}

.chip-value {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    text-anchor: middle;
}

/* The shadow a stack casts on the table. */
.chip.grounded .slice:first-child { box-shadow: -4px 9px 10px rgba(0, 0, 0, .6); }

/* The tray on the rail that holds the selector. Its position must match TRAY_X and TRAY_Y in blackjack.js. */
.chip-tray {
    position: absolute;
    left: 266px;
    top: 792px;
    width: 544px;
    height: 102px;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, .07), transparent 70%),
        #101114;
    border: 3px solid var(--gold-dim);
    border-radius: 51px;
    box-shadow:
        0 8px 14px rgba(0, 0, 0, .65),
        inset 0 3px 12px rgba(0, 0, 0, .8),
        inset 0 0 0 2px rgba(0, 0, 0, .45);
    transform-style: preserve-3d;
}

.chip-rail {
    position: absolute;
    left: 75px;
    top: 4px;
    width: 388px;
    height: 88px;
    transform-style: preserve-3d;
}

/* A selector chip is a small stack. --slot-x places it, so cycling just changes that value and the
   transition slides it. Chips outside the four visible slots shrink away and are hidden. */
.chip-button {
    position: absolute;
    left: 0;
    top: 0;
    width: 88px;
    height: 88px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transform-style: preserve-3d;
    transform: translateX(var(--slot-x));
    transition: transform .3s cubic-bezier(.3, .8, .3, 1), visibility 0s;
}

.chip-button.off-rail {
    transform: translateX(var(--slot-x)) scale(.05);
    visibility: hidden;
    pointer-events: none;
    transition: transform .3s cubic-bezier(.3, .8, .3, 1), visibility 0s .3s;
}

.chip-lift {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform .14s ease;
}

.chip-button .chip { position: absolute; inset: 0; width: 88px; height: 88px; }
.chip-button:hover:not(:disabled) .chip-lift { transform: translateZ(22px); }
.chip-button:active:not(:disabled) .chip-lift { transform: translateZ(6px); }
.chip-button:disabled { cursor: default; }
.chip-button:disabled:not(.above-limit) .slice { filter: saturate(.72) brightness(.76); }
.chip-button.above-limit { cursor: not-allowed; }
.chip-button:focus-visible { outline: 3px solid var(--cream); outline-offset: 4px; }

.chip-arrow {
    position: absolute;
    top: 25px;
    width: 46px;
    height: 46px;
    padding: 0;
    background: linear-gradient(145deg, #f3d995, #b98f35 55%, #8a6820);
    border: 2px solid #4f3b10;
    border-radius: 50%;
    box-shadow: 0 4px 7px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .6);
    color: #2a1f05;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.chip-arrow-prev { left: 14px; }
.chip-arrow-next { right: 14px; }
.chip-arrow:hover { background: linear-gradient(145deg, #fbe7ae, #cfa548 55%, #9a7626); }
.chip-arrow:active { box-shadow: 0 1px 3px rgba(0, 0, 0, .6), inset 0 2px 4px rgba(0, 0, 0, .4); }
.chip-arrow:focus-visible { outline: 3px solid var(--cream); outline-offset: 2px; }

/* A chip on its way from the tray to the betting circle. */
.flying-chip {
    position: absolute;
    left: 0;
    top: 0;
    width: 88px;
    height: 88px;
    pointer-events: none;
    transform-style: preserve-3d;
}

.flying-chip .chip { width: 88px; height: 88px; }

/* Billboard nameplates */
.plate {
    position: absolute;
    width: 210px;
    height: 78px;
    padding: 9px 10px;
    background: linear-gradient(var(--plate-top), var(--plate-bottom));
    border: 3px solid #6c737b;
    border-radius: 8px;
    box-shadow: 0 7px 12px rgba(0, 0, 0, .55), inset 0 1px 0 #fff;
    text-align: center;
}

.plate.human { border-color: var(--gold-dim); }
.plate.active { border-color: var(--gold); box-shadow: 0 0 18px var(--gold), inset 0 1px 0 #fff; }

.plate-name {
    overflow: hidden;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plate-balance {
    font-size: 18px;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

/* Action panel */
.panel {
    position: absolute;
    left: 880px;
    top: 652px;
    width: 300px;
    height: 142px;
    padding: 6px 14px 10px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(#eef1f4, #b7bdc5);
    border: 3px solid #6c737b;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, .6);
}

.panel-message {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.panel-message.error { color: #a01423; }

.panel-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.panel-controls .wide { grid-column: 1 / -1; }

.btn {
    height: 36px;
    padding: 0 10px;
    background: linear-gradient(#fff, #cdd3da);
    border: 2px solid #565c64;
    border-radius: 18px;
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover:not(:disabled) { background: linear-gradient(#fff, #e4e8ec); }
.btn:focus-visible { outline: 3px solid #145ec2; outline-offset: 1px; }
.btn:disabled { opacity: .42; cursor: default; }

.btn-primary {
    background: linear-gradient(#1e9a51, #0f6a35);
    border-color: #083e1e;
    color: #fff;
}

.btn-primary:hover:not(:disabled) { background: linear-gradient(#24ad5c, #127a3d); }

/* Menu */
.menu {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: flex;
    gap: 4px;
}

.menu a,
.menu button {
    padding: 7px 16px;
    background: linear-gradient(#49505a, #1d2127);
    border: 1px solid #8e959d;
    border-radius: 4px;
    color: #fff;
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.menu a:hover,
.menu button:hover { background: linear-gradient(#5d6570, #2b3038); }

/* Rules */
.rules {
    width: 620px;
    padding: 22px 28px 26px;
    background: var(--cream);
    border: 3px solid var(--gold-dim);
    border-radius: 10px;
    color: var(--ink);
    font-family: var(--font-ui);
}

.rules::backdrop { background: rgba(0, 0, 0, .55); }
.rules h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: 28px; }
.rules ul { margin: 0 0 18px; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.rules .btn { padding: 0 22px; }

/* Phones: the table is zoomed in and draggable (see fitStage in blackjack.js). The chip tray moves under
   the player's seat, and the panel and menu move into a bar fixed to the bottom of the screen. */
.phone-only { display: none; }
.hud { display: none; }

.phone-layout #stage {
    touch-action: none;
    cursor: grab;
}

.phone-layout .chip-tray { left: 428px; }

.phone-layout .hud {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: linear-gradient(#141518, #08080a);
    border-top: 1px solid var(--gold-dim);
    box-shadow: 0 -8px 18px rgba(0, 0, 0, .6);
    font-family: var(--font-ui);
}

/* A fixed height, so the bar never grows and covers the table when the message or buttons change. */
.phone-layout .hud .panel {
    position: static;
    width: 100%;
    max-width: 460px;
    height: 104px;
    padding: 6px 10px 8px;
}

.phone-layout .hud .panel-message {
    font-size: 15px;
    margin-bottom: 6px;
}

/* All the buttons in one row. */
.phone-layout .hud .panel-controls {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
}

.phone-layout .hud .panel-controls .wide { grid-column: auto; }
.phone-layout .hud .btn { height: 40px; padding: 0 6px; }

.phone-layout .hud .menu {
    position: static;
    justify-content: center;
}

.phone-layout .hud .menu a,
.phone-layout .hud .menu button {
    padding: 5px 14px;
    font-size: 14px;
}

.phone-layout .phone-only { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
    .dealing, .revealing, .result, .chip-glint { animation: none; }
    .dealer { transition: none; }
}
