@font-face {
    font-family: 'SN Pro';
    src: url('fonts/SNPro/SNPro-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'SN Pro';
    src: url('fonts/SNPro/SNPro-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'SN Pro';
    src: url('fonts/SNPro/SNPro-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

:root {
    /* Colors - Target UI Palette */
    --bg-color: #0d0d0d;
    /* Updated to match body bg */
    --surface-color: #121212;
    --surface-alt: #1c1c1e;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --accent-color: #f4f0e6;
    --card-bg: #ffffff;
    --card-text: #000000;
    --suit-red: #d94541;
    /* Muted red */
    --suit-black: #2c2c2c;
    /* Dark gray */

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-s: 8px;
    --spacing-m: 16px;
    --spacing-l: 24px;
    --spacing-xl: 32px;

    /* Borders & Shadows */
    --radius-xs: 4px;
    --radius-s: 14px;
    --radius-m: 22px;
    --radius-l: 32px;
    --radius-full: 9999px;
    --shadow-premium: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.4);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --motion-feedback: 120ms;
    --motion-state: 220ms;
    --motion-deal: 560ms;

    --font-family: 'SN Pro', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    background-color: #0d0d0d;
    height: 100%;
}

body {
    background-color: #0d0d0d;
    background-image: none;
    color: var(--text-primary);
    font-family: var(--font-family);
    height: 100%;
    /* Reverted to explicit height to ensure #app % works */
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(env(safe-area-inset-top, 0px) + 2px);
    background: #0d0d0d;
    pointer-events: none;
    z-index: 5000;
}

#app {
    width: 100%;
    max-width: 480px;
    height: 100dvh;
    /* Use dynamic viewport height for mobile responsiveness */
    margin: 0 auto;
    display: grid;
    background-color: #0d0d0d;
    grid-template-rows: auto auto 1fr auto auto;
    grid-template-areas:
        "header"
        "opponents"
        "table"
        "controls"
        "player";
    padding: 0 var(--spacing-m);
    gap: var(--spacing-s);
    overflow: hidden;
    border-top: none;
    /* Prevent global scroll */
}


#app,
.header-actions {
    border-top: 0 !important;
}

/* Home Screen - Remove Gradient, match Game BG */
.home-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0d0d0d;
    padding-top: env(safe-area-inset-top, 0px);
    /* Flat color */
    background-image: none;
    /* Keep texture if desired, or remove */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-l);
    text-align: center;
    overflow-y: auto;
}

.home-ad-slot {
    width: min(100%, 340px);
    min-height: 96px;
    margin: 18px auto 0;
    padding: 14px 16px;
    border: 1px solid rgba(244, 240, 230, 0.22);
    border-radius: 24px;
    background:
        radial-gradient(circle at 20% 0%, rgba(244, 240, 230, 0.16), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.78);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.home-actions {
    display: grid;
    gap: 10px;
    width: min(100%, 340px);
}

.btn-private-table {
    display: grid;
    place-items: center;
    min-height: 56px;
    border: 1px solid rgba(244, 240, 230, 0.44);
    color: var(--accent-color);
    text-decoration: none;
    background: transparent;
}

.home-ad-eyebrow {
    color: var(--accent-color);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
}

.home-ad-slot .adsbygoogle {
    width: 100%;
    min-height: 60px;
}

@media (max-height: 720px) {
    .home-ad-slot {
        min-height: 58px;
        margin-top: 12px;
        padding: 10px 14px;
    }

    .home-ad-slot .adsbygoogle {
        min-height: 42px;
    }
}

.header-actions {
    grid-area: header;
}

.opponents-bar {
    grid-area: opponents;
}

.table-area {
    grid-area: table;
}

/* Controls Area padding */
.controls-area {
    grid-area: controls;
    padding: 0 16px;
    /* Matched 16px gutter */
    width: 100%;
    box-sizing: border-box;
}

.player-area {
    grid-area: player;
}

/* Status Bar & Header */
.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 14px var(--spacing-s) 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.status-icons {
    display: flex;
    gap: 5px;
    font-size: 14px;
}

.header-actions {
    padding: calc(var(--spacing-l) + env(safe-area-inset-top, 0px)) 16px 0 16px;
    /* Increased top padding and safe-area fill for standalone PWA mode */
}

.btn-icon {
    /* Matched Style */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);

    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-left: 0px;
    /* Align with app padding */
    font-family: inherit;
    padding-left: 0;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Consolidating .header-actions rules */

.btn-icon:disabled,
.btn-icon.disabled {
    /* Simple Faded Glass */
    opacity: 0.4 !important;
    cursor: default;
    pointer-events: none;
    transform: none;
    box-shadow: none !important;
}

/* Opponent Bar */
.opponents-bar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding: 5px 0 100px 0;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.opponents-bar::-webkit-scrollbar {
    display: none;
}

/* Compact Opponent */
.opponent {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
    /* Equalized padding (Top/Bottom) */
    justify-content: center;
    /* Vertically center content to ensure equal blank space */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    /* Fixed height to prevent stretching from showdown cards */
    height: 110px;
    /* Slightly smaller */
    max-height: 110px;
    overflow: visible;
    /* Show cards */
    z-index: 1;
    /* Ensure stacking context */
}

.glow-pill {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 50%;
    background: rgba(244, 240, 230, 0.2);
    filter: blur(14px);
    border-radius: 50%;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.opponent.active .glow-pill {
    opacity: 1;
}

.opponent.folded .opponent-avatar,
.opponent.folded .opponent-name,
.opponent.folded .opponent-chips {
    opacity: 0.5;
}

.opponent-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background: transparent;
    /* Removed background circles */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    /* Slightly larger emojis */
    position: relative;
    transition: transform 0.2s ease;
}

.avatar-img-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Opponent Showdown Hand */
.opponent-hand-container {
    position: absolute !important;
    /* Force out of flow */
    top: 100%;
    /* Anchor to bottom of parent */
    margin-top: 40px;
    /* Increased from 30px */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    max-width: 120%;
    width: max-content;
}

/* User's Hand Style Mini-Stack */
.mini-hand-stack {
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0.6);
    /* Scale down the whole stack */
    transform-origin: top center;
}

.mini-card {
    /* Use exact same proportions as player card */
    width: 10em;
    height: 14em;
    font-size: 10px;
    /* Layout Compensation for Scale */
    margin: 0 -60px !important;
}

/* Fan effect for mini-stack */
/* Fan effect for mini-stack */
.mini-hand-stack .mini-card:nth-child(1) {
    /* Combine Rotation with Scale */
    transform: rotate(-10deg) translateY(6px) scale(0.5) !important;
    margin-left: 0;
    z-index: 1;
}

.mini-hand-stack .mini-card:nth-child(2) {
    /* Combine Rotation with Scale */
    transform: rotate(10deg) translateY(4px) scale(0.5) !important;
    z-index: 2;
}

.opponent-hand-container .card:hover {
    transform: translateY(-10px) scale(1.1);
    z-index: 101;
}



/* Turn Indicator (Triangle) */
/* Turn Indicator (Downward Triangle) */
.turn-indicator {
    display: none !important;
}

.dealer-button {
    position: absolute;
    bottom: 0;
    /* Positioned at bottom right of avatar */
    right: -4px;
    background: white;
    color: black;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    border: none;
    /* Cleaner look */
}

.opponent-name {
    font-size: 11px;
    color: #888;
    /* Darker grey */
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* Fix: Move bets below card */
.opponent-bet-container {
    position: absolute;
    bottom: -40px;
    /* Below card */
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    z-index: 50;
    pointer-events: none;
}

.opponent-chips {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-top: 2px;
    /* Add space */
}

.opponent-bet-bubble {
    margin-top: 8px;
    background: rgba(244, 240, 230, 0.15);
    /* 15% Ivory */
    color: #f4f0e6;
    /* Bright Ivory Text */
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(244, 240, 230, 0.2);
    animation: popIn 180ms var(--ease-out-quint) both;
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* User Bet Bubble - Specific Positioning */
.user-bet-container {
    position: absolute;
    top: -48px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    z-index: 10;
    pointer-events: none;
}

.user-bet-bubble {
    position: relative;
    /* Reset absolute from shared rule overrides */
    bottom: auto;
    left: auto;
    transform: none;
    background: rgba(244, 240, 230, 0.15);
    /* Match opponents */
    border: 1px solid rgba(244, 240, 230, 0.2);
    color: #f4f0e6;
    /* Ivory text */
    min-width: 40px;
    height: 30px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    /* Match pot size */
    font-weight: 700;
    padding: 0 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Table Area */
.table-area {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding-bottom: var(--spacing-l);
    /* Push table up slightly */
}

.table-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center align instead of flex-end */
    width: 100%;
    /* Changed from fit-content */
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.community-cards {
    display: flex;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    margin-bottom: var(--spacing-m);
    flex: 1;
    overflow: visible;
    box-sizing: border-box;
    position: relative;
}


/* Community Card Scale - Adjusted to fill width minus margins */
.community-cards .card {
    font-size: clamp(7.5px, 2.2vw, 10.5px);
    width: 10em;
    /* Reverted to original */
    height: 14em;
    /* Reverted to original */
    margin-right: -2em;
    flex-shrink: 0;
    transition: margin-right 0.3s ease;
    z-index: 1;
    /* Ensure stacking context to prevent jump on opacity change */
}

/* Adjust overlap for last card */
.community-cards .card:last-child {
    margin-right: 0;
}



.pot-display {
    display: flex;
    justify-content: flex-end;
    /* Keep right aligned */
    align-items: center;
    width: auto;
    min-width: 80px;
    /* SMALLER PILL */
    padding: 4px 14px;
    font-size: 18px;
    /* SMALLER FONT */
    font-weight: 600;
    color: #fff;
}

.pot-display::before {
    content: '';
}

/* Card Styling */
/* 
    UNIFIED CARD SYSTEM 
    Base size is set via font-size on parent/element.
    All internal dimensions use 'em' to scale proportionally.
    Standard Width: 10em
    Standard Height: 14em (2.5/3.5 aspect ratio)
*/
.card {
    width: 11em;
    /* Increased from 10em */
    height: 15.4em;
    /* Increased from 14em */
    background: var(--card-bg);
    --border-radius: 2.25em;
    --corner-granularity: 8;
    border-radius: var(--border-radius);
    /* Slightly reduced corner roundness */
    display: flex;
    flex-direction: column;
    padding: 1.4em;
    /* 0.9em Rim + 0.5em Content Padding */
    /* scalable padding */
    color: var(--card-text);
    /* border: none; (Padding creates white rim) */
    background: #ffffff;
    /* Rim Color */
    position: relative;
    box-shadow: 0 0.2em 2em rgba(0, 0, 0, 0.3);
    overflow: hidden;
    /* Clip internal glow */
    transform-style: preserve-3d;
    backface-visibility: hidden;
    --flip-lift: 2.8em;
    --card-depth: 0.48em;
}

.card-edge {
    position: absolute;
    pointer-events: none;
    backface-visibility: hidden;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.12s ease;
    background: linear-gradient(180deg, #fafafa 0%, #dfdfdf 100%);
}

.card-edge-right,
.card-edge-left {
    width: var(--card-depth);
    inset-block: var(--border-radius);
    height: calc(100% - 2 * var(--border-radius));
}

.card-edge-right {
    inset-inline-end: 0;
    transform: rotateY(270deg);
    transform-origin: right center;
}

.card-edge-left {
    inset-inline-start: 0;
    transform: rotateY(90deg);
    transform-origin: left center;
}

.card-edge-top,
.card-edge-bottom {
    height: var(--card-depth);
    inset-inline: var(--border-radius);
    width: calc(100% - 2 * var(--border-radius));
}

.card-edge-top {
    inset-block-start: 0;
    transform: rotateX(270deg);
    transform-origin: center top;
}

.card-edge-bottom {
    inset-block-end: 0;
    transform: rotateX(90deg);
    transform-origin: center bottom;
}

.card-corner {
    --n: var(--corner-granularity);
    --r: var(--border-radius);
    position: absolute;
    transform-style: preserve-3d;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.card-corner>* {
    position: absolute;
    inset-block-end: 0;
    width: var(--card-depth);
    height: calc(2 * var(--r) * sin(45deg / var(--n)));
    transform-origin: bottom center;
    background: linear-gradient(180deg, #fbfbfb 0%, #e0e0e0 100%);
    transform:
        translateZ(calc(var(--r) * cos(var(--i) * 90deg / var(--n))))
        translateY(calc(-1 * var(--r) * sin(var(--i) * 90deg / var(--n))))
        rotateX(calc(45deg * (2 * var(--i) + 1) / var(--n)));
}

.card-corner-top-right {
    inset-block-start: 0;
    inset-inline-end: 0;
    transform:
        rotateY(90deg)
        translateZ(calc(-1 * var(--r)))
        translateY(var(--r));
}

.card-corner-bottom-right {
    inset-block-end: 0;
    inset-inline-end: 0;
    transform:
        rotateY(90deg)
        rotateX(270deg)
        translateZ(calc(-1 * var(--r)))
        translateY(var(--r));
}

.card-corner-bottom-left {
    inset-block-end: 0;
    inset-inline-start: 0;
    transform:
        rotateY(90deg)
        rotateX(180deg)
        translateZ(calc(-1 * var(--r)))
        translateY(var(--r));
}

.card-corner-top-left {
    inset-block-start: 0;
    inset-inline-start: 0;
    transform:
        rotateY(90deg)
        rotateX(90deg)
        translateZ(calc(-1 * var(--r)))
        translateY(var(--r));
}

.card.card-3d-flip,
.card.fold-flipping,
.card.show-back {
    overflow: visible;
}

.card.card-3d-flip .card-edge,
.card.fold-flipping .card-edge,
.card.show-back .card-edge,
.card.card-3d-flip .card-corner,
.card.fold-flipping .card-corner,
.card.show-back .card-corner {
    opacity: 1;
}


.card.face-down,
.card.face-down-initial {
    background-color: transparent;
    /* Use gradient layers */
    /* Layer 1: Hatching (Content Box), Layer 2: White (Padding Box) */
    background-image: repeating-linear-gradient(45deg,
            transparent,
            transparent 6px,
            #333333 6px,
            #333333 8.5px),
        linear-gradient(#fff, #fff);
    background-clip: content-box, padding-box;
    background-size: auto;
    background-repeat: repeat;
    padding: 0.9em !important;
    /* Override Flow Padding to match Rim size */
    position: relative;
    overflow: hidden;
    /* border: none; padding handles rim */
    /* Ensure border matches white context */
}

/* Suit Masking Fix (Div instead of Img) */
/* Suit Icon Positioning */
.card-suit,
.suit-icon {
    position: absolute;
    bottom: 2.1em;
    /* 1.2em + 0.9em Rim */
    /* Bottom spacing - Anchored low */
    left: 1.4em;
    /* 0.5em + 0.9em Rim */
    display: block !important;
    z-index: 3;
    pointer-events: none;
}

/* Overlay for the card back */
.card-back-overlay {
    position: absolute;
    top: 0.9em;
    left: 0.9em;
    right: 0.9em;
    bottom: 0.9em;
    width: auto;
    height: auto;
    background-color: #ffffff;
    /* Continuous Diagonal Stripes */
    background-image: repeating-linear-gradient(45deg,
            transparent,
            transparent 6px,
            #333333 6px,
            #333333 8.5px);
    z-index: 2;
    border-radius: 1.35em;
    /* Inner radius tracks outer 2.25em with 0.9em rim */
    backface-visibility: hidden;
}


.card.reveal .card-back-overlay {
    opacity: 0;
    visibility: hidden;
}

.card .card-value,
.card .card-suit,
.card .suit-icon {
    opacity: 0;
}

.card.reveal .card-value,
.card.reveal .card-suit,
.card.reveal .suit-icon {
    opacity: 1;
    transform: translateY(0);
}

/* Green indicator pill for cards contributing to best hand */
.card-indicator {
    position: absolute;
    top: 0.6em;
    /* Centered in gap */
    /* Proportional top spacing */
    left: 50%;
    transform: translateX(-50%);
    width: 3em;
    /* Compact pill centered on card */
    height: 0.5em;
    /* Proportional height (Relative to card size) */
    border-radius: 1.2em;
    /* Proportional rounded ends matching card corner style */
    background: #4ade80;
    z-index: 10;
    pointer-events: none;

    /* Animation: Pop in + spread glow */
    opacity: 0;
    /* Start hidden for animation */
    /* transform handled in keyframes */
    animation: pill-spread-pop 700ms var(--ease-out-quint) 180ms forwards;
}

.card-indicator.card-indicator-settled {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    box-shadow: 0 0 5em 2.5em rgba(74, 222, 128, 0.4);
    animation: none;
}

@keyframes pill-spread-pop {
    0% {
        transform: translateX(-50%) scale(0.5);
        opacity: 0;
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }

    30% {
        transform: translateX(-50%) scale(1.1);
        opacity: 1;
        box-shadow: 0 0 1em 0.5em rgba(74, 222, 128, 0.6);
    }

    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
        box-shadow: 0 0 5em 2.5em rgba(74, 222, 128, 0.4);
        /* Super Soft Green Glow */
    }
}

/* Removed pulse-indicator animation */

.card-value {
    position: relative;
    z-index: 3;
    font-size: 3.8em;
    /* Scaled to match player proportion everywhere */
    font-weight: 500;
    line-height: 1;
    margin-top: 0.15em;
    margin-left: 0.15em;
}

/* Eliminated Player Style */
.opponent.eliminated {
    opacity: 0.3;
    filter: grayscale(1);
    pointer-events: none;
}

.opponent.eliminated .glow-pill {
    display: none;
}

/* Card Coloring */
/* Suits are colored via their SVG files, Rank via color */


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

.card.black {
    color: #2b2b2b;
}

.card.red {
    color: #ff5555;
    background-color: white;
}

.card-suit,
.suit-icon {
    width: 3.5em;
    height: 3.5em;
    display: block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent !important;
}

/* Action Controls Area */
.controls-area {
    position: relative;
    padding: 0 16px;
    /* Restored side padding to match 16px gutter */
    margin-bottom: 0;
    /* Remove margin, rely on grid gap 8px */
    width: 100%;
    box-sizing: border-box;
}

/* Action Bar Layout - HIDDEN: replaced by unified action button in profile card */
.action-bar-container {
    display: none !important;
}

/* Main Controls */
.controls {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    /* Take available space */
    pointer-events: auto;
    /* Re-enable clicks */
}



/* Hardening for Action Bar Layout */
.secondary-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0 !important;
    /* CRITICAL: Prevent crushing by Raise Menu */
    min-width: auto;
}

.raise-morph-group {
    flex: 1;
    min-width: 0;
    /* CRITICAL: Allow shrinking if needed */
    position: relative;
    /* Ensure containment */
}

/* Liquid Glass Button Style */
.btn {
    height: 54px;
    /* Glass Effect */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 27px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 var(--spacing-l);
    font-family: 'SN Pro', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    text-transform: uppercase;
    /* Capitalize */
    /* Ensure clickable inside pointer-events: none containers */
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn:active {
    transform: translateY(1px);
    background: rgba(255, 255, 255, 0.02);
}

.btn:disabled,
.btn.disabled {
    /* Simple Faded Glass - No Overlay */
    opacity: 0.4 !important;
    cursor: default;
    pointer-events: none;
    box-shadow: none !important;
    /* Maintain standard glass background, just faded */
}

/* Ensure no pseudo-element overlays */
.btn:disabled::before,
.btn:disabled::after,
.btn.disabled::before,
.btn.disabled::after {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
}

.btn-primary {
    flex: 1;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary {
    flex: 1;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    /* Matched to Primary */
    border: 1px solid rgba(255, 255, 255, 0.15);
    /* Matched to Primary */
    color: #ff6b6b;
    /* Red Text */
}

.btn-secondary:hover {
    background: rgba(217, 69, 65, 0.15);
    /* Red tint on hover only */
    border-color: rgba(217, 69, 65, 0.5);
    box-shadow: 0 0 15px rgba(217, 69, 65, 0.2);
}

.controls .btn:not(.btn-round) {
    flex: 1;
    /* Make all play buttons (except round ones) fill width */
    width: 100%;
}

.btn-round {
    width: 54px;
    height: 54px;
    min-width: 54px;
    /* Ensure circular */
    border-radius: 50%;
    padding: 0;
    font-size: 32px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1;
    /* Ensure material consistency (Glass Effect from Player Profile) */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 0.74px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    /* Subtle shadow */
    transition: all 0.2s ease;
    pointer-events: auto;
}

.btn-round:disabled,
.btn-round.disabled {
    /* Darker glass style - no opacity overlay */
    background: rgba(60, 60, 60, 0.1);
    border-color: rgba(60, 60, 60, 0.15);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
    pointer-events: none;
}

.btn-small {
    padding: var(--spacing-xs) var(--spacing-s);
    font-size: 13px;
    border-radius: var(--radius-s);
    min-width: 55px;
    height: 36px;
    /* Standard glass style */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.btn-small:disabled,
.btn-small.disabled {
    /* Darker glass style - no opacity overlay */
    background: rgba(60, 60, 60, 0.1);
    border-color: rgba(60, 60, 60, 0.15);
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
    pointer-events: none;
}


/* Raise Preset Popup */
/* Raise Preset Popup - Pill Shape */
/* Raise Preset Popup - Pill Shape */
.raise-options {
    position: absolute;
    bottom: 100%;
    right: 20px;
    /* Align roughly with raise button which is on the right */
    left: auto;
    transform: none;
    width: auto;
    min-width: unset;
    /* Let content dictate */
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 100px;
    padding: 6px;
    /* Reduced padding */
    display: flex;
    gap: 8px;
    /* Gap handles the spacing */
    justify-content: center;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    /* Ensure moves above everything */
    margin-bottom: 24px;
    pointer-events: auto;
    /* Force clickable */
}

.raise-preset-btn {
    width: auto;
    min-width: 50px;
    height: 36px;
    padding: 0 12px;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    /* Pill buttons */
    color: #fff;
    font-family: var(--font-family);
    /* Correct font */
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.raise-preset-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.raise-preset-btn:disabled,
.raise-preset-btn.disabled {
    /* Darker glass style - no opacity overlay */
    background: rgba(60, 60, 60, 0.1);
    border-color: rgba(60, 60, 60, 0.15);
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
    pointer-events: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Pot Pill Targeting */
/* Pot Pill Targeting */
#pot-display,
.pot-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0px;
    padding: 8px 24px !important;
    /* Restore Padding */
    /* Remove container padding */
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    font-size: 18px;
    color: #f4f0e6;
    font-weight: 700;
    margin-bottom: 24px;
    width: auto;
    /* Prevent full width */
    min-width: 0px;
    /* Minimum width for stability */
}

.pot-label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
}

#raise-val-label {
    color: #fff;
    font-size: 14px;
}

.btn-confirm {
    width: 100%;
    background: #27ae60;
    /* specific confirm color or keep generic */
    justify-content: center;
}


.btn:active {
    transform: scale(0.97);
    background: #1c1c1e;
}

/* Removed duplicate .btn:disabled - consolidated at line 716 */

/* Player Area */
.player-area {
    /* Manual gutter matching */
    padding: 0 16px;
    padding-bottom: 0;
    /* Remove bottom padding to fix gap */
    margin-bottom: 0;
    /* Minimal bottom gap */
    box-sizing: border-box;
    width: 100%;
    /* Max width constraint to match table/controls */
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    isolation: isolate;
}

.player-area::before {
    content: '';
    position: absolute;
    left: -10px;
    right: -10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) - 18px);
    height: min(34vh, 230px);
    border-radius: 46% 54% 0 0 / 52% 48% 0 0;
    background:
        radial-gradient(ellipse at 18% 72%, rgba(244, 240, 230, 0.52) 0%, rgba(244, 240, 230, 0.24) 26%, transparent 58%),
        radial-gradient(ellipse at 76% 44%, rgba(244, 240, 230, 0.42) 0%, rgba(244, 240, 230, 0.18) 30%, transparent 60%),
        radial-gradient(ellipse at 48% 92%, rgba(248, 245, 236, 0.36) 0%, rgba(248, 245, 236, 0.14) 28%, transparent 62%);
    filter: blur(26px) saturate(1.35);
    opacity: 0;
    transform: translate3d(0, 22px, 0) scale(0.94);
    transition: opacity 260ms var(--ease-out-quart), transform 360ms var(--ease-out-quart);
    pointer-events: none;
    z-index: -1;
    will-change: opacity, transform;
}

.player-area.user-turn-active::before {
    opacity: 0.82;
    transform: translate3d(0, 0, 0) scale(1);
    animation: playerTurnMesh 3.8s ease-in-out infinite alternate;
}

.player-area.user-turn-active .action-btn {
    border-color: rgba(244, 240, 230, 0.34);
    box-shadow:
        0 12px 28px rgba(244, 240, 230, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

@keyframes playerTurnMesh {
    0% {
        filter: blur(26px) saturate(1.3);
        transform: translate3d(-5px, 4px, 0) scale(0.98) skewX(-1deg);
    }

    50% {
        filter: blur(30px) saturate(1.55);
        transform: translate3d(7px, -3px, 0) scale(1.04) skewX(1.5deg);
    }

    100% {
        filter: blur(24px) saturate(1.4);
        transform: translate3d(2px, 2px, 0) scale(1.01) skewX(-0.5deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .player-area.user-turn-active::before {
        animation: none;
        opacity: 0.68;
        transform: none;
    }
}

.player-hand-container {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    /* Height intrinsic: Let content drive it */
    height: auto !important;
    font-size: 15.5px;
    width: 100%;
    gap: 8px;
    max-width: 100%;
    position: relative;
    z-index: 1;
}

.player-cards {
    flex-shrink: 0;
    position: relative;
    display: flex;
    z-index: 1;
}



/* Player Cards Scale: ~155px width. 1em = 15.5px */
.player-cards .card {
    font-size: 15.5px;
    width: 10em;
    height: 14em !important;
    /* Driver of height */
    min-height: 14em !important;
    max-height: 14em !important;
    box-sizing: border-box !important;
    position: relative;
    /* Changed from absolute to relative for flow */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
}

.player-cards .card:first-child {
    left: 0;
    z-index: 1;
    /* Custom shadow for player can stay px or em */
    box-shadow: 0 0.6em 2em rgba(0, 0, 0, 0.5);
}

.player-cards .card:not(:first-child) {
    margin-left: -4em;
    /* Revert to em */
    /* Reduced overlap so first card value visible */
    z-index: 2;
    box-shadow: -0.6em 0 2em rgba(0, 0, 0, 0.2);
}

/* Update Profile Wrapper Layout */
/* Split Profile: Action Button + Profile Card */
.player-info-wrapper {
    --player-panel-radius: 1.8em;
    --player-panel-joint-radius: 0.35em;
    position: relative;
    width: auto;
    flex: 1;
    height: auto !important;
    min-height: auto !important;
    max-height: auto !important;
    font-size: 15.5px;
    overflow: visible !important;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box !important;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Action Button Segment - Top portion */
.action-button-segment {
    position: relative;
    width: 100%;
    height: 54px;
    flex-shrink: 0;
    z-index: 3;
    touch-action: none;
}

.action-btn {
    width: 100%;
    height: 54px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    /* Match player-card corner roundness on exposed edges */
    border-radius: var(--player-panel-radius) var(--player-panel-radius) var(--player-panel-joint-radius) var(--player-panel-joint-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 var(--spacing-l);
    font-family: 'SN Pro', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    pointer-events: auto;
    touch-action: none;
    -webkit-user-select: none;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.action-btn:active {
    transform: translateY(1px);
    background: rgba(255, 255, 255, 0.02);
}

.action-btn:disabled {
    opacity: 0.4 !important;
    cursor: default;
    pointer-events: none;
    box-shadow: none !important;
}

/* "Pull up to raise" hint */
.raise-hint {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.3px;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 12;
}

.action-button-segment.dragging .raise-hint {
    opacity: 0;
}

.action-button-segment.dragging .action-btn {
    z-index: 30;
}

.action-button-segment.dragging .user-bet-container {
    z-index: 2;
}

/* Raise stretch rect for action button */
.action-raise-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.action-raise-container.hidden {
    display: none;
}

.action-stretch-rect {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: rgba(212, 175, 55, 0.32);
    border-radius: var(--player-panel-radius) var(--player-panel-radius) var(--player-panel-joint-radius) var(--player-panel-joint-radius);
    transition: background 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
    z-index: 1;
}

.action-stretch-rect.all-in {
    background: rgba(214, 74, 64, 0.42);
}

.action-raise-amount {
    position: absolute;
    right: 100%;
    bottom: 0;
    margin-right: 12px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 20;
}

/* Profile Card - Bottom portion */
.player-profile-card {
    position: relative;
    width: 100%;
    flex: 1;
    /* Glass Effect */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), var(--shadow-premium);
    /* Match player-card corner roundness on exposed edges */
    border-radius: var(--player-panel-joint-radius) var(--player-panel-joint-radius) var(--player-panel-radius) var(--player-panel-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 2;
}

.player-hand-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.player-avatar-large {
    font-size: 72px;
    position: relative;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.player-chips-large {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

/* User Bet Bubble */
.user-bet-bubble {
    background: rgba(244, 240, 230, 0.15);
    color: #f4f0e6;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 24px;
    /* Added spacing above buttons */
}

.user-bet-container {
    position: absolute;
    top: -48px;
    /* Position above profile */
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    z-index: 10;
    pointer-events: none;
}

/* Table Center Container */
.table-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.community-cards {
    justify-content: center;
}

/* Player Stats Panel & Swipe Interaction */





.stat-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

#stat-win-pct {
    color: #ff5f5f;
}

#stat-tie-pct {
    color: #fff;
}

/* Winner Toast */
.winner-toast {
    position: fixed;
    bottom: 220px;
    /* Aligned with player bet area */
    left: 50%;
    /* Center horizontally */
    transform: translateX(-50%) translateY(20px);
    background: var(--accent-color);
    color: #000;
    padding: var(--spacing-s) var(--spacing-m);
    border-radius: var(--radius-full);
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 10px 25px rgba(244, 240, 230, 0.4);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.winner-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Opponent Showdown Cards */
.opponent-hand {
    display: flex;
    justify-content: center;
    /* REMOVED absolute positioning here, handled by wrapper */
    margin-top: 5px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    gap: 4px;
    pointer-events: none;
}



/* Opponent Hand Scale: ~60px width. 1em = 6px */
.opponent-hand .card {
    font-size: 6px;
    /* Scales entire card including border/padding */
    margin-left: -5em;
    /* Clean stack overlap relative to scaled size */
    box-shadow: -0.5em 0 1em rgba(0, 0, 0, 0.5);
    position: relative;
    transition: transform 0.3s ease;

    /* Proportional Fixes for Small Scale */
    border-radius: 1em;
    /* Less rounded corners (was 2em) */
    border-width: 0.6em;
    /* Thinner border (was 0.9em) */
}

.opponent-hand .card:first-child {
    margin-left: 0;
}

.opponent-hand .card:hover {
    transform: translateY(-2em);
    z-index: 10;
}

.opponent-hand .card .card-value {
    font-size: 3.8em;
    /* Same as player cards (3.8em) */
    font-weight: 500;
    line-height: 1;
    margin-top: 0.15em;
    margin-left: 0.15em;
}

.opponent-hand .card .suit-icon {
    /* Match player/community card styling */
    width: 3.5em;
    height: 3.5em;
    bottom: 1.2em;
    bottom: 1.2em;
    left: 0.5em;
}

/* Showdown Layer (Global Overlay) */
#showdown-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2000;
    /* Above everything */
}

/* Showdown Mini Stack (Global Layer) */
.mini-hand-stack {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-hand-stack .card {
    /* Base styles from .mini-card are good, but enforce spacing */
    margin: 0 !important;
    margin-left: -20px !important;
    /* Overlap: Next card covers previous */
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3);
    /* Shadow on left edge to show separation */
    transition: transform 0.2s ease, margin 0.2s ease;
    /* Reverse Stacking: Left card on top? User said "NOT right covering left" */
    /* If we want Card 1 on Top of Card 2, we need explicit Z-Index handling in JS or here */
}

/* Blur Effect for Fast Forward - Apply to APP when BODY has class */
body.fast-forwarding #app {
    filter: blur(4px);
    pointer-events: none;
    transition: filter 0.3s ease;
}

.mini-hand-stack .card:first-child {
    margin-left: 0 !important;
}

.mini-hand-stack .card:hover {
    transform: translateY(-10px);
    z-index: 100;
    /* Pop on hover */
    margin-right: 20px !important;
    /* Push neighbors away? Optional */
}

/* ================================================
   GAME START SEQUENCE STYLES
   ================================================ */

/* Start Button Overlay */
.start-controls {
    display: flex;
    justify-content: center;
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0 20px;
    box-sizing: border-box;
    transition: opacity 0.5s ease;
    pointer-events: none;
    /* Allow clicks through empty space */
}

/* Blur Effect for Fast Forward */
.blur-active {
    filter: blur(4px);
    transition: filter 0.3s ease-out;
    pointer-events: none;
    /* Prevent clicks while blurred */
}

.start-controls.fade-out {
    opacity: 0;
    pointer-events: none;
}

#btn-resume {
    height: 48px !important;
    padding: 8px 32px !important;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-start {
    width: 100%;
    height: 54px;
    /* Matches standard */
    /* Standard Glass Style (No Ivory) */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background 0.2s ease;
    pointer-events: auto;
    /* Re-enable clicks for the button */
}

.btn-start:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.15);
}

.btn-start:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.05);
}

/* Controls State Classes */
.controls.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.controls.controls-disabled {
    pointer-events: none;
    transition: all 0.3s ease;
}

.controls.controls-disabled .btn:disabled,
.controls.controls-disabled .btn.disabled {
    /* Darker glass style for disabled controls */
    background: rgba(60, 60, 60, 0.1);
    border-color: rgba(60, 60, 60, 0.15);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(60, 60, 60, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
}

.controls.visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    filter: none;
    transition: all 0.3s ease;
}

/* Raise Morph Logic */
.action-bar-container {
    display: flex;
    gap: 8px !important;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    /* Allow filling width */
}

/* Ensure no margins interfere with gap */
.action-bar-container>* {
    margin: 0 !important;
}

.raise-morph-group {
    display: flex;
    flex: 1;
    /* Default: Share space */
    transition: flex 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    height: 54px;
    /* Base Desktop Height */
    justify-content: center;
    align-items: center;
}

/* Call Button - Shrink logic */
#btn-call {
    flex: 1;
    transition: flex 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    height: 54px;
    /* Explicit Base Height */
}

/* EXPANDED STATE (High Specificity) */
#app #play-controls.expanded #btn-call {
    display: none !important;
    /* Hide Call button when Raise is open to reduce crampedness */
}

#app #play-controls.expanded .raise-morph-group {
    flex: 1 1 100% !important;
    /* Take full width */
    min-width: 0;
}

.secondary-actions {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    /* Align right */
}

/* Apply Glass to Start/Fold/FF Buttons too */
/* Apply Glass to Start/Fold/FF Buttons too */
.secondary-actions .btn,
.btn-round {
    /* Match .btn styles exactly - increased brightness to match Call Button */
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
}

/* Raise Options Inline - Replaces #raise-options absolute */
/* Raise Options Inline - Glass Pill Style */
#raise-options {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;

    /* Unified Glass Pill - Match .btn style */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    /* Fully rounded container */
    padding: 0 !important;
    overflow: hidden;
    /* Clip children */

    /* Animation: Fade In Content */
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    /* Prevent clicks when hidden */
}

/* Visible State provided by parent .expanded or explicit class? 
   Actually JS toggles .hidden on #raise-options.
   Let's target strict: not(.hidden) */
#raise-options:not(.hidden) {
    display: flex !important;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

#raise-options.hidden {
    display: none !important;
}

/* Raise Button inside Group */
#btn-raise {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    border-radius: 40px;
    /* Match container */
}

#btn-raise.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Options Buttons - Transparent segments */
#raise-options button,
#raise-options .btn {
    display: flex;
    /* Ensure centering */
    align-items: center;
    /* Vertical Center */
    justify-content: center;
    flex: 1;
    height: 100% !important;
    /* Force match container */
    font-size: 13px !important;
    padding: 0 !important;
    margin: 0 !important;

    /* Revert to Dividers */
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    /* Dividers */
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9);
}

/* Close/X Button - Bigger */
#btn-raise-close {
    font-size: 24px !important;
    /* Bigger X */
    font-weight: 300;
    padding-bottom: 2px !important;
    /* Slight vertical alignment adjustment */
}

#raise-options button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.player-cards .card.face-down-initial .card-value,
.player-cards .card.face-down-initial .suit-icon {
    opacity: 0;
}

.player-cards .card.face-down-initial .card-back-overlay {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
    /* Fade out back immediately */
}

/* Player card face content: always visible (3D flip handles back/front swap via show-back class) */
.player-cards .card .card-value,
.player-cards .card .suit-icon {
    opacity: 1;
}

/* Initial deal: hide face content until revealPlayerCards() removes face-down-initial */
.player-cards .card.face-down-initial .card-value,
.player-cards .card.face-down-initial .suit-icon {
    opacity: 0 !important;
}

/* Animations */
/* Flying Chip */
.flying-chip {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #f4f0e6;
    border-radius: 50%;
    border: 2px dashed #b38f00;
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.6s ease;
}

/* Player Action Text Overlay */
.action-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 20;
    /* Above card content */
    opacity: 0;
    transition: opacity 0.3s ease;
    /* Removed background/scrim as requested - it's now just text + dimmed avatar */
}

.action-overlay.visible {
    opacity: 1;
}

/* Clean up old selector */
#app.fast-forwarding {
    filter: blur(4px);
    pointer-events: none;
}

.action-text {
    color: #fff;
    font-size: 14px;
    /* Slightly larger */
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 1);
    /* Strong shadow for readability */
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(0, 0, 0, 0.4);
    /* Small pill background for text only */
    padding: 2px 8px;
    border-radius: 4px;
}

.action-overlay.visible .action-text {
    transform: scale(1);
}

/* Dim Avatar on Action */
.player-avatar-large {
    transition: opacity 0.3s ease;
}

.player-avatar-large.dimmed {
    opacity: 0.3;
}

.opponent-avatar {
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.opponent-avatar.dimmed {
    opacity: 0.3;
}

/* End of File */

/* Fix: Avatar Dimming */
.dimmed {
    opacity: 0.3 !important;
    filter: grayscale(100%);
    transition: opacity 0.3s ease;
}

/* Fix: Fast Forward Clickability */
#fast-forward-btn {
    pointer-events: auto !important;
    z-index: 2000 !important;
    /* Above everything */
    position: relative;
    /* Ensure stacking context */
}

/* --- Home Screen Styles --- */

.home-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0d0d0d;
    background-image: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-l);
    overflow-y: auto;
}

.home-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    gap: var(--spacing-xl);
}

.game-title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -2px;
    background: linear-gradient(180deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: -10px;
    text-align: center;
}

.subtitle {
    font-size: 14px;
    letter-spacing: 4px;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 20px;
    text-align: center;
    opacity: 0.8;
}

.resume-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: all 0.3s ease;
}

.resume-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
    border-color: rgba(244, 240, 230, 0.2);
}

.resume-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.resume-time {
    color: var(--accent-color);
}

.resume-stats {
    display: flex;
    gap: 16px;
}

.resume-stat-box {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 600;
}

.btn-large {
    width: 100%;
    height: 54px;
    /* Matches standard gameplay buttons */
    border-radius: 30px;
    font-size: 18px;
    letter-spacing: 1px;
}

.btn-resume {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background 0.2s ease;

    /* Fix Squashed Look */
    height: 54px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.btn-resume:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

.btn-new-game {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.app-version {
    position: absolute;
    bottom: 20px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 12px;
}

/* Win Rankings */
.rankings-section {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.rankings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rankings-title {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.rankings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ranking-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    transition: background 0.2s ease;
}

.ranking-row.ranking-best {
    background: rgba(244, 240, 230, 0.08);
    border: 1px solid rgba(244, 240, 230, 0.15);
}

.ranking-position {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 28px;
}

.ranking-best .ranking-position {
    color: var(--accent-color);
}

.ranking-detail {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.ranking-chips {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-color);
}

.hidden {
    display: none !important;
}

/* Chip Animation */
.flying-chip {
    position: fixed;
    width: 20px;
    height: 20px;
    background: #f4f0e6;
    border-radius: 50%;
    color: #000;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #8d887c;
    z-index: 1000;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.6s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* =================================================
   RESPONSIVE BREAKPOINTS FOR SMALLER PHONES
   ================================================= */

/* Medium-small phones (375-400px wide) */
@media screen and (max-width: 400px) {
    :root {
        --spacing-xs: 2px;
        --spacing-s: 4px;
        --spacing-m: 8px;
        /* Tighter margins */
        --spacing-l: 12px;
        --spacing-xl: 16px;
    }

    #app {
        gap: 2px;
        /* Very tight gap */
    }

    .player-cards .card {
        font-size: 11px !important;
        /* Smaller player cards on mobile */
    }

    .player-cards-wrapper {
        font-size: 11px;
    }

    .btn {
        height: 48px !important;
        /* Restore touch target */
        font-size: 14px !important;
    }

    /* Fixed Syntax: CSS variables must be in selector */
}

/* Base Mobile Overrides (Global Shrink) */
:root {
    /* Globally Reduce Spacing by ~15% */
    --spacing-m: 14px;
    --spacing-l: 20px;
    --spacing-xl: 28px;
}

/* Mobile Tweaks */
@media screen and (max-width: 450px) {
    #app {
        padding: 0;
        /* Remove global padding, let children handle gutters for alignment */
        gap: 6px;
    }


    /* Shrink Player Cards (Base 15.5px -> 13px) */
    .player-cards .card {
        font-size: 13px;
    }

    .player-cards-wrapper {
        font-size: 13px;
    }

    /* Shrink Buttons */
    .btn {
        height: 48px;
        font-size: 13px;
    }
}

/* Header/Menu Button */
.btn-icon {
    width: 38px;
    height: 38px;
    font-size: 20px;
}

/* Opponents Bar */
/* Opponents Bar - 16px Gutter */
/* Opponents Bar */
/* Opponents Bar - 16px Gutter */
.opponents-bar {
    display: flex;
    /* Ensure flex */
    flex-wrap: wrap;
    /* Allow wrapping if needed? Usually nowrap */
    align-items: flex-start;
    /* CRITICAL: Prevent chips from stretching height/alignment */
    justify-content: center;
    padding: 4px 10px 40px 10px;
    /* Reduced bottom padding */
    gap: 8px;

    /* FIX CLIP: Ensure cards hang over the table */
    position: relative;
    z-index: 50;
    overflow: visible !important;
}

/* Global Showdown Layer */
#showdown-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2000;
}

/* Opponent Wrapper */
.opponent {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    /* Reset Styles */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-height: auto !important;
}

/* Glass Card Content - Match Player Profile & Call Button */
.opponent-card {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    /* Add Inset Shadow for consistency */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    padding: 8px 4px 14px 4px !important;
    /* More bottom buffer + general padding */
    border-radius: 16px;
    /* Matched rounding */
    min-height: auto !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    /* Added explicit gap between elements */
}



/* Bet Container Flow */
.opponent-bet-container {
    position: absolute;
    /* Remove from flow */
    top: 100%;
    /* Anchor to bottom of card */
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    /* Set directly to 8px gap */
    /* Gap */
    width: max-content;
    z-index: 10;
}

/* Showdown Hand Container (Child of .opponent) */
.opponent-hand-container {
    position: absolute;
    bottom: 0px;
    /* Overlap bottom of .opponent wrapper */
    left: 50%;
    transform: translate(-50%, 50%);
    /* Center X, Push Down Y to overlap? */
    top: 100%;
    margin-top: -30px;
    /* Adjusted for smaller cards */
    /* Pull UP MORE into the card */
    /* Pull UP into the card to overlap */
    z-index: 2000;
    /* Ensure on top of everything */
    pointer-events: none;
    width: max-content;
}

/* Fan effect for cards in stack */
.mini-hand-stack .card:not(:first-child),
.mini-hand-stack .mini-card:not(:first-child) {
    margin-left: -85px !important;
    /* Adjusted for smaller scale */
    /* Overlap */
}


/* Hide Glow Pill (Suspected Artifact) */
.glow-pill {
    display: none !important;
}

/* Mini Card for Showdown */
.mini-card {
    position: relative !important;
    display: block !important;
    opacity: 1 !important;

    /* Proportional Dimensions for 10px Font Base */
    width: 100px;
    height: 140px;
    font-size: 10px;

    /* Base Scale: 0.5 (Half size of the "Massive" 1.0) */
    transform: scale(0.5);
    transform-origin: bottom center;

    background-color: white;
    border-radius: 20px;
    /* Kept smooth radius */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);

    /* Layout Compensation for Scale */
    margin: 0 -85px !important;
}

/* Parent Container Scaling - RESET */
.mini-hand-stack {
    transform: none;
    /* Removed container scaling */
    transform-origin: bottom center;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

/* Global Fix for Bet Container Gap */
.opponent-bet-container {
    margin-top: 0px !important;
}

/* Ensure Value is on top of Suit */
.mini-card .card-value {
    position: relative;
    z-index: 10;
}

.mini-card .card-value,
.mini-card .suit-icon {
    opacity: 1 !important;
}

/* Force Colors in Mini Cards */
.mini-card.red {
    color: #ff5555 !important;
}

.mini-card.black {
    color: #2b2b2b !important;
}

.opponent-avatar {
    width: 42px;
    height: 42px;
    font-size: 26px;
}

.opponent-name {
    font-size: 10px;
}

.opponent-chips {
    font-size: 12px;
}

.dealer-button {
    width: 15px;
    height: 15px;
    font-size: 9px;
}

.opponent-bet-bubble {
    padding: 3px 8px;
    font-size: 12px;
    border-radius: 10px;
}

/* Pot Display */
#pot-display,
.pot-pill {
    padding: 8px 18px;
    font-size: 15px;
    margin-bottom: 16px;
}

/* Buttons */
.btn {
    height: 48px;
    /* Mobile Height */
    font-size: 14px;
    padding: 0 var(--spacing-m);
    border-radius: 24px;
}

/* Force Action Bar items to match mobile height */
.raise-morph-group,
#btn-call {
    height: 48px !important;
}

.btn-round {
    width: 48px;
    height: 48px;
    min-width: 48px;
    font-size: 20px;
}

.controls {
    gap: 8px;
}

/* Raise Options */
.raise-options {
    padding: 5px;
    gap: 6px;
    margin-bottom: 18px;
}

.raise-preset-btn {
    min-width: 42px;
    height: 100% !important;
    /* Force Fill */
    padding: 0 10px;
    font-size: 12px;
    border-radius: 0;
    /* Remove individual radius in grouped glass */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Player Area */
.player-area {
    padding: 0 16px;
    /* Match Opponent Margin (16px) */
    padding-bottom: calc(var(--spacing-m) + env(safe-area-inset-bottom, 20px));
}

.player-area::before {
    left: -4px;
    right: -4px;
    bottom: calc(env(safe-area-inset-bottom, 0px) - 10px);
    height: min(27vh, 176px);
    filter: blur(22px) saturate(1.32);
}


.player-cards .card {
    font-size: 13px;
}


.player-profile-card {
    border-radius: var(--player-panel-joint-radius) var(--player-panel-joint-radius) var(--player-panel-radius) var(--player-panel-radius);
    padding: 20px 0;
}

.player-info-wrapper {
    border-radius: 0;
}

.player-avatar-large {
    font-size: 40px;
}

.player-chips-large {
    font-size: 20px;
}

.player-hand-label {
    font-size: 12px;
}

/* User Bet Bubble */
.user-bet-bubble {
    font-size: 16px;
    padding: 5px 12px;
    height: 26px;
}

.user-bet-container {
    top: -38px;
    left: 50%;
    /* Center horizontally */
    transform: translateX(-50%);
    /* Center align */
}

/* Start Button */
.btn-start {
    height: 52px;
    font-size: 16px;
}

/* Home Screen */
.game-title {
    font-size: 36px;
}

.subtitle {
    font-size: 12px;
    letter-spacing: 3px;
}

.resume-card {
    padding: 18px;
    gap: 16px;
}

.btn-large {
    height: 52px;
    font-size: 16px;
}

.stat-value {
    font-size: 20px;
}

/* Winner Toast */
.winner-toast {
    font-size: 14px;
    padding: 6px 12px;
}

/* Action Overlay */
.action-text {
    font-size: 12px;
}

/* Opponent Showdown Cards */
.opponent-hand-container {
    bottom: -75px;
}

.opponent-hand .card {
    font-size: 5px;
}


/* Very small phones (360px and below - like iPhone SE, older Androids) */
@media screen and (max-width: 360px) {
    :root {
        --spacing-xs: 2px;
        --spacing-s: 4px;
        --spacing-m: 10px;
        --spacing-l: 14px;
        --spacing-xl: 20px;
    }

    #app {
        padding: 0 var(--spacing-xs);
        gap: 4px;
    }

    /* Header/Menu Button */
    .btn-icon {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }

    .header-actions {
        padding: var(--spacing-s) 0 4px 0;
    }

    /* Opponents Bar */
    .opponents-bar {
        padding: 3px 8px 70px 8px;
        gap: 6px;
    }

    .opponent {
        border-radius: 10px;
        padding: 8px 4px;
        min-height: 85px;
    }

    .opponent-avatar {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .opponent-name {
        font-size: 9px;
    }

    .opponent-chips {
        font-size: 11px;
    }

    .dealer-button {
        width: 13px;
        height: 13px;
        font-size: 8px;
        right: -2px;
    }

    .opponent-bet-bubble {
        padding: 2px 6px;
        font-size: 11px;
        border-radius: 8px;
    }

    /* Pot Display */
    #pot-display,
    .pot-pill {
        padding: 6px 14px;
        font-size: 14px;
        margin-bottom: 12px;
        border-radius: 24px;
    }

    /* Buttons - compact */
    .btn {
        height: 44px;
        /* Small Mobile Height */
        font-size: 13px;
        padding: 0 var(--spacing-s);
        border-radius: 22px;
    }

    /* Match height again */
    .raise-morph-group,
    #btn-call {
        height: 44px !important;
    }

    .btn-round {
        width: 44px;
        height: 44px;
        min-width: 44px;
        font-size: 18px;
    }

    .controls {
        gap: 6px;
    }

    .controls-area {
        margin-bottom: 14px;
    }

    /* Raise Options */
    .raise-options {
        padding: 4px;
        gap: 4px;
        margin-bottom: 14px;
    }

    .raise-preset-btn {
        min-width: 38px;
        height: 100% !important;
        /* Force Fill */
        padding: 0 8px;
        font-size: 11px;
    }

    /* Player Area - significantly smaller */
    .player-area {
        padding: 0 8px;
        padding-bottom: var(--spacing-s);
    }

    .player-area::before {
        left: -2px;
        right: -2px;
        bottom: -8px;
        height: 142px;
        filter: blur(20px) saturate(1.25);
    }




    .player-cards .card {
        font-size: 11px;
    }

    .player-cards-wrapper {
        font-size: 11px;
    }

    .player-profile-card {
        border-radius: var(--player-panel-joint-radius) var(--player-panel-joint-radius) var(--player-panel-radius) var(--player-panel-radius);
        padding: 16px 0;
    }

    .player-info-wrapper {
        border-radius: 0;
    }

    .player-avatar-large {
        font-size: 34px;
    }

    .player-chips-large {
        font-size: 18px;
    }

    .player-hand-label {
        font-size: 11px;
    }

    /* User Bet Bubble */
    .user-bet-bubble {
        font-size: 14px;
        padding: 4px 10px;
        height: 24px;
    }

    .user-bet-container {
        top: -34px;
        left: 50%;
        transform: translateX(-50%);
        width: max-content;
        /* Ensure width allows centering */
    }

    /* Prevent Active Opponent Scaling/Growth */
    .opponent.active,
    .opponent.turn-active,
    .opponent.active-player {
        transform: none !important;
        height: auto !important;
        min-height: auto !important;
    }

    /* Reduce bet gap further */
    .opponent-bet-container {
        margin-top: 0px !important;
    }

    /* Fold Button Arrow - Bigger & Lighter */
    .btn-fold,
    .btn-round {
        font-size: 36px !important;
        /* Bigger arrow */
        font-weight: 300 !important;
        /* Lighter weight */
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-bottom: 4px;
        /* Optical center adjustment */
    }

    /* Start Button */
    .btn-start {
        height: 48px;
        font-size: 14px;
    }

    /* Update Folded/Eliminated Styles to use Simple Faded Glass */
    .opponent.folded .opponent-card,
    .opponent.eliminated .opponent-card,
    .opponent.out .opponent-card {
        background: inherit !important;
        /* Keep standard glass */
        opacity: 0.4 !important;
        /* Faded like buttons */
        box-shadow: none !important;
        border-color: rgba(255, 255, 255, 0.05) !important;
    }

    .opponent.folded .opponent-avatar,
    .opponent.eliminated .opponent-avatar {
        /* Optional: Keep grayscale or just rely on opacity. User said "same effect" */
        /* Let's keep it simple: just opacity inherited from parent */
        opacity: 1;
        /* Reset specific opacity since parent is 0.4 */
        filter: none;
        /* Remove grayscale to match buttons exactly? Or keep it? Buttons don't grayscale. */
    }

    /* Home Screen */
    .game-title {
        font-size: 30px;
    }

    .subtitle {
        font-size: 11px;
        letter-spacing: 2px;
        margin-bottom: 14px;
    }

    .resume-card {
        padding: 14px;
        gap: 12px;
        border-radius: 18px;
    }

    .btn-large {
        height: 48px;
        font-size: 14px;
        border-radius: 24px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 9px;
    }

    .resume-stat-box {
        padding: 10px;
        border-radius: 10px;
    }

    /* Winner Toast */
    .winner-toast {
        font-size: 13px;
        padding: 5px 10px;
        bottom: 340px;
    }

    /* Action Overlay */
    .action-text {
        font-size: 11px;
        padding: 2px 6px;
    }

    /* Opponent Showdown Cards */
    .opponent-hand-container {
        bottom: -65px;
    }

    .opponent-hand .card {
        font-size: 4.5px;
    }

    .opponent-hand {
        padding: 4px;
        border-radius: 10px;
    }
}

/* CSS Update: Fix Continue Button, Showdown Stack, Raise Menu */

/* Make Continue Button larger (and all resume buttons) */
.btn-resume {
    /* Height deferred to default .btn-large or .btn style (54px) */
    font-size: 18px !important;
}

/* Ensure hidden class works */
.hidden {
    display: none !important;
}

/* Fix Raise Options Popup Position */


/* Fix Opponent Showdown Stack Position */
.opponent-hand-container {
    position: absolute;
    bottom: -15px;
    /* Hang slightly off bottom to clear Name */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 20;
    /* Above chips/name */
    overflow: visible;
}

/* Ensure Stack doesn't get clipped */
.opponent {
    overflow: visible !important;
}

/* Ensure cards are visible */
.opponent-hand .card {
    box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.5);
    /* Stronger shadow */
}

/* Override for Showdown positioning */

/* Disable old glow pill */
.glow-pill {
    display: none !important;
}

/* REDESIGN: Opponent Card Material (Simple Translucent - No Blur Artifacts) */
.opponent-card {
    /* Simple Translucent Material */
    background: rgba(30, 30, 30, 0.85) !important;
    /* Darker, more solid to hide background issues */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;

    /* Ensure Layout Preserved */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Reset old styles */
    overflow: visible !important;
}

/* Ensure Folded/Eliminated just fade opacity, keeping glass */
.opponent.folded .opponent-card,
.opponent.eliminated .opponent-card {
    background: rgba(255, 255, 255, 0.05) !important;
    /* Dimmer glass */
    opacity: 0.5 !important;
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

/* Active Opponent Style - Inset glow through glass material */
.opponent.active .opponent-card {
    border-color: rgba(244, 240, 230, 0.2) !important;
    box-shadow:
        inset 0 0 20px 6px rgba(244, 240, 230, 0.15),
        inset 0 0 40px 10px rgba(244, 240, 230, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    transition: box-shadow 0.4s ease, border-color 0.3s ease;
}

.opponent.active .turn-indicator {
    display: none !important;
    /* Hide old indicator functionality */
}

/* FIX: Remove artifacts (Vertical lines, scrollbars, pseudo-elements) */
.opponent::before,
.opponent::after,
.opponent-card::before,
.opponent-card::after {
    display: none !important;
    content: none !important;
    width: 0 !important;
    background: none !important;
}

/* Ensure turn indicator is definitely gone */
.turn-indicator {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Hide Scrollbars causing vertical lines */
.opponent-card::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.opponent::-webkit-scrollbar {
    display: none;
}

/* --- Win Probability Thermometer --- */
.player-profile-card {
    position: relative;
    /* Anchor for thermometer */
}

/* player-info-wrapper is flex column - defined in main section */

/* Horizontal win likelihood bar */
.win-bar-container {
    width: 80%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    display: none;
}

.win-bar-container.active {
    display: flex;
}

.win-bar-fill {
    height: 100%;
    /* width set by JS */
    min-width: 0%;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s ease;
    border-radius: 3px;
}

.win-bar-fill.low-chance {
    background-color: #ef4444;
}

.win-bar-fill.med-chance {
    background-color: #facc15;
}

.win-bar-fill.high-chance {
    background-color: #22c55e;
}

/* Divider line between hand label and chips */
.profile-divider {
    width: 60%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* --- Slider Control V2 --- */

.raise-slider-wrapper {
    position: relative;
    width: 100%;
    height: 54px;
    /* Match standard button height */
    background: rgba(255, 255, 255, 0.1);
    /* Base glass track */
    border-radius: 27px;
    display: flex;
    align-items: center;
    overflow: hidden;
    /* Clip fill */
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.raise-active-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 27px;
    /* Start as circle width */
    background: var(--accent-color);
    border-radius: 27px 0 0 27px;
    /* Rounded start */
    pointer-events: none;
    /* Let clicks pass to input */
    z-index: 5;
    display: flex;
    align-items: center;
    padding-left: 20px;
    transition: width 0.05s linear;
    /* Smooth but fast */
}

.raise-label {
    font-size: 12px;
    font-weight: 800;
    color: #000;
    opacity: 0;
    display: none;
}

.raise-slider {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    /* Invisible touch target */
    z-index: 10;
    cursor: pointer;
    margin: 0;
}

.raise-confirm-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    min-width: 80px;
    padding: 0 20px;
    background: rgba(0, 0, 0, 0.2);
    /* Slight contrast */
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 16px;
    z-index: 20;
    /* Above slider */
    cursor: pointer;
    border-radius: 0 27px 27px 0;
    pointer-events: auto;
    /* Clickable */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.raise-confirm-btn:active {
    background: rgba(0, 0, 0, 0.4);
}

/* Glow Effect */
.all-in-glow {
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.6) !important;
    background: rgba(255, 85, 85, 0.2) !important;
    border-color: rgba(255, 85, 85, 0.4) !important;
    color: #ff5555 !important;
}

/* Ensure inline options container fills space */
.raise-options-inline {
    width: 100%;
    height: 100%;
    display: flex;
}

/* --- NEW: Drag-to-Raise UI --- */
.raise-drag-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

.raise-drag-container.hidden {
    display: none;
}

/* Green stretch rectangle that appears when dragging */
.raise-stretch-rect {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: rgba(212, 175, 55, 0.32);
    /* Gold glass — raise fill (poker chips = committing chips) */
    border-radius: 27px;
    /* Fully radiused corners (top and bottom) */
    transition: background 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
    z-index: 1;
    /* Ensure it is behind the button if possible, or just visually consistent */
}

.raise-stretch-rect.all-in {
    background: rgba(214, 74, 64, 0.42);
    /* Deep crimson — danger fill when the raise is all-in */
}

/* Amount display to the left of button */
.raise-amount-display {
    position: absolute;
    right: 100%;
    /* Outside to the left */
    bottom: 0;
    margin-right: 12px;
    /* Spacing from button */
    height: 54px;
    /* Match button height for vertical alignment */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.15s ease;
    z-index: 20;
}

/* Tick marks REMOVED */
.raise-tick-marks {
    display: none;
}

.tick-mark {
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 1px;
}

/* Button state when dragged to all-in */
#btn-raise.drag-all-in,
#btn-action.drag-all-in {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #ff9999 !important;
}

/* Ensure button can move smoothly and stays on top */
/* Ensure button can move smoothly and stays on top */
#btn-raise {
    /* transition: transform 0.05s ease-out;  <-- REMOVED to prevent jitter during drag */
    will-change: transform;
    position: relative;
    z-index: 20;
    touch-action: none;
    /* Prevent browser scrolling */
}

/* --- Flick-to-Fold Gesture --- */
.player-cards {
    touch-action: none;
    /* Prevent browser scroll during drag */
    perspective: 800px;
}

.player-cards.dragging .card {
    transition: none !important;
    /* Remove transitions during drag for responsiveness */
}

.player-cards.snapping .card {
    transition: transform 240ms var(--ease-out-quint),
                margin-left 240ms var(--ease-out-quint) !important;
}

/* Card 3D flip state - shared between fold and community reveal */
.card.fold-flipping,
.card.card-3d-flip {
    transform-style: preserve-3d !important;
}

.card.fold-flipping {
    backface-visibility: visible !important;
}

/* Show-back state: hide front content, show card back with white border */
.card.show-back .card-back-overlay {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 10 !important;
    transform: rotateY(180deg) !important;
    backface-visibility: visible !important;

    /* Force explicit white rim around hatched back in fold/flip states */
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    padding: 0.9em !important;
    border-radius: 2.25em !important;
    background-image:
        repeating-linear-gradient(45deg,
            transparent,
            transparent 6px,
            #333333 6px,
            #333333 8.5px),
        linear-gradient(#fff, #fff) !important;
    background-clip: content-box, padding-box !important;
    background-repeat: repeat, no-repeat !important;
}

.card.show-back .card-value,
.card.show-back .suit-icon,
.card.show-back .card-indicator {
    opacity: 0 !important;
    visibility: hidden !important;
}

.card.fold-flipping.show-back .card-back-overlay {
    transform: none !important;
}

/* Player cards: overlay starts hidden since cards are face-up */
.player-cards .card .card-back-overlay {
    opacity: 0;
    visibility: hidden;
    background-image: repeating-linear-gradient(45deg,
            transparent,
            transparent 7.5px,
            #333333 7.5px,
            #333333 10.5px);
}

/* Player cards: face content always visible (override base hidden state) */
.player-cards .card .card-value,
.player-cards .card .suit-icon {
    opacity: 1;
}

/* Fold/hand-end animation z-index: above all other UI */
.player-cards.dragging,
.player-cards.fold-phase-flip,
.player-cards.fold-phase-exit,
.player-cards.hand-end-anim {
    z-index: 2147483647 !important;
}

/* Phase: Complete flip + fly to vertical center */
.player-cards.fold-phase-flip .card {
    transition: transform 240ms var(--ease-out-quint),
                margin-left 180ms var(--ease-out-quint) !important;
    transform-style: preserve-3d !important;
}

/* Phase: Shoot off the left side */
.player-cards.fold-phase-exit .card {
    transition: transform 280ms cubic-bezier(0.55, 0, 1, 0.45) !important;
    transform-style: preserve-3d !important;
}

/* Community card 3D flip is driven by JS (Web Animations API / explicit inline
   transitions in _flipRevealCard). No CSS transition here — a forced one only
   fought the JS timing and caused mid-flip flicker. */

/* Persistent placeholder behind player cards */
.player-cards-wrapper {
    position: relative;
    flex-shrink: 0;
    font-size: 13px;
    /* Must match .player-cards .card font-size override */
    /* 2 overlapping cards: 10em + 10em - 4em = 16em wide, 14em tall */
    width: 16em;
    height: 14em;
}

.player-cards-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 2.5em;
    box-sizing: border-box;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-fast-forward-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.2s ease;
}

.btn-fast-forward-placeholder:active {
    background: rgba(255, 255, 255, 0.12);
}

.btn-fast-forward-placeholder.hidden {
    display: none;
}

/* Settings Screen */
.settings-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0d0d0d;
    background-image: none;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-l);
    overflow-y: auto;
}

.settings-screen.hidden {
    display: none !important;
}

.onboarding-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(3, 3, 3, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.onboarding-modal.hidden {
    display: none !important;
}

.onboarding-card {
    width: min(92vw, 680px);
    max-height: min(92vh, 820px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 30px;
    background: #101010;
    box-shadow: 0 34px 110px rgba(0, 0, 0, 0.74), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: clamp(22px, 4vw, 34px);
    text-align: left;
}

.onboarding-kicker {
    color: var(--accent-color);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.onboarding-card h2 {
    margin: 10px 0 8px;
    font-size: clamp(34px, 6vw, 56px);
    line-height: 0.94;
    letter-spacing: -0.055em;
    color: var(--text-primary);
}

.onboarding-copy {
    max-width: 500px;
    margin: 0 0 20px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 15px;
    line-height: 1.5;
}

.gesture-guide {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.gesture-panel {
    position: relative;
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    align-items: center;
    min-height: 162px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.055);
    overflow: hidden;
}

.gesture-panel::before {
    display: none;
}

.gesture-phone {
    position: relative;
    width: 92px;
    height: 136px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.gesture-button {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 16px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.gesture-cards {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 20px;
    height: 48px;
}

.gesture-cards span {
    position: absolute;
    width: 36px;
    height: 52px;
    border-radius: 9px;
    background: linear-gradient(180deg, #fff, #d8d8d8);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
    transform: rotate(-7deg);
}

.gesture-cards span + span {
    left: 26px;
    transform: rotate(9deg);
}

.gesture-arrow {
    position: absolute;
    left: 50%;
    top: 48px;
    bottom: auto;
    width: 2px;
    height: 38px;
    background: linear-gradient(180deg, var(--accent-color), rgba(244, 240, 230, 0));
    transform: translateX(-50%);
}

.gesture-arrow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    width: 16px;
    height: 16px;
    border-top: 2px solid var(--accent-color);
    border-left: 2px solid var(--accent-color);
    transform: translateX(-50%) rotate(45deg);
}

.gesture-amount {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(244, 240, 230, 0.14);
    border: 1px solid rgba(244, 240, 230, 0.28);
    color: var(--accent-color);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.gesture-panel h3 {
    margin: 0 0 6px;
    color: var(--text-primary);
    font-size: 17px;
    letter-spacing: -0.02em;
}

.gesture-panel p {
    margin: 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12.5px;
    line-height: 1.38;
}

.onboarding-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
}

.onboarding-actions .btn {
    min-height: 52px;
}

.onboarding-secondary {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.48);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    justify-self: center;
}

@media screen and (max-width: 680px) {
    .onboarding-card {
        border-radius: 28px;
    }

    .gesture-guide {
        grid-template-columns: 1fr;
    }

    .gesture-panel {
        min-height: 144px;
    }
}

@media screen and (max-width: 420px) {
    .onboarding-modal {
        padding: 12px;
        align-items: center;
    }

    .onboarding-card {
        max-height: calc(100dvh - 24px);
        padding: 18px;
        border-radius: 24px;
    }

    .onboarding-card h2 {
        font-size: clamp(32px, 12vw, 44px);
    }

    .onboarding-copy {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .gesture-panel {
        grid-template-columns: 82px 1fr;
        gap: 12px;
        padding: 12px;
        overflow: visible;
    }

    .gesture-panel::before {
        display: none;
    }

    .gesture-phone {
        width: 78px;
        height: 116px;
        border-radius: 21px;
    }

    .gesture-button {
        left: 9px;
        right: 9px;
        bottom: 13px;
        height: 30px;
    }

    .gesture-arrow {
        top: 40px;
        height: 34px;
    }

    .gesture-amount {
        top: 14px;
        font-size: 9px;
    }

    .gesture-cards {
        left: 15px;
        right: 15px;
        bottom: 18px;
    }

    .gesture-cards span {
        width: 31px;
        height: 45px;
    }

    .gesture-cards span + span {
        left: 22px;
    }

    .gesture-panel h3 {
        font-size: 16px;
    }

    .gesture-panel p {
        font-size: 12px;
    }

    .onboarding-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.settings-header {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
    padding: var(--spacing-l) 0 var(--spacing-m) 0;
}

.settings-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    flex: 1;
    text-align: center;
    padding-right: 44px;
    /* Offset for back button centering */
    font-family: var(--font-family);
}

.settings-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    gap: var(--spacing-l);
    margin-top: var(--spacing-m);
}

.settings-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-controls-card {
    gap: 18px;
}

.settings-control-list {
    display: grid;
    gap: 14px;
}

.settings-control-item {
    display: grid;
    gap: 4px;
}

.settings-control-item strong {
    color: var(--text-primary);
    font-size: 15px;
}

.settings-control-item span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    line-height: 1.4;
}

.settings-help-button {
    align-self: flex-start;
    color: var(--accent-color);
    padding: 0;
}

.settings-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.settings-slider-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-slider-row input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    outline: none;
}

.settings-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.settings-slider-row input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.settings-slider-value {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    min-width: 40px;
    text-align: right;
    font-family: var(--font-family);
}

.settings-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: -8px;
}

.settings-slider-labels span {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive adjustments for fold placeholder */
@media screen and (max-width: 400px) {
    .fold-placeholder .fold-card-ghost {
        font-size: 11px !important;
    }
}

@media screen and (max-width: 450px) {
    .fold-placeholder .fold-card-ghost {
        font-size: 13px;
    }
}

/* Gameplay chip language */
.chip-stack {
    display: inline-flex;
    align-items: center;
    min-width: 18px;
    height: 20px;
    padding-left: 2px;
}

.chip-stack .game-chip + .game-chip {
    margin-left: -10px;
}

.chip-stack.compact {
    min-width: 14px;
    height: 16px;
}

.chip-stack.compact .game-chip {
    width: 14px;
    height: 14px;
}

.chip-stack.compact .game-chip + .game-chip {
    margin-left: -8px;
}

.game-chip {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.58);
    background: #b9b0a3;
    box-shadow:
        inset 0 0 0 2px rgba(14, 14, 14, 0.45),
        inset 0 0 0 3px rgba(255, 255, 255, 0.22),
        0 2px 4px rgba(0, 0, 0, 0.34);
}

.game-chip::after {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 50%;
}

.game-chip.chip-100 { background: #252525; }
.game-chip.chip-50 { background: #59616a; }
.game-chip.chip-20 { background: #ad873f; }
.game-chip.chip-10 { background: #7c403a; }
.game-chip.chip-5 { background: #d1c7b6; }
.game-chip.chip-1 { background: #657b68; }

.opponent-bet-bubble,
.user-bet-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    color: rgba(255, 255, 255, 0.94);
    background: rgba(18, 18, 18, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.13);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.opponent-bet-bubble {
    padding: 4px 8px 4px 5px;
    font-size: 12px;
}

.user-bet-bubble {
    height: 30px;
    padding: 0 11px 0 6px;
    font-size: 16px;
}

.chip-amount {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

#pot-display {
    align-self: center;
    flex: 0 0 auto;
    width: fit-content;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    gap: 4px;
    min-width: 0;
    padding: 5px 8px 5px 5px !important;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.96);
    background: rgba(14, 14, 14, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.pot-chip-stack {
    flex: 0 0 auto;
    width: fit-content;
    min-width: 0;
    padding-left: 0;
}

.pot-chip-stack:empty {
    display: none;
}

#pot-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.game-message {
    min-height: 19px;
    max-width: min(100%, 390px);
    margin: 9px auto 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.25;
    text-align: center;
    text-wrap: balance;
}

.chip-flight-layer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    overflow: hidden;
}

.chip-flight {
    position: fixed;
    width: 18px;
    height: 18px;
    will-change: transform, opacity;
}

.payout-ledger {
    position: fixed;
    left: 50%;
    bottom: calc(214px + env(safe-area-inset-bottom));
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    width: max-content;
    max-width: calc(100vw - 28px);
    z-index: 120;
    opacity: 0;
    transform: translate(-50%, 8px);
    pointer-events: none;
    color: rgba(255, 255, 255, 0.92);
    transition: opacity 160ms ease, transform 220ms cubic-bezier(.22,.72,.2,1);
}

.payout-ledger.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.payout-row {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 6px 9px;
    background: rgba(13, 13, 13, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 999px;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.payout-player {
    min-width: 0;
    max-width: 104px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payout-total {
    display: inline-flex;
    flex: none;
    align-items: center;
    padding-left: 7px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.payout-total strong {
    color: #e7c675;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

@media screen and (max-width: 450px) {
    .payout-ledger {
        bottom: calc(198px + env(safe-area-inset-bottom));
        max-width: calc(100vw - 20px);
        gap: 5px;
    }

    .payout-row {
        gap: 6px;
        padding: 5px 8px;
    }

    .payout-player {
        max-width: 88px;
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chip-flight-layer {
        display: none;
    }

    .payout-ledger {
        transition: none;
    }
}

/* Lobby refinement — restrained private-table entry */
.home-screen {
    justify-content: flex-start;
    min-height: 100dvh;
    height: 100dvh;
    padding: max(24px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
    background: #0d0d0c;
    text-align: left;
}

.home-content {
    position: relative;
    width: min(100%, 390px);
    min-height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
}

.home-brand {
    margin: 0 0 clamp(52px, 10vh, 88px);
}

.game-title {
    margin: 0;
    color: #f4f0e6;
    background: none;
    -webkit-text-fill-color: currentColor;
    font-size: clamp(46px, 13vw, 64px);
    font-weight: 700;
    line-height: .9;
    letter-spacing: .16em;
    text-align: left;
}

.subtitle {
    margin: 14px 0 0;
    color: #817e76;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .3em;
    line-height: 1;
    text-align: left;
    opacity: 1;
}

.home-actions {
    width: 100%;
    display: grid;
    gap: 10px;
}

.home-actions .btn-large {
    height: 58px;
    min-height: 58px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em;
    transition: transform 120ms var(--ease-out-quart), background-color 160ms ease, border-color 160ms ease;
}

.home-actions .btn-large:active,
.btn-resume:active {
    transform: scale(.985);
}

.btn-new-game {
    pointer-events: auto;
    background: #f4f0e6;
    border: 1px solid #f4f0e6;
    color: #11110f;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.btn-new-game:hover {
    background: #ffffff;
}

.btn-private-table {
    min-height: 58px;
    border: 1px solid #302f2b;
    color: #f4f0e6;
    background: transparent;
}

.btn-private-table:hover {
    border-color: #4a4842;
    background: #141412;
}

.resume-card {
    width: 100%;
    margin: 0 0 28px;
    padding: 0 0 28px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #2a2925;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none;
    transition: none;
}

.resume-card:hover {
    transform: none;
    box-shadow: none;
    border-color: #2a2925;
}

.resume-header {
    color: #6f6c65;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
}

.resume-time {
    color: #8f8b82;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: none;
}

.resume-stats {
    display: flex;
    align-items: baseline;
    gap: 7px;
    color: #9b978e;
    font-size: 14px;
    line-height: 1.2;
}

.resume-stats strong {
    color: #f4f0e6;
    font-size: inherit;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.resume-divider {
    color: #45433e;
}

.btn-resume {
    width: 100%;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(244, 240, 230, .72);
    border-radius: 13px;
    background: transparent;
    color: var(--accent-color);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    font-size: 12px !important;
    font-weight: 700;
    letter-spacing: .12em;
}

.btn-resume:hover {
    background: rgba(244, 240, 230, .07);
    transform: none;
}

.home-settings {
    position: fixed;
    top: max(22px, env(safe-area-inset-top));
    right: 22px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6f6c65;
    font: 600 9px/44px 'SN Pro', sans-serif;
    letter-spacing: .14em;
    cursor: pointer;
}

.home-settings:hover {
    color: #b7b2a8;
}

.home-ad-slot,
.app-version {
    display: none !important;
}

@media screen and (max-width: 450px) {
    .home-screen {
        padding-inline: 20px;
    }

    .home-brand {
        margin-bottom: clamp(46px, 9vh, 72px);
    }

    .game-title {
        font-size: clamp(42px, 13vw, 56px);
    }

    .subtitle {
        margin-top: 12px;
        font-size: 9px;
    }

    .home-actions .btn-large {
        height: 56px;
        min-height: 56px;
        border-radius: 14px;
        font-size: 12px;
    }

    .resume-card {
        padding: 0 0 24px;
        margin-bottom: 24px;
        gap: 12px;
        border-radius: 0;
    }

    .resume-stats {
        font-size: 13px;
    }
}

@media screen and (max-height: 650px) {
    .home-brand {
        margin-bottom: 36px;
    }

    .game-title {
        font-size: 42px;
    }

    .resume-card {
        margin-bottom: 18px;
        padding-bottom: 18px;
    }
}

/* Shared premium card back: one centered SVG scales across every card size. */
.card.face-down,
.card.face-down-initial {
    background-color: #fff !important;
    background-image: url('assets/card-back.svg?v=3') !important;
    background-clip: border-box !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
    padding: 0 !important;
}

.card-back-overlay,
.card.show-back .card-back-overlay,
.player-cards .card .card-back-overlay {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 2.25em !important;
    background-color: #fff !important;
    background-image: url('assets/card-back.svg?v=3') !important;
    background-clip: border-box !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
}

/* Active-turn treatment shared by local AI and invited-player seats. */
.opponent.active .opponent-card {
    border-color: rgba(244, 240, 230, 0.28) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 18px 28px -24px rgba(244, 240, 230, 0.42) !important;
}

.opponent.active .turn-indicator {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute;
    top: 7px;
    left: 50%;
    width: 34px !important;
    height: 4px !important;
    transform: translateX(-50%);
    border-radius: 999px;
    background: #f4f0e6 !important;
    box-shadow:
        0 0 5px rgba(250, 247, 239, 0.92),
        0 0 13px rgba(244, 240, 230, 0.5),
        0 0 24px rgba(244, 240, 230, 0.22) !important;
    z-index: 8;
}

.player-area.user-turn-active::before {
    display: none !important;
}

.player-area.user-turn-active .action-btn {
    border-color: rgba(255, 255, 255, 0.30) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
}

.player-area.user-turn-active .action-button-segment::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 18px;
    height: 2px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    pointer-events: none;
    z-index: 40;
}

/* One restrained, rounded-stroke icon language across every game surface. */
.ui-icon {
    display: block;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    overflow: visible;
    color: currentColor;
    pointer-events: none;
}

.btn-icon .ui-icon {
    width: 18px;
    height: 18px;
}

#btn-fold .ui-icon {
    width: 23px;
    height: 23px;
}

#btn-fast-forward .ui-icon,
.btn-fast-forward-placeholder .ui-icon {
    width: 19px;
    height: 19px;
}

.btn-new-game,
.home-actions .btn-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.home-settings {
    display: grid;
    place-items: center;
    line-height: 1;
}

.home-settings .ui-icon {
    width: 17px;
    height: 17px;
}

#btn-fast-forward .ui-icon { color: currentColor; }
.btn-fast-forward-placeholder .ui-icon { color: rgba(255, 255, 255, .4); }

.btn-icon:hover {
    background: rgba(255, 255, 255, .07);
    transform: none;
}

/* Home screen — private-table entry, aligned to .impeccable.md */
.home-screen {
    overflow: hidden;
    padding: max(22px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom));
}

.home-content {
    min-height: 100%;
    padding-top: clamp(58px, 10dvh, 92px);
    justify-content: flex-start;
}

.home-brand {
    margin: 0 0 clamp(44px, 8dvh, 68px);
}

.game-title {
    font-size: clamp(38px, 11vw, 50px);
    line-height: .92;
    letter-spacing: .14em;
}

.subtitle {
    margin-top: 11px;
    color: #77746d;
    font-size: 8px;
    letter-spacing: .28em;
}

.resume-card {
    margin: 0;
    padding: 0;
    gap: 12px;
    border: 0;
}

.resume-header {
    min-height: 16px;
    color: #77746d;
    font-size: 9px;
    letter-spacing: .17em;
}

.resume-time {
    color: #77746d;
    font-size: 10px;
    letter-spacing: 0;
}

.resume-stats {
    margin-bottom: 2px;
    color: #8d8980;
    font-size: 13px;
}

.resume-stats strong {
    color: #ded9ce;
    font-weight: 500;
}

.btn-resume {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid var(--accent-color);
    border-radius: 14px;
    background: var(--accent-color);
    color: #11110f;
    font-size: 12px !important;
    letter-spacing: .14em;
}

.btn-resume .ui-icon {
    width: 15px;
    height: 15px;
}

.btn-resume:hover {
    background: #faf7ef;
    color: #11110f;
}

.home-actions {
    margin-top: 10px;
}

.home-actions .btn-large {
    height: 46px;
    min-height: 46px;
    border-radius: 12px;
    font-size: 10px;
    letter-spacing: .16em;
}

.btn-new-game,
.btn-new-game:hover {
    border: 1px solid #292824;
    background: transparent;
    color: #aaa69d;
}

.btn-new-game:hover {
    border-color: #3c3a35;
    color: #e5e0d5;
}

.rankings-section {
    width: 100%;
    margin-top: auto;
    padding: clamp(30px, 6dvh, 52px) 0 0;
    gap: 9px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.rankings-header {
    min-height: 18px;
    border-bottom: 1px solid #262520;
}

.rankings-title {
    color: #68655e;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .17em;
}

.rankings-list {
    gap: 0;
}

.ranking-row,
.ranking-row.ranking-best {
    min-height: 39px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid #1e1d1a;
    border-radius: 0;
    background: transparent;
}

.ranking-row:last-child {
    border-bottom: 0;
}

.ranking-position,
.ranking-best .ranking-position {
    min-width: 0;
    color: #68655e;
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ranking-best .ranking-position {
    color: #bba30d;
}

.ranking-detail {
    overflow: hidden;
    color: #a19d94;
    font-size: 11px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-chips {
    color: #d8d3c8;
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

@media screen and (max-height: 700px) {
    .home-content {
        padding-top: 44px;
    }

    .home-brand {
        margin-bottom: 34px;
    }

    .rankings-section {
        padding-top: 22px;
    }
}

/* Full-screen table result — shared by solo and multiplayer. */
.table-end-screen {
    --end-accent: #d6ba12;
    --end-bg: #11110e;
    position: fixed;
    inset: 0;
    z-index: 12000;
    min-height: 100dvh;
    padding: max(24px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--end-bg);
    color: #f2ede2;
    text-align: left;
    user-select: none;
    -webkit-user-select: none;
    animation: table-end-enter 260ms var(--ease-out-quint) both;
}

.table-end-screen[hidden] {
    display: none !important;
}

.table-end-screen::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--end-accent);
}

.table-end-screen.is-loss {
    --end-accent: #71645a;
    --end-bg: #100f0e;
}

.table-end-header,
.table-end-main,
.table-end-actions {
    position: relative;
    width: min(100%, 400px);
    margin-inline: auto;
}

.table-end-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
}

.table-end-wordmark {
    color: #f2ede2;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .17em;
}

.table-end-kicker,
.table-end-eyebrow {
    color: var(--end-accent);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .18em;
}

.table-end-main {
    margin-top: clamp(88px, 18dvh, 154px);
    animation: table-end-copy-enter 560ms 70ms var(--ease-out-quint) both;
}

.table-end-eyebrow {
    margin: 0 0 16px;
}

.table-end-title {
    max-width: 360px;
    margin: 0;
    color: #f2ede2;
    font-size: clamp(48px, 14vw, 68px);
    font-weight: 500;
    line-height: .91;
    letter-spacing: -.045em;
    text-wrap: balance;
}

.table-end-summary {
    max-width: 320px;
    margin: 24px 0 0;
    color: #8f8a80;
    font-size: 14px;
    line-height: 1.45;
}

.table-end-total {
    width: 100%;
    margin-top: clamp(34px, 7dvh, 56px);
    padding-top: 16px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-top: 1px solid #2b2924;
}

.table-end-total strong {
    color: #ded8cb;
    font-size: 25px;
    font-weight: 500;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.table-end-total span {
    color: #6f6b63;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .16em;
}

.table-end-actions {
    margin-top: auto;
    display: grid;
    gap: 9px;
    animation: table-end-actions-enter 520ms 150ms var(--ease-out-quint) both;
}

.table-end-primary,
.table-end-secondary {
    width: 100%;
    height: 56px;
    border-radius: 14px;
    font: 700 11px/1 'SN Pro', sans-serif;
    letter-spacing: .15em;
    cursor: pointer;
    transition: transform 120ms var(--ease-out-quart), background-color 160ms ease, border-color 160ms ease;
}

.table-end-primary {
    border: 1px solid var(--end-accent);
    background: var(--end-accent);
    color: #11110e;
}

.is-loss .table-end-primary {
    color: #f2ede2;
}

.table-end-secondary {
    height: 46px;
    border: 1px solid #2c2a26;
    background: transparent;
    color: #aaa59b;
}

.table-end-primary:active,
.table-end-secondary:active {
    transform: scale(.985);
}

.table-end-primary:focus-visible,
.table-end-secondary:focus-visible {
    outline: 2px solid #f2ede2;
    outline-offset: 3px;
}

@keyframes table-end-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes table-end-copy-enter {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes table-end-actions-enter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media screen and (max-height: 700px) {
    .table-end-main {
        margin-top: 52px;
    }

    .table-end-title {
        font-size: clamp(42px, 12vw, 56px);
    }

    .table-end-summary {
        margin-top: 18px;
    }

    .table-end-total {
        margin-top: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .table-end-screen,
    .table-end-main,
    .table-end-actions {
        animation: none;
    }
}

/* Showdown geometry: full-width opponent rail with contained, readable reveals. */
.opponents-bar {
    --opponent-count: 5;
    display: grid !important;
    grid-template-columns: repeat(var(--opponent-count), minmax(0, 1fr));
    align-items: start;
    width: calc(100% - 20px) !important;
    margin-inline: 10px;
    padding: 4px 0 58px !important;
    gap: clamp(4px, 1.5vw, 8px) !important;
    overflow: visible !important;
}

.opponents-bar .opponent {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 96px;
    max-height: 96px;
    flex: none !important;
    container-type: inline-size;
}

.opponents-bar .opponent-card {
    width: 100%;
    height: 90px;
    min-height: 90px !important;
    padding: 10px 3px 9px !important;
    gap: 2px;
    border-radius: 14px !important;
}

.opponents-bar .opponent-name,
.opponents-bar .opponent-chips {
    width: 100%;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.opponents-bar .opponent-hand-container {
    top: calc(100% - 10px) !important;
    right: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    transform: none !important;
    filter: drop-shadow(0 4px 7px rgba(0, 0, 0, .32));
    z-index: 60 !important;
}

.opponents-bar .mini-hand-stack {
    --showdown-card-unit: calc((100cqw - 4px) / 16.8);
    display: flex !important;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    gap: 0;
    padding-inline: 2px;
    transform: none !important;
}

.opponents-bar .mini-hand-stack .card,
.opponents-bar .mini-hand-stack .mini-card {
    width: 10em !important;
    min-width: 10em !important;
    max-width: 10em !important;
    height: 14em !important;
    min-height: 14em !important;
    max-height: 14em !important;
    aspect-ratio: auto;
    margin: 0 !important;
    flex: 0 0 10em !important;
    font-size: var(--showdown-card-unit) !important;
    border-radius: var(--border-radius) !important;
    transform: none !important;
    transform-origin: center !important;
    box-shadow: 0 .2em 2em rgba(0, 0, 0, .3) !important;
}

.opponents-bar .mini-hand-stack .card + .card,
.opponents-bar .mini-hand-stack .mini-card + .mini-card {
    margin-left: -3.2em !important;
    z-index: 2;
}

.opponent.revealed-hand {
    opacity: 1 !important;
}

.payout-row {
    padding: 2px 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.payout-total {
    padding-left: 0;
    border-left: 0;
}

@media screen and (max-width: 360px) {
    .opponents-bar {
        width: calc(100% - 16px) !important;
        margin-inline: 8px;
        gap: 3px !important;
    }

    .opponents-bar .opponent-avatar {
        width: 32px;
        height: 32px;
    }
}

/* Home mode choice: two terse, unmistakable actions. */
.home-actions .btn-large {
    height: 54px;
    min-height: 54px;
    flex-direction: row;
    gap: 0;
    font-size: 11px;
    line-height: 1;
    letter-spacing: .15em;
}

.home-actions .btn-new-game,
.home-actions .btn-new-game:hover {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: #11110f;
}

.home-actions .btn-new-game:hover {
    background: #faf7ef;
}

.home-actions .btn-private-table {
    border: 1px solid #302f2b;
    background: transparent;
    color: #d0cbc0;
}

.home-actions .btn-private-table:hover {
    border-color: #48463f;
    background: #141412;
    color: #f4f0e6;
}

/* ------------------------------------------------------------------ */
/* Global reduced-motion reset (solo game).                            */
/* The multiplayer sheet (table.css) already neutralizes every         */
/* animation/transition under prefers-reduced-motion; the solo sheet   */
/* previously silenced only three effects and left the whole           */
/* transition layer running. This mirrors table.css so the OS          */
/* "reduce motion" setting is honoured across the entire solo UI.      */
/* JS-driven card flips/chip flights also check this at runtime.       */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Invite ritual — color swap only; do not restyle home layout. */
.home-actions .btn-private-table,
.home-actions .btn-private-table:hover {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: #11110f;
}

.home-actions .btn-new-game,
.home-actions .btn-new-game:hover {
    border: 1px solid #302f2b;
    background: transparent;
    color: #d0cbc0;
}

.home-actions .btn-new-game:hover {
    border-color: #48463f;
    background: #141412;
    color: #f4f0e6;
}

.home-code-form {
    width: min(100%, 340px);
    margin: 16px auto 0;
    display: grid;
    justify-items: center;
    gap: 8px;
}

.home-code-label {
    color: #817e76;
    font-size: 12px;
    letter-spacing: .08em;
}

.home-code-input {
    width: min(100%, 220px);
    height: 44px;
    border: 0;
    border-bottom: 1px solid #302f2b;
    border-radius: 0;
    background: transparent;
    color: #f4f0e6;
    font-size: 18px;
    letter-spacing: .14em;
    text-align: center;
    text-transform: uppercase;
}

.home-code-input::placeholder {
    color: #4a4740;
    letter-spacing: .08em;
}
