/**
 * Hand Ranges Page Styles
 *
 * Page-specific styles for the hand range charts feature.
 */

/* =====================================================================
   PAGE LAYOUT
   ===================================================================== */

.ranges-page {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.ranges-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 12px;
    padding: 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}

.ranges-positions-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.ranges-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.ranges-control-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* On touch devices, native selects are shown — style them */
@media (pointer: coarse) and (hover: none) {
    .ranges-control-group select,
    .ranges-situation-row select {
        padding: 7px 28px 7px 12px;
        background-color: rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: 6px;
        color: var(--text);
        font-size: 0.9rem;
        min-width: 100px;
    }
}

/* =====================================================================
   SCENARIO CONTROLS
   ===================================================================== */

.ranges-scenario-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ranges-scenario-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ranges-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.ranges-action-btn {
    padding: 8px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ranges-action-btn:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text);
}

.ranges-action-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.ranges-scenario-select {
    padding: 8px 28px 8px 12px;
    background-color: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
    min-width: 260px;
    cursor: pointer;
}

.ranges-scenario-select:focus {
    outline: none;
    border-color: var(--accent);
}

.ranges-scenario-summary {
    text-align: center;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
}

.ranges-reset-btn {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ranges-reset-btn:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text);
}

.ranges-methodology-note {
    margin: 16px 0 0;
    font-size: 0.72rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.32);
    text-align: center;
}

.ranges-methodology-disclaimer {
    margin: 12px 0 48px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.22);
    font-style: italic;
}

.ranges-footnote {
    margin: -8px 0 16px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
    text-align: center;
}

.ranges-disclaimer-link {
    color: rgba(255,255,255,0.40);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ranges-insight-panel {
    margin: 8px 0 25px;
    font-size: 0.8rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.55);
}

.ranges-insight-title {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    margin-right: 6px;
}

.ranges-insight-title::after {
    content: ':';
}

.ranges-insight-intro {
    color: rgba(255, 255, 255, 0.55);
}

.ranges-insight-more {
    display: none;
    white-space: normal;
}

.ranges-para-break {
    display: block;
    height: 12px;
}

.ranges-insight-panel.expanded .ranges-insight-more {
    display: inline;
}

.ranges-insight-toggle {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    opacity: 0.85;
}

.ranges-insight-toggle:hover {
    opacity: 1;
    text-decoration: underline;
}
.ranges-disclaimer-link:hover {
    color: rgba(255,255,255,0.70);
}

/* =====================================================================
   RANGE GRID
   ===================================================================== */

.ranges-content-wrapper {
    position: relative;
    display: flex;
    gap: 24px;
}

.ranges-grid-container {
    flex: 1;
}

.ranges-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 4px;
    background: rgba(255,255,255,0.05);
    padding: 2px;
    border-radius: 8px;
}

.ranges-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s;
}

.ranges-cell:hover {
    z-index: 5;
}

.ranges-cell .hand-label {
    line-height: 1.1;
}

.ranges-cell .freq-label {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.5;
}

/* Hand action colors */
.ranges-cell.action-fold {
    background: rgba(80, 80, 95, 0.55);
    color: rgba(255,255,255,0.7);
}

.ranges-cell.action-raise {
    background: rgba(156, 39, 176, 0.7);
    color: white;
}

.ranges-cell.action-raise_sometimes {
    background: rgba(255, 152, 0, 0.7);
    color: white;
}

.ranges-cell.action-call {
    background: rgba(76, 175, 80, 0.7);
    color: white;
}

.ranges-cell.action-check {
    background: rgba(33, 150, 243, 0.35);
    color: rgba(255, 255, 255, 0.75);
}

.ranges-cell.action-4bet,
.ranges-cell.action-3bet {
    background: rgba(156, 39, 176, 0.7);
    color: white;
}

.ranges-cell.is-pair {
    border: 1px solid rgba(255,255,255,0.3);
}

/* Split-cell display for size-aware Open Raise grid */
.ranges-cell.ranges-cell-split {
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Mixed Frequencies toggle button */
.ranges-freq-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.ranges-freq-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}
.ranges-freq-toggle.active {
    background: rgba(156, 39, 176, 0.2);
    border-color: rgba(156, 39, 176, 0.5);
    color: rgba(255, 255, 255, 0.9);
}

/* =====================================================================
   TABLE DISPLAY
   ===================================================================== */

.ranges-table-display {
    width: 280px;
    flex-shrink: 0;
}

.ranges-table-display .poker-table-container {
    width: 100%;
    height: 200px;
}

.ranges-table-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ranges-table-toggle label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =====================================================================
   LEGEND
   ===================================================================== */

.ranges-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-end;
    font-size: 0.8rem;
}

.ranges-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ranges-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.ranges-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ranges-description {
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex: 1;
    min-width: 200px;
}

/* =====================================================================
   TOGGLE SWITCH (shared component)
   ===================================================================== */

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-switch.active {
    background: var(--accent);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* =====================================================================
   COMING SOON
   ===================================================================== */

.ranges-coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 56px 24px;
    text-align: center;
}

.ranges-coming-soon-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.ranges-coming-soon-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 320px;
    line-height: 1.5;
}

/* =====================================================================
   MOBILE RESPONSIVE
   ===================================================================== */

@media (max-width: 768px) {
    .ranges-hand-advice {
        margin-bottom: 0;
    }

    .ranges-hand-advice-note {
        font-size: 0.7rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ranges-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ranges-description {
        order: 1;
        margin-top: 8px;
    }

    .ranges-legend {
        flex-wrap: wrap;
        gap: 6px 10px;
        font-size: 0.75rem;
    }

    .ranges-legend-label {
        width: 100%;
        text-align: right;
        margin-bottom: 2px;
    }

    .ranges-legend-item[data-legend-key="fold"] {
        display: none;
    }

    .ranges-content-wrapper {
        flex-direction: column;
    }

    .ranges-table-display {
        width: 100%;
        order: -1;
    }

    .ranges-cell {
        font-size: 0.6rem;
    }

    .ranges-cell .freq-label {
        display: none;
    }

    .ranges-controls {
        flex-direction: column;
        align-items: center;
    }

    .ranges-positions-row {
        flex-wrap: wrap;
        justify-content: center;
    }

    .ranges-scenario-select {
        min-width: 100%;
    }
}

/* Missing CSS for: ranges */
/* 131 rule blocks */

.game-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0px;
}

.game-info span {
    margin-right: 12px;
}

.poker-table-container {
    position: relative;
    flex: 1;
    min-width: 320px;
    max-width: 360px;
    aspect-ratio: 16/9;
}

.poker-table {
    position: absolute;
    top: 30px;
    left: 20px;
    right: 20px;
    bottom: 30px;
    background: linear-gradient(145deg, #1a472a 0%, #2d5a3d 50%, #1a472a 100%);
    border-radius: 90px;
    border: 8px solid #5c3d2e;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.3);
    margin: 0 auto;
}

.poker-table::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 80px;
}

.table-pot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.3);
    padding: 7px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #f0c674;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.community-cards-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-45px);
    display: flex;
    gap: 4px;
    z-index: 3;
}

.community-cards-center .playing-card {
    width: 51px;
    height: 66px;
    font-size: 20px;
}

.seat-wrapper {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 5;
}

.table-seat {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2a2a3e;
    border: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    transition: all 0.2s;
}

.table-seat.hero {
    border-color: var(--winner-green);
    background: #2a2a3e;
    
}

.table-seat.villain {
    border-color: var(--accent);
    background: #2a2a3e;
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.5);
    animation: pulse-villain 1.5s infinite;
}

@keyframes pulse-villain {
    0%, 100% { box-shadow: 0 0 8px rgba(233, 69, 96, 0.5); }
    50% { box-shadow: 0 0 16px rgba(233, 69, 96, 0.8), 0 0 24px rgba(233, 69, 96, 0.3); }
}

.table-seat.active {
    border-color: #9c27b0;
    box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.3);
    animation: pulse-seat 1.5s infinite;
}

@keyframes pulse-seat {
    0%, 100% { box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(156, 39, 176, 0.15); }
}

.table-seat.folded {
    opacity: 1;
    animation: none;
}

.table-seat.villain.folded {
    animation: none;
    box-shadow: none;
}

.seat-position {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.table-seat.hero .seat-position,
.table-seat.villain .seat-position {
    color: inherit;
}

.seat-label {
    font-size: 0.55rem;
    color: var(--text);
    margin-top: 1px;
}

.table-seat.hero .seat-label {
    color: var(--winner-green);
}

.table-seat.villain .seat-label {
    color: var(--accent);
}

.dealer-button {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    border: 2px solid #888;
    color: #333;
    font-size: 0.55rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 10;
}

.seat-action {
    font-size: 0.6rem;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
    font-weight: 500;
    background: rgba(100, 100, 100, 0.7);
    color: #ccc;
    display: flex;
    align-items: center;
    z-index: 10;
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
}

.seat-action.hero-action {
    background: rgba(76, 175, 80, 0.9);
    color: white;
}

.seat-action.villain-action {
    background: rgba(233, 69, 96, 0.9);
    color: white;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.8), 0 0 20px rgba(233, 69, 96, 0.4);
    animation: pulse-villain-action 1.5s infinite;
}

@keyframes pulse-villain-action {
    0%, 100% { box-shadow: 0 0 10px rgba(233, 69, 96, 0.8), 0 0 20px rgba(233, 69, 96, 0.4); }
    50% { box-shadow: 0 0 16px rgba(233, 69, 96, 1), 0 0 32px rgba(233, 69, 96, 0.6); }
}

.seat-action.fold {
    background: rgba(100, 100, 100, 0.7);
    color: #ccc;
}

.seat-wrapper-btn { bottom: 4%; left: 50%; transform: translateX(-50%); }

.seat-wrapper-sb { bottom: 8%; left: 22%; transform: translateX(-50%); }

.seat-wrapper-bb { bottom: 40%; left: 7%; transform: translateX(-50%); }

.seat-wrapper-utg { top: 7%; left: 22%; transform: translateX(-50%); }

.seat-wrapper-utg1 { top: 3%; left: 35%; transform: translateX(-50%); }

.seat-wrapper-mp { top: 3%; left: 50%; transform: translateX(-50%); }

.seat-wrapper-lj { top: 7%; left: 78%; transform: translateX(-50%); }

.seat-wrapper-hj { bottom: 40%; right: 7%; transform: translateX(50%); }

.seat-wrapper-co { bottom: 8%; right: 22%; transform: translateX(50%); }

.btn-dealer-btn { bottom: 14%; left: calc(50% + 28px); }

.btn-dealer-sb { bottom: 18%; left: 28%; }

.btn-dealer-bb { bottom: 36%; left: 14%; }

.btn-dealer-utg { top: 16%; left: 28%; }

.btn-dealer-utg1 { top: 12%; left: calc(35% + 28px); }

.btn-dealer-mp { top: 12%; left: calc(50% + 28px); }

.btn-dealer-lj { top: 16%; left: 72%; }

.btn-dealer-hj { bottom: 36%; right: 14%; }

.btn-dealer-co { bottom: 18%; right: 28%; }

.quiz-hand-card:not(.layout-full-table) .community-cards-center {
    display: none;
}

@media (max-width: 900px) {
    .layout-full-table .poker-table-container {
        min-width: 280px;
        max-width: min(750px, calc(100% - 40px));
        width: calc(100% - 40px);
        margin: 0 auto 20px;
        transition: transform 0.2s ease;
    }
    .layout-full-table .hero-cards-on-seat,
    .layout-full-table .community-cards-center {
        display: none;
    }
}

@media (max-width: 480px) {
    .layout-full-table .poker-table-container {
        transform: scale(0.9);
        transform-origin: top center;
        margin-bottom: -10px;
    }
}

@media (max-width: 380px) {
    .layout-full-table .poker-table-container {
        transform: scale(0.8);
        margin-bottom: -25px;
    }
}

@media (min-width: 901px) {
    .layout-full-table .poker-table-container {
        min-width: 640px;
        max-width: 750px;
        margin: 0 10px 20px;
    }
}

.layout-full-table .poker-table {
    
    border-radius: 50% / 50%;
}

.layout-full-table .poker-table::before {
    
    border-radius: 50% / 50%;
}

.layout-full-table .table-seat {
    width: 65px;
    height: 65px;
}

.layout-full-table .table-seat.hero {
    width: 150px;
    height: 50px;
    border-radius: 12px;
    background: #2a2a3e;
    border: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    z-index: 15;
}

.layout-full-table .table-seat.hero .hero-action-inside {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
}

.layout-full-table .table-seat.hero .seat-label {
    font-size: 0.8rem;
    color: var(--winner-green);
}

.layout-full-table .btn-dealer-btn { bottom: 19%; left: calc(50% + 76px); }

.layout-full-table .btn-dealer-sb { bottom: 20%; left: 30%; }

.layout-full-table .btn-dealer-bb { bottom: 36%; left: 12%; }

.layout-full-table .btn-dealer-utg { top: 18%; left: 30%; }

.layout-full-table .btn-dealer-utg1 { top: 12%; left: calc(36% + 36px); }

.layout-full-table .btn-dealer-mp { top: 10%; left: calc(50% + 36px); }

.layout-full-table .btn-dealer-lj { top: 18%; left: 70%; }

.layout-full-table .btn-dealer-hj { bottom: 36%; right: 12%; }

.layout-full-table .btn-dealer-co { bottom: 20%; right: 30%; }

.layout-full-table .hero-action-above {
    position: absolute;
    bottom: -28%;
    left: 50%;
    transform: translateX(-50%) translateY(-245px);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0px;
    z-index: 11;
    white-space: nowrap;
    background: rgba(76, 175, 80, 0.9);
    color: white;
}

.layout-full-table .hero-action-above.fold {
    background: rgba(90, 90, 100, 0.85);
    color: white;
}

.layout-full-table .hero-cards-on-seat {
    position: absolute;
    
    bottom: -11%;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    display: flex;
    gap: 6px;
    z-index: 4;  
}

.layout-full-table .hero-cards-on-seat .playing-card {
    --card-width: 51px;
    --card-height: 66px;
    --card-font: 20px;
}

.layout-full-table .community-cards-center {
    position: absolute;
    
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-15px);
    display: flex;
    gap: 6px;
    z-index: 5;
}

.layout-full-table .community-cards-center .playing-card {
    --card-width: 51px;
    --card-height: 66px;
    --card-font: 20px;
}

.layout-full-table .table-pot {
    
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-70px);
    font-size: 0.85rem;
}

.layout-full-table .seat-wrapper-bb {
    bottom: 40%;
    left: 4%;
    transform: translateX(-50%);
}

.layout-full-table .seat-wrapper-sb {
    bottom: 10%;
    left: 22%;
    transform: translateX(-50%);
}

.layout-full-table .seat-wrapper-hj {
    bottom: 40%;
    right: 4%;
    transform: translateX(50%);
}

.layout-full-table .seat-wrapper-co {
    bottom: 9%;
    right: 22%;
    transform: translateX(50%);
}

.layout-full-table .seat-wrapper-lj {
    top: 8%;
    left: 78%;
    transform: translateX(-50%);
}

.layout-full-table .seat-wrapper-utg {
    top: 8%;
    left: 22%;
    transform: translateX(-50%);
}

.layout-full-table .seat-wrapper-utg1 {
    top: 1%;
    left: 36%;
    transform: translateX(-50%);
}

.layout-full-table .seat-wrapper-mp {
    top: -1%;
    left: 50%;
    transform: translateX(-50%);
}

.layout-full-table .seat-wrapper-btn {
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
}

.sessions-table-outer.layout-full-table .poker-table-container {
    min-width: 0;
    max-width: 420px;
    margin: 0 auto 16px;
}

.sessions-table-outer.layout-full-table .table-seat {
    width: 50px;
    height: 50px;
    font-size: 0.55rem;
}

.sessions-table-outer.layout-full-table .table-seat.hero {
    width: 110px;
    height: 40px;
    border-radius: 12px;
}

.sessions-table-outer.layout-full-table .hero-cards-on-seat {
    display: flex;
    bottom: -20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.sessions-table-outer.layout-full-table .hero-cards-on-seat .playing-card {
    --card-width: 40px;
    --card-height: 48px;
    --card-font: 13px;
}

.ranges-scenario-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ranges-scenario-label::before,
.ranges-scenario-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to var(--dir, right), rgba(255,255,255,0.2), transparent);
}

.ranges-scenario-label::before {
    --dir: left;
}

.ranges-scenario-select optgroup {
    background: var(--surface, #1e1e2e);
    color: var(--text-muted);
    font-size: 0.75rem;
}

.ranges-scenario-select option {
    background: var(--surface, #1e1e2e);
    color: var(--text);
    font-size: 0.9rem;
    padding: 6px 16px;
}

.ranges-table-display .poker-table {
    width: 100%;
    height: 100%;
}

.ranges-edit-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    margin-bottom: 12px;
}

.ranges-toolbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ranges-toolbar-main {
    justify-content: flex-start;
}

.ranges-toolbar-actions {
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.ranges-edit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ranges-edit-toggle:hover {
    background: rgba(255,255,255,0.12);
}

.ranges-edit-toggle.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.ranges-view-toggle {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 2px;
}

.ranges-view-toggle button {
    padding: 5px 10px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.ranges-view-toggle button:hover {
    color: var(--text);
}

.ranges-view-toggle button.active {
    background: var(--accent);
    color: white;
}

.ranges-customized-badge {
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
}

.ranges-edit-actions {
    display: flex;
    gap: 4px;
}

.ranges-edit-actions button {
    width: 36px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ranges-edit-actions .action-raise-btn {
    background: rgba(156, 39, 176, 0.85);
    color: white;
    border-color: rgba(156, 39, 176, 0.9);
}

.ranges-edit-actions .action-call-btn {
    background: rgba(76, 175, 80, 0.85);
    color: white;
    border-color: rgba(76, 175, 80, 0.9);
}

.ranges-edit-actions .action-fold-btn {
    background: rgba(100, 100, 100, 0.6);
    color: white;
    border-color: rgba(100, 100, 100, 0.7);
}

.ranges-edit-actions .action-mixed-btn {
    background: rgba(255, 152, 0, 0.85);
    color: white;
    border-color: rgba(255, 152, 0, 0.9);
    width: auto;
    padding: 0 10px;
}

.ranges-save-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ranges-save-actions button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.ranges-save-actions .save-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.ranges-save-actions .discard-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-muted);
    padding: 6px 8px;
}

.ranges-save-actions .discard-btn:hover {
    color: var(--text);
    background: rgba(255,255,255,0.12);
}

.ranges-grid.edit-mode .ranges-cell {
    cursor: pointer;
    user-select: none;
}

.ranges-grid.edit-mode .ranges-cell:hover {
    box-shadow: 0 0 0 2px var(--accent);
}

.ranges-cell.selected {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    z-index: 10;
}

.ranges-cell.modified::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.ranges-create-situation-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 6px;
    padding: 0;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 6px;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s;
}

.ranges-create-situation-btn:hover {
    background: rgba(99, 102, 241, 0.35);
    transform: scale(1.05);
}

.ranges-create-situation-btn svg {
    flex-shrink: 0;
}

.situation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.situation-modal-content {
    background: #1e1a2e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 24px;
    width: 400px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.situation-modal-content h3 {
    margin: 0 0 20px;
    font-size: 1.1rem;
    color: var(--text);
}

.situation-form-group {
    margin-bottom: 16px;
}

.situation-form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.situation-form-group input,
.situation-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
}

.situation-form-group select {
    width: 100%;
    padding: 10px 28px 10px 12px;
    background-color: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
}

.situation-form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.situation-modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

.situation-modal-buttons button {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.situation-modal-buttons .create-btn {
    background: var(--accent);
    border: none;
    color: white;
}

.situation-modal-buttons .cancel-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .ranges-edit-toolbar {
        padding: 8px;
        gap: 6px;
    }
    .ranges-toolbar-row {
        gap: 6px;
    }
    .ranges-toolbar-actions {
        flex-wrap: nowrap;
    }
    .ranges-edit-toggle {
        padding: 5px 8px;
    }
    .ranges-edit-toggle .btn-text {
        display: none;
    }
    .ranges-view-toggle button {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    .ranges-edit-actions {
        gap: 3px;
    }
    .ranges-edit-actions button {
        width: 32px;
        height: 28px;
        font-size: 0.7rem;
    }
    .ranges-edit-actions .action-mixed-btn {
        padding: 0 6px;
        font-size: 0.65rem;
    }
    .ranges-save-actions {
        gap: 4px;
    }
    .ranges-save-actions button {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    .ranges-save-actions .save-btn .btn-text {
        display: none;
    }
    .ranges-save-actions .discard-btn {
        padding: 5px 6px;
    }
    .ranges-create-situation-btn {
        width: 28px;
        height: 28px;
    }
    .ranges-create-situation-btn svg {
        width: 12px;
        height: 12px;
    }
}

#sessions-content .poker-table::before {
    border-radius: 50% / 50%;
}

/* =====================================================================
   TWO-TIER CONTROLS: setup row + situation sentence row
   ===================================================================== */

/* Setup row: Stakes, Stack, Reset — always visible, game context */
.ranges-setup-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 12px;
}

/* Situation row: reads as a sentence — "I am at [pos] [action] [villain]" */
.ranges-situation-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
}

/* Inline sentence connectors between dropdowns */
.situation-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.ranges-first-actor-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 6px 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    white-space: nowrap;
}

.ranges-size-selector {
    padding: 7px 28px 7px 10px;
    background-color: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.85rem;
    min-width: 72px;
    cursor: pointer;
}

.ranges-size-selector:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ranges-size-disabled label {
    opacity: 0.4;
}

.ranges-3bet-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.ranges-3bet-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* =====================================================================
   DATASET TOGGLE (6-Max / 9-Max)
   ===================================================================== */

.ranges-dataset-toggle {
    display: flex;
    gap: 0;
    justify-content: center;
    margin-bottom: 14px;
}

.dataset-btn {
    padding: 6px 18px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.dataset-btn:first-child {
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.dataset-btn:last-child {
    border-radius: 0 6px 6px 0;
}

.dataset-btn:hover:not(.active) {
    background: rgba(255,255,255,0.1);
    color: var(--text);
}

.dataset-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    cursor: default;
}

/* =====================================================================
   HERO CARDS PICKER
   ===================================================================== */

.ranges-cards-picker-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ranges-hero-cards-btn {
    padding: 7px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px dashed rgba(255,255,255,0.25);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.ranges-hero-cards-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent);
    color: var(--text);
}

.ranges-hero-cards-btn.has-cards {
    border-style: solid;
    border-color: rgba(255,255,255,0.2);
    color: var(--text);
    background: rgba(255,255,255,0.08);
}

.ranges-cards-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s;
}

.ranges-cards-clear:hover {
    color: var(--text);
}

.ranges-card-glyph {
    font-weight: 700;
    font-size: 1rem;
}

/* =====================================================================
   HAND ADVICE PANEL (tri-bar)
   ===================================================================== */

.ranges-hand-advice {
    margin-bottom: 25px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
}

.ranges-hand-advice-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ranges-hand-advice-cards {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.ranges-hand-advice-class {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.ranges-hand-advice-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: auto;
    opacity: 0.7;
}

.ranges-action-bar {
    display: flex;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    height: 40px;
}

.ranges-action-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    min-width: 0;
    transition: width 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    padding: 0 8px;
}

.ranges-seg-pct {
    opacity: 0.8;
    font-size: 0.75rem;
}

/* =====================================================================
   GRID HIGHLIGHT
   ===================================================================== */

.ranges-cell-highlighted {
    outline: 2px solid white;
    outline-offset: -2px;
    z-index: 1;
    position: relative;
}

