/**
 * Arena Mobile Styles - Portrait Mode Support
 *
 * Mobile-first responsive design for Poker Shark Training Arena.
 * Implements portrait layout with:
 * - Fixed bottom action bar
 * - Vertical table layout (villains top, hero bottom)
 * - Enhanced touch targets (48px minimum)
 * - Collapsible panels
 *
 * Breakpoints:
 * - Phone portrait: max-width 480px
 * - Phone landscape / small tablet: 481px - 768px
 * - Tablet: 769px - 1024px
 */

/* ============================================
   DESKTOP DEFAULTS - Hide mobile-only elements
   ============================================ */

/* Hide mobile elements on desktop */
#mobile-menu-toggle,
.hand-history-backdrop,
.hand-history-close-btn {
    display: none;
}

/* Hide hand-history-header on desktop (no text/toggle, only mobile close btn) */
.hand-history-header {
    display: none;
}

/* ============================================
   MOBILE PORTRAIT MODE (max-width: 480px)
   Primary mobile phone layout
   ============================================ */

/* ============================================
   MOBILE/TABLET - Hide chrome for table focus
   Applies to all screens 768px and below
   ============================================ */

@media (max-width: 768px) {
    /* ========== HIDE TOP BARS FOR FULL TABLE FOCUS ========== */
    /* Hide site header (POKER SHARK logo bar) */
    .header {
        display: none !important;
    }

    /* Hide main navigation tabs */
    .main-nav {
        display: none !important;
    }

    /* Hide sub navigation */
    .sub-nav {
        display: none !important;
    }

    /* Hide arena stats bar */
    .arena-stats-bar {
        display: none !important;
    }

    /* ========== HIDE SIDE PANELS ========== */
    /* Hide battle log */
    .battle-log {
        display: none !important;
    }

    /* Hide arena side panel */
    .arena-side-panel {
        display: none !important;
    }

    /* Hide stats panel */
    .stats-panel {
        display: none !important;
    }

    /* Hide hand rankings */
    .hand-rankings-toggle,
    .hand-rankings-panel {
        display: none !important;
    }

    /* Hide desktop action panel (use mobile action bar instead) */
    .action-panel-right {
        display: none !important;
    }

    /* ========== FULL SCREEN TABLE ========== */
    /* Tab panel takes full screen */
    .tab-panel {
        position: fixed !important;
        inset: 0 !important;
        overflow: visible !important;
    }

    /* Game container fills available space */
    .game-container {
        height: 100vh !important;
        height: 100dvh !important;
        padding: 0 !important;
    }

    /* Table wrapper fills screen */
    .table-wrapper {
        padding: 8px 16px 160px;
        height: 100%;
        overflow: visible;
    }

    /* Poker table maximized */
    .poker-table {
        max-height: calc(100vh - 220px);
        max-height: calc(100dvh - 220px);
    }

    /* Hide settings button on mobile - accessible via menu toggle */
    .arena-settings-btn {
        display: none !important;
    }


    /* ========== MOBILE MENU TOGGLE ========== */
    #mobile-menu-toggle {
        display: flex !important;
        position: fixed;
        top: 8px;
        left: 8px;
        width: 48px;
        height: 48px;
        border-radius: 10px;
        background: rgba(0, 0, 0, 0.5);
        border: none;
        padding: 0;
        align-items: center;
        justify-content: center;
        z-index: 1001;
        cursor: pointer;
        transition: opacity 0.2s ease;
    }

    #mobile-menu-toggle:active {
        opacity: 0.7;
    }

    /* Show hamburger by default, hide close icon */
    #mobile-menu-toggle .menu-icon-close {
        display: none;
    }

    /* When menu is open, show close icon, hide hamburger */
    #mobile-menu-toggle.menu-open .menu-icon-hamburger {
        display: none;
    }

    #mobile-menu-toggle.menu-open .menu-icon-close {
        display: block;
    }

    /* ========== MENU VISIBLE STATE ========== */
    /* When body has .mobile-menu-visible, show header and nav as overlays */
    body.mobile-menu-visible .header {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        padding-left: 56px;
    }

    body.mobile-menu-visible .main-nav {
        display: flex !important;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        z-index: 1000;
    }

/* Toggle button highlight when menu is open */
    #mobile-menu-toggle.menu-open {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ============================================
   PHONE PORTRAIT (max-width: 480px)
   Additional optimizations for small screens
   ============================================ */

@media (max-width: 480px) {
    /* Override action bar height variable for phone portrait (bar is 110px) */
    :root {
        --action-bar-height: 110px;
    }

    /* Table wrapper: add perspective for 3D, tighter bottom padding for phone */
    .table-wrapper {
        perspective: 800px;
        padding: 8px 16px 150px;
    }

    /* Poker table: subtle 3D oval for phone portrait */
    .poker-table {
        transform: perspective(800px) rotateX(6deg) scaleY(0.99);
        transform-origin: center bottom;
        max-width: 100%;
        width: 100%;
        aspect-ratio: 1 / 0.95 !important;
        border-radius: 44% / 40% !important;
        margin: 0 auto;
    }

    /* ========== HERO SEAT (Bottom Center) ========== */
    .player-seat.hero,
    .player-seat.seat-0 {
        position: fixed;
        bottom: calc(var(--action-bar-height, 100px) + 8px);
        left: 50%;
        transform: translateX(-50%);
        z-index: var(--z-modal);
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }

    .player-seat.hero .player-portrait {
        width: var(--portrait-size-mobile-hero, 64px);
        height: var(--portrait-size-mobile-hero, 64px);
        order: 1;
    }

    /* Hero nameplate badge below portrait */
    .player-seat.hero .player-nameplate {
        display: flex !important;
        order: 2;
        min-width: auto !important;
        max-width: none !important;
        padding: 2px 10px !important;
        border-radius: 10px !important;
        background: rgba(12, 16, 24, 0.9) !important;
        border: 1px solid rgba(var(--hero-nameplate-gold-rgb, 180, 155, 80), 0.5) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
        gap: 4px !important;
    }

    .player-seat.hero .player-nameplate .player-name {
        display: none !important;
    }

    .player-seat.hero .player-nameplate .player-stack {
        font-family: var(--font-family-mono, monospace) !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        color: #fff !important;
    }

    .player-seat.hero .cards-container {
        order: 3;
        flex-direction: row;
        gap: 4px;
        margin-top: 2px;
    }

    .player-seat.hero .cards-container .card {
        width: 60px;
        height: 84px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
                    0 0 20px rgba(255, 215, 0, 0.15);
        border-radius: 6px;
    }

    .player-seat.hero .cards-container .card + .card {
        margin-left: -8px;
    }

    /* ========== VILLAIN SEATS (Top Arc) ========== */
    /* Reposition villains to top portion of screen */
    .player-seat.seat-1,
    .player-seat.seat-2,
    .player-seat.seat-3,
    .player-seat.seat-4,
    .player-seat.seat-5 {
        position: absolute;
        transform: scale(0.75);
    }

    /* Seat 3: Top center (directly across from hero) */
    .player-seat.seat-3 {
        top: -30px;
        left: 50%;
        transform: translateX(-50%) scale(0.8);
    }

    /* Seat 2: Top left */
    .player-seat.seat-2 {
        top: 10%;
        left: 14%;
        transform: scale(0.7);
    }

    /* Seat 4: Top right */
    .player-seat.seat-4 {
        top: 10%;
        right: 14%;
        left: auto;
        transform: scale(0.7);
    }

    /* Seat 1: Mid left */
    .player-seat.seat-1 {
        top: 52%;
        left: 10%;
        bottom: auto;
        transform: scale(0.7);
    }

    /* Seat 5: Mid right */
    .player-seat.seat-5 {
        top: 52%;
        right: 10%;
        left: auto;
        bottom: auto;
        transform: scale(0.7);
    }

    /* Villain portrait sizing */
    .player-seat:not(.hero) .player-portrait {
        width: var(--portrait-size-mobile-villain, 48px);
        height: var(--portrait-size-mobile-villain, 48px);
    }

    /* Villain nameplates - compact */
    .player-seat:not(.hero) .player-nameplate {
        min-width: 60px;
        max-width: 80px;
        padding: 3px 8px;
        font-size: 9px;
    }

    /* Seat 3 (top center): push nameplate down closer to table edge */
    .player-seat.seat-3 .player-nameplate {
        margin-top: 20px;
    }

    /* Side seats: nameplate below portrait (normal flow, not absolute side) */
    .player-seat.seat-1 .player-nameplate,
    .player-seat.seat-2 .player-nameplate,
    .player-seat.seat-4 .player-nameplate,
    .player-seat.seat-5 .player-nameplate {
        position: static;
        transform: none;
        white-space: nowrap;
        max-width: none !important;
        min-width: auto !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        padding: 2px 8px !important;
        margin-top: 2px;
    }

    /* Villain cards - smaller */
    .player-seat:not(.hero) .card {
        width: 28px;
        height: 40px;
    }

    /* ========== BOARD AREA - Centered Display ========== */
    .board-area {
        top: 44%;
        transform: translate(-50%, -50%);
        z-index: 10;
    }

    .board-cards {
        gap: 5px;
        transform: none;
        padding: 8px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 12px;
    }

    .board-cards .card {
        width: 56px;
        height: 78px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        border-radius: 5px;
    }

    .board-cards .card .rank {
        font-size: 26px;
    }

    .board-cards .card .suit {
        font-size: 24px;
    }

    /* Flop group spacing */
    .board-cards .flop-group {
        gap: 3px;
        padding-right: 8px;
        margin-right: 4px;
    }

    .board-cards .turn-card {
        padding-right: 8px;
        margin-right: 4px;
    }

    /* ========== POT DISPLAY - Compact for mobile ========== */
    .pot-display {
        font-size: 15px;
        font-weight: 600;
        padding: 6px 12px;
        background: rgba(0, 0, 0, 0.45);
        border-radius: 8px;
        margin-bottom: 4px;
        gap: 4px;
    }

    .pot-value {
        color: var(--color-gold, #ffd700);
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }

    /* ========== STREET INDICATOR ========== */
    .street-indicator {
        top: 5% !important;
        font-size: 10px !important;
        padding: 3px 8px !important;
        opacity: 0.7;
    }

    /* ========== DEALER BUTTON ========== */
    .dealer-button {
        width: 20px;
        height: 20px;
    }

    /* ========== HIDE NON-ESSENTIAL ELEMENTS ========== */
    /* Decision context hidden by default on mobile */
    .decision-context {
        display: none;
    }

    /* Game controls move to bottom action bar */
    .game-controls {
        display: none;
    }

    /* ========== MOBILE BET DISPLAYS ========== */
    /* Repositioned for tighter mobile oval */
    .bet-display .bet-amount {
        font-size: 11px;
    }

    /* Seat 0 (hero) - bottom center */
    .bet-display.bet-seat-0 {
        bottom: 18% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    /* Seat 1 - lower-left, inward from seat */
    .bet-display.bet-seat-1 {
        bottom: 28% !important;
        left: 18% !important;
        top: auto !important;
    }

    /* Seat 2 - upper-left, inward from seat */
    .bet-display.bet-seat-2 {
        top: 28% !important;
        left: 18% !important;
        bottom: auto !important;
    }

    /* Seat 3 - top center */
    .bet-display.bet-seat-3 {
        top: 20% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    /* Seat 4 - upper-right, inward from seat */
    .bet-display.bet-seat-4 {
        top: 28% !important;
        right: 18% !important;
        left: auto !important;
        flex-direction: row-reverse;
    }

    /* Seat 5 - lower-right, inward from seat */
    .bet-display.bet-seat-5 {
        bottom: 28% !important;
        right: 18% !important;
        left: auto !important;
        top: auto !important;
        flex-direction: row-reverse;
    }

    /* ========== MOBILE CHIP SIZING ========== */
    /* Scale down seat chip stacks */
    .chip-stack {
        width: 36px !important;
        height: 32px !important;
        min-height: 32px !important;
    }

    .chip-bundle-img,
    .seat-chip-bundle-img {
        width: 22px !important;
        max-height: 36px !important;
    }

    /* Hero chip stack slightly smaller */
    .bet-display.bet-seat-0 .chip-bundle-img,
    .bet-display.bet-seat-0 .seat-chip-bundle-img {
        width: 20px !important;
        max-height: 32px !important;
    }

    /* Scale down pot chip stack */
    .pot-chip-stack {
        width: 70px !important;
        height: 55px !important;
        min-height: 55px !important;
    }

    .pot-chip-stack .chip-bundle-img {
        width: 32px !important;
        max-height: 50px !important;
    }

    /* Villain felt panel - fullscreen on mobile */
    .villain-felt-panel {
        position: fixed;
        inset: 0;
        border-radius: 0;
        z-index: var(--z-modal);
    }
}

/* ============================================
   MOBILE LANDSCAPE (481px - 768px, landscape)
   ============================================ */

@media (min-width: 481px) and (max-width: 768px) and (orientation: landscape) {
    .table-wrapper {
        padding: 80px 16px 120px;
    }

    .poker-table {
        max-height: calc(100vh - 180px);
    }

    /* Action bar is narrower in landscape */
    .mobile-action-bar {
        height: 80px;
    }
}

/* ============================================
   PORTRAIT ORIENTATION DETECTION
   ============================================ */

@media (orientation: portrait) and (max-width: 768px) {
    /* Force portrait-optimized layout */
    body {
        overflow: hidden;
    }

    .app-container {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile */
    }

    /* Ensure safe area insets for notched phones */
    .mobile-action-bar {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
}

/* ============================================
   TOUCH TARGET ENHANCEMENTS
   All interactive elements >= 48px
   ============================================ */

@media (max-width: 768px) {
    /* Action buttons */
    .action-btn {
        min-height: var(--touch-target-min, 48px);
        font-size: 16px; /* Prevent iOS zoom on focus */
        padding: 12px 16px;
    }

    /* Size buttons */
    .size-btn,
    .quick-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 12px;
    }

    /* Game buttons */
    .game-btn {
        min-height: var(--touch-target-min, 48px);
        padding: 12px 16px;
    }

    /* Slider thumb */
    .slider-thumb {
        width: var(--slider-thumb-size-mobile, 28px);
        height: var(--slider-thumb-size-mobile, 28px);
    }

    /* Slider track taller for easier grabbing */
    .slider-track {
        height: var(--slider-track-height-mobile, 12px);
    }

    /* Arena buttons (settings, shop) */
    .arena-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }

    /* Player portraits - minimum touch target */
    .player-portrait {
        min-width: 44px;
        min-height: 44px;
    }

    /* Collapsible headers */
    .collapsible-header {
        min-height: 44px;
        padding: 12px;
    }

    /* Quick bet buttons need adequate spacing */
    .slider-quick-buttons {
        gap: 8px;
    }

    .slider-quick-buttons .quick-btn {
        min-width: 48px;
        font-size: 12px;
    }
}

/* ============================================
   TABLET PORTRAIT (769px - 1024px)
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    .table-wrapper {
        padding: 100px 24px;
    }

    /* Slightly reduced table perspective */
    .poker-table {
        transform: perspective(1000px) rotateX(10deg) scaleY(0.99) translateY(-30px);
    }

    /* Reduced seat positions */
    .player-seat.hero,
    .player-seat.seat-0 {
        bottom: -160px;
    }

    .player-seat.seat-3 {
        top: -120px;
    }
}

/* ============================================
   MOBILE STATS BAR - Auto-collapse
   ============================================ */

@media (max-width: 768px) {
    .arena-stats-bar {
        /* Compact on mobile by default */
        min-width: auto;
        gap: 8px;
        padding: 8px 12px;
        top: 4px;
        max-width: calc(100vw - 16px);
    }

    /* Hide progress bar on small screens */
    .arena-stats-bar .arena-progress-container {
        display: none;
    }

    /* Hide equipped items on mobile */
    .arena-stats-bar .arena-equipped-items {
        display: none;
    }

    /* Compact level badge */
    .arena-level-badge {
        padding: 4px 8px;
        gap: 4px;
    }

    .level-number {
        font-size: 0.9rem;
    }

    .level-text {
        display: none;
    }

    /* Compact stats */
    .arena-stat-label {
        font-size: 8px;
        letter-spacing: 0.08em;
    }

    .arena-stat-value {
        font-size: 0.85rem;
    }

    /* Show expand indicator */
    .arena-stats-bar::after {
        content: '···';
        color: var(--text-alpha-muted);
        font-size: 14px;
        letter-spacing: 2px;
        margin-left: auto;
    }

    /* Expanded state on tap */
    .arena-stats-bar.expanded {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        flex-wrap: wrap;
        padding: 12px 16px;
        z-index: var(--z-toast);
    }

    .arena-stats-bar.expanded .arena-progress-container,
    .arena-stats-bar.expanded .arena-equipped-items {
        display: flex;
    }

    .arena-stats-bar.expanded::after {
        content: '×';
        font-size: 18px;
    }
}

/* ============================================
   HAND HISTORY - Slide-in Panel on Mobile
   ============================================ */

@media (max-width: 768px) {
    /* Hide battle log but keep side panel for hand history */
    .arena-side-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 0;
        overflow: visible;
        background: transparent;
        border: none;
        z-index: var(--z-modal);
    }

    .battle-log {
        display: none;
    }


    /* Hand history panel - slide in from right */
    .hand-history-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 85%;
        max-width: 360px;
        background: var(--bg-panel);
        z-index: var(--z-modal);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        border-left: 1px solid var(--border-subtle);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
    }

    .hand-history-panel.mobile-expanded {
        transform: translateX(0);
    }

    /* Backdrop when panel is open */
    .hand-history-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: calc(var(--z-modal) - 1);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .hand-history-backdrop.visible {
        display: block;
        opacity: 1;
    }

    /* Mobile header with close button */
    .hand-history-panel .hand-history-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        border-bottom: 1px solid var(--border-subtle);
        min-height: 56px;
    }

    .hand-history-panel .hand-history-header span:first-child {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-light);
    }

    /* Hide the default toggle arrow on mobile */
    .hand-history-panel .hand-history-toggle {
        display: none;
    }

    /* Mobile close button inside panel */
    .hand-history-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: transparent;
        border: 1px solid var(--border-subtle);
        color: var(--text-muted);
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .hand-history-close-btn:hover,
    .hand-history-close-btn:active {
        background: var(--bg-glass);
        color: var(--text-light);
    }

    /* Content area scrollable */
    .hand-history-panel .hand-history-content {
        flex: 1;
        overflow-y: auto;
        padding: 12px;
        -webkit-overflow-scrolling: touch;
    }

    /* Improve hand history entries for touch */
    .hand-entry {
        padding: 12px;
        margin-bottom: 8px;
        min-height: 48px;
    }
}

/* ============================================
   SIZING SECTION - Mobile Layout
   ============================================ */

@media (max-width: 768px) {
    .sizing-section {
        flex-wrap: wrap;
        padding: 8px;
        gap: 8px;
    }

    /* Stack sizing grids */
    .sizing-grid {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Bet slider container - full width */
    .bet-slider-container {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    /* Slider quick buttons - wrap on mobile */
    .slider-quick-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Hide overbet container on very small screens */
    @media (max-width: 380px) {
        .overbet-container {
            display: none;
        }
    }
}

/* ============================================
   GAME CONTAINER - Mobile Reflow
   ============================================ */

@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        padding: 8px;
        gap: 8px;
    }

    /* Session stats panel - horizontal on mobile */
    .session-stats {
        width: 100%;
        margin-bottom: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }

    .stat-box {
        padding: 4px;
    }

    .stat-box-label {
        font-size: 8px;
    }

    .stat-box-value {
        font-size: var(--font-size-xs);
    }
}

/* ============================================
   REDUCED MOTION - Mobile Performance
   ============================================ */

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    /* Disable all animations on mobile with reduced motion */
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   SAFE AREA INSETS (Notch Support)
   ============================================ */

@supports (padding: env(safe-area-inset-bottom)) {
    @media (max-width: 768px) {
        .mobile-action-bar {
            padding-bottom: calc(12px + env(safe-area-inset-bottom));
        }

        .arena-stats-bar {
            padding-top: calc(8px + env(safe-area-inset-top));
        }
    }
}

/* ============================================
   MOBILE ACTION BAR - Fixed Bottom Controls
   ============================================ */

.mobile-action-bar {
    display: none; /* Hidden by default, shown via media query */
}

@media (max-width: 768px) {
    /* Hide the original action buttons container on mobile */
    .action-buttons:not(.mobile-action-bar .action-buttons) {
        display: none;
    }

    /* Show mobile action bar */
    .mobile-action-bar {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--action-bar-height, 100px);
        background: linear-gradient(180deg, rgba(18, 25, 38, 0.97) 0%, rgba(8, 12, 22, 0.99) 100%);
        backdrop-filter: blur(16px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding: var(--action-bar-padding, 12px);
        padding-bottom: calc(var(--action-bar-padding, 12px) + env(safe-area-inset-bottom, 0px));
        z-index: var(--z-modal);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
        gap: 8px;
    }

    /* Hero stack display in action bar - hidden (shown as badge on portrait instead) */
    .mobile-hero-stack {
        display: none;
    }

    /* Action buttons row - horizontal layout */
    .mobile-action-bar .action-buttons-row {
        display: flex;
        flex-direction: row;
        gap: 8px;
        flex: 1;
    }

    /* Action buttons - full width in mobile bar */
    .mobile-action-bar .action-btn {
        flex: 1;
        min-height: var(--touch-target-min, 48px);
        font-size: 14px;
        font-weight: var(--font-weight-bold);
        text-transform: uppercase;
        letter-spacing: 0.08em;
        border-radius: var(--radius-md);
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* FOLD button */
    .mobile-action-bar .action-btn.fold {
        flex: 0.8; /* Slightly narrower */
    }

    /* CHECK/CALL button */
    .mobile-action-bar .action-btn.check,
    .mobile-action-bar .action-btn.call {
        flex: 1;
    }

    /* BET/RAISE button - wider to accommodate amount */
    .mobile-action-bar .action-btn.bet,
    .mobile-action-bar .action-btn.raise {
        flex: 1.2;
    }

    /* All-in gets prominent styling */
    .mobile-action-bar .action-btn.allin {
        animation: allInButtonPulse 2s ease-in-out infinite;
    }

    /* Raise size popup - hidden by default, appears above action bar */
    .raise-size-popup {
        display: none;
        position: absolute;
        bottom: 100%;
        left: 0;
        right: 0;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        background: rgba(10, 16, 20, 0.95);
        border-top: 1px solid rgba(0, 212, 255, 0.15);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .raise-size-popup.open {
        display: flex;
    }

    /* Raise size buttons - single inline row */
    .raise-size-buttons {
        display: flex;
        flex-direction: row;
        gap: 6px;
        flex: 1;
        justify-content: flex-end;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .raise-size-buttons .quick-bet-btn {
        padding: 6px 10px;
        font-size: 11px;
        font-weight: var(--font-weight-bold);
        background: rgba(20, 25, 30, 0.8);
        border: 1px solid rgba(0, 212, 255, 0.2);
        border-radius: var(--radius-sm);
        color: rgba(0, 212, 255, 0.7);
        cursor: pointer;
        transition: all var(--duration-quick) var(--ease-in-out);
        text-transform: uppercase;
        min-height: 32px;
        min-width: 40px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .raise-size-buttons .quick-bet-btn:hover,
    .raise-size-buttons .quick-bet-btn:active {
        background: rgba(0, 212, 255, 0.15);
        border-color: rgba(0, 212, 255, 0.5);
        color: var(--color-cyan);
    }

    /* All-in quick bet */
    .raise-size-buttons .quick-bet-btn.allin {
        background: rgba(0, 228, 184, 0.15);
        border-color: rgba(0, 228, 184, 0.4);
        color: #00e4b8;
    }

    /* Overbet quick bet */
    .raise-size-buttons .quick-bet-btn.overbet {
        background: rgba(255, 170, 0, 0.1);
        border-color: rgba(255, 170, 0, 0.3);
        color: rgba(255, 170, 0, 0.8);
    }

    /* Turn indicator in mobile bar */
    .mobile-action-bar .turn-indicator {
        text-align: center;
        padding: 6px 12px;
        font-size: 12px;
        margin-bottom: 4px;
    }

    /* Disabled state */
    .mobile-action-bar.disabled {
        opacity: 0.6;
        pointer-events: none;
    }

    .mobile-action-bar.disabled .action-btn {
        pointer-events: none;
    }

    /* Waiting state - show waiting message */
    .mobile-action-bar.waiting .action-buttons-row {
        opacity: 0.5;
    }

    .mobile-action-bar.waiting .raise-size-popup {
        display: none;
    }
}

/* ============================================
   MOBILE ACTION BAR - Phone Specific (< 480px)
   ============================================ */

@media (max-width: 480px) {
    .mobile-action-bar {
        height: 110px;
        padding: 10px 12px;
    }

    .mobile-action-bar .action-btn {
        font-size: 15px;
        min-height: 52px;
    }

    .raise-size-buttons {
        gap: 4px;
    }

    .raise-size-buttons .quick-bet-btn {
        padding: 5px 8px;
        font-size: 10px;
        min-width: 36px;
        min-height: 30px;
    }
}

/* ============================================
   MOBILE ACTION BAR - Landscape Mode
   ============================================ */

@media (max-width: 768px) and (orientation: landscape) {
    .mobile-action-bar {
        height: 70px;
        flex-direction: row;
        padding: 8px 16px;
    }

    .raise-size-popup {
        flex: 1;
        height: auto;
    }

    .mobile-action-bar .action-buttons-row {
        flex: 1.5;
    }

    .mobile-action-bar .action-btn {
        min-height: 40px;
    }
}
