@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');
.villain-grid-container, .villain-grid {
    position: relative;
    z-index: 10;
}
/* ========================================
   MG POKER - UNIFIED STYLES
   Combined CSS for better organization
   ======================================== */

/* ========================================
   CSS CUSTOM PROPERTIES & RESET
   ======================================== */
:root {
    --card-width: 65px;
    --card-margin: 3px;
    --game-gap: 5px;
    --inner-padding: 5px;
    --folded-transition-time: 0.1s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================================
   BASE LAYOUT & TYPOGRAPHY
   ======================================== */
body {
    font-family: 'Open Sans', sans-serif;
    position: fixed;
    height: 100dvh;
    width: 100dvw;
}

/* Prevent zooming on inputs and buttons */
input, button {
    touch-action: manipulation;
}

/* Disable zooming on the whole page */
html, body {
    touch-action: manipulation;
}

/* ========================================
   MAIN CONTAINER & GRID LAYOUT
   ======================================== */
.container {
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100dvh ;
    width: 100%;

}

.app_area {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 600px;
    height: 100%;
    background-color: #ededed;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive design: full width on larger screens */
@media (min-width: 768px) {
    .app_area {
        max-width: 100%;
    }
}

.app_grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 0px auto auto 1fr;
    gap: var(--game-gap);
    width: 100%;
    height: 100%;
    padding-right: var(--game-gap);
    padding-left: var(--game-gap);
    padding-bottom: var(--game-gap);
}

/* ========================================
   ZONE LAYOUTS
   ======================================== */
.app_zone {
    display: grid;
    border-radius: 3px;
    overflow: hidden;
}

/* Zone 1 - Header */
.zone1 {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    place-items: center;
}

.header-content h1 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

/* Zone 2 - Villains Area */
.zone2 {
    /* background-color: #f8f9fa; */
    /* border: 2px solid #e9ecef; */
    position: relative;
}

.villain-grid-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.villain-grid {
    display: flex;
    flex-direction: row;
    height: 100%;
    gap: var(--inner-padding);
    overflow-x: auto;
    overflow-y: hidden;

    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 10px;

    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;

    cursor: grab;
    user-select: none;
    touch-action: pan-x;
    will-change: scroll-position;
    will-change: transform;
    transition: transform 0.2s ease-out;
    transition: scroll-position 0.5s ease-out;    
}

.villain-grid:active {
    cursor: grabbing;
}

.villain-grid::-webkit-scrollbar {
    display: none;
}

.villain-box {
    display: flex;
    flex-direction: column;
    flex: 0 0 170px; /* fixed width for scroll alignment */
    scroll-snap-align: start;
    scroll-behavior: smooth;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: var(--inner-padding);
    gap: var(--game-gap);

}


.villain-box.villain-empty {
    opacity: 0.5;
    background-color: #f8f9fa;
}

.villain-name-row {
    display: grid;
    grid-template-columns: 2fr 2fr;
    gap: 5px;
    align-items: center;
}

.villain-name {
    font-size: 12px;
    /* font-weight: 600; */
    text-align: center;
    color: #495057;
    margin: 0;
    min-height: 20px;
    text-align: start;
}

.villain-chips {
    font-size: 15px;
    text-align: center;
    color: #414649;
    margin: 0;
    min-height: 16px;
}

.villain-cards {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    border-radius: 4px;
}

.villain-dealer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 24px;
    gap: 0; /* Let margin-left on dealer button handle spacing */
}

.position-label {
    font-size: 8px;
    font-weight: 600;
    color: #6c757d;
    background-color: rgba(108, 117, 125, 0.1);
    border: 1px solid rgba(108, 117, 125, 0.2);
    border-radius: 10px;
    padding: 2px 6px;
    text-align: center;
    min-width: 20px;
    line-height: 1;
}

.villain-message {
    font-size: 10px;
    text-align: center;
    min-height: 37px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Zone 3 - Community Cards */
.zone3 {
    color: white;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 2fr 2fr;
    grid-template-rows: auto auto auto;
    gap: var(--inner-padding);
    padding: var(--game-gap);
    align-items: center;
    min-height: 200px !important;
    background: linear-gradient(135deg, #799a6b 0%, #6b8e58 100%);
}

.zone3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.community-header {
    z-index: 1;
    grid-column: 1;
    grid-row: 1;

    padding-left: var(--inner-padding);
}

.community-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.pot-display {
    text-align: center;
    z-index: 1;
    grid-column: 2;
    grid-row: 1;
}

.community-cards {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 95px;
}

.hand-evaluations {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    grid-column: 1 / -1;
    grid-row: 3;
}

.hand-evaluations .villain-evaluation {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    font-size: 12px;
    min-width: 120px;
    visibility: hidden; /* Initially hidden, shown by JavaScript when villain wins */
}

/* Zone 4 - Hero & Controls */
.zone4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap:var(--game-gap );
    /* border: 2px solid #e9ecef; */
}

.hero-section {
    display: grid;
    grid-template-rows: 
        auto          /* name row (contains name + position) */
        auto          /* chips */
        1fr           /* cards */
        auto          /* evaluation */
        auto;         /* message */
    gap: var(--game-gap) ;
    background-color: white;
    border-radius: 8px;
    padding: 5px;
    padding-top: 10px;
    padding-bottom: var(--game-gap);
    border: 1px solid #dee2e6;
}

.hero-name-row {
    display: grid;
    grid-template-columns: 3fr 1fr;

    align-items: start;
    min-height: 20px;
    max-height: 20px;
}

.hero-name {
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    color: #495057;
    margin-left: var(--inner-padding);

}

.hero-cards {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
}

.hero-evaluation {
    font-size: 12px;
    text-align: center;
    color: #333;
    /* background-color: rgba(255, 255, 255, 0.9); */
    border-radius: 4px;
    padding: 8px;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    /* border: 1px solid #dee2e6; */
}

.hero-dealer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 24px;
    gap: 0; /* Let margin-left on dealer button handle spacing */
}

.hero-position-label {
    font-size: 10px;
    font-weight: 600;
    color: #6c757d;
    background-color: rgba(108, 117, 125, 0.1);
    border: 1px solid rgba(108, 117, 125, 0.2);
    border-radius: 12px;
    padding: 4px 8px;
    text-align: center;
    min-width: 24px;
    line-height: 1;
}

.hero-message {
    font-size: 10px;
    text-align: center;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-chips {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
    text-align: center;
    margin: 0;
    min-height: 16px;
}

.controls-section {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: var(--game-gap);
}

.controls-header {
    background-color: white;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #dee2e6;
}

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

.blinds-info {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

.hamburger-menu {
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.hamburger-menu:hover {
    background-color: #f8f9fa;
}

.hamburger-icon {
    width: 24px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    width: 100%;
    height: 3px;
    background-color: #495057;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    padding: 0;
    width: min(95vw, 700px);
    height: 90vh;
    max-height: 800px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Simple menu container approach */
.menu-container {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    /* overflow-y: scroll; */
}

.menu-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.menu-screen.main-menu {
    display: block;
}

.menu-screen.confirmation-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: white;
}

/* Show confirmation menu when active */
.menu-container.show-confirmation .menu-screen.main-menu {
    opacity: 0;
    transform: translateX(-20px);
}

.menu-container.show-confirmation .menu-screen.confirmation-menu {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Show settings menu when active */
.menu-container.show-settings .menu-screen.main-menu {
    opacity: 0;
    transform: translateX(-20px);
}

.menu-container.show-settings .menu-screen.settings-menu {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Show rules menu when active */
.menu-container.show-rules .menu-screen.main-menu {
    opacity: 0;
    transform: translateX(-20px);
}

.menu-container.show-rules .menu-screen.rules-menu {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Settings specific styles */
.menu-screen.settings-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: white;
}

/* Rules specific styles */
.menu-screen.rules-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: white;
}

/* About specific styles */
.menu-screen.about-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: white;
}

.setting-item {
    padding: 15px 25px;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-label {
    flex: 1;
}

.setting-label span {
    font-size: 16px;
    color: #495057;
    font-weight: 500;
}

/* Modern Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: block;
    width: 50px;
    height: 28px;
    background-color: #ccc;
    border-radius: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-label {
    background-color: #28a745;
}

.toggle-input:checked + .toggle-label .toggle-slider {
    transform: translateX(22px);
}

/* Hand Rankings styles */
.menu-screen.hand-rankings-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
}

.menu-container.show-hand-rankings .menu-screen.rules-menu {
    opacity: 0;
    transform: translateX(-20px);
}

.menu-container.show-hand-rankings .menu-screen.hand-rankings-menu {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Texas Hold'em Rankings styles */
.menu-screen.holdem-rankings-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
}

.menu-container.show-holdem-rankings .menu-screen.rules-menu {
    opacity: 0;
    transform: translateX(-20px);
}

.menu-container.show-holdem-rankings .menu-screen.holdem-rankings-menu {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.menu-container.show-about .menu-screen.main-menu {
    opacity: 0;
    transform: translateX(-20px);
}

.menu-container.show-about .menu-screen.about-menu {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Menu submenu removed - no CSS needed */

.share-button:hover {
    background: linear-gradient(135deg, #6b8e58 0%, #5d7a4a 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.hand-ranking-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.hand-ranking-item:last-of-type {
    border-bottom: none;
}

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-name {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    display: block;
}

.ranking-description {
    font-size: 11px;
    color: #6c757d;
    display: block;
    margin-top: 2px;
}

.hand-example {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

/* Small Card Design */
.card-sm {
    width: 24px;
    height: 36px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 8px;
    font-weight: bold;
    position: relative;
    opacity: 1; /* Default faded for non-highlighted cards */
    transition: opacity 0.2s ease;
}

.card-sm.highlight {
    opacity: 1; /* Full opacity for highlighted cards */
}

.card-sm.faded {
    opacity: 0.40; /* Much more transparent for unused cards */
}

.card-sm-rank {
  font-size: 15px;
  line-height: 1;
  padding-top: 3px;
  -webkit-text-size-adjust: 100%; /* iOS Safari fix */
  text-size-adjust: 100%;         /* modern browsers */
}

.card-sm-suit {
  font-size: 20px;
  line-height: 1;
  font-family: Menlo, Consolas, "Courier New", monospace;
  -webkit-text-size-adjust: 100%; /* iOS Safari fix */
  text-size-adjust: 100%;         /* modern browsers */
  display: inline-block;
  vertical-align: middle;
}
/* Texas Hold'em Examples Styles */
.holdem-examples {
    padding: 0 15px 15px 15px;
}

.community-section {
    text-align: center;
    margin-bottom: 20px;
}

.community-label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.community-cards {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 15px;
}

.examples-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

/* Mobile responsive - stack examples vertically */
@media (max-width: 768px) {
    .examples-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.example-column {
    text-align: center;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 8px;
    background-color: #f8f9fa;
}

.example-title {
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}

.example-subtitle {
    font-size: 10px;
    color: #28a745;
    font-weight: 500;
    margin-bottom: 8px;
}

.example-community {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-bottom: 8px;
}

.hole-cards {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-bottom: 8px;
}

.winning-hand {
    display: flex;
    justify-content: center;
    gap: 2px;
    flex-wrap: wrap;
}

.modal-header {
    background: linear-gradient(135deg, #799a6b 0%, #6b8e58 100%);
    color: white;
    padding: 12px;
    text-align: center;
    height: 8%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

.modal-body {
    padding: 20px 0;
    height: 84%;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.modal-footer {
    padding: 15px 0;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    height: 8%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.modal-footer .menu-item {
    margin: 0;
    border-bottom: none;
    background-color: transparent;
}

.modal-footer .menu-item:hover {
    background-color: #e9ecef;
}

.menu-item {
    padding: 15px 25px;
    cursor: pointer;
    font-size: 16px;
    color: #495057;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f1f3f4;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background-color: #f8f9fa;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap:var(--game-gap);
    align-content: start;
    background-color: white;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #dee2e6;
}

/* Floating Raise Overlay */
#raise-overlay {
    position: fixed;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none; /* container doesn't block clicks except its children */
    width: min(96vw, 520px);
}

#raise-overlay #raise-options {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    padding: 8px;
    min-width: 260px;
    max-width: 90vw;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

#raise-overlay #raise-options:not(.d-none) {
    display: flex;
}

#raise-overlay #raise-options .btn {
    margin: 0;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 6px;
}



/* ========================================
   BUTTON STYLES
   ======================================== */
.btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    margin: 2px ;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.3);
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.btn:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
    opacity: 0.6;
}

.btn:focus {
    outline: none;
    outline-offset: 2px;
}

/* ========================================
   CARD STYLES & ANIMATIONS
   ======================================== */
.card-container {
    perspective: 1000px;
    background-color: transparent;
    transition: transform 0.3s ease;
    flex-shrink: 1;
    min-width: 0;
    margin: 0 var(--card-margin, 4px);
    position: relative;
    z-index: 10; /* Higher than normal content */
}

.card-container:hover {
    transform: translateY(-5px);
}

.card-container:focus {
    outline: none;
    outline-offset: 2px;
}

/* Premium card glow effect */
.premium-glow {
    position: relative;
    animation: premiumPulse 2s ease-in-out infinite;
    z-index: 12; /* Higher than normal cards */
}

/* Winning hand card highlight - raises the card */
.winning-card {
    transform: translateY(-5px);
    transition: transform 0.8s ease-in-out;
    z-index: 15; /* Even higher for highlighted cards */
    filter: brightness(1.1) saturate(1.2);
    box-shadow: 0 8px 16px rgba(255, 215, 0, 0.4), 
                0 0 20px rgba(255, 215, 0, 0.3);
}

/* Folded card styling - makes cards appear faded/discarded */
.folded-card {
    opacity: 0.3;
    filter: grayscale(0.8) brightness(0.6);
    transform: rotate(-5deg) scale(0.95);
    transition: all var(--folded-transition-time) ease-in-out;
    z-index: 5; /* Lower than active cards */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); /* Darker shadow to appear "dead" */
}

.folded-card:hover {
    transform: rotate(-5deg) scale(0.95); /* Prevent hover effects on folded cards */
    opacity: 0.3; /* Maintain faded appearance even on hover */
}

.premium-glow::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, 
        #fff8dc, #fffacd, #ffffe0, #fff8dc, 
        #fffaf0, #ffeaa7, #fff8dc, #fffacd);
    background-size: 300% 300%;
    border-radius: 10px;
    z-index: -1;
    animation: premiumShimmer 2s ease-in-out infinite;
    opacity: 0.9;
    filter: blur(2px);
}

.premium-glow::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(255, 248, 220, 0.6), 
        rgba(255, 250, 205, 0.6), 
        rgba(255, 255, 224, 0.6),
        rgba(255, 248, 220, 0.6));
    border-radius: 8px;
    z-index: -1;
    animation: premiumGlow 1.5s ease-in-out infinite alternate;
    box-shadow: 
        0 0 10px rgba(255, 248, 220, 0.8),
        0 0 20px rgba(255, 250, 205, 0.6),
        0 0 30px rgba(255, 255, 224, 0.4);
}

.mx-1 {
    margin-left: 5px;
    margin-right: 5px;
}

.card-inner {
    position: relative;
    width: var(--card-width, 55px);
    aspect-ratio: 1/1.45;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    background-color: transparent;
}

.game-card {
    width: var(--card-width, 55px);
    aspect-ratio: 1/1.45;
    /* padding: 3px; */
    border-radius: 3px;
    background-color: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1), 5px 5px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 3px;
}

.flip-card {
    transform: rotateY(180deg);
}

.card-facing-down {
    transform: rotateY(180deg);
}

.card-container:hover .card-inner {
    transform: rotateY(180deg);
}

/* Card Face Styles */
.cardFacingDown-face {
    transform: rotateY(180deg);
}

.cardFacingUp-back {
    transform: rotateY(180deg);
}

.cardFacingDown-face, .cardFacingDown-back,
.cardFacingUp-face, .cardFacingUp-back {
    position: absolute;
    backface-visibility: hidden;
    border-radius: 5px;
    padding: 3px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1), 5px 5px 10px rgba(0, 0, 0, 0.2);
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* ========================================
   MESSAGE BOXES & UI COMPONENTS
   ======================================== */
/* Pot display */
#pot {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    padding: 6px 12px;
    border-radius: 16px;
    display: inline-block;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1; /* Base text level */
    min-height: 32px;
    min-width: 60px;
}

/* Hero and Villain hand evaluation displays */
#hero-hand-evaluation, #villain-hand-evaluation {
    font-size: 12px;
    color: #333;
    padding: 6px 8px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
    /* border: 1px solid #dee2e6; */
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    text-align: center;
    transition: all 0.3s ease;
}

#hero-hand-evaluation.visible, #villain-hand-evaluation.visible {
    visibility: visible;
}

#hero-hand-evaluation strong, #villain-hand-evaluation strong {
    color: #2c3e50;
    font-weight: 600;
}

#hero-hand-evaluation span, #villain-hand-evaluation span {
    color: #666 !important;
    font-size: 10px !important;
}

/* Villain hand evaluation display (identical to hero) */
#villain-hand-evaluation {
    font-size: 10px;
    color: #333;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin-top: 5px;
    margin-bottom: 4px; /* Add bottom margin for separation */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
    height: 40px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1; /* Lower than cards */
    justify-content: center;
    visibility: hidden;
    /* Match hero box width */
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

#villain-hand-evaluation strong {
    color: #2c3e50;
    font-weight: 600;
}

#villain-hand-evaluation span {
    color: #666 !important;
    font-size: 10px !important;
}

/* Error and success message styles */
.error-message-box {
    background-color: #dc3545;
    color: white;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 12px;
    display: inline-block;
    text-align: center;
    box-shadow: 0px 4px 8px rgba(220, 53, 69, 0.3);
    font-size: 13px;
    animation: fadeIn 0.3s ease-in-out, shake 0.5s ease-in-out;
    position: relative;
    z-index: 2; /* Above basic text but below cards */
}

.success-message-box {
    background-color: #28a745;
    color: white;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 12px;
    display: inline-block;
    text-align: center;
    box-shadow: 0px 4px 8px rgba(40, 167, 69, 0.3);
    font-size: 13px;
    animation: fadeIn 0.3s ease-in-out;
}

.warning-message-box {
    background-color: #ffc107;
    color: #212529;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 12px;
    display: inline-block;
    text-align: center;
    box-shadow: 0px 4px 8px rgba(255, 193, 7, 0.3);
    font-size: 13px;
    animation: fadeIn 0.3s ease-in-out;
}

.villain-message-box {
    background: linear-gradient(135deg, #d11141 0%, #b8103a 100%);
    color: white;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 12px;
    display: inline-block;
    text-align: center;
    box-shadow: 0px 4px 8px rgba(209, 17, 65, 0.3);
    font-size: 13px;
    animation: fadeIn 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
    z-index: 2; /* Above basic text but below cards */
}

.villain-message-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

.betting-message-box {
    background: linear-gradient(135deg, #2E8B57 0%, #228B22 100%);
    color: white;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 12px;
    display: inline-block;
    text-align: center;
    box-shadow: 0px 4px 8px rgba(46, 139, 87, 0.3);
    font-size: 13px;
    animation: fadeIn 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
    z-index: 2;
    border: 2px solid #32CD32;
}

.betting-message-box.semi-permanent {
    background: linear-gradient(135deg, #1E6B47 0%, #1C5F3F 100%);
    border: 2px solid #228B22;
    box-shadow: 0px 4px 12px rgba(46, 139, 87, 0.4);
}

/* ========================================
   DEALER BUTTON
   ======================================== */
.dealer-button {
    position: relative;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    border: 1px solid #B8860B;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.4), 
                inset 0 1px 2px rgba(255, 255, 255, 0.3),
                inset 0 -1px 2px rgba(0, 0, 0, 0.2);
    z-index: 20;
    transition: all 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    opacity: 1; /* Make visible by default when added to DOM */
    transform: scale(1); /* Normal size by default */
    pointer-events: none;
    margin-left: 8px; /* Add separation from position label */
    flex-shrink: 0; /* Prevent button from shrinking */
}

.dealer-button.visible {
    opacity: 1;
    transform: scale(1);
}

.dealer-button-text {
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 10px;
    color: #8B4513;
    text-shadow: 0.5px 0.5px 1px rgba(255, 255, 255, 0.5);
    user-select: none;
}

.dealer-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.6), 
                inset 0 2px 4px rgba(255, 255, 255, 0.4),
                inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

/* Animation for moving between spaces */
.dealer-button.moving {
    transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Animation for moving between spaces */
.dealer-button.moving {
    transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-content-center { justify-content: center; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

.spread { min-height: 80%; }

.fade-in { animation: fadeIn 0.5s forwards; }
.fade-out { animation: fadeOut 0.5s forwards; }

.flash-update {
    animation: flashBackground 1s ease-in-out, pulse 0.5s ease-in-out;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #f3f3f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.screen-reader-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   CARD CONTAINER OVERFLOW PROTECTION
   ======================================== */
#villain-space, #community-space, #hero-space {
    overflow: visible; /* Allow cards to float above */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 5; /* Base level for card areas */
}

.d-flex.justify-content-center {
    max-width: 100%;
    overflow: hidden;
}

/* ========================================
   ANIMATIONS & KEYFRAMES
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-5px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes flashBackground {
    0% { background-color: transparent; }
    25% { background-color: rgba(40, 167, 69, 0.2); }
    50% { background-color: rgba(40, 167, 69, 0.4); }
    75% { background-color: rgba(40, 167, 69, 0.2); }
    100% { background-color: transparent; }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes premiumPulse {
    0%, 100% { 
        transform: scale(1);
        filter: brightness(1) saturate(1);
    }
    50% { 
        transform: scale(1.025);
        filter: brightness(1.2) saturate(1.2);
    }
}

@keyframes premiumShimmer {
    0% { 
        background-position: 0% 50%;
        opacity: 0.8;
    }
    25% {
        opacity: 1;
    }
    50% { 
        background-position: 100% 50%;
        opacity: 1.2;
    }
    75% {
        opacity: 1;
    }
    100% { 
        background-position: 0% 50%;
        opacity: 0.8;
    }
}

@keyframes premiumGlow {
    0% { 
        box-shadow: 
            0 0 8px rgba(255, 248, 220, 0.6),
            0 0 16px rgba(255, 250, 205, 0.4),
            0 0 24px rgba(255, 255, 224, 0.2);
        opacity: 0.6;
    }
    100% { 
        box-shadow: 
            0 0 15px rgba(255, 248, 220, 1),
            0 0 25px rgba(255, 250, 205, 0.8),
            0 0 35px rgba(255, 255, 224, 0.6),
            0 0 45px rgba(255, 248, 220, 0.4);
        opacity: 1;
    }
}

@keyframes premiumFadeOut {
    0% { 
        opacity: 1;
        transform: scale(1);
    }
    70% { 
        opacity: 1;
        transform: scale(1);
    }
    100% { 
        opacity: 0;
        transform: scale(1);
    }
}

@keyframes premiumPulseStop {
    0% { 
        transform: scale(1);
        filter: brightness(1) saturate(1);
    }
    16% { 
        transform: scale(1.05);
        filter: brightness(1.2) saturate(1.2);
    }
    32% { 
        transform: scale(1);
        filter: brightness(1) saturate(1);
    }
    48% { 
        transform: scale(1.05);
        filter: brightness(1.2) saturate(1.2);
    }
    64% { 
        transform: scale(1);
        filter: brightness(1) saturate(1);
    }
    70% { 
        transform: scale(1);
        filter: brightness(1) saturate(1);
    }
    100% { 
        transform: scale(1);
        filter: brightness(1) saturate(1);
    }
}

/* ========================================
   RAISE SLIDER STYLES
   ======================================== */
.raise-slider-container {
    margin: 15px 0;
    padding: 15px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    text-align: center;
}

.raise-slider-label {
    color: white;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 14px;
}

.raise-amount-input {
    width: 120px;
    padding: 8px;
    font-size: 16px;
    text-align: center;
    margin: 0 10px;
    border: 2px solid #007bff;
    border-radius: 4px;
    background: white;
    color: black;
    font-weight: bold;
}

.raise-amount-slider {
    width: 200px;
    margin: 10px 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
    height: 6px;
    border-radius: 3px;
    background: #333;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.raise-amount-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.raise-amount-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.raise-range-display {
    color: #ccc;
    font-size: 12px;
    margin-top: 5px;
}

.raise-slider-btn {
    background: #28a745 !important;
    margin-top: 10px;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    color: white;
    cursor: pointer;
}

.raise-slider-btn:hover {
    background: #218838 !important;
}

/* ========================================
   FAST FORWARD FADE OVERLAY
   ======================================== */
.fast-forward-fade {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.fast-forward-fade.active {
    opacity: 1;
    pointer-events: all;
}

.fast-forward-fade .fade-message {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.6; transform: scale(1); }
}
