/* 바카라 분석기 스타일 */

/* 분석기 내부 배너 (4개) */
.analyzer-banner-area {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
}

.analyzer-banner-item {
    display: block;
    width: 25%;
    transition: transform 0.2s;
}

.analyzer-banner-item:hover {
    transform: scale(1.01);
}

.analyzer-banner-item img {
    width: 100%;
    height: 90px;
    object-fit: fill;
    display: block;
    border-radius: 6px;
    background: #1a1a2e;
}

.analyzer-banner-placeholder {
    width: 25%;
    height: 90px;
    background: var(--bg-tertiary, #1a1a2e);
    border: 1px dashed var(--border-dark, #3a3a3a);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #666);
    font-size: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.analyzer-banner-placeholder:hover {
    border-color: var(--accent-primary, #14b8a6);
    color: var(--accent-primary, #14b8a6);
}

@media (max-width: 768px) {
    .analyzer-banner-area {
        flex-wrap: wrap;
    }

    .analyzer-banner-item {
        width: 50%;
    }

    .analyzer-banner-item img {
        height: 60px;
        border-radius: 4px;
    }

    .analyzer-banner-placeholder {
        width: 50%;
        height: 60px;
        border-radius: 4px;
        font-size: 10px;
    }
}

:root {
    /* 결과 색상 */
    --color-player: #1BA9DE;
    --color-player-border: #1787B0;
    --color-banker: #E62626;
    --color-banker-border: #C01E1E;
    --color-tie: #91C653;
    --color-live: #fbbf24;

    /* 그리드 색상 */
    --grid-bg: #1a1a1a;
    --grid-cell: #1e1e1e;
    --grid-border: #3a3a3a;
}

/* 분석기 컨테이너 */
.analyzer-container {
    padding: 0 3px 0 0;
}

.analyzer-container.detail-page {
    padding: 0 3px 0 0;
}

.analyzer-wrapper {
    max-width: 100%;
}

/* 게임사 탭 */
.provider-tabs {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 16px;
}

.provider-tab {
    padding: 12px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.provider-tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.provider-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: var(--accent-primary);
    color: #0a0f14;
}

/* 카테고리 탭 */
.category-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.category-tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.category-tab.active {
    background: rgba(20, 184, 166, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.category-count {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-muted);
}

.category-tab.active .category-count {
    background: rgba(20, 184, 166, 0.2);
    color: var(--accent-primary);
}

/* 카테고리 그리드 (3행 x 5열) */
.category-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.category-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.category-tab {
    padding: 10px 8px;
    text-align: center;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-tab:hover:not(.empty) {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.category-tab.active {
    background: rgba(20, 184, 166, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 500;
}

.category-tab.empty {
    visibility: hidden;
    pointer-events: none;
}

/* 기존 flex 기반 탭 (하위 호환) */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

/* 결과 범례 */
.result-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.legend-label {
    font-weight: 500;
    color: var(--text-primary);
}

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

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    background: transparent;
    border: 2px solid;
}

.legend-dot.player {
    border-color: var(--color-player);
}

.legend-dot.banker {
    border-color: var(--color-banker);
}

.legend-dot.tie {
    border-color: var(--color-tie);
}

.legend-divider {
    color: var(--text-muted);
}

.result-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: white;
}

.result-dot.player { background: var(--color-player); }
.result-dot.banker { background: var(--color-banker); }
.result-dot.tie { background: var(--color-tie); }
.result-dot.live {
    background: transparent;
    border: 2px solid var(--color-live);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); }
}

/* 새 결과 하이라이트 애니메이션 */
@keyframes highlight-flash {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.table-card.highlight-player {
    border-color: var(--color-player) !important;
    box-shadow: 0 0 12px rgba(27, 169, 222, 0.5);
    animation: highlight-flash 0.5s ease-in-out 3;
}

.table-card.highlight-banker {
    border-color: var(--color-banker) !important;
    box-shadow: 0 0 12px rgba(230, 38, 38, 0.5);
    animation: highlight-flash 0.5s ease-in-out 3;
}

.table-card.highlight-tie {
    border-color: var(--color-tie) !important;
    box-shadow: 0 0 12px rgba(145, 198, 83, 0.5);
    animation: highlight-flash 0.5s ease-in-out 3;
}

/* 날짜 바 (우측 상단 고정) */
.date-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    margin-bottom: 8px;
}

.date-bar .limit-selector {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    padding: 6px 10px;
}

.date-bar .limit-selector select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.date-bar .limit-selector select option {
    background: #1a1a2e;
    color: #fff;
}

.date-bar .date-selector {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    padding: 8px 12px;
}

/* 날짜 범위 선택 */
.date-range-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    padding: 6px 10px;
}

.date-range-selector .date-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    padding: 5px 8px;
    outline: none;
    cursor: pointer;
    color-scheme: dark;
    width: 130px;
}

.date-range-selector .date-input:focus {
    border-color: var(--accent-primary);
}

.date-range-separator {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.date-apply-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #0a0f14;
    border: none;
    border-radius: var(--radius-sm);
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.date-apply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
}

.date-today-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.date-today-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.range-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-sm);
    color: #60a5fa;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .date-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .date-range-selector {
        flex-wrap: wrap;
        justify-content: center;
    }

    .date-range-selector .date-input {
        width: 115px;
        font-size: 12px;
        padding: 5px 4px;
    }
}

@media (max-width: 480px) {
    .date-range-selector .date-input {
        width: 105px;
        font-size: 11px;
    }

    .date-apply-btn,
    .date-today-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* 옵션 바 */
.options-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.options-left,
.options-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 옵션 그룹 (구분선으로 분리) */
.option-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 12px;
    border-right: 1px solid var(--border-dark);
}

.option-group:last-child {
    padding-right: 0;
    border-right: none;
}

.options-left .result-legend {
    margin-bottom: 0;
    padding: 4px 0;
}

/* 테이블 수 표시 */
.table-count {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.table-count span {
    font-weight: 600;
    color: var(--accent-primary);
}

/* 날짜 선택 */
.date-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.date-btn:hover:not(.disabled) {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.date-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.date-display {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.today-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
    color: #0a0f14;
    font-size: 11px;
    font-weight: 600;
}

/* 그리드 선택 */
.grid-selector {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.grid-selector .grid-btn {
    min-width: 40px;
}

/* 결과 수 선택 */
.limit-selector select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

.limit-selector select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-btn:hover:not(.disabled) {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-btn.today-btn {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #0a0f14;
}

.current-date {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    padding: 0 8px;
}

.options-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.grid-options {
    display: flex;
    align-items: center;
    gap: 4px;
}

.grid-btn {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.grid-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.grid-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #0a0f14;
}

.grid-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 12px;
    cursor: help;
}

.grid-help:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.limit-select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
}

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

/* 테이블 그리드 - 1열 레이아웃 */
.tables-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

/* 테이블 카드 */
.table-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-dark);
    gap: 8px;
    flex-wrap: wrap;
}

.table-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.table-header h3 {
    margin: 0;
}

/* 전역 오버레이 토글 버튼 */
.overlay-toggle-global {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(0, 200, 150, 0.3);
    border-radius: 6px;
    background: rgba(0, 200, 150, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 500;
}

.overlay-toggle-global:hover {
    background: rgba(0, 200, 150, 0.2);
}

.overlay-toggle-global.active {
    border-color: rgba(0, 200, 150, 0.5);
}

.overlay-toggle-global:not(.active) {
    background: rgba(100, 100, 100, 0.1);
    border-color: rgba(100, 100, 100, 0.3);
}

.overlay-toggle-global:not(.active):hover {
    background: rgba(100, 100, 100, 0.2);
}

.overlay-toggle-global .toggle-label {
    white-space: nowrap;
    color: var(--text-secondary);
}

.overlay-toggle-global .toggle-status {
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.overlay-toggle-global.active .toggle-status {
    background: rgba(0, 200, 150, 0.3);
    color: #00c896;
}

.overlay-toggle-global:not(.active) .toggle-status {
    background: rgba(100, 100, 100, 0.3);
    color: #888;
}

.table-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    flex-wrap: wrap;
    padding: 10px 14px;
    background: var(--bg-tertiary);
}

.table-stats.detail {
    margin-top: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-dark);
}

.table-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 항목 사이 구분점 */
.table-stats .stat-item + .stat-item::before {
    content: '·';
    color: var(--text-muted);
    margin-right: 4px;
    font-size: 14px;
    line-height: 1;
}

.table-stats .stat-item .stat-label {
    color: var(--text-muted);
    font-size: 11px;
}

.table-stats .stat-item .stat-value {
    font-weight: 600;
    font-size: 12px;
}

.table-stats .stat-item .stat-percent {
    color: var(--text-muted);
    font-size: 10px;
}

.table-stats .stat-item.player .stat-value { color: var(--color-player); }
.table-stats .stat-item.banker .stat-value { color: var(--color-banker); }
.table-stats .stat-item.tie .stat-value { color: var(--color-tie); }

.stat-count {
    color: var(--text-muted);
}

.stat-player { color: var(--color-player); font-weight: 600; }
.stat-banker { color: var(--color-banker); font-weight: 600; }
.stat-tie { color: var(--color-tie); }
.stat-divider { color: var(--text-muted); }

.detail-btn {
    padding: 4px 10px;
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
    color: #0a0f14;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.detail-btn:hover {
    background: var(--accent-secondary);
}

/* 입력 버튼 영역 */
.input-buttons {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-dark);
    flex-wrap: wrap;
}

.input-btn {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.input-btn.player {
    background: var(--color-player);
}

.input-btn.player:hover {
    background: var(--color-player-border);
    transform: translateY(-1px);
}

.input-btn.banker {
    background: var(--color-banker);
}

.input-btn.banker:hover {
    background: var(--color-banker-border);
    transform: translateY(-1px);
}

.input-btn.tie {
    background: var(--color-tie);
}

.input-btn.tie:hover {
    background: #7fb344;
    transform: translateY(-1px);
}

.input-btn.undo {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    color: var(--text-secondary);
}

.input-btn.undo:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.input-btn.clear {
    background: transparent;
    border: 1px solid rgba(230, 38, 38, 0.5);
    color: #e62626;
}

.input-btn.clear:hover {
    background: rgba(230, 38, 38, 0.1);
    border-color: #e62626;
}

/* 상세 페이지 입력 버튼 */
.input-buttons.detail-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.input-buttons.detail-input .input-btn {
    padding: 8px 16px;
    font-size: 13px;
}

/* Big Road 그리드 */
.big-road {
    padding: 12px;
    background: var(--grid-bg);
    overflow-x: auto;
}

.bigroad-container {
    padding: 8px;
    background: var(--grid-bg);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    contain: layout style;
}

/* 스크롤바 스타일 */
.bigroad-container::-webkit-scrollbar {
    height: 4px;
}

.bigroad-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.bigroad-container::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 2px;
}

.bigroad-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.bigroad-container.large {
    padding: 12px;
}

.bigroad-grid {
    display: block;
    min-width: 100%;
    width: max-content;
    contain: content;
}

.bigroad-grid-inner {
    display: inline-grid;
    gap: 1px;
}

.bigroad-cell {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    background: var(--grid-cell);
    border: 1px solid var(--grid-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: white;
    border-radius: 0;
    position: relative;
    box-sizing: border-box;
}

/* 빅로드 페어 점 */
.pair-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    z-index: 2;
}

.pair-dot.pp-dot {
    top: 1px;
    left: 1px;
    background: #4fc3f7;
}

.pair-dot.bp-dot {
    bottom: 1px;
    right: 1px;
    background: #ff8a65;
}

.pair-dot.perfect {
    box-shadow: 0 0 3px 1px currentColor;
}

/* 플레이어: 파란색 테두리 빈 원 */
.bigroad-cell.player {
    border: none;
}

.bigroad-cell.player::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--color-player);
    border-radius: 50%;
    background: transparent;
    box-sizing: border-box;
}

/* 뱅커: 빨간색 테두리 빈 원 */
.bigroad-cell.banker {
    border: none;
}

.bigroad-cell.banker::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--color-banker);
    border-radius: 50%;
    background: transparent;
    box-sizing: border-box;
}

.bigroad-cell.empty-cell {
    background: var(--grid-cell);
    border-color: var(--grid-border);
}

/* 로딩 셀 */
.bigroad-cell.loading-cell {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

.cell-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: cell-spin 0.8s linear infinite;
    will-change: transform;
}

@keyframes cell-spin {
    to {
        transform: rotate(360deg);
    }
}

.grid-container {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    min-width: 100%;
}

.grid-row {
    display: flex;
    gap: 1px;
}

.grid-cell {
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: var(--grid-cell);
    border: 1px solid var(--grid-border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 10px;
    color: var(--text-muted);
}

.result-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.result-marker.player {
    background: var(--color-player);
    border: 1px solid var(--color-player-border);
}

.result-marker.banker {
    background: var(--color-banker);
    border: 1px solid var(--color-banker-border);
}

.result-marker.live {
    box-shadow: 0 0 0 2px var(--color-live);
    animation: pulse 1.5s infinite;
}

/* 타이 표시 (작은 점) */
.tie-marker {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: var(--color-tie);
    border-radius: 50%;
}

/* Big Road 타이 슬래시 (/) - 우상단에서 좌하단 */
.tie-slash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.tie-slash::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 24px;
    background: var(--color-tie);
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 1px;
}

/* 타이 개수 표시 */
.tie-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 800;
    color: var(--color-tie);
    background: none;
    border: none;
    z-index: 3;
    line-height: 1;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}


/* 실시간 결과 표시 */
.bigroad-cell.live::after {
    box-shadow: 0 0 0 2px var(--color-live);
    animation: pulse 1.5s infinite;
}

/* 열 번호 / 카운트 행 */
.grid-row.numbers .grid-cell,
.grid-row.counts .grid-cell {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    font-size: 9px;
    border-color: transparent;
}

/* 빈 상태 */
.empty-tables {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-tables-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-tables h3 {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
}

.empty-tables p {
    margin: 0;
}

/* Big Road 빈 상태 */
.bigroad-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    background: var(--grid-bg);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
}

/* 상세 결과 빈 상태 */
.empty-results {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-muted);
}

.empty-results p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.empty-results .empty-sub {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== 카드 상세 페이지 ===== */

/* 상세 페이지 헤더 (제목 + 날짜 선택 양쪽 정렬) */
.detail-page .detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.detail-page .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-page .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-page .header-right .limit-selector {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    padding: 6px 10px;
}

.detail-page .header-right .limit-selector select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.detail-page .header-right .limit-selector select option {
    background: #1a1a2e;
    color: #fff;
}

.detail-page .header-right .date-selector {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    padding: 8px 12px;
}

.detail-page .table-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.detail-page .provider-badge {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.detail-page .provider-badge.pragmatic {
    background: rgba(255, 153, 0, 0.15);
    color: #ff9900;
}

.detail-page .provider-badge.evolution {
    background: rgba(20, 184, 166, 0.15);
    color: var(--accent-primary);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* 상세 페이지 네비게이션 */
.detail-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.detail-nav .back-btn {
    margin-bottom: 0;
}

.detail-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.detail-provider {
    padding: 4px 10px;
    background: rgba(20, 184, 166, 0.15);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 500;
}

/* 상세 컨텐츠 */
.detail-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

/* 카드 표시 */
.cards-display {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cards-display .card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 34px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 4px;
    font-size: 12px;
    font-weight: bold;
    color: #333;
}

.cards-display .card.spade,
.cards-display .card.club {
    color: #333;
}

.cards-display .card.heart,
.cards-display .card.diamond {
    color: #e74c3c;
}

.cards-display .score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-left: 4px;
}

.cards-display .score.player {
    background: var(--color-player);
}

.cards-display .score.banker {
    background: var(--color-banker);
}

/* 결과 배지 */
.result-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.result-badge.p {
    background: rgba(27, 169, 222, 0.15);
    color: var(--color-player);
}

.result-badge.b {
    background: rgba(230, 38, 38, 0.15);
    color: var(--color-banker);
}

.result-badge.t {
    background: rgba(145, 198, 83, 0.15);
    color: var(--color-tie);
}

/* 페이지네이션 추가 스타일 */
.page-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #0a0f14;
    font-weight: 600;
}

/* 상세 테이블 */
.detail-table-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 20px;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.detail-table th {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-dark);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
}

.detail-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-dark);
    color: var(--text-primary);
    vertical-align: middle;
}

.detail-table tr:last-child td {
    border-bottom: none;
}

.detail-table tr:hover td {
    background: var(--bg-tertiary);
}

.time-cell {
    white-space: nowrap;
}

.time-cell .date {
    font-size: 12px;
    color: var(--text-muted);
}

.time-cell .clock {
    font-size: 14px;
    color: var(--text-primary);
}

.score-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.winner-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.winner-badge.player { background: var(--color-player); }
.winner-badge.banker { background: var(--color-banker); }
.winner-badge.tie { background: var(--color-tie); }

.score-text {
    color: var(--text-primary);
}

.cards-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-group {
    display: flex;
    gap: 4px;
}

.card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-primary);
}

.card .suit {
    margin-left: 2px;
    font-size: 14px;
}

.card .suit.red { color: #e74c3c; }
.card .suit.black { color: #333; }

.vs-text {
    color: var(--text-muted);
    font-size: 12px;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-btn, .page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.page-btn:hover:not(.disabled),
.page-num:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.page-num.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #0a0f14;
    font-weight: 600;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== 반응형 ===== */

@media (max-width: 1200px) {
    .category-tab {
        font-size: 11px;
        padding: 8px 6px;
    }
}

@media (max-width: 768px) {
    .provider-tabs {
        width: 100%;
    }

    .provider-tab {
        flex: 1;
        text-align: center;
        padding: 10px 16px;
    }

    /* 카테고리 그리드 모바일 */
    .category-grid {
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .category-row {
        grid-template-columns: repeat(5, minmax(80px, 1fr));
        min-width: max-content;
    }

    .category-tab {
        min-width: 80px;
        font-size: 11px;
        padding: 8px 6px;
    }

    /* 기존 flex 기반 탭 */
    .category-tabs {
        overflow-x: auto;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        padding-bottom: 8px;
    }

    .options-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .date-nav {
        justify-content: center;
    }

    .options-right {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }

    /* 모바일에서 option-group 내 버튼 2개씩 정렬 */
    .options-right .option-group {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
        padding-right: 0;
        border-right: none;
    }

    .options-right .option-group > button {
        width: 100%;
        justify-content: center;
    }

    .grid-options {
        flex-wrap: wrap;
        justify-content: center;
    }

    .detail-btn {
        width: 100%;
        text-align: center;
    }

    .detail-table {
        font-size: 12px;
    }

    .detail-table th,
    .detail-table td {
        padding: 10px 12px;
    }

    .cards-cell {
        flex-wrap: wrap;
        gap: 8px;
    }

    .card {
        min-width: 24px;
        height: 32px;
        font-size: 11px;
    }

    /* 상세 페이지 헤더 모바일 */
    .detail-page .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .detail-page .header-left {
        flex-wrap: wrap;
        gap: 8px;
    }

    .detail-page .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .detail-page .header-right .limit-selector {
        flex-shrink: 0;
    }

    .detail-page .header-right .date-selector {
        flex: 1;
        justify-content: center;
    }

    .detail-page .table-title {
        font-size: 1.1rem;
    }

    .back-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .result-legend {
        gap: 6px;
        font-size: 11px;
    }

    .legend-item {
        gap: 3px;
    }

    .grid-btn {
        padding: 5px 6px;
        font-size: 10px;
    }

    .detail-btn {
        padding: 3px 8px;
        font-size: 10px;
    }

    /* 상세 페이지 헤더 480px */
    .detail-page .detail-header {
        gap: 10px;
    }

    .detail-page .header-left {
        width: 100%;
    }

    .detail-page .header-right {
        flex-direction: row;
        gap: 8px;
    }

    .detail-page .header-right .limit-selector {
        padding: 4px 6px;
    }

    .detail-page .header-right .limit-selector select {
        font-size: 0.8rem;
    }

    .detail-page .header-right .date-selector {
        padding: 6px 8px;
    }

    .detail-page .header-right .date-selector .date-display {
        font-size: 0.85rem;
    }

    .detail-page .table-title {
        font-size: 1rem;
    }

    .detail-page .provider-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* ========================================
   가상오토 스타일
   ======================================== */

/* 가상오토 토글 버튼 */
.virtual-auto-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.virtual-auto-toggle:hover {
    background: rgba(255, 165, 0, 0.2);
}

.virtual-auto-toggle.active {
    background: rgba(255, 165, 0, 0.25);
    border-color: #ffa500;
    color: #ffa500;
}

.virtual-auto-toggle .toggle-status {
    font-weight: 600;
}

/* 가상오토 상태바 */
.va-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.15), rgba(255, 165, 0, 0.05));
    border-bottom: 1px solid rgba(255, 165, 0, 0.3);
    font-size: 11px;
    flex-wrap: wrap;
}

.va-status-bar .va-step {
    padding: 2px 8px;
    background: rgba(255, 165, 0, 0.3);
    border-radius: 4px;
    color: #ffa500;
    font-weight: 600;
}

.va-status-bar .va-bet {
    display: flex;
    align-items: center;
}

.va-status-bar .va-bet-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 10px;
}

.va-status-bar .va-bet-badge.player {
    background: rgba(27, 169, 222, 0.3);
    color: var(--color-player);
}

.va-status-bar .va-bet-badge.banker {
    background: rgba(230, 38, 38, 0.3);
    color: var(--color-banker);
}

.va-status-bar .va-money {
    margin-left: auto;
    font-weight: 600;
}

.va-status-bar .va-money .profit {
    color: #22c55e;
}

.va-status-bar .va-money .loss {
    color: #ef4444;
}

.va-status-bar .va-pending {
    color: var(--text-muted);
}

/* 가상오토 모달 */
.va-modal-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: 9999;
    padding: 20px;
}

.va-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.va-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-dark);
}

.va-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.va-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.va-modal-close:hover {
    color: var(--text-primary);
}

.va-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.va-step-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.va-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #ffa500;
    color: #000;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.va-selected-info {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.va-selected-info strong {
    color: #ffa500;
}

.va-select-all {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-dark);
}

.va-select-all label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 커스텀 체크박스 스타일 */
.va-checkbox {
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.va-checkbox input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.va-checkbox .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-light);
    border-radius: 5px;
    transition: all 0.2s ease;
}

.va-checkbox input:hover + .checkmark {
    border-color: rgba(255, 165, 0, 0.5);
}

.va-checkbox input:checked + .checkmark {
    background: linear-gradient(135deg, #ffa500, #ff8c00);
    border-color: #ffa500;
}

.va-checkbox .checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.va-checkbox input:checked + .checkmark::after {
    display: block;
}

.va-table-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

/* 카테고리 그룹 */
.va-category-group {
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    overflow: hidden;
}

.va-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 165, 0, 0.08);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.va-category-header:hover {
    background: rgba(255, 165, 0, 0.15);
}

.va-category-name {
    font-size: 12px;
    font-weight: 600;
    color: #ffa500;
}

.va-category-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 1px 6px;
    border-radius: 10px;
}

.va-category-toggle {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.va-category-group.collapsed .va-category-toggle {
    transform: rotate(-90deg);
}

.va-category-tables {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
}

.va-category-group.collapsed .va-category-tables {
    display: none;
}

.va-category-tables .va-table-item {
    border-radius: 6px;
}

.va-table-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.va-table-item:hover {
    border-color: rgba(255, 165, 0, 0.5);
    background: rgba(255, 165, 0, 0.05);
}

.va-table-item.selected {
    border-color: rgba(255, 165, 0, 0.6);
    background: rgba(255, 165, 0, 0.1);
}

.va-table-item .va-checkbox input:checked ~ .va-table-name {
    color: #ffa500;
}

.va-table-name {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
}

/* 폼 그룹 */
.va-form-group {
    margin-bottom: 16px;
}

.va-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.va-form-group input,
.va-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.va-form-group input:focus,
.va-form-group textarea:focus {
    outline: none;
    border-color: #ffa500;
}

.va-form-group textarea {
    resize: vertical;
    font-family: monospace;
    font-size: 13px;
}

.va-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.va-formula-help {
    margin-top: 8px;
    padding: 10px;
    background: rgba(255, 165, 0, 0.1);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-muted);
}

.va-formula-help p {
    margin: 0 0 4px 0;
}

.va-formula-help p:last-child {
    margin-bottom: 0;
}

.va-formula-help strong {
    color: var(--text-secondary);
}

/* 서식 컨트롤 */
.va-formula-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.va-formula-select-wrap {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.va-formula-controls select {
    flex: 1;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
}

.va-formula-controls #vaFormulaName {
    flex: 1;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    min-width: 120px;
}

.va-btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

.va-btn-danger {
    background: #dc2626 !important;
    color: #fff !important;
}

.va-btn-danger:hover {
    background: #b91c1c !important;
}

/* 서식 저장 모달 */
.va-formula-save-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: 10001;
}

.va-formula-save-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 360px;
    overflow: hidden;
}

.va-formula-save-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-dark);
}

.va-formula-save-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.va-formula-save-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.va-formula-save-header button:hover {
    color: var(--text-primary);
}

.va-formula-save-body {
    padding: 16px;
}

.va-formula-save-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-dark);
}

.va-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-dark);
}

.va-btn-secondary:hover {
    background: var(--bg-primary);
}

.va-btn-primary {
    background: #ffa500;
    color: #000;
}

.va-btn-primary:hover {
    background: #e69500;
}

/* 모달 푸터 */
.va-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-dark);
}

.va-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.va-btn-cancel,
.va-btn-back {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    color: var(--text-secondary);
}

.va-btn-cancel:hover,
.va-btn-back:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.va-btn-next,
.va-btn-start {
    background: linear-gradient(135deg, #ffa500, #ff8c00);
    color: #000;
}

.va-btn-next:hover,
.va-btn-start:hover {
    background: linear-gradient(135deg, #ffb732, #ffa500);
    transform: translateY(-1px);
}

/* 반응형 */
@media (max-width: 480px) {
    .va-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .va-form-row {
        grid-template-columns: 1fr;
    }

    .va-status-bar {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* ========================================
   오토현황 버튼 & 모달 스타일
======================================== */

/* 오토현황 버튼 */
.auto-status-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), rgba(0, 150, 136, 0.15));
    border: 1px solid rgba(0, 212, 170, 0.4);
    border-radius: 6px;
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auto-status-btn:hover {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.3), rgba(0, 150, 136, 0.25));
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.auto-status-btn svg {
    flex-shrink: 0;
}

/* 오토현황 모달 오버레이 */
.auto-status-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    /* backdrop-filter 제거 - 성능 최적화 */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

/* 오토현황 모달 */
.auto-status-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* 모달 헤더 */
.auto-status-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-dark);
    background: var(--bg-tertiary);
}

.auto-status-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.auto-status-modal-header h3 svg {
    color: var(--accent-primary);
}

.auto-status-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.auto-status-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* 모달 바디 */
.auto-status-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* 세션 정보 섹션 */
.auto-status-session-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    margin-bottom: 16px;
}

.session-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 140px;
}

.session-info-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.session-info-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.session-info-value.status-active {
    color: #22c55e;
}

.session-info-value.status-ended {
    color: var(--text-muted);
}

.session-info-value.status-idle {
    color: var(--text-muted);
}

.session-info-value.reason-win {
    color: #22c55e;
}

.session-info-value.reason-lose {
    color: #ef4444;
}

.session-info-value.reason-manual {
    color: var(--text-muted);
}

/* 잔액 현황 섹션 */
.auto-status-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.summary-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.summary-card.current {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 170, 0.1);
}

.summary-card.profit.positive {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.summary-card.profit.negative {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.summary-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-card.profit.positive .summary-value {
    color: #22c55e;
}

.summary-card.profit.negative .summary-value {
    color: #ef4444;
}

/* 배팅 통계 섹션 */
.auto-status-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.stats-row {
    display: grid;
    gap: 10px;
}

.stats-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.stats-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    padding: 14px 10px;
    text-align: center;
    gap: 6px;
}

.stat-box.win {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.05);
}

.stat-box.tie {
    border-color: rgba(168, 85, 247, 0.3);
    background: rgba(168, 85, 247, 0.05);
}

.stat-box.lose {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-box.win .stat-value {
    color: #22c55e;
}

.stat-box.tie .stat-value {
    color: #a855f7;
}

.stat-box.lose .stat-value {
    color: #ef4444;
}

/* 배팅 로그 섹션 */
.auto-status-log-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    overflow: hidden;
}

.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-dark);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.log-refresh-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.log-refresh-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.auto-status-log {
    max-height: 280px;
    overflow-y: auto;
}

.log-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.log-item {
    display: grid;
    grid-template-columns: 65px 1fr 45px 100px 50px 75px;
    gap: 6px;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
}

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

.log-item.result-win {
    background: rgba(34, 197, 94, 0.05);
}

.log-item.result-lose {
    background: rgba(239, 68, 68, 0.05);
}

.log-item.result-pending {
    background: rgba(245, 158, 11, 0.08);
}

.log-item.result-tie {
    background: rgba(139, 92, 246, 0.05);
}

.log-time {
    color: var(--text-muted);
    font-size: 11px;
}

.log-table {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-step {
    color: var(--text-muted);
    text-align: center;
}

/* 상태 칼럼 */
.log-status {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
}

.log-status.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.log-status.status-win {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.log-status.status-lose {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.log-status.status-tie {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.log-bet {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bet-side {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
}

.bet-side.player {
    background: rgba(27, 169, 222, 0.2);
    color: var(--color-player);
}

.bet-side.banker {
    background: rgba(230, 38, 38, 0.2);
    color: var(--color-banker);
}

.bet-amount {
    color: var(--text-secondary);
}

.log-result-side {
    text-align: center;
    font-weight: 600;
}

.log-result-side.player {
    color: var(--color-player);
}

.log-result-side.banker {
    color: var(--color-banker);
}

.log-result-side.tie {
    color: var(--color-tie);
}

.log-profit {
    text-align: right;
    font-weight: 600;
}

.log-profit.profit-positive {
    color: #22c55e;
}

.log-profit.profit-negative {
    color: #ef4444;
}

/* 모달 푸터 */
.auto-status-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-dark);
    display: flex;
    justify-content: flex-end;
}

.auto-status-btn-close {
    padding: 10px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.auto-status-btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* 오토현황 모달 반응형 */
@media (max-width: 768px) {
    .auto-status-modal {
        max-width: 100%;
        max-height: 90vh;
        margin: 10px;
    }

    .auto-status-summary {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stats-row-2,
    .stats-row-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-row-3 .stat-box:last-child {
        grid-column: span 2;
    }

    .log-item {
        grid-template-columns: 55px 60px 40px 1fr 50px 65px;
        gap: 4px;
        padding: 8px 10px;
        font-size: 11px;
    }

    .summary-value {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .auto-status-modal-overlay {
        padding: 0;
    }

    .auto-status-modal {
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .auto-status-modal-body {
        padding: 14px;
    }

    .log-item {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 10px 12px;
    }

    .log-time, .log-table {
        grid-column: span 1;
    }

    .log-step {
        text-align: left;
    }

    .log-bet {
        grid-column: span 2;
    }

    .log-result-side {
        text-align: left;
    }

    .log-profit {
        text-align: left;
    }

    .auto-status-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-box {
        padding: 12px 8px;
        gap: 4px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-value {
        font-size: 14px;
    }
}

/* ========================================
   VA-STATUS-BAR 개선된 레이아웃
======================================== */

/* va-status-bar 기본 스타일 (flexbox 레이아웃) */
.va-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.15), rgba(255, 140, 0, 0.1));
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 6px;
    margin-top: 8px;
    font-size: 11px;
    gap: 10px;
}

/* 왼쪽 섹션: 단계, 배팅사이드, 배팅금액 */
.va-status-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 오른쪽 섹션: 현재수익 */
.va-status-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* 단계 표시 */
.va-step {
    padding: 2px 8px;
    background: rgba(255, 165, 0, 0.3);
    border-radius: 4px;
    color: #ffa500;
    font-weight: 700;
    font-size: 11px;
}

/* 배팅 정보 그룹 */
.va-bet-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 배팅 사이드 (P/B) */
.va-bet {
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 10px;
}

.va-bet.player {
    background: rgba(27, 169, 222, 0.25);
    color: var(--color-player);
}

.va-bet.banker {
    background: rgba(230, 38, 38, 0.25);
    color: var(--color-banker);
}

/* 배팅 금액 */
.va-amount {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
}

/* 대기중 표시 */
.va-waiting {
    padding: 2px 8px;
    background: rgba(150, 150, 150, 0.2);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-style: italic;
}

/* 수익/손실 표시 */
.va-profit {
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
}

.va-profit.va-profit-plus {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.va-profit.va-profit-minus {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.va-profit.va-profit-zero {
    background: rgba(150, 150, 150, 0.2);
    color: var(--text-muted);
}

/* 배팅 뱃지 (JS에서 생성) */
.va-bet-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 10px;
}

.va-bet-badge.player {
    background: rgba(27, 169, 222, 0.25);
    color: var(--color-player);
}

.va-bet-badge.banker {
    background: rgba(230, 38, 38, 0.25);
    color: var(--color-banker);
}

/* ========================================
   오토 시작/종료 알림 스타일
======================================== */

/* 시작 알림 - 화면 중앙 배치 */
.auto-start-notice {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 10000;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 2px solid rgba(0, 212, 170, 0.6);
    border-radius: 16px;
    padding: 0;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 212, 170, 0.2);
    opacity: 0;
    transition: all 0.3s ease-out;
    overflow: hidden;
}

.auto-start-notice.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 알림 헤더 */
.auto-start-notice .notice-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), rgba(0, 150, 136, 0.15));
    border-bottom: 1px solid rgba(0, 212, 170, 0.3);
}

.auto-start-notice .notice-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #00d4aa, #00a896);
    border-radius: 12px;
    flex-shrink: 0;
}

.auto-start-notice .notice-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.auto-start-notice .notice-title {
    color: #00d4aa;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.auto-start-notice .notice-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.auto-start-notice .notice-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* 알림 본문 */
.auto-start-notice .notice-content {
    padding: 20px;
}

.auto-start-notice .notice-desc {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 16px;
}

.auto-start-notice .notice-desc strong {
    color: #00d4aa;
    font-weight: 700;
}

/* 알림 정보 그리드 */
.auto-start-notice .notice-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.auto-start-notice .notice-info span {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    overflow: hidden;
    min-width: 0;
}

.auto-start-notice .notice-info .info-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auto-start-notice .notice-info .info-value {
    display: block;
    font-size: clamp(11px, 2.8vw, 14px);
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.auto-start-notice .notice-info .info-value.positive {
    color: #22c55e;
}

.auto-start-notice .notice-info .info-value.negative {
    color: #ef4444;
}

/* 모바일 대응 */
@media (max-width: 480px) {
    .auto-start-notice {
        width: 95%;
        max-width: none;
    }

    .auto-start-notice .notice-info {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .auto-start-notice .notice-info span {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 14px;
    }
}

/* 종료 알림 */
.auto-end-notice {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 10000;
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    transition: all 0.3s ease-out;
}

.auto-end-notice.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.auto-end-notice.win {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auto-end-notice.lose {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auto-end-notice .notice-icon {
    flex-shrink: 0;
    color: #fff;
}

.auto-end-notice .notice-icon svg {
    width: 32px;
    height: 32px;
}

.auto-end-notice .notice-content {
    flex: 1;
}

.auto-end-notice .notice-title {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auto-end-notice .notice-profit {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.auto-end-notice .notice-stats {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.auto-end-notice .notice-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.auto-end-notice .notice-close:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ========================================
   오토현황 모달 - 종료 로그 섹션
======================================== */

#asEndLogSection {
    margin-bottom: 20px;
    padding: 14px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
}

.end-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 6px;
}

.end-log-header.win {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.end-log-header.lose {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.end-log-header.manual {
    background: rgba(150, 150, 150, 0.15);
    border: 1px solid rgba(150, 150, 150, 0.3);
}

.end-log-reason {
    font-size: 14px;
    font-weight: 700;
}

.end-log-header.win .end-log-reason {
    color: #22c55e;
}

.end-log-header.lose .end-log-reason {
    color: #ef4444;
}

.end-log-header.manual .end-log-reason {
    color: var(--text-muted);
}

.end-log-time {
    font-size: 11px;
    color: var(--text-muted);
}

/* va-status-bar 반응형 */
@media (max-width: 480px) {
    .va-status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 8px 10px;
    }

    .va-status-left {
        width: 100%;
    }

    .va-status-right {
        width: 100%;
        justify-content: flex-end;
    }

    .auto-start-notice,
    .auto-end-notice {
        max-width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        transform: none;
    }

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

/* ========================================
   결과 수 선택 경고 모달
======================================== */

.limit-warning-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    /* backdrop-filter 제거 - 성능 최적화 */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.limit-warning-modal.show {
    opacity: 1;
}

.limit-warning-content {
    background: linear-gradient(145deg, #1e2a3a, #151d2a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.limit-warning-modal.show .limit-warning-content {
    transform: scale(1);
}

.limit-warning-icon {
    margin-bottom: 20px;
    color: #f59e0b;
}

.limit-warning-icon svg {
    filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.3));
}

.limit-warning-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
}

.limit-warning-message {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
}

.limit-warning-message strong {
    color: var(--accent-primary);
    font-weight: 600;
}

.limit-warning-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 24px 0;
}

.limit-warning-checkbox {
    margin-bottom: 24px;
}

.limit-warning-checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
}

.limit-warning-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.limit-warning-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.limit-warning-cancel,
.limit-warning-confirm {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.limit-warning-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.limit-warning-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.limit-warning-confirm {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #0a0f14;
}

.limit-warning-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}

@media (max-width: 480px) {
    .limit-warning-content {
        padding: 24px 20px;
    }

    .limit-warning-buttons {
        flex-direction: column;
    }

    .limit-warning-cancel,
    .limit-warning-confirm {
        width: 100%;
    }
}

/* ===== N매 선택 바 ===== */
.mae-selector-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.mae-selector-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    margin-right: 2px;
}

.mae-selector {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}

.mae-btn {
    padding: 5px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.mae-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.mae-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #0a0f14;
    font-weight: 600;
}

/* N매 모드: 타이 셀 (초록 원형) */
.bigroad-cell.tie {
    border: none;
}

.bigroad-cell.tie::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--color-tie);
    border-radius: 50%;
    background: transparent;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .mae-selector-bar {
        padding: 6px 10px;
        gap: 4px;
    }

    .mae-selector {
        gap: 2px;
    }

    .mae-btn {
        padding: 4px 7px;
        font-size: 11px;
    }
}
