/* box-sizing은 게임 보드 영역에만 적용 */
.hl-board-section,
.hl-board-section *,
.hl-board-section *::before,
.hl-board-section *::after {
    box-sizing: border-box;
}

/* 배경 래퍼 */
.hl-wrap {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 1230px;
    min-height: 100vh;
    background-color: #1a1008;
}

.hl-wrap::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('images/bg-hilo.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.4;
    pointer-events: none;
}

.hl-wrap > .header {
    position: relative;
    z-index: 1;
    background: #fefcf5;
}

/* 컨테이너 */
.hl-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1280px;
    min-width: 1230px;
    padding: 1.25rem;
    margin: 0 auto;
}

/* 게임 레이아웃 - 3단 그리드 */
.hl-game-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 320px;
    align-items: stretch;
    gap: 20px;
}

/* 보드 섹션 - 카드 테이블 */
.hl-board-section {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 620px;
    padding: 30px 20px;
    /* 테이블 펠트 배경 */
    background:
        radial-gradient(ellipse at center, rgba(255,255,255,.06) 0%, transparent 70%),
        linear-gradient(180deg, #1a5c2a 0%, #145222 40%, #0f4a1c 100%);
    /* 테이블 테두리 (나무 림) */
    border: 6px solid #5c3317;
    border-radius: 18px;
    box-shadow:
        inset 0 0 60px rgba(0,0,0,.35),
        inset 0 0 4px rgba(255,255,255,.05),
        0 0 0 3px #3e2009,
        0 0 0 6px #7a4a1e,
        0 4px 20px rgba(0,0,0,.5);
}

/* 펠트 질감 오버레이 */
.hl-board-section::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='6' height='6' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: .5;
    pointer-events: none;
    z-index: 0;
}

/* 테이블 내부 라인 장식 */
.hl-board-section::after {
    content: '';
    position: absolute;
    inset: 14px;
    border: 2px solid rgba(255,255,255,.08);
    border-radius: 12px;
    pointer-events: none;
    z-index: 0;
}

.hl-board-section > * {
    position: relative;
    z-index: 1;
}

/* 보드 헤더 */
.hl-board-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 auto 1rem;
}

.hl-board-header-icons {
    display: none;
}

.hl-board-title-img {
    width: 100%;
    max-width: 336px;
    height: auto;
    display: block;
}

.hl-board-header-title {
    display: none;
}

/* 좌측 패널 */
.hl-left-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* 히스토리 패널 */
.hl-history-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border: 4px solid #daa520;
    border-radius: 5px;
    background: linear-gradient(180deg, #fffef9 0%, #fefcf5 100%);
}

.hl-history-tabs {
    display: flex;
    border-bottom: 1px solid #d4af37;
    background: linear-gradient(180deg, #a01830 0%, #8b1528 100%);
}

.hl-history-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 12px 10px;
    gap: 5px;
    font-size: 0.85em;
    font-weight: 600;
    font-family: 'Pretendard';
    color: #8b4513;
    border: none;
    border-bottom: none;
    cursor: pointer;
    transition: all 0.2s;
    background: #fffef9;
}

.hl-history-tab:hover {
    background: #fefcf5;
}

.hl-history-tab.hl-active {
    font-weight: 700;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    background: linear-gradient(180deg, #a01830 0%, #8b1528 100%);
}

.hl-history-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.hl-tab-content {
    display: none;
    padding: 10px;
    flex: 1;
    min-height: 0;
}

.hl-tab-content.hl-active {
    display: flex;
    flex-direction: column;
}

.hl-tab-content.hl-active > div,
.hl-guide-tab-content.hl-active > div {
    flex: 1;
    min-height: 0;
}

.hl-empty-message {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    font-size: 0.9em;
    font-family: 'Pretendard';
    color: #8b4513;
    text-align: center;
    opacity: 0.7;
}

/* 통계 패널 (우측) */
.hl-stats-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.hl-stats-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 1rem;
    overflow: hidden;
}

.hl-bet-panel {
    overflow: hidden;
    padding: 0 15px 15px 15px;
    flex-shrink: 0;
    border: 4px solid #daa520;
    border-radius: 5px;
    background: linear-gradient(180deg, #fffef9 0%, #fefcf5 100%);
}

.hl-panel-title {
    padding: 12px 15px;
    font-size: 0.95em;
    font-weight: 600;
    font-family: 'Pretendard';
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    background: linear-gradient(180deg, #a01830 0%, #8b1528 100%);
    border-bottom: 3px solid #d4af37;
    margin: 0 -15px 15px -15px;
}

.hl-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 2px solid #d4af37;
    border-radius: 3px;
    background: #ffffff;
    margin-bottom: 10px;
}

.hl-stat-label {
    font-size: 0.9em;
    font-weight: 500;
    font-family: 'Pretendard';
    color: #8b4513;
}

.hl-stat-value {
    font-size: 1.2em;
    font-weight: bold;
    font-family: 'Pretendard';
    color: #333333;
}


/* 버튼 공통 */
.hl-btn {
    padding: 12px;
    width: 100%;
    font-size: 1em;
    font-weight: bold;
    font-family: 'Pretendard';
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.hl-btn-start {
    color: #ffffff;
    font-size: 1.15em;
    letter-spacing: 2px;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    background: linear-gradient(to top, #ff424c, #ee9d72);
    border: 1px solid #e64045;
    box-shadow: 0 5px 0 #ca0d13;
}

.hl-btn-cashout {
    color: #228b22;
    background: #ffffff;
}

.hl-btn-cashout:hover:not(:disabled) {
    background: #fefcf5;
}

.hl-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 가이드 패널 (우측 하단) */
.hl-guide-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    border: 4px solid #daa520;
    border-radius: 5px;
    background: linear-gradient(180deg, #fffef9 0%, #fefcf5 100%);
}

.hl-guide-tabs {
    display: flex;
    border-bottom: 1px solid #d4af37;
    background: linear-gradient(180deg, #a01830 0%, #8b1528 100%);
}

.hl-guide-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 12px 10px;
    font-size: 0.85em;
    font-weight: 600;
    font-family: 'Pretendard';
    color: #8b4513;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    background: #fffef9;
}

.hl-guide-tab:hover {
    background: #fefcf5;
}

.hl-guide-tab.hl-active {
    font-weight: 700;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    background: linear-gradient(180deg, #a01830 0%, #8b1528 100%);
}

.hl-guide-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.hl-guide-tab-content {
    display: none;
    padding: 10px;
    flex: 1;
    min-height: 0;
}

.hl-guide-tab-content.hl-active {
    display: flex;
    flex-direction: column;
}

/* 플레이 기록 아이템 */
.hl-playlog-item {
    padding: 12px;
    border: 1px solid #d4af37;
    border-radius: 3px;
    background: #ffffff;
    margin-bottom: 10px;
}

.hl-playlog-item .hl-round-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.hl-playlog-item .hl-round-id {
    font-size: 0.8em;
    font-family: 'Pretendard';
    color: #888888;
}

.hl-playlog-item .hl-round-time {
    font-size: 0.75em;
    font-family: 'Pretendard';
    color: #aaaaaa;
}

.hl-playlog-item .hl-round-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hl-playlog-item .hl-bet-info {
    font-size: 0.85em;
    font-family: 'Pretendard';
    color: #666666;
}

.hl-playlog-item .hl-result-info {
    text-align: right;
}

.hl-playlog-item .hl-result-info .hl-multiplier {
    font-size: 0.9em;
    font-weight: 600;
    font-family: 'Pretendard';
    color: #e93342;
}

.hl-playlog-item .hl-result-info .hl-profit {
    font-size: 0.95em;
    font-weight: bold;
    font-family: 'Pretendard';
}

.hl-playlog-item .hl-result-info .hl-profit.hl-win {
    color: #22c55e;
}

.hl-playlog-item .hl-result-info .hl-profit.hl-lose {
    color: #ef4444;
}

/* 배수표 */
.hl-multiplier-table {
    padding: 0;
}

.hl-multiplier-table h3 {
    padding: 10px 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Pretendard';
    color: #333;
    text-align: center;
    background: #fff8e5;
    border: 2px solid #ffdbad;
    border-bottom: none;
    margin: 0;
}

.hl-multiplier-table table {
    width: 100%;
    font-size: 0.8em;
    font-family: 'Pretendard';
    border-collapse: collapse;
}

.hl-multiplier-table thead th {
    padding: 8px 6px;
    font-weight: bold;
    font-size: 0.9em;
    color: #ffffff;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    background: linear-gradient(180deg, #a01830 0%, #8b1528 100%);
    border-bottom: 2px solid #d4af37;
}

.hl-multiplier-table tbody td {
    padding: 7px 6px;
    color: #333333;
    text-align: center;
    border-bottom: 1px solid #e8d5a3;
    background: #ffffff;
}

.hl-multiplier-table tbody tr:hover td {
    background: rgba(218, 165, 32, 0.1);
}

.hl-multiplier-table .hl-td-multiplier {
    font-weight: bold;
    color: #c41e3a;
}

.hl-multiplier-table .hl-td-amount {
    font-weight: 600;
    color: #228b22;
}

/* 캐시아웃 히스토리 */
.hl-cashout-history {
    overflow-y: auto;
    padding: 15px;
    border: 4px solid #daa520;
    border-radius: 5px;
    background: linear-gradient(180deg, #fffef9 0%, #fefcf5 100%);
}

.hl-cashout-history h3 {
    padding-top: 10px;
    font-size: 0.95em;
    font-weight: 600;
    font-family: 'Pretendard';
    color: #8b4513;
    text-align: left;
    margin-bottom: 10px;
}

.hl-cashout-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border: 1px solid #d4af37;
    border-radius: 3px;
    animation: hl-slideIn 0.3s ease;
    background: #ffffff;
    margin-bottom: 8px;
}

@keyframes hl-slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hl-cashout-item .hl-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hl-cashout-item .hl-user {
    font-size: 0.8em;
    font-family: 'Pretendard';
    color: #8b4513;
    margin-bottom: 3px;
}

.hl-cashout-item .hl-right-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.hl-cashout-item .hl-amount {
    font-size: 1em;
    font-weight: bold;
    font-family: 'Pretendard';
    color: #228b22;
}

.hl-cashout-item .hl-multiplier {
    font-size: 0.85em;
    font-weight: 600;
    font-family: 'Pretendard';
    color: #c41e3a;
}

/* 게임룰 스타일 */
.hl-rule-content {
    padding: 5px;
    flex: 1;
}

.hl-rule-section {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #d4af37;
}

.hl-rule-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.hl-rule-title {
    font-size: 0.9em;
    font-weight: 700;
    font-family: 'Pretendard';
    color: #8b4513;
    margin-bottom: 8px;
}

.hl-rule-section p {
    font-size: 0.8em;
    font-family: 'Pretendard';
    color: #555;
    line-height: 1.5;
    margin: 0;
}

.hl-rule-step {
    font-size: 0.8em;
    font-family: 'Pretendard';
    color: #333;
    margin-bottom: 8px;
}

.hl-rule-step strong {
    color: #c41e3a;
}

.hl-rule-step ul {
    margin: 5px 0 0 0;
    padding-left: 20px;
}

.hl-rule-step ul li {
    font-size: 0.95em;
    color: #555;
    line-height: 1.6;
    margin-bottom: 2px;
}

.hl-fair-section {
    background: #fff4eb;
    border: 2px solid #ffc584 !important;
    border-radius: 5px;
    padding: 12px !important;
    margin-top: 10px;
}

.hl-fair-section .hl-rule-title {
    color: #c41e3a;
    margin-bottom: 10px;
}

.hl-fair-section p {
    font-size: 0.75em;
    color: #666;
    line-height: 1.5;
}

.hl-fair-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.hl-fair-list li {
    font-size: 0.8em;
    font-family: 'Pretendard';
    color: #228b22;
    font-weight: 600;
    line-height: 1.6;
}

/* Footer */
.hl-wrap .footer {
    width: 100%;
    background: #fff;
}

.hl-wrap .footer > div {
    padding: 1rem;
    background: #fffdf7;
}

/* ── 모바일 (480px 이하) - 레이아웃 ── */
@media (max-width: 480px) {
    .hl-wrap {
        overflow-x: hidden;
        padding: 5px;
        min-width: auto;
    }

    .hl-wrap::before {
        min-width: auto;
    }

    .hl-container {
        min-width: auto;
        padding: 5px;
    }

    .hl-game-layout {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .hl-board-section {
        order: 1;
        width: 100%;
        padding: 15px 10px;
        border-width: 4px;
        height:95vh;
        max-height: calc(100vh - 51px);
        border-radius: 0;
    }

    .hl-board-section::after {
        inset: 8px;
        border-radius: 8px;
    }

    .hl-stats-panel {
        order: 2;
        width: 100%;
        overflow: visible;
    }

    .hl-stats-inner {
        flex: none;
        overflow: visible;
    }

    .hl-left-panel {
        order: 3;
        width: 100%;
        overflow: visible;
    }

    .hl-history-panel {
        flex: none;
        max-height: 40vh;
        overflow: hidden;
        border-width: 1px;
        border-radius: 0;
    }

    .hl-history-content {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    .hl-history-content .hl-tab-content {
        padding: 10px 10px 20px;
    }

    .hl-tab-content.hl-active > div,
    .hl-guide-tab-content.hl-active > div {
        flex: none;
    }

    .hl-board-title-img {
        max-width: 196px;
    }

    .hl-bet-panel {
        padding: 0 10px 10px 10px;
        border-width: 1px;
        border-radius: 0;
    }

    .hl-panel-title {
        padding: 10px 12px;
        font-size: 0.85em;
        margin: 0 -10px 10px -10px;
    }

    .hl-stat-item {
        display: inline-flex;
        flex-direction: column;
        padding: 2px;
        width: calc(50% - 2px);
        margin-bottom: 0;
    }

    .hl-guide-panel {
        flex: none;
        max-height: 40vh;
        overflow: hidden;
        border-width: 1px;
        border-radius: 0;
    }

    .hl-guide-content {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    .hl-guide-tab {
        padding: 10px 8px;
        font-size: 0.8em;
    }

    .hl-guide-tab-content {
        padding: 8px 8px 20px;
    }

    .hl-multiplier-table h3 {
        padding: 8px 10px;
        font-size: 0.8em;
    }

    .hl-multiplier-table table {
        font-size: 0.75em;
    }

    .hl-multiplier-table thead th {
        padding: 6px 4px;
        font-size: 0.85em;
    }

    .hl-multiplier-table tbody td {
        padding: 5px 4px;
    }

    /* 게임룰 모바일 */
    .hl-rule-content {
        padding: 3px;
    }

    .hl-rule-section {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .hl-rule-title {
        font-size: 0.8em;
    }

    .hl-rule-section p,
    .hl-rule-step,
    .hl-rule-step ul li {
        font-size: 0.75em;
    }

    .hl-fair-section {
        padding: 8px !important;
    }

    .hl-fair-section p,
    .hl-fair-list li {
        font-size: 0.7em;
    }
}


/* ============================================================
   Part 2: HiLo Game Board Styles (from hilo.html)
   - 게임 영역 내부: 카드, 버튼, 오버레이 등
   ============================================================ */

/* CSS Variables */
:root {
    --bg-dark: #1a1a2e;
    --bg-game: #0f0f23;
    --card-bg: #f0f0f0;
    --accent-orange: #e8891d;
    --accent-gold: #f5c842;
    --accent-green: #2ecc71;
    --accent-red: #e74c3c;
    --accent-blue: #3498db;
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, .7);
    --glass-bg: rgba(255, 255, 255, .08);
    --glass-border: rgba(255, 255, 255, .12);
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, .3);
    --font: 'Inter', sans-serif;
}

/* Game Area - 테이블 내부 */
.hl-game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    padding: 20px 20px 0;
    position: relative;
    min-height: 380px;
}

/* Step progress bar */
.hl-step-bar {
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 12px 0;
    padding: 8px 14px;
    background: rgba(0,0,0,.18);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.06);
}

.hl-step-dot {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .15);
    transition: background .4s, box-shadow .4s;
}

.hl-step-dot.hl-won {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(46, 204, 113, .5);
}

.hl-step-dot.hl-lost {
    background: var(--accent-red);
    box-shadow: 0 0 8px rgba(231, 76, 60, .5);
}

.hl-step-dot.hl-active {
    background: var(--accent-gold);
    box-shadow: 0 0 8px rgba(245, 200, 66, .5);
}

/* Side Info (multiplier & step) - 한 줄 가로 배치 */
.hl-side-info {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    margin-bottom: 16px;
}

.hl-info-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    backdrop-filter: blur(4px);
}

.hl-info-badge .hl-info-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: .5px;
}

.hl-info-badge .hl-val {
    font-size: 18px;
    font-weight: 800;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255,215,0,.4);
}

/* Deck Pile (cards-area 내부 flex 아이템) */
.hl-deck-pile-area {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.hl-deck-pile-area.hl-visible { display: flex; }

.hl-deck-stack {
    position: relative;
    width: 50px;
    height: 70px;
}

.hl-deck-mini-card {
    position: absolute;
    left: 0;
    width: 50px;
    height: 70px;
    border-radius: 5px;
    background: linear-gradient(145deg, #8b0000 0%, #a01530 40%, #c41e3a 100%);
    border: 1.5px solid #f0d060;
    box-shadow: 0 2px 5px rgba(0,0,0,.5);
    transition: transform .25s ease, opacity .25s ease;
    overflow: hidden;
}
.hl-deck-mini-card::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(255,215,0,.3);
    border-radius: 3px;
    background:
        repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255,255,255,.05) 2px, rgba(255,255,255,.05) 4px),
        repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(255,255,255,.05) 2px, rgba(255,255,255,.05) 4px);
}
.hl-deck-mini-card::after {
    content: '♠';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: rgba(255,215,0,.3);
    border: none;
    inset: auto;
    border-radius: 0;
}
.hl-deck-count-num {
    font-size: 20px;
    font-weight: 900;
    color: #ffd700;
    line-height: 1;
    text-shadow: 0 0 6px rgba(255,215,0,.3);
}
.hl-deck-count-label {
    font-size: 9px;
    color: var(--text-secondary);
    letter-spacing: .5px;
}
@media (max-width: 800px) { .hl-deck-pile-area { display: none !important; } }

/* Shuffle Overlay */
.hl-shuffle-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 30, .82);
    backdrop-filter: blur(3px);
    z-index: 200;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    border-radius: var(--radius);
}
.hl-shuffle-overlay.hl-show { display: flex; }

.hl-shuffle-cards {
    position: relative;
    width: 90px;
    height: 120px;
}
.hl-sh-card {
    position: absolute;
    left: 50%;
    top: 0;
    width: 60px;
    height: 85px;
    margin-left: -30px;
    border-radius: 7px;
    background: linear-gradient(145deg, #8b0000 0%, #a01530 40%, #c41e3a 100%);
    border: 1.5px solid #f0d060;
    box-shadow: 0 4px 14px rgba(0,0,0,.55);
    transform-origin: center 130%;
    overflow: hidden;
}
.hl-sh-card::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(255,215,0,.3);
    border-radius: 4px;
    background:
        repeating-linear-gradient(45deg, transparent, transparent 3px, rgba(255,255,255,.05) 3px, rgba(255,255,255,.05) 6px),
        repeating-linear-gradient(-45deg, transparent, transparent 3px, rgba(255,255,255,.05) 3px, rgba(255,255,255,.05) 6px);
}
@keyframes hl-sh-riffle-0 { 0%,100%{transform:rotate(-30deg) translateY(0)}  50%{transform:rotate(-30deg) translateY(-14px)} }
@keyframes hl-sh-riffle-1 { 0%,100%{transform:rotate(-15deg) translateY(0)}  50%{transform:rotate(-15deg) translateY(-10px)} }
@keyframes hl-sh-riffle-2 { 0%,100%{transform:rotate(0deg)   translateY(0)}  50%{transform:rotate(0deg)   translateY(-8px)}  }
@keyframes hl-sh-riffle-3 { 0%,100%{transform:rotate(15deg)  translateY(0)}  50%{transform:rotate(15deg)  translateY(-10px)} }
@keyframes hl-sh-riffle-4 { 0%,100%{transform:rotate(30deg)  translateY(0)}  50%{transform:rotate(30deg)  translateY(-14px)} }
.hl-sh-card:nth-child(1){animation:hl-sh-riffle-0 .55s ease-in-out infinite;animation-delay:0s}
.hl-sh-card:nth-child(2){animation:hl-sh-riffle-1 .55s ease-in-out infinite;animation-delay:.07s}
.hl-sh-card:nth-child(3){animation:hl-sh-riffle-2 .55s ease-in-out infinite;animation-delay:.14s}
.hl-sh-card:nth-child(4){animation:hl-sh-riffle-3 .55s ease-in-out infinite;animation-delay:.21s}
.hl-sh-card:nth-child(5){animation:hl-sh-riffle-4 .55s ease-in-out infinite;animation-delay:.28s}

.hl-shuffle-text {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}
.hl-shuffle-dots::after {
    content: '';
    animation: hl-dots-anim 1.2s steps(4, end) infinite;
}
@keyframes hl-dots-anim {
    0%  { content: '';    }
    25% { content: '.';   }
    50% { content: '..';  }
    75% { content: '...'; }
}

/* Flying card animation */
.hl-flying-card {
    position: fixed;
    border-radius: 7px;
    background: linear-gradient(145deg, #8b0000 0%, #a01530 40%, #c41e3a 100%);
    border: 1.5px solid #f0d060;
    box-shadow: 0 6px 24px rgba(0,0,0,.7);
    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
    transition: left .32s cubic-bezier(.4,0,.2,1),
                top .32s cubic-bezier(.4,0,.2,1),
                width .32s cubic-bezier(.4,0,.2,1),
                height .32s cubic-bezier(.4,0,.2,1),
                border-radius .32s ease;
}
.hl-flying-card::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(255,215,0,.3);
    border-radius: 4px;
    background:
        repeating-linear-gradient(45deg, transparent, transparent 3px, rgba(255,255,255,.05) 3px, rgba(255,255,255,.05) 6px),
        repeating-linear-gradient(-45deg, transparent, transparent 3px, rgba(255,255,255,.05) 3px, rgba(255,255,255,.05) 6px);
}

/* Cards Area - 테이블 중앙 카드존 */
.hl-cards-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    width: 100%;
    max-width: 600px;
    margin-bottom: 28px;
    padding: 28px 40px;
    background: rgba(0,0,0,.15);
    border: 2px solid rgba(255,255,255,.08);
    border-radius: 16px;
    box-shadow: inset 0 2px 12px rgba(0,0,0,.2);
}

.hl-card-slot {
    width: 120px;
    height: 170px;
    perspective: 800px;
    position: relative;
}

.hl-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform .6s cubic-bezier(.4, .2, .2, 1);
    border-radius: 12px;
    cursor: default;
}

.hl-card.hl-flipped {
    transform: rotateY(180deg);
}

.hl-card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .5), 0 2px 6px rgba(0,0,0,.3);
}

.hl-card-back {
    background: linear-gradient(145deg, #8b0000 0%, #a01530 40%, #c41e3a 100%);
    border: 3px solid #f0d060;
    overflow: hidden;
}

/* 카드 뒷면 패턴 */
.hl-card-back::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 2px solid rgba(255,215,0,.4);
    border-radius: 6px;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 4px,
            rgba(255,255,255,.06) 4px,
            rgba(255,255,255,.06) 8px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 4px,
            rgba(255,255,255,.06) 4px,
            rgba(255,255,255,.06) 8px
        );
    z-index: 1;
}

.hl-card-back::after {
    content: '♠';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: auto;
    border: none;
    border-radius: 0;
    font-size: 32px;
    color: rgba(255,215,0,.35);
    text-shadow: 0 0 6px rgba(255,215,0,.2);
    z-index: 2;
}

#nextCard.hl-empty-slot .hl-card-back {
    background: rgba(255,255,255,.04);
    border: 2px dashed rgba(255, 255, 255, .18);
    box-shadow: none;
}
#nextCard.hl-empty-slot .hl-card-back::before {
    display: none;
}
#nextCard.hl-empty-slot .hl-card-back::after {
    content: '?';
    font-size: 38px;
    font-weight: 900;
    color: rgba(255, 255, 255, .12);
    text-shadow: none;
}

.hl-card-front {
    background: linear-gradient(180deg, #ffffff 0%, #f8f8f8 100%);
    color: #333;
    transform: rotateY(180deg);
    padding: 12px;
    border: 2px solid rgba(0,0,0,.08);
}

.hl-card-front .hl-card-value {
    font-size: 42px;
    line-height: 1;
    font-weight: 900;
}

.hl-card-front .hl-card-suit {
    font-size: 36px;
    margin-top: 4px;
}

.hl-card-front.hl-red {
    color: #e74c3c;
}

.hl-card-front.hl-black {
    color: #2c3e50;
}

.hl-card-front .hl-corner {
    position: absolute;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.hl-card-front .hl-corner-tl {
    top: 8px;
    left: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.hl-card-front .hl-corner-br {
    bottom: 8px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    transform: rotate(180deg);
}

.hl-card-front .hl-corner .hl-c-suit {
    font-size: 12px;
}

/* VS divider */
.hl-vs-badge {
    font-size: 13px;
    font-weight: 800;
    color: #ffd700;
    background: rgba(0,0,0,.4);
    border: 2px solid rgba(255,215,0,.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 6px rgba(255,215,0,.4);
    box-shadow: 0 0 12px rgba(0,0,0,.3);
}

/* Refresh Button */
.hl-refresh-area {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.hl-btn-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid rgba(255,215,0,.4);
    border-radius: 8px;
    background: rgba(255,215,0,.1);
    color: #ffd700;
    font-family: var(--font);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}

.hl-btn-refresh:hover {
    background: rgba(255,215,0,.25);
    border-color: rgba(255,215,0,.6);
}

.hl-btn-refresh:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.hl-refresh-icon {
    font-size: 16px;
}

.hl-refresh-count {
    font-size: 11px;
    opacity: .7;
}

/* Guess Buttons */
.hl-guess-buttons {
    display: flex;
    visibility: hidden;
    gap: 0;
    width: 100%;
    max-width: 600px;
    flex: 1;
    align-items: center;
}

.hl-btn-guess {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-radius: 0;
    font-family: var(--font);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 0 rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.2);
}

.hl-btn-guess:hover {
}

@media (hover: hover) {
    .hl-guess-buttons:has(.hl-btn-guess:hover:not(:disabled)) .hl-btn-guess:not(:hover) {
        opacity: 0.75;
    }
}

.hl-btn-guess:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

.hl-btn-higher {
    background: linear-gradient(180deg, #34d058, #28a745);
    color: #fff;
    border-bottom: 3px solid #1e7e34;
    border-radius: 10px 0 0 10px;
    justify-content: flex-end;
}

.hl-btn-lower {
    background: linear-gradient(180deg, #e85d5d, #d32f2f);
    color: #fff;
    border-bottom: 3px solid #b71c1c;
    border-radius: 0 10px 10px 0;
    justify-content: flex-start;
}

.hl-btn-guess .hl-mult {
    font-size: 12px;
    opacity: .85;
    min-height: 1em;
}

.hl-btn-higher .hl-mult {
    margin-right: auto;
}

.hl-btn-lower .hl-mult {
    margin-left: auto;
}

.hl-btn-guess .hl-guess-label {
    font-size: 14px;
}

.hl-btn-guess .hl-arrow {
    font-size: 20px;
    margin: 0 6px;
}

/* ========== Bet Overlay (Mine 스타일 동일) ========== */
.hl-bet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border-radius: 15px;
    background: rgb(0 0 0 / 25%);
    backdrop-filter: blur(3px);
}

.hl-bet-overlay.hl-hidden {
    display: none;
}

.hl-bet-overlay-content {
    width: 90%;
    max-width: 340px;
    overflow: hidden;
    padding: 3px;
    background: linear-gradient(to right, #fc7555 50%, #ff5d58);
    clip-path: polygon(20px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.hl-overlay-section {
    overflow: hidden;
    background: transparent;
}

.hl-overlay-section:first-child {
    margin-top: 0;
}

.hl-bet-overlay-content > .hl-overlay-section {
    clip-path: polygon(20px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
}

.hl-overlay-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.9em;
    font-weight: 600;
    font-family: 'Pretendard', sans-serif;
    color: #c41e3a;
    background: #fff;
    border: 2px solid #d54a6138;
    border-bottom-width: 1px;
}

.hl-overlay-title .hl-bet-limits {
    font-size: 0.8em;
    color: #c41e3a;
    font-weight: bold;
}

.hl-overlay-body {
    padding: 12px;
    border: 1px solid #d4af37;
    border-top: none;
    background: #ffffff;
}

.hl-overlay-body input[type="number"] {
    padding: 10px;
    width: 100%;
    font-size: 0.95em;
    font-weight: bold;
    font-family: 'Pretendard', sans-serif;
    color: #333333;
    text-align: right;
    border: 2px solid #d4af37;
    border-radius: 3px;
    background: #ffffff;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.hl-overlay-body input[type="number"]:focus {
    border-color: #b8860b;
    outline: none;
}

.hl-quick-bet-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-top: 8px;
}

.hl-quick-bet-btn {
    padding: 6px 4px;
    font-size: 0.8em;
    font-weight: 600;
    font-family: 'Pretendard', sans-serif;
    color: #8b4513;
    border: 2px solid #d4af37;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    background: #ffffff;
}

.hl-quick-bet-btn:hover {
    color: #ffffff;
    border-color: #d4af37;
    background: linear-gradient(180deg, #c41e3a 0%, #a01830 100%);
}

.hl-overlay-section.hl-start-section {
    padding: 0;
    border: none;
    width: 90%;
    max-width: 340px;
    background: transparent;
    overflow: visible;
}

.hl-btn {
    padding: 12px;
    width: 100%;
    font-size: 1em;
    font-weight: bold;
    font-family: 'Pretendard', sans-serif;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.hl-btn-start {
    color: #ffffff;
    font-size: 1.15em;
    letter-spacing: 2px;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    background: linear-gradient(to top, #ff424c, #ee9d72);
    border: 1px solid #e64045;
    box-shadow: 0 5px 0 #ca0d13;
    padding: 16px 20px;
}

.hl-btn-start:hover:not(:disabled) {
    background: linear-gradient(to bottom, #e63040, #d4785a);
}

.hl-btn-start:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* History + Cashout Row */
.hl-history-row {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 600px;
    padding: 8px 12px;
    background: rgba(0,0,0,.12);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.05);
    min-height: 60px;
}

.hl-history-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
    max-height: 60px;
    overflow: hidden;
}

/* Cashout button (HiLo) */
.hl-btn-cashout-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, #ffd700, #e8a800);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-family: var(--font);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 3px 0 #b8860b, 0 4px 12px rgba(0,0,0,.3);
    flex-shrink: 0;
    margin-left: auto;
    white-space: nowrap;
}

.hl-btn-cashout-game:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #b8860b, 0 8px 20px rgba(0, 0, 0, .3);
}

.hl-btn-cashout-game:disabled {
    background: linear-gradient(180deg, #8a8a6e, #6e6e56);
    color: rgba(255,255,255,.4);
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

.hl-btn-cashout-game .hl-cashout-amount {
    font-size: 12px;
    opacity: .9;
    min-height: 1em;
}

.hl-history-card {
    width: 40px;
    height: 56px;
    border-radius: 6px;
    background: linear-gradient(180deg, #ffffff, #f5f5f5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
    transition: all .3s;
    border: 1px solid rgba(0,0,0,.08);
}

.hl-history-card.hl-red {
    color: #e74c3c;
}

.hl-history-card.hl-black {
    color: #2c3e50;
}

.hl-history-card .hl-h-suit {
    font-size: 10px;
}


/* Result Overlay */
.hl-result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    border-radius: var(--radius);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s;
}

.hl-result-overlay.hl-show {
    opacity: 1;
    pointer-events: auto;
}

.hl-result-box {
    text-align: center;
    padding: 30px 50px;
    border-radius: 16px;
    background: rgba(0,0,0,.6);
    border: 2px solid rgba(255,215,0,.3);
    animation: hl-popIn .4s cubic-bezier(.4, .2, .2, 1);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}

@keyframes hl-popIn {
    from {
        transform: scale(.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.hl-result-box .hl-r-title {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 8px;
}

.hl-result-box .hl-r-title.hl-won {
    color: var(--accent-green);
}

.hl-result-box .hl-r-title.hl-lost {
    color: var(--accent-red);
}

.hl-result-box .hl-r-detail {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.hl-result-box .hl-r-amount {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: 16px;
}

.hl-btn-new-game {
    padding: 10px 40px;
    background: linear-gradient(180deg, #ffd700, #e8a800);
    color: #1a1a1a;
    border: none;
    border-radius: 10px;
    font-family: var(--font);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 3px 0 #b8860b, 0 4px 12px rgba(0,0,0,.3);
}

.hl-btn-new-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #b8860b, 0 8px 20px rgba(0,0,0,.3);
}

/* Status Bar */
.hl-status-bar {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: center;
}

.hl-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.hl-status-dot.hl-connected {
    background: var(--accent-green);
}

.hl-status-dot.hl-disconnected {
    background: var(--accent-red);
}

/* Help Button */
.hl-btn-help {
    background: transparent;
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.hl-btn-help:hover { background: rgba(255,255,255,.15); }

/* Help Modal */
.hl-help-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 999;
    align-items: center;
    justify-content: center;
}
.hl-help-overlay.hl-show { display: flex; }
.hl-help-box {
    background: #1e1e3a;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 420px;
    width: 90%;
    color: var(--text-primary);
}
.hl-help-box h2 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 18px;
    color: var(--accent-gold);
    text-align: center;
}
.hl-help-box .hl-rule-item {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.6;
}
.hl-help-box .hl-rule-icon {
    font-size: 20px;
    flex-shrink: 0;
}
.hl-help-box .hl-rule-label {
    font-weight: 700;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 2px;
}
.hl-help-box .hl-rule-text {
    color: var(--text-secondary);
}
.hl-help-box .hl-help-close {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: var(--accent-orange);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.hl-help-box .hl-help-close:hover { opacity: .85; }

/* Animations */
@keyframes hl-slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes hl-shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-8px);
    }
    75% {
        transform: translateX(8px);
    }
}

.hl-card-shake {
    animation: hl-shake .4s ease;
}

.hl-fade-in {
    animation: hl-slideUp .4s ease;
}

/* ── 모바일 (600px 이하) - 게임보드 ── */
@media(max-width:600px) {
    .hl-game-area {
        padding: 10px 0 0;
    }

    .hl-side-info {
        margin-bottom: 0;
    }

    .hl-cards-area {
        padding: 12px 16px;
        gap: 12px;
        margin-bottom: 12px;
    }

    .hl-card-slot {
        width: 100px;
        height: 140px;
    }

    .hl-card-front .hl-card-value {
        font-size: 32px;
    }

    .hl-card-front .hl-card-suit {
        font-size: 28px;
    }

    .hl-guess-buttons {
        gap: 0;
        padding: 0 0.5rem;
    }

    .hl-btn-guess {
        padding: 10px 16px;
        font-size: 12px;
        box-shadow: 0 2px 0 rgba(0, 0, 0, .2);
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .hl-btn-guess .hl-arrow { order: 1; }
    .hl-btn-guess .hl-guess-label { order: 2; }
    .hl-btn-guess .hl-mult { order: 3; margin: 4px 0 0; margin-left: 0; margin-right: 0; }

    .hl-bet-overlay-content,
    .hl-overlay-section.hl-start-section {
        max-width: 280px;
    }

    .hl-quick-bet-btn {
        font-size: 0.7em;
        padding: 5px 3px;
    }

    .hl-btn-start {
        font-size: 1em;
        padding: 12px 16px;
    }

    .hl-history-row {
        flex-wrap: wrap;
        padding: 8px 10px;
    }

    .hl-history-cards {
        width: 100%;
        flex-wrap: nowrap;
    }

    .hl-history-card {
        width: auto;
        min-width: 0;
        flex: 0 1 40px;
        height: auto;
        aspect-ratio: 5/7;
        font-size: 10px;
    }

    .hl-history-card .hl-h-suit {
        font-size: 8px;
    }

    .hl-btn-cashout-game {
        flex-direction: row;
        justify-content: space-around;
        gap: 12px;
        width: 100%;
        margin-left: 0;
        padding: 10px 0;
    }

    .hl-btn-cashout-game .hl-cashout-amount {
        font-size: 14px;
        font-weight: 700;
        min-height: auto;
    }
}

/* ── 모바일 가로모드 - 세로모드처럼 표시 (맨 끝에 위치하여 모든 스타일 오버라이드) ── */
@media (orientation: landscape) and (max-height: 600px) {
    .hl-wrap {
        max-width: 393px;
        min-width: auto;
        min-height: auto;
        margin: 0 auto;
        overflow-x: hidden;
        padding: 5px;
    }

    .hl-wrap::before {
        min-width: auto;
    }

    .hl-container {
        min-width: auto;
        padding: 5px;
    }

    .hl-game-layout {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .hl-board-section {
        order: 1;
        width: 100%;
        padding: 15px 10px;
        border-width: 4px;
        height: auto;
        min-height: auto;
        max-height: none;
        border-radius: 0;
    }

    .hl-board-section::after {
        inset: 8px;
        border-radius: 8px;
    }

    .hl-stats-panel {
        order: 2;
        width: 100%;
        height: auto !important;
        min-height: auto;
        max-height: none;
        overflow: visible;
    }

    .hl-stats-inner {
        flex: none;
        height: auto;
        min-height: auto;
        max-height: none;
        overflow: visible;
    }

    .hl-left-panel {
        order: 3;
        width: 100%;
        height: auto;
        min-height: auto;
        max-height: none;
        overflow: visible;
    }

    .hl-history-panel {
        flex: none;
        height: auto;
        min-height: auto;
        max-height: none;
        overflow-y: auto;
        border-width: 1px;
        border-radius: 0;
    }

    .hl-history-content {
        flex: none;
        min-height: auto;
    }

    .hl-tab-content.hl-active {
        flex: none;
    }

    .hl-tab-content.hl-active > div,
    .hl-guide-tab-content.hl-active > div {
        flex: none;
        min-height: auto;
    }

    .hl-board-title-img {
        max-width: 196px;
    }

    .hl-bet-panel {
        padding: 0 10px 10px 10px;
        border-width: 1px;
        border-radius: 0;
    }

    .hl-panel-title {
        padding: 10px 12px;
        font-size: 0.85em;
        margin: 0 -10px 10px -10px;
    }

    .hl-stat-item {
        display: inline-flex;
        flex-direction: column;
        padding: 2px;
        width: calc(50% - 2px);
        margin-bottom: 0;
    }

    .hl-guide-panel {
        flex: none;
        height: auto;
        min-height: auto;
        max-height: none;
        overflow-y: auto;
        border-width: 1px;
        border-radius: 0;
    }

    .hl-guide-content {
        flex: none;
        min-height: auto;
    }

    .hl-guide-tab-content.hl-active {
        flex: none;
    }

    .hl-guide-tab {
        padding: 10px 8px;
        font-size: 0.8em;
    }

    .hl-guide-tab-content {
        padding: 8px 8px 20px;
    }

    .hl-history-content .hl-tab-content {
        padding: 10px 10px 20px;
    }

    .hl-multiplier-table h3 {
        padding: 8px 10px;
        font-size: 0.8em;
    }

    .hl-multiplier-table table {
        font-size: 0.75em;
    }

    .hl-multiplier-table thead th {
        padding: 6px 4px;
        font-size: 0.85em;
    }

    .hl-multiplier-table tbody td {
        padding: 5px 4px;
    }

    .hl-rule-content {
        padding: 3px;
    }

    .hl-rule-section {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .hl-rule-title {
        font-size: 0.8em;
    }

    .hl-rule-section p,
    .hl-rule-step,
    .hl-rule-step ul li {
        font-size: 0.75em;
    }

    .hl-fair-section {
        padding: 8px !important;
    }

    .hl-fair-section p,
    .hl-fair-list li {
        font-size: 0.7em;
    }

    /* 게임보드 내부 */
    .hl-game-area {
        flex: none;
        padding: 10px 0 0;
        min-height: auto;
    }

    .hl-side-info {
        margin-bottom: 0;
    }

    .hl-cards-area {
        flex: none;
        padding: 10px 12px;
        gap: 10px;
        margin-bottom: 8px;
    }

    .hl-card-slot {
        width: 80px;
        height: auto;
        aspect-ratio: 5 / 7;
    }

    .hl-card-front .hl-card-value {
        font-size: 26px;
    }

    .hl-card-front .hl-card-suit {
        font-size: 22px;
    }

    .hl-guess-buttons {
        gap: 0;
        padding: 0 0.5rem;
    }

    .hl-btn-guess {
        padding: 8px 14px;
        font-size: 11px;
        box-shadow: 0 2px 0 rgba(0, 0, 0, .2);
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .hl-btn-guess .hl-arrow { order: 1; }
    .hl-btn-guess .hl-guess-label { order: 2; }
    .hl-btn-guess .hl-mult { order: 3; margin: 4px 0 0; margin-left: 0; margin-right: 0; }

    .hl-bet-overlay-content,
    .hl-overlay-section.hl-start-section {
        max-width: 260px;
    }

    .hl-quick-bet-btn {
        font-size: 0.65em;
        padding: 4px 2px;
    }

    .hl-btn-start {
        font-size: 0.95em;
        padding: 10px 14px;
    }

    .hl-history-row {
        flex-wrap: wrap;
        padding: 8px 10px;
    }

    .hl-history-cards {
        width: 100%;
        flex-wrap: nowrap;
    }

    .hl-history-card {
        width: auto;
        min-width: 0;
        flex: 0 1 40px;
        height: auto;
        aspect-ratio: 5/7;
        font-size: 10px;
    }

    .hl-history-card .hl-h-suit {
        font-size: 8px;
    }

    .hl-btn-cashout-game {
        flex-direction: row;
        justify-content: space-around;
        gap: 12px;
        width: 100%;
        margin-left: 0;
        padding: 10px 0;
    }

    .hl-btn-cashout-game .hl-cashout-amount {
        font-size: 14px;
        font-weight: 700;
        min-height: auto;
    }

    .hl-deck-pile-area {
        display: none !important;
    }
}
