/* Mobile-first base styles */
:root {
    --poker-green: #2d6a4f;
    --poker-dark-green: #1b4332;
    --poker-light-green: #40916c;
    --poker-red: #e63946;
    --poker-gold: #f1c40f;
    --poker-black: #1a1a1a;
    --poker-white: #f8f9fa;
    --card-width: 60px;
    --card-height: 84px;
    --border-radius: 8px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --font-size-sm: 0.85rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.2rem;
    --font-size-xl: 1.5rem;
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.4;
    background-color: #121212;
    color: var(--poker-white);
    position: relative;
    font-size: var(--font-size-md);
    -webkit-tap-highlight-color: transparent;
    /* Remove the background image from the body */
    min-height: 100vh;
    /* mobile viewport bug fix */
    min-height: -webkit-fill-available;
    overflow-x: hidden; /* Prevent horizontal scroll */
    width: 100%; /* Ensure full width */
    margin: 0;
    padding: 0;
}

/* Add viewport resizing fix */
html {
  height: -webkit-fill-available;
}

/* Add this new rule after the body style */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-color: #0a1e1a; /* Dark green base color */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%232d6a4f' fill-opacity='0.15'%3E%3Cpath d='M50 0C22.4 0 0 22.4 0 50s22.4 50 50 50 50-22.4 50-50S77.6 0 50 0zm0 5c24.8 0 45 20.2 45 45S74.8 95 50 95 5 74.8 5 50 25.2 5 50 5z'/%3E%3C/g%3E%3C/g%3E%3Cg fill='%23f1c40f' fill-opacity='0.05'%3E%3Cpath d='M25 30L35 30 30 20z'/%3E%3Cpath d='M65 30L75 30 70 20z'/%3E%3Cpath d='M25 70L35 70 30 80z'/%3E%3Cpath d='M65 70L75 70 70 80z'/%3E%3C/g%3E%3Cg fill='%23e63946' fill-opacity='0.05'%3E%3Cpath d='M50 25C45 25 40 30 40 35 40 40 45 45 50 45 55 45 60 40 60 35 60 30 55 25 50 25z'/%3E%3Cpath d='M50 55C45 55 40 60 40 65 40 70 45 75 50 75 55 75 60 70 60 65 60 60 55 55 50 55z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none; /* Prevent the overlay from intercepting clicks */
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: -1;
}

/* Add animated pattern for enhanced background */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1.5;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='%23f1c40f' fill-opacity='0.3'%3E%3Cpath d='M30 5L35 15 25 15zM30 55L35 45 25 45zM5 30L15 35 15 25zM55 30L45 35 45 25z'/%3E%3Cpath d='M20 20L25 25 15 15zM40 20L35 25 45 15zM20 40L25 35 15 45zM40 40L35 35 45 45z'/%3E%3C/g%3E%3C/svg%3E");
    animation: patternMove 120s linear infinite;
    pointer-events: none; /* Prevent the pattern from intercepting mouse events */
}

@keyframes patternMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 1000px 1000px;
    }
}

.container {
    width: 100%;
    max-width: 100vw; /* Use viewport width instead of 100% */
    margin: 0;
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    height: auto;
    overflow-x: hidden; /* Prevent horizontal overflow */
    box-sizing: border-box;
}

header {
    text-align: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-bottom: 2px solid var(--poker-gold);
    position: relative;
}

h1 {
    color: var(--poker-gold);
    font-size: var(--font-size-xl);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

/* Remove the mobile-tabs related styles */
.mobile-tabs {
    display: none; /* Hide completely */
}

/* Update container layout */
.container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    max-width: 100%;
    margin: 0 auto;
}

/* Game container styles - completely redesigned */
.game-container {
    display: flex; /* Change from grid to flex for mobile */
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0; /* Remove padding that might cause overflow */
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Only use grid on larger screens */
@media (min-width: 768px) {
    .game-container {
        display: grid;
        grid-template-columns: 3fr 1fr;
        grid-template-rows: auto auto 1fr;
        grid-template-areas:
            "create create"
            "status status"
            "table controls";
        padding: var(--spacing-sm);
        max-width: 1200px;
    }
}

/* Create Game Section */
.create-game-section {
    grid-area: create;
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    width: 100%;
}

.create-game-section #startGame {
    max-width: 300px;
    padding: 12px 20px;
    font-size: var(--font-size-md);
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.create-game-section #startGame:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* Add pulse animation for the start game button */
.create-game-section #startGame.pulse-button {
    animation: pulse-button 1.5s infinite;
}

/* Game status bar */
.game-status-bar {
    grid-area: status;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm);
    border: 1px solid var(--poker-light-green);
}

.game-info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.game-info > div {
    background-color: rgba(27, 67, 50, 0.8);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: var(--font-size-sm);
    transition: background-color 0.3s ease;
}

.game-info > div span {
    font-weight: bold;
    color: var(--poker-gold);
}

/* Add this to the CSS file */
.limit-info, .blind-info {
  background-color: rgba(27, 67, 50, 0.8);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: var(--font-size-sm);
  transition: background-color 0.3s ease;
  color: var(--poker-gold);
}

.limit-info {
  border-left: 2px solid var(--poker-gold);
}

.blind-info {
  border-left: 2px solid var(--poker-light-green);
}

/* Add animation for game-info updates */
@keyframes info-highlight {
    0% {
        background-color: rgba(27, 67, 50, 0.8);
    }
    50% {
        background-color: rgba(64, 145, 108, 0.8);
    }
    100% {
        background-color: rgba(27, 67, 50, 0.8);
    }
}

.info-updated {
    animation: info-highlight 1s ease-out;
}

/* Game end state styling for poker table */
.poker-table.game-ended {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 
              inset 0 0 80px rgba(0, 0, 0, 0.3),
              0 0 30px rgba(241, 196, 15, 0.4); /* Golden glow for game end */
  border-color: var(--poker-gold);
  transition: box-shadow 0.8s ease, border-color 0.8s ease;
}

/* Add a subtle overlay to indicate game is over */
.poker-table.game-ended::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.2) 100%);
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.7;
  z-index: 1;
}

@keyframes game-end-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

.poker-table.game-ended {
    animation: game-end-pulse 2s ease-in-out 1;
}

/* Game log section */
.game-log-section {
    grid-area: log;
    background-color: rgba(27, 67, 50, 0.8);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    border: 1px solid var(--poker-light-green);
}

.game-log-section h2 {
    color: var(--poker-gold);
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--poker-light-green);
    padding-bottom: var(--spacing-sm);
    font-size: var(--font-size-lg);
}

.log-container {
    height: 150px;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.7);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    font-family: 'Courier New', monospace;
    border: 1px solid var(--poker-light-green);
    font-size: var(--font-size-sm);
}


/* Game area and poker table - completely redesigned */
.game-area {
    grid-area: table;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    display: flex;
    justify-content: center;
    max-height: none;
    position: relative;
}

.poker-table {
    background: radial-gradient(circle, var(--poker-green) 0%, var(--poker-dark-green) 100%);
    border-radius: 50%;
    border: 8px solid var(--poker-dark-green);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 
                inset 0 0 80px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(64, 145, 108, 0.3);
    position: relative;
    width: 100%;
    max-width: calc(100vw - 32px); /* Account for container padding */
    aspect-ratio: 1 / 0.8;
    display: grid;
    grid-template-rows: 1fr 1fr 1fr;
    grid-template-areas:
        "ai"
        "community"
        "player";
    padding: 5%;
    box-sizing: border-box;
    overflow: visible;
    height: auto;
    min-height: auto;
    max-height: none;
    margin: 0 auto; /* Center the table */
}

.table-felt {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 80px;
    background-image: 
        radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.2) 100%),
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.03) 10px, rgba(255, 255, 255, 0.03) 20px);
    pointer-events: none;
}

.table-felt::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVGhD7ZnBDYMwDEWzUkboCB2hI3SEjsAIHaEjdISOkBEYgZ+oEBKkNjGJVfuetJJz8P+RkTjGGGOMMcYYY4wxpgLbtm2e5/kJfI33vu/LsizTNE3vwfQBgnwA+75/xJgQwkOYPkCQzxhj3AbTBwjyGWPcBtMHCPIZY9wG0wcI8hlj3AbTBwjyGWPcBtMHCPIZY9wG0wcI8hlj3AbTBwjyGWPcBtMHCPIZY9wG0wcI8hlj3AbTBwjyGWPcBtMHCPIZY9wG0wcI8hlj3AbTBwjyGWPcBtMHCPIZY9wG0wcI8hlj3AbTB/8QxBhjjDHGGGOMMeYPcO4LCnQv5xO2JpMAAAAASUVORK5CYII=');
    opacity: 0.05;
    pointer-events: none;
}

/* Add MACHAAO watermark to poker table */
.poker-table::after {
    content: 'MACHAAO';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: bold;
    color: rgba(255, 255, 255, 0.08);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 1;
    user-select: none;
    font-family: 'Poppins', sans-serif;
}

/* Player and AI areas */
.ai-area {
    grid-area: ai;
    align-self: start;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
}

.community-area {
    grid-area: community;
    align-self: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
}

.player-area {
    grid-area: player;
    align-self: end;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
}

/* Card containers */
.card-container {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: clamp(2px, 1.5vw, 8px); /* Smaller minimum gap */
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    padding: 5px 0;
    min-height: calc(var(--card-height) + 10px);
    box-sizing: border-box;
}

/* Ensure community cards fit on mobile */
.community-area .card-container {
    min-width: auto; /* Remove fixed min-width */
    max-width: 100%;
    justify-content: center;
    gap: clamp(1px, 1vw, 6px); /* Even tighter gap for 5 cards */
}

/* Pot display */
.pot-display {
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: var(--font-size-md);
    color: var(--poker-gold);
    border: 2px solid var(--poker-gold);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.3);
    text-align: center;
    font-weight: bold;
    letter-spacing: 1px;
    margin-top: var(--spacing-sm);
}

/* Cards - mobile optimized */
.card-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    overflow: visible; /* Change from auto to visible */
    padding: 5px 0;
}

/* Improve two-card hands positioning */
.two-card-hand {
    display: flex;
    justify-content: center;
    gap: clamp(var(--spacing-xs), 3vw, var(--spacing-md));
}

.card {
    width: var(--card-width);
    height: var(--card-height);
    min-width: var(--card-width); /* Prevent shrinking */
    max-width: var(--card-width); /* Prevent growing */
    flex-shrink: 0; /* Don't shrink when space is tight */
    background: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: var(--font-size-lg);
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 5px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    transform-style: preserve-3d;
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.2);
}

.card:active {
    transform: scale(1.05);
}

.card.hearts, .card.diamonds {
    color: var(--poker-red);
}

.card.clubs, .card.spades {
    color: var(--poker-black);
}

.card::before, .card::after {
    position: absolute;
    font-size: var(--font-size-sm);
}

.card::before {
    top: 3px;
    left: 3px;
}

.card::after {
    bottom: 3px;
    right: 3px;
    transform: rotate(180deg);
}

.card.hearts::before, .card.hearts::after { content: "♥"; }
.card.diamonds::before, .card.diamonds::after { content: "♦"; }
.card.clubs::before, .card.clubs::after { content: "♣"; }
.card.spades::before, .card.spades::after { content: "♠"; }

.card.hidden {
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: transparent;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.card.hidden::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://www.transparenttextures.com/patterns/carbon-fibre.png');
    opacity: 0.3;
}

.card.hidden::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="white" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm-32-316v116h-67c-10.7 0-16 12.9-8.5 20.5l99 99c4.7 4.7 12.3 4.7 17 0l99-99c7.6-7.6 2.2-20.5-8.5-20.5h-67V140c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

/* Player info - mobile optimized */
.player-info, .ai-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-sm) 0;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--poker-light-green);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    min-width: 120px;
    text-align: center;
}

.player-avatar, .ai-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--font-size-md);
    color: white;
    font-weight: bold;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.ai-avatar {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.player-avatar {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.chip-count {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    color: var(--poker-gold);
}

.chip-icon {
    width: 20px;
    height: 20px;
    background-color: var(--poker-gold);
    border-radius: 50%;
    border: 2px dashed white;
    display: inline-block;
    box-shadow: 0 0 5px var(--poker-gold);
}

/* Game controls wrapper */
.game-controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Game controls */
.game-controls {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    border: 1px solid var(--poker-light-green);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    position: relative;
    z-index: 10; /* Higher than background */
    pointer-events: auto; /* Explicitly enable pointer events */
}

.primary-controls {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

.bet-controls {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.bet-quick-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

/* Special style for the max button */
.bet-quick[data-bet="max"] {
    background-color: var(--poker-red);
    color: white;
}

.bet-amount-container {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: var(--spacing-sm);
    align-items: center;
}

/* Game management */
.game-management {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Add spacing between buttons in game controls */
.game-controls button {
  margin-bottom: 10px;
}

/* Make primary buttons stand out more */
.primary-button {
  padding: 12px 16px;
  margin-top: 10px;
  margin-bottom: 10px;
}

/* Improved button styles */
button {
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 11; /* Higher than the controls container */
    pointer-events: auto; /* Explicitly enable pointer events */
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

button:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Action button colors */
#actionFold {
    background-color: var(--poker-red);
    color: white;
}

#actionCheck {
    background-color: var(--poker-light-green);
    color: white;
}

#actionCall {
    background-color: #3498db;
    color: white;
}

#actionRaise {
    background-color: #9b59b6;
    color: white;
}

.primary-button {
    background-color: var(--poker-gold);
    color: var(--poker-black);
    width: 100%;
}

.secondary-button {
    background-color: var(--poker-light-green);
    color: white;
    width: 100%;
}

/* Input styling */
input[type="text"], input[type="number"] {
    padding: 8px 12px;
    border-radius: var(--border-radius);
    border: 2px solid var(--poker-light-green);
    background-color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-md);
    min-height: 40px;
}

input[type="number"] {
    text-align: center;
    font-weight: bold;
}

input[type="text"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--poker-gold);
    box-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
}

/* Improved bet input for mobile */
.bet-controls {
    display: flex;
    gap: var(--spacing-xs);
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
}

.bet-quick {
    flex: 1;
    background-color: rgba(155, 89, 182, 0.7);
    color: white;
    padding: var(--spacing-xs) var(--spacing-xs);
    font-size: 0.8rem;
    min-height: 30px;
}

.bet-amount-container {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.bet-adjust {
    width: 36px;
    height: 36px;
    background-color: var(--poker-light-green);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#betAmount {
    flex: 1;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    border: 2px solid #9b59b6;
    -webkit-appearance: none;
    appearance: none;
    margin-top: -10px;
}

/* Fix for iOS input styling */
input[type="number"] {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    border-radius: var(--border-radius);
}

/* Mobile game controls */
.mobile-game-controls {
    margin-top: var(--spacing-md);
}

/* Game log - mobile optimized */
.log-container {
    height: 150px;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.7);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    font-family: 'Courier New', monospace;
    border: 1px solid var(--poker-light-green);
    font-size: var(--font-size-sm);
}

.log-entry {
    margin-bottom: var(--spacing-xs);
    padding: 3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Section styling */
.section {
    background-color: rgba(27, 67, 50, 0.8);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--poker-light-green);
    margin-bottom: var(--spacing-md);
}

.section h2 {
    color: var(--poker-gold);
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--poker-light-green);
    padding-bottom: var(--spacing-sm);
    font-size: var(--font-size-lg);
}

/* Game info display */
.game-info {
    display: flex;
    justify-content: space-between;
    background-color: rgba(0, 0, 0, 0.6);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.game-info div {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 6px 10px;
    border-radius: 20px;
    font-size: var(--font-size-sm);
}


/* Animations */
@keyframes dealCard {
    0% {
        transform: translate(-50%, -100px) rotate(10deg);
        opacity: 0;
    }
    70% {
        transform: translate(0, 10px) rotate(2deg);
        opacity: 1;
    }
    100% {
        transform: translate(0, 0) rotate(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.7);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
        box-shadow: 0 0 0 10px rgba(241, 196, 15, 0);
    }
    100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(241, 196, 15, 0);
    }
}

@keyframes pulse-top-right {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(241, 196, 15, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(241, 196, 15, 0);
    }
}

.pot-display.top-right.pulse-animation {
    animation: pulse-top-right 1.5s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

/* Add subtle animations for better aesthetics */
@keyframes subtle-glow {
    0% { box-shadow: 0 0 5px rgba(241, 196, 15, 0.3); }
    50% { box-shadow: 0 0 15px rgba(241, 196, 15, 0.5); }
    100% { box-shadow: 0 0 5px rgba(241, 196, 15, 0.3); }
}

.deal-animation {
    animation: dealCard 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.pulse-animation {
    animation: pulse 1.5s ease-in-out infinite; /* Add ease-in-out for smoother animation */
}

.pulse-animation {
    animation: pulse 1.5s infinite;
}

/* Add this to your styles.css file */
@keyframes pulse-button {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(241, 196, 15, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(241, 196, 15, 0);
    }
}

.pulse-button {
    animation: pulse-button 1.5s infinite;
    position: relative;
    z-index: 100;
}

/* Ultra-small screens */
@media (max-width: 360px) {
    :root {
        --card-width: 38px;
        --card-height: 53px;
    }
    
    .poker-table {
        border-width: 4px;
        padding: 3%;
        max-width: calc(100vw - 16px);
    }
    
    .community-area .card-container {
        gap: 1px;
    }
}

/* Small screens */
@media (max-width: 480px) {
    :root {
        --card-width: 42px;
        --card-height: 59px;
    }
    
    .poker-table {
        border-width: 5px;
        padding: 4%;
        max-width: calc(100vw - 24px);
    }
    
    .community-area .card-container {
        gap: 2px;
    }
}

/* Mobile-specific improvements */
@media (max-width: 767px) {
    .poker-table {
        min-height: auto; /* Remove fixed height constraint */
        padding: 15px 15px 25px 15px; /* Reduce padding */
        border-radius: 60px; /* Smaller border radius */
        margin-bottom: 15px; /* Reduce bottom margin */
    }
    
    /* Adjust card spacing */
    .card-container {
        gap: 4px; /* Reduce gap between cards */
    }
    
    /* Make community area more compact */
    .community-area {
        padding: 5px;
    }
    
    /* Adjust player/AI areas */
    .player-area, .ai-area {
        padding: 5px;
    }
    
    /* Make pot display smaller */
    .pot-display {
        padding: 5px 12px;
        font-size: 0.9rem;
    }
}

/* Add these styles to ensure game area fits in viewport */
.game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  overflow: visible; /* Ensure no scrollbars */
  max-height: none; /* Remove height constraint */
  touch-action: auto; /* Allow all touch actions */
}

/* Ensure the poker table is properly centered */
.poker-table {
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  width: 100%; /* Take full width of container */
  max-width: 800px; /* But limit maximum width */
}

/* Ensure poker table scales properly on all devices */
@media (max-width: 480px) {
  .poker-table {
    border-radius: 40px; /* Smaller border radius for small screens */
    border-width: 4px; /* Thinner border */
    padding: 10px; /* Smaller padding */
  }
}

/* Footer styles */
.app-footer {
    text-align: center;
    padding: var(--spacing-md) 0;
    margin-top: auto;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(64, 145, 108, 0.3);
    background-color: rgba(0, 0, 0, 0.2);
    width: 100%;
}

.app-footer p {
    margin: 0;
}

.app-footer a {
    color: var(--poker-gold);
    text-decoration: none;
    transition: color 0.3s;
}

.app-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.heart-emoji {
    color: var(--poker-red);
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.2); }
    30% { transform: scale(1); }
    45% { transform: scale(1.2); }
    60% { transform: scale(1); }
    100% { transform: scale(1); }
}

@media (min-width: 481px) and (max-width: 768px) {
  .poker-table {
    border-radius: 60px;
    border-width: 6px;
    padding: 15px;
  }
}

/* Ensure card containers don't overflow */
.card-container {
  max-width: 100%;
  flex-wrap: wrap; /* Allow cards to wrap if needed */
  justify-content: center;
}

/* Make sure the player/AI areas don't push content out of viewport */
.player-area, .ai-area {
  padding: var(--spacing-sm);
  max-height: 30vh; /* Limit height to prevent overflow */
}

/* Ensure community area doesn't take too much space */
.community-area {
  flex: 0 0 auto; /* Don't grow or shrink */
  padding: var(--spacing-sm);
}

/* Adjust for different screen sizes */
@media (max-height: 700px) {
  :root {
    --card-width: 45px;
    --card-height: 63px;
  }
  
  .player-area, .ai-area, .community-area {
    padding: var(--spacing-xs);
  }
}


/* Ensure game controls are always visible */
.game-controls-mobile {
  position: relative; /* Change from sticky to relative */
  bottom: auto; /* Remove sticky positioning */
  background: rgba(0, 0, 0, 0.3);
  z-index: 20; /* Higher z-index so it appears above the table */
  padding: var(--spacing-sm);
  width: 100%;
  max-width: 600px;
  margin: 0 auto var(--spacing-md);
  border-radius: var(--border-radius);
  border: 1px solid var(--poker-light-green);
}

/* Responsive layouts */
/* Tablet layout */
@media (min-width: 768px) {
    .poker-table {
        aspect-ratio: 1 / 0.7;
        max-width: 800px;
    }
    
    .game-controls-wrapper {
        max-width: 800px;
    }
    
    .primary-controls {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bet-quick-options {
        grid-template-columns: 1fr;
    }
    
    .bet-amount-container {
        grid-template-columns: auto 1fr auto 1fr;
    }
}

/* Desktop layout */
@media (min-width: 1024px) {
    .game-container {
        grid-template-columns: 3fr 1fr;
        grid-template-rows: auto auto 1fr;
        grid-template-areas:
            "create create"
            "status status"
            "table controls";
        gap: var(--spacing-lg);
        padding: var(--spacing-lg);
    }
    
    .poker-table {
        aspect-ratio: 1 / 0.6;
        max-width: 900px;
    }
    
    .game-controls-wrapper {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .game-controls {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .log-container {
        height: 250px;
    }
}

/* Large desktop */
@media (min-width: 1440px) {
    .game-container {
        max-width: 1400px;
    }
    
    .poker-table {
        max-width: 1000px;
    }
}

/* More conservative card sizing for better river card fit */
@media (max-width: 480px) {
    :root {
        --card-width: 42px;
        --card-height: 59px;
    }
    
    .community-area .card-container {
        gap: 2px; /* Very tight gap for small screens */
        min-width: calc(5 * 42px + 4 * 2px); /* Exact space needed */
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    :root {
        --card-width: 55px;
        --card-height: 77px;
    }
    
    .community-area .card-container {
        gap: 4px;
        min-width: calc(5 * 55px + 4 * 4px);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --card-width: 65px;
        --card-height: 91px;
    }
    
    .community-area .card-container {
        gap: 6px;
        min-width: calc(5 * 65px + 4 * 6px);
    }
}

@media (min-width: 1025px) {
    :root {
        --card-width: 80px;
        --card-height: 112px;
    }
    
    .community-area .card-container {
        gap: 8px;
        min-width: calc(5 * 80px + 4 * 8px);
    }
}

/* Large desktop styles - add these */
@media (min-width: 1440px) {
    :root {
        --card-width: 110px;
        --card-height: 154px;
    }
    
    .poker-table {
        border-radius: 180px;
        max-width: 900px; /* Change from 50% to a fixed width */
        width: 80%; /* Add width constraint */
    }
    
    .game-container {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .poker-table {
        max-width: 1000px;
    }
    
    .game-controls-mobile {
        width: 250px;
    }
    
    /* Make the pot display more prominent */
    .pot-display {
        padding: 10px 20px;
        font-size: 1.2rem;
    }
    
    /* Improve action buttons */
    button {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    /* Center the game area */
    #game-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    /* Improve game controls layout */
    .game-controls-mobile {
        width: 80%;
        max-width: 800px;
    }
    
    /* Make the log container larger on desktop */
    .log-container {
        height: 250px;
    }
}

/* Desktop-specific fixes */
@media (min-width: 1024px) {
  .game-area {
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
  }
  
  .poker-table {
    margin-bottom: 30px; /* Add more space between table and controls on desktop */
  }
  
  .game-controls-mobile {
    width: 80%; /* Make controls slightly narrower on desktop */
    max-width: 800px;
  }
  
  /* Ensure proper flow of elements */
  #game-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
}

/* Touch feedback */
@media (hover: none) {
    button:active:not(:disabled) {
        transform: scale(0.95);
        opacity: 0.9;
    }
    
    .card:active {
        transform: scale(1.05);
    }
    
    .tab-button:active {
        background-color: var(--poker-light-green);
        opacity: 0.8;
    }
    
}

/* Message panel styles */
.message-panel {
  position: fixed;
  right: -300px;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  background-color: var(--poker-dark-green);
  border-left: 3px solid var(--poker-gold);
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.3);
  transition: right 0.3s ease;
  z-index: 900;
  display: flex;
}

.message-panel.open {
  right: 0;
}

.message-handle {
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 80px;
  background-color: var(--poker-dark-green);
  border: 1px solid var(--poker-gold);
  border-right: none;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Make sure the handle icon is properly centered */
.handle-icon {
  font-size: 20px;
  color: var(--poker-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: var(--poker-red);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  font-weight: bold;
}

.message-badge.visible {
  opacity: 1;
}

/* Ensure message content takes full width */
.message-content {
  padding: 15px;
  width: 100%;
  max-height: 400px;
  overflow-y: auto;
}

.message-content h3 {
  color: var(--poker-gold);
  margin-bottom: 10px;
  border-bottom: 1px solid var(--poker-light-green);
  padding-bottom: 5px;
}

.slider-log-container {
  color: white;
  font-family: 'Courier New', monospace;
  line-height: 1.4;
  height: 300px;
  overflow-y: auto;
}

.log-entry {
  margin-bottom: var(--spacing-xs);
  padding: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Game event notification - update these styles */
.game-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: rgba(0, 0, 0, 0.9); /* More opaque */
    color: white;
    padding: 10px 20px; /* Smaller padding */
    border-radius: 10px;
    text-align: center;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s ease; /* Smoother transition */
    border: 1px solid var(--poker-gold); /* Thinner border */
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.2); /* Lighter glow */
    max-width: 80%;
    backdrop-filter: blur(3px); /* Add blur effect behind notification */
}

.game-notification.visible {
    opacity: 1.0; /* Fully opaque */
    transform: translate(-50%, -50%) scale(1); /* Add scale effect */
}

/* Add fade-in-out animation instead of pulse for notifications */
@keyframes fade-in-out {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    15% {
        opacity: 1.0; /* Fully opaque */
        transform: translate(-50%, -50%) scale(1);
    }
    85% {
        opacity: 1.0; /* Fully opaque */
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.02); /* Smaller exit scale */
    }
}

.game-notification.visible {
    animation: fade-in-out 3s ease forwards;
}

.game-notification.round-change {
    font-size: 1rem; /* Smaller font for round changes */
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-notification.winner {
    font-size: 1.2rem; /* Smaller font for winner notifications */
    font-weight: bold;
    padding: 15px 25px; /* Still slightly larger than regular notifications */
}

.game-notification.winner.player-win {
    border-color: #2ecc71;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
}

.game-notification.winner.ai-win {
    border-color: var(--poker-red);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
}

/* Highlight for changed elements */
.highlight-change {
    animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
    0% { background-color: rgba(241, 196, 15, 0.1); }
    50% { background-color: rgba(241, 196, 15, 0.3); }
    100% { background-color: rgba(241, 196, 15, 0.1); }
}

/* Pot update animation */
.pot-update {
    animation: pot-highlight 0.8s ease-in-out;
}

@keyframes pot-highlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background-color: rgba(241, 196, 15, 0.3); }
    100% { transform: scale(1); }
}

/* Card highlight animation */
@keyframes card-highlight {
    0% {
        box-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(241, 196, 15, 0.8);
        transform: scale(1.1);
    }
    100% {
        box-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
        transform: scale(1);
    }
}

.card-highlight {
    animation: card-highlight 1.5s ease-in-out;
    z-index: 10;
}

/* Action indicator */
.action-indicator {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.9); /* More opaque */
    color: white;
    padding: 6px 12px; /* Smaller padding */
    border-radius: 15px; /* Smaller radius */
    font-size: 0.8rem; /* Smaller font */
    font-weight: bold;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.action-indicator.player {
    bottom: 70px; /* Position closer to player area */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
}

.action-indicator.ai {
    top: 70px; /* Position closer to AI area */
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
}

.action-indicator.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.action-indicator.fold {
    background-color: rgba(231, 76, 60, 0.9); /* More opaque for fold */
}

.action-indicator.check {
    background-color: rgba(46, 204, 113, 0.9); /* More opaque for check */
}

.action-indicator.call {
    background-color: rgba(52, 152, 219, 0.9); /* More opaque for call */
}

.action-indicator.raise {
    background-color: rgba(155, 89, 182, 0.9); /* More opaque for raise */
}

/* Add active state styles for better touch feedback */
.card-active {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.button-active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* Settings UI */
.settings-button {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--poker-dark-green);
    color: var(--poker-white);
    border: 1px solid var(--poker-light-green);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.settings-panel {
    position: fixed;
    top: 50px;
    right: 10px;
    background-color: var(--poker-dark-green);
    border: 1px solid var(--poker-light-green);
    border-radius: var(--border-radius);
    padding: 15px;
    z-index: 900;
    width: 250px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: none;
}

.settings-panel.visible {
    display: block;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--poker-light-green);
    padding-bottom: 10px;
}

.settings-header h3 {
    margin: 0;
    color: var(--poker-gold);
}

.close-button {
    background: none;
    border: none;
    color: var(--poker-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    min-height: auto;
    box-shadow: none;
}

.setting-item {
    margin-bottom: 10px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    color: var(--poker-white);
}

.setting-item select {
    width: 100%;
    padding: 8px;
    border-radius: var(--border-radius);
    background-color: var(--poker-black);
    color: var(--poker-white);
    border: 1px solid var(--poker-light-green);
}

/* No longer needed notification level styles removed */

/* Add this to your styles.css file */
.table-info-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: var(--spacing-sm);
    flex-wrap: wrap;
}

/* Update pot display to work in the new container */
.pot-display {
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: var(--font-size-md);
    color: var(--poker-gold);
    border: 2px solid var(--poker-gold);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.3);
    text-align: center;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Top-right pot display */
.pot-display.top-right {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: var(--font-size-md);
    color: var(--poker-gold);
    border: 2px solid var(--poker-gold);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.3);
    text-align: center;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Add responsive adjustments for the top-right pot display */
@media (max-width: 480px) {
    .pot-display.top-right {
        top: 10px;
        right: 10px;
        padding: 5px 12px;
        font-size: 0.9rem;
    }
}

/* Update hand strength indicator styles */
.hand-strength-indicator {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.9rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--poker-light-green);
    transition: all 0.3s ease;
}

.hand-strength-meter {
    width: 80px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.hand-strength-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--poker-red) 0%, var(--poker-gold) 50%, #2ecc71 100%);
    width: 0%;
    transition: width 0.5s ease-out;
}

.hand-strength-text {
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

.hand-strength-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Add responsive adjustments */
@media (max-width: 480px) {
    .table-info-container {
        gap: 10px;
    }
    
    .hand-strength-indicator {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
    
    .hand-strength-meter {
        width: 60px;
    }
}

/* Prominent balance display in game status bar */
.balance-display-prominent {
    background: linear-gradient(135deg, var(--poker-gold), #f39c12);
    color: var(--poker-black);
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 1.4rem;
    font-weight: bold;
    border: 3px solid #fff;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.6), 
                0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    justify-content: center;
    animation: balance-glow 2s ease-in-out infinite alternate;
    position: relative;
    z-index: 10;
}

/* Header balance display for maximum visibility */
.header-balance-display {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--poker-gold);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    border: 2px solid var(--poker-gold);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 100;
}

/* Enhanced chip icon for prominent display */
.balance-display-prominent .chip-icon,
.header-balance-display .chip-icon {
    width: 24px;
    height: 24px;
    background-color: #fff;
    border-radius: 50%;
    border: 2px dashed var(--poker-black);
    display: inline-block;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.header-balance-display .chip-icon {
    background-color: var(--poker-gold);
    border-color: #fff;
}

/* Glowing animation for balance */
@keyframes balance-glow {
    0% {
        box-shadow: 0 0 20px rgba(241, 196, 15, 0.6), 
                    0 4px 15px rgba(0, 0, 0, 0.3);
    }
    100% {
        box-shadow: 0 0 30px rgba(241, 196, 15, 0.8), 
                    0 4px 15px rgba(0, 0, 0, 0.3),
                    0 0 40px rgba(241, 196, 15, 0.4);
    }
}

/* Balance update animation */
.balance-update {
    animation: balance-pulse 0.6s ease-out;
}

@keyframes balance-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .balance-display-prominent {
        font-size: 1.2rem;
        padding: 10px 16px;
        min-width: 120px;
    }
    
    .header-balance-display {
        font-size: 1rem;
        padding: 6px 12px;
        top: 10px;
        right: 10px;
    }
    
    .balance-display-prominent .chip-icon,
    .header-balance-display .chip-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .balance-display-prominent {
        font-size: 1.1rem;
        padding: 8px 14px;
    }
    
    .header-balance-display {
        font-size: 0.9rem;
        padding: 5px 10px;
    }
}

/* Version display */
.version-display {
  position: fixed;
  bottom: 10px;
  left: 10px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  background-color: rgba(0, 0, 0, 0.3);
  padding: 3px 8px;
  border-radius: 10px;
  z-index: 100;
  pointer-events: none;
}


/* Ensure side panels have proper z-index and pointer events */
.message-panel, .management-panel {
  z-index: 900;
  pointer-events: auto;
}

.message-handle, .management-handle {
  z-index: 901;
  pointer-events: auto;
}

/* Ensure clicks on the document body can be detected */
body {
  min-height: 100vh;
  position: relative;
}

/* Card tooltip */
.card-tooltip {
  position: fixed;
  transform: translate(-50%, -100%);
  background-color: rgba(0, 0, 0, 0.9);
  border-radius: 8px;
  padding: 10px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--poker-light-green);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.card-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -120%);
}

.tooltip-card {
  width: 40px;
  height: 56px;
  background: white;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  position: relative;
}

.tooltip-card.hearts, .tooltip-card.diamonds {
  color: var(--poker-red);
}

.tooltip-card.clubs, .tooltip-card.spades {
  color: var(--poker-black);
}

.tooltip-info {
  color: white;
  font-size: 0.9rem;
}

/* Tutorial styles */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

.tutorial-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.tutorial-content {
  background-color: var(--poker-dark-green);
  border-radius: 12px;
  padding: 20px;
  max-width: 90%;
  width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  border: 2px solid var(--poker-gold);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.tutorial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--poker-light-green);
  padding-bottom: 10px;
}

.tutorial-header h2 {
  color: var(--poker-gold);
  margin: 0;
}

.tutorial-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  min-height: auto;
  box-shadow: none;
}

.tutorial-step {
  margin-bottom: 20px;
}

.tutorial-step h3 {
  color: var(--poker-gold);
  margin-bottom: 10px;
}

.tutorial-step p {
  margin-bottom: 10px;
  line-height: 1.5;
}

.tutorial-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.tutorial-button {
  background-color: var(--poker-light-green);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 8px 15px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.tutorial-button:hover {
  background-color: var(--poker-green);
}

.tutorial-button.next {
  background-color: var(--poker-gold);
  color: var(--poker-black);
}

.tutorial-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
}

.tutorial-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  transition: background-color 0.3s;
}

.tutorial-dot.active {
  background-color: var(--poker-gold);
}

/* Light theme */
body.light-theme {
    background-color: #f0f0f0;
    color: var(--poker-black);
}

body.light-theme::before {
    background-color: rgba(255, 255, 255, 0.7);
}

body.light-theme .section {
    background-color: rgba(255, 255, 255, 0.8);
    border-color: var(--poker-light-green);
}

body.light-theme .log-container {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--poker-black);
    border-color: var(--poker-light-green);
}

body.light-theme .log-entry {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .player-info, 
body.light-theme .ai-info,
body.light-theme .game-info-compact {
    background-color: rgba(255, 255, 255, 0.7);
    color: var(--poker-black);
}

body.light-theme .settings-panel {
    background-color: white;
    color: var(--poker-black);
}

body.light-theme .settings-header h3 {
    color: var(--poker-dark-green);
}

body.light-theme .close-button {
    color: var(--poker-black);
}

body.light-theme .setting-item label {
    color: var(--poker-black);
}

/* Compact layout classes */
.compact-layout .section {
    padding: 10px;
    margin-bottom: 10px;
}

.compact-layout .poker-table {
    min-height: auto;
    padding: 15px;
}

.compact-layout .card-container {
    gap: 5px;
}

.compact-layout .game-info {
    padding: 8px;
}

.compact-layout .actions {
    gap: 4px;
}

/* More compact buttons for mobile */
@media (max-width: 480px) {
  button {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: calc(var(--font-size-sm) - 1px);
    min-height: 32px;
    letter-spacing: 0.5px;
  }
  
  .actions {
    gap: 3px;
  }
  
  .bet-input {
    margin-top: 3px;
  }
  
  #actionRaise {
    padding-left: var(--spacing-xs);
    padding-right: var(--spacing-xs);
  }
}

.compact-layout h2, .compact-layout h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    padding-bottom: 8px;
}

/* Readonly input styling */
input[readonly] {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--poker-light-green);
    color: var(--poker-gold);
    cursor: not-allowed;
}

/* User ID display */
#userId {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* Additional compact layout styles */
.game-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.actions-container h3 {
    margin-bottom: 10px;
    color: var(--poker-gold);
    border-bottom: 1px solid var(--poker-light-green);
    padding-bottom: 5px;
}

/* Improve touch targets while keeping compact */
button, input[type="number"] {
    min-height: 36px;
}

/* Collapsible sections for extreme space saving */
.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible-header::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.collapsed .collapsible-header::after {
    transform: rotate(-90deg);
}

.collapsible-content {
    transition: max-height 0.3s ease-out;
    overflow: hidden;
    max-height: 1000px;
}

.collapsed .collapsible-content {
    max-height: 0;
}

/* Optimize spacing */
.compact-layout .game-container {
    gap: 8px;
}

.compact-layout .card-container {
    gap: 3px;
}

.compact-layout .actions {
    gap: 5px;
}

.compact-layout .section {
    margin-bottom: 8px;
}

.compact-layout .poker-table {
    margin: 15px 0;
}

.compact-layout .ai-area {
    margin-bottom: 10px;
}

.compact-layout .player-area {
    margin-top: 10px;
}

.compact-layout .community-area {
    margin: 5px 0;
}

/* Advice button and container styles */
.advice-button {
  background-color: #3498db;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.advice-container {
  background-color: rgba(0, 0, 0, 0.7);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  margin-top: var(--spacing-md);
  border: 1px solid var(--poker-light-green);
  display: none;
  max-width: 100%;
  word-wrap: break-word;
}

.advice-container.visible {
  display: block;
}

.advice-content {
  font-style: italic;
  line-height: 1.5;
}

/* AI advice modal styling */
.advice-modal.ai {
    border-left: 4px solid #e74c3c;
    position: relative;
}

.advice-modal.ai h3 {
    color: #e74c3c;
}

.advice-modal.ai::before {
    content: "AI";
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #e74c3c;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.advice-content {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-top: 10px;
    margin-bottom: 15px;
    color: #f8f9fa;
}

/* Nickname Modal Styles */
.nickname-modal-content {
    max-width: 500px;
    text-align: center;
}

.nickname-form {
    text-align: left;
    margin-top: 20px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--poker-gold);
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border-radius: var(--border-radius);
    border: 2px solid var(--poker-light-green);
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
}

.color-selection {
    margin-bottom: 20px;
}

.color-selection label {
    display: block;
    margin-bottom: 10px;
    color: var(--poker-gold);
    font-weight: bold;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 200px;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.color-option:hover {
    transform: scale(1.1);
    border-color: var(--poker-gold);
}

.color-option.selected {
    border-color: var(--poker-gold);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.nickname-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Enhanced Leaderboard Styles */
.leaderboard-modal-content {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
    border-radius: 16px;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--poker-gold);
    padding-bottom: 15px;
    position: sticky;
    top: 0;
    background-color: var(--poker-dark-green);
    z-index: 10;
}

.leaderboard-header h3 {
    margin: 0;
    color: var(--poker-gold);
    font-size: 1.5rem;
}

.close-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--poker-red);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-button:hover {
    background-color: #c0392b;
    transform: scale(1.1);
}

.leaderboard-tabs {
    display: flex;
    gap: 2px;
    margin: 0 20px 25px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    background-color: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 60px;
    position: relative;
    text-align: center;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--poker-gold), #f39c12);
    color: var(--poker-black);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(241, 196, 15, 0.4);
}

.tab-btn:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-icon {
    font-size: 1.2rem;
    line-height: 1;
    display: block;
}

.tab-text {
    font-size: 0.75rem;
    font-weight: inherit;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.leaderboard-search {
    margin-bottom: 20px;
    position: relative;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-container input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border-radius: var(--border-radius);
    border: 2px solid var(--poker-light-green);
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: var(--poker-gold);
    box-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--poker-light-green);
    font-size: 1rem;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--poker-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

/* Improved Player Cards */
.player-card {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--poker-light-green);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.player-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--poker-gold);
}

.player-card:hover::before {
    opacity: 1;
}

.player-card-main {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas: "rank avatar info earnings";
    gap: 16px;
    align-items: center;
}

.player-rank-section {
    grid-area: rank;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.trophy-icon {
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.player-rank {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--poker-gold);
    text-align: center;
}

.player-avatar {
    grid-area: avatar;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.player-info {
    grid-area: info;
    min-width: 0; /* Allows text to truncate */
}

.player-nickname {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-item {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.player-earnings {
    grid-area: earnings;
    text-align: right;
    min-width: 80px;
}

.earnings-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--poker-gold);
    line-height: 1;
}

.earnings-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Rank-specific styling */
.player-card.rank-1 {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(0, 0, 0, 0.6));
}

.player-card.rank-2 {
    border-color: #c0c0c0;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(0, 0, 0, 0.6));
}

.player-card.rank-3 {
    border-color: #cd7f32;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), rgba(0, 0, 0, 0.6));
}

.no-players {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.7);
}

/* Pagination improvements */
.leaderboard-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 20px 0 10px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.pagination-controls {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 300px;
}

.pagination-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: var(--poker-light-green);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--poker-green);
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.1rem;
}

.page-info {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.last-updated {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Player details modal styles */
.player-details-modal h3 {
    color: var(--poker-gold);
    margin-bottom: 20px;
    text-align: center;
}

.player-details-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-child {
    border-bottom: none;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .leaderboard-modal-content {
        margin: 10px;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .leaderboard-header {
        padding: 10px 15px;
        margin-bottom: 15px;
    }
    
    .leaderboard-header h3 {
        font-size: 1.3rem;
    }
    
    .close-button {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
    
    .player-card {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .player-card-main {
        grid-template-columns: auto auto 1fr;
        grid-template-areas: 
            "rank avatar info"
            "earnings earnings earnings";
        gap: 12px;
    }
    
    .player-earnings {
        grid-area: earnings;
        text-align: center;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .player-avatar {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .player-nickname {
        font-size: 1rem;
    }
    
    .player-stats {
        gap: 8px;
    }
    
    .stat-item {
        font-size: 0.75rem;
        padding: 1px 6px;
    }
    
    .earnings-value {
        font-size: 1.2rem;
    }
    
    .pagination-controls {
        max-width: 250px;
    }
    
    .pagination-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .leaderboard-modal-content {
        margin: 5px;
        border-radius: 8px;
    }
    
    .player-card {
        padding: 10px;
    }
    
    .player-card-main {
        gap: 10px;
    }
    
    .player-rank-section {
        min-width: 40px;
    }
    
    .trophy-icon {
        font-size: 1.5rem;
    }
    
    .player-rank {
        font-size: 1rem;
    }
    
    .player-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .player-nickname {
        font-size: 0.95rem;
    }
    
    .stat-item {
        font-size: 0.7rem;
        padding: 1px 5px;
    }
    
    .earnings-value {
        font-size: 1.1rem;
    }
    
    .earnings-label {
        font-size: 0.65rem;
    }
    
    .pagination-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .btn-text {
        display: none;
    }
    
    .btn-icon {
        font-size: 1.2rem;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    .leaderboard-modal-content {
        max-height: 90vh;
    }
    
    .leaderboard-header {
        padding: 8px 15px;
        margin-bottom: 10px;
    }
    
    .player-card {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .leaderboard-pagination {
        margin: 15px 0 5px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .leaderboard-modal-content {
        margin: 2px;
        max-height: 99vh;
        border-radius: 8px;
    }
    
    .leaderboard-header {
        padding: 10px 12px 0;
        margin-bottom: 12px;
    }
    
    .leaderboard-header h3 {
        font-size: 1.2rem;
    }
    
    .close-button {
        width: 32px;
        height: 32px;
        font-size: 1.4rem;
    }
    
    .leaderboard-tabs {
        margin: 0 12px 15px;
        gap: 1px;
        padding: 2px;
    }
    
    .tab-btn {
        padding: 6px 2px;
        min-height: 40px;
        font-size: 0.7rem;
        gap: 1px;
        border-radius: 4px;
    }
    
    .tab-icon {
        font-size: 0.8rem;
    }
    
    .tab-text {
        font-size: 0.6rem;
        font-weight: 800;
        line-height: 0.9;
    }
    
    .leaderboard-search {
        margin: 0 12px 12px;
    }
    
    .search-container input {
        padding: 8px 8px 8px 30px;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    
    .search-icon {
        left: 8px;
        font-size: 0.8rem;
    }
    
    .leaderboard-list {
        margin: 0 12px 12px;
        gap: 6px;
        min-height: 200px;
    }
    
    .player-card {
        padding: 8px;
        gap: 6px;
        border-radius: 8px;
    }
    
    .player-card-header {
        gap: 8px;
        margin-bottom: 6px;
    }
    
    .trophy-icon, .player-rank {
        font-size: 1rem;
        min-width: 25px;
    }
    
    .player-avatar {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .player-nickname {
        font-size: 0.9rem;
        margin-bottom: 3px;
    }
    
    .player-stats {
        gap: 4px;
    }
    
    .stat-item {
        font-size: 0.6rem;
        padding: 1px 4px;
        border-radius: 6px;
    }
    
    .player-earnings {
        font-size: 1rem;
        min-width: 50px;
    }
    
    .leaderboard-pagination {
        margin: 0 12px 12px;
        padding: 8px 0;
        gap: 8px;
    }
    
    .pagination-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
        border-radius: 6px;
    }
    
    .page-info {
        font-size: 0.8rem;
    }
    
    .last-updated {
        padding: 0 12px 12px;
        font-size: 0.65rem;
    }
    
    .no-players {
        padding: 40px 15px;
        font-size: 0.9rem;
    }
    
    .no-players p {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
}

@media (max-width: 360px) {
    .leaderboard-modal-content {
        margin: 1px;
        border-radius: 6px;
    }
    
    .leaderboard-header h3 {
        font-size: 1.1rem;
    }
    
    .leaderboard-tabs {
        margin: 0 10px 12px;
        padding: 2px;
    }
    
    .tab-btn {
        padding: 6px 2px;
        min-height: 45px;
        font-size: 0.7rem;
        gap: 1px;
        border-radius: 4px;
    }
    
    .tab-icon {
        font-size: 0.9rem;
    }
    
    .tab-text {
        font-size: 0.6rem;
        font-weight: 900;
        line-height: 0.9;
    }
    
    .player-card {
        padding: 6px;
    }
    
    .player-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .player-nickname {
        font-size: 0.85rem;
    }
    
    .stat-item {
        font-size: 0.55rem;
        padding: 1px 3px;
    }
    
    .player-earnings {
        font-size: 0.9rem;
    }
    
    .pagination-btn {
        padding: 5px 8px;
        font-size: 0.7rem;
    }
}

/* AI Settings Modal Styles */
.ai-settings-modal .modal-content {
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
    border-radius: 12px;
}

.ai-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid var(--poker-gold);
    background: linear-gradient(135deg, var(--poker-dark-green), var(--poker-light-green));
    border-radius: 12px 12px 0 0;
}

.ai-settings-header h3 {
    margin: 0;
    color: var(--poker-gold);
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--poker-gold);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    min-height: auto;
    box-shadow: none;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.ai-settings-form {
    padding: 25px;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-title {
    display: block;
    font-weight: bold;
    color: var(--poker-gold);
    margin-bottom: 8px;
    font-size: 14px;
}

.setting-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--poker-light-green);
    border-radius: 8px;
    background-color: var(--poker-dark-green);
    color: var(--poker-white);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.setting-select:focus {
    outline: none;
    border-color: var(--poker-gold);
    box-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
}

.setting-select:hover {
    border-color: var(--poker-gold);
}

.setting-select option {
    background-color: var(--poker-dark-green);
    color: var(--poker-white);
    padding: 8px;
}

.ai-settings-actions {
    padding: 20px 25px;
    border-top: 1px solid var(--poker-light-green);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
}

.ai-settings-actions button {
    min-width: 120px;
    padding: 10px 20px;
}

/* AI Settings Preview in Management Panel */
.ai-settings-preview {
    margin-top: 10px;
    padding: 10px 12px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border-left: 3px solid var(--poker-gold);
}

.ai-settings-preview small {
    color: var(--poker-light-green);
    font-size: 12px;
    line-height: 1.4;
    display: block;
}

/* Enhanced setting sections in management panel */
.setting-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-section:first-child {
    margin-top: 15px;
    border-top: none;
    padding-top: 0;
}

.setting-section h4 {
    color: var(--poker-gold);
    margin-bottom: 12px;
    font-size: 0.95rem;
    font-weight: 600;
}

/* AI Settings Button */
#aiSettingsButton {
    margin-bottom: 10px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

#aiSettingsButton:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ai-settings-modal .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 20px 10px;
    }
    
    .ai-settings-header {
        padding: 15px 20px;
    }
    
    .ai-settings-header h3 {
        font-size: 1.2rem;
    }
    
    .ai-settings-form {
        padding: 20px;
    }
    
    .ai-settings-actions {
        flex-direction: column;
        padding: 15px 20px;
    }
    
    .ai-settings-actions button {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .ai-settings-actions button:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .ai-settings-modal .modal-content {
        width: 98%;
        margin: 10px 5px;
    }
    
    .ai-settings-header {
        padding: 12px 15px;
    }
    
    .ai-settings-form {
        padding: 15px;
    }
    
    .setting-group {
        margin-bottom: 15px;
    }
    
    .setting-select {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .leaderboard-modal-content {
        max-height: 95vh;
    }
    
    .leaderboard-header {
        padding: 8px 15px 0;
        margin-bottom: 10px;
    }
    
    .leaderboard-tabs {
        margin-bottom: 10px;
    }
    
    .tab-btn {
        min-height: 40px;
        padding: 6px 4px;
    }
    
    .tab-icon {
        font-size: 0.9rem;
    }
    
    .tab-text {
        font-size: 0.6rem;
    }
    
    .leaderboard-search {
        margin-bottom: 10px;
    }
    
    .leaderboard-list {
        min-height: 150px;
        margin-bottom: 10px;
    }
    
    .player-card {
        padding: 6px;
    }
    
    .leaderboard-pagination {
        margin-bottom: 10px;
        padding: 6px 0;
    }
}

/* Desktop enhancements */
@media (min-width: 1024px) {
    .leaderboard-tabs {
        margin: 0 30px 30px;
        padding: 6px;
        border-radius: 12px;
    }
    
    .tab-btn {
        padding: 15px 12px;
        min-height: 70px;
        font-size: 0.9rem;
        gap: 6px;
        border-radius: 10px;
    }
    
    .tab-icon {
        font-size: 1.4rem;
    }
    
    .tab-text {
        font-size: 0.8rem;
    }
}

/* Enhanced Player Details Modal - Compact Grid */
.player-details-modal {
  max-width: 450px;
  padding: 0;
}

.player-details-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
  border-bottom: 1px solid var(--poker-light-green);
  margin-bottom: 15px;
}

.player-details-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.5rem;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.player-details-info h3 {
  margin: 0 0 8px 0;
  color: var(--poker-gold);
  font-size: 1.4rem;
}

.player-rank-badge {
  background: linear-gradient(135deg, var(--poker-gold), #f39c12);
  color: var(--poker-black);
  padding: 4px 12px;
  border-radius: 15px;
  font-weight: bold;
  font-size: 0.8rem;
  display: inline-block;
}

.player-details-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 20px 20px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
  border-radius: 8px;
  padding: 12px;
  border: 1px solid var(--poker-light-green);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
  min-height: 80px;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: var(--poker-gold);
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.stat-content {
  width: 100%;
}

.stat-value {
  font-size: 1rem;
  font-weight: bold;
  color: var(--poker-gold);
  line-height: 1.2;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .player-details-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .player-details-header {
    padding: 15px;
    gap: 12px;
  }
  
  .player-details-avatar {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
  
  .player-details-info h3 {
    font-size: 1.2rem;
  }
  
  .stat-card {
    padding: 10px;
    min-height: 70px;
  }
  
  .stat-icon {
    font-size: 1.2rem;
  }
  
  .stat-value {
    font-size: 0.9rem;
  }
}
