.session-control-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.session-control-modal {
    background: #2a2a2a;
    border: 2px solid #555;
    border-radius: 8px;
    width: 90%;
    max-width: 800px; /* Increased from 500px for debugging section */
    color: white;
    overflow-y: scroll;
    overflow-x: hidden;
    padding: 15px;
    max-height: 95vh; /* Ensure it fits in viewport */
}

.session-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.session-control-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.session-control-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.session-stats-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.session-stats-table th,
.session-stats-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #444;
}

.session-stats-table th {
    background: #333;
    font-weight: 600;
}

.hero-row {
    background: rgba(74, 144, 164, 0.2);
}

.profit-positive {
    color: #27ae60;
}

.profit-negative {
    color: #e74c3c;
}

.hero-indicator {
    font-size: 12px;
    color: #4a90a4;
    margin-left: 5px;
}

/* ===== NEW CUSTOM HAND DEBUGGING STYLES ===== */

/* Section Headers */
.session-control-content h3 {
    color: #fff;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid #555;
    padding-bottom: 8px;
}

.session-control-content h4 {
    color: #ccc;
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 500;
}

/* Custom Hand Container */
.custom-hand-container {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid #555;
}

/* All Seats Configuration Table */
.all-seats-config {
    margin-bottom: 25px;
}

.hands-config-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    margin: 15px 0;
}

.hands-config-table th {
    background: #333;
    color: #fff;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid #444;
    font-size: 0.9rem;
}

.hands-config-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #333;
    text-align: center;
}

.hand-config-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.hero-config-row {
    background: rgba(74, 144, 164, 0.15);
}

.seat-cell {
    min-width: 80px;
    font-size: 0.9rem;
}

.card-cell {
    min-width: 140px;
}

.stack-cell {
    min-width: 80px;
}

/* Card Dropdowns */
.card-dropdowns {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.rank-select,
.suit-select {
    background: #444;
    border: 1px solid #666;
    color: #fff;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    min-width: 50px;
}

.rank-select:focus,
.suit-select:focus {
    outline: none;
    border-color: #4a90a4;
    box-shadow: 0 0 0 1px rgba(74, 144, 164, 0.3);
}

.clear-card-btn {
    background: #e74c3c;
    border: none;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.clear-card-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Stack Input in Table */
.stack-input-table {
    width: 70px;
    padding: 4px 6px;
    background: #333;
    border: 1px solid #666;
    border-radius: 3px;
    color: #fff;
    font-size: 0.8rem;
    text-align: center;
}

.stack-input-table:focus {
    outline: none;
    border-color: #4a90a4;
    box-shadow: 0 0 0 1px rgba(74, 144, 164, 0.3);
}

/* Debug Label */
.debug-label {
    display: block;
    color: #ccc;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* Hand Presets */
.hand-presets {
    margin-bottom: 20px;
}

.preset-hands {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    justify-content: center;
}

.preset-btn {
    background: #34495e;
    border: 1px solid #5a6c7d;
    color: #ecf0f1;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 40px;
}

.preset-btn:hover {
    background: #4a5f7a;
    transform: translateY(-1px);
}

/* Debug Execution */
.debug-execution {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.debug-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.debug-btn-primary {
    background: #5ea514;
    color: #fff;
    font-size: 1rem;
    padding: 12px 24px;
    font-weight: 600;
}

.debug-btn-primary:hover {
    background: #f39c12;
    transform: translateY(-2px);
}

.debug-btn-secondary {
    background: #7f8c8d;
    color: #fff;
    padding: 10px 20px;
}

.debug-btn-secondary:hover {
    background: #95a5a6;
}

/* Debug Info */
.debug-info {
    padding: 15px;
    background: rgba(52, 152, 219, 0.1);
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

.debug-info p {
    margin: 0;
    color: #bdc3c7;
    line-height: 1.4;
}

/* Session Summary */
.session-summary {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
}

.session-summary p {
    margin: 5px 0;
    color: #ccc;
    font-size: 0.9rem;
}

/* Card Selection Modal */
.card-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001; /* Higher than session control modal */
}

.card-selection-modal {
    background: #2a2a2a;
    border: 2px solid #555;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    color: white;
}

.card-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #444;
}

.card-selection-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
}

.card-selection-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.card-selection-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.card-selection-grid {
    padding: 20px;
}

.rank-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    justify-content: center;
}

.card-option {
    width: 50px;
    height: 40px;
    border: 1px solid #666;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-option.available {
    background: #444;
    color: #fff;
}

.card-option.available:hover {
    background: #555;
    border-color: #4a90a4;
    transform: scale(1.05);
}

.card-option.unavailable {
    background: #2a2a2a;
    color: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

.card-option.current {
    background: #4a90a4;
    border-color: #5aa4c4;
    color: #fff;
}

/* Card Selection in Table */
.card-selection {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.selected-card {
    background: #333;
    border: 1px solid #555;
    padding: 6px 10px;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
    font-size: 0.9rem;
    color: #aaa;
}

.selected-card.has-card {
    color: #fff;
    border-color: #4a90a4;
    background: #444;
}

.select-card-btn {
    background: #4a90a4;
    border: none;
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.select-card-btn:hover {
    background: #5aa4c4;
}

.clear-card-btn {
    background: #e74c3c;
    border: none;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.clear-card-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}
.cards-cell {
    min-width: 80px;
}

.card-pair {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.card-outline {
    width: 35px;
    height: 50px;
    border: 1px solid #666;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-outline:hover {
    border-color: #4a90a4;
    transform: scale(1.05);
}

.card-back-session-control {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-back-session-control-pattern {
    color: #666;
    font-size: 18px;
    font-weight: bold;
}

.card-face {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    border-radius: 3px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-face.red {
    color: #EA0700;
}

.card-face.black {
    color: #1a1a1a;
}

.card-rank-session-control {
    font-size: 22px;
    font-weight: bold;
    position: absolute;
    top: -2px;
    left: 1px;
}

.card-suit-session-control {
    font-size: 35px;
    font-weight: bold;
    position: absolute;
    bottom: -6px;
}

/* Mobile Responsive */
@media (max-width: 700px) {
    .session-control-modal {
        width: 95%;
        margin: 20px auto;
        max-height: 90vh;
        max-width: 95%;
    }

    .hand-config-row {
        flex-direction: column;
        gap: 15px;
    }

    .seat-buttons {
        justify-content: center;
    }

    .seat-btn {
        min-width: 70px;
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .hands-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }

    .debug-execution {
        flex-direction: column;
        align-items: center;
    }

    .debug-btn-primary,
    .debug-btn-secondary {
        width: 80%;
        text-align: center;
    }

    .preset-hands {
        justify-content: center;
    }
}