/**
 * HTZ Type 2 - Gold Theme (Light/Dark Toggle)
 * Premium Betting Design
 */

:root {
    /* ================= Default (Light) Theme Variables ================= */
    --gold-primary: #d4af37;
    --gold-light: #f3e5ab;
    --gold-dark: #b8860b;
    --gold-gradient: linear-gradient(135deg, #d4af37 0%, #aa8c2c 100%);

    --bg-main: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.95);

    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-gold: #b8860b;

    --border-color: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(212, 175, 55, 0.3);

    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 10px 20px rgba(0, 0, 0, 0.1);

    /* Spacing & Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* Headers & Layout */
    --header-height: 70px;
    --sidebar-width: 260px;
    --sidebar-right-width: 336px;
}

/* ================= Dark Theme Overrides ================= */
[data-theme="dark"] {
    --gold-primary: #d4af37;
    --gold-light: #f3e5ab;
    --gold-dark: #aa8c2c;
    /* Brighter gold for dark mode */
    --gold-gradient: linear-gradient(135deg, #d4af37 0%, #aa8c2c 100%);

    --bg-main: #0a0a0c;
    --bg-secondary: #141417;
    --bg-card: #1c1c21;
    --bg-header: rgba(10, 10, 12, 0.95);

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-gold: #d4af37;

    --border-color: rgba(212, 175, 55, 0.15);
    --border-glow: rgba(212, 175, 55, 0.3);

    --shadow-card: 0 4px 24px -1px rgba(0, 0, 0, 0.15);
    --shadow-card-hover: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Use standard box-sizing */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #333;
}

/* Layout Grid */
.layout-container {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
}

/* ================= Header ================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold-primary);
}

[data-theme="dark"] .logo {
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 1rem;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--gold-dark);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: var(--gold-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gold-primary);
}

[data-theme="dark"] .nav-link.active::after {
    box-shadow: 0 0 10px var(--gold-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 배팅슬립 버튼 */
.bet-slip-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: var(--gold-gradient);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.bet-slip-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.bet-slip-btn #slip-count-badge {
    font-weight: 700;
}

.slip-count-badge {
    color: #fff;
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.slip-count-badge:empty,
.slip-count-badge[data-count="0"] {
    display: none;
}

/* Quick Links Grid */
.quick-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.quick-links-grid .menu-item {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 0;
}

.quick-links-grid .menu-item:hover {
    border-color: var(--gold-primary);
    background: var(--bg-hover);
}

.quick-links-grid .menu-icon {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.quick-links-grid .menu-text {
    font-size: 0.8rem;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all 0.3s;
    background: var(--bg-secondary);
}

.theme-toggle:hover {
    color: var(--gold-primary);
    border-color: var(--gold-primary);
    background: var(--bg-main);
}

.btn-login {
    border: 1px solid var(--gold-primary);
    color: var(--gold-dark);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s;
}

[data-theme="dark"] .btn-login {
    color: var(--gold-primary);
}

.btn-login:hover {
    background: rgba(212, 175, 55, 0.1);
}

[data-theme="dark"] .btn-login:hover {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.btn-signup {
    background: var(--gold-gradient);
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    transition: all 0.3s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .btn-signup {
    color: #000;
    text-shadow: none;
}

.btn-signup:hover {
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-signup:hover {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* ================= Sidebars ================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    bottom: 0;
    top: var(--header-height);
    overflow-y: auto;
    padding: 1.5rem 1rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Light mode sidebar shadow */
html:not([data-theme="dark"]) .sidebar {
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.sidebar-left {
    left: 0;
}

.sidebar-close-btn {
    display: none;
}

.sidebar-right {
    right: 0;
    width: var(--sidebar-right-width);
    border-right: none;
    border-left: 1px solid var(--border-color);
}

html:not([data-theme="dark"]) .sidebar-right {
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.02);
}

/* Sidebar Menu */
.sidebar-title {
    font-size: 0.8rem;
    color: var(--gold-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    font-weight: 700;
    padding-left: 0.5rem;
}

[data-theme="dark"] .sidebar-title {
    color: var(--gold-primary);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.menu-item:hover {
    background: #f0f0f0;
    color: var(--text-primary);
    padding-left: 1.25rem;
}

[data-theme="dark"] .menu-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.menu-item.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.1), transparent);
    color: var(--gold-dark);
    border-left: 3px solid var(--gold-primary);
}

[data-theme="dark"] .menu-item.active {
    color: var(--gold-primary);
}

.menu-icon {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.menu-text {
    flex: 1;
    font-weight: 500;
}

.menu-badge {
    background: #f0f0f0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
}

[data-theme="dark"] .menu-badge {
    background: var(--bg-main);
}


/* ================= Main Content ================= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-right: var(--sidebar-right-width);
    padding: 2rem;
    min-height: 100vh;
}

/* Hero Slider */
.hero-slider {
    position: relative;
    height: 300px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .hero-slider {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: top center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.hero-slider .slide.active {
    opacity: 1;
}

/* Slider Navigation */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-nav:hover {
    background: var(--gold-primary);
    color: #000;
}

.slider-nav.prev {
    left: 15px;
}

.slider-nav.next {
    right: 15px;
}

/* Slider Dots */
.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.slider-dots .dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.slider-dots .dot.active {
    background: var(--gold-primary);
    width: 25px;
    border-radius: 5px;
}

/* Hero Banner (legacy support) */
.hero-banner {
    background: url('https://images.unsplash.com/photo-1540747913346-19e32dc3e97e?q=80&w=2805&auto=format&fit=crop') center/cover;
    height: 300px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .hero-banner {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.7) 50%, transparent 100%);
    display: flex;
    align-items: center;
    padding: 3rem;
}

[data-theme="dark"] .hero-overlay {
    background: linear-gradient(90deg, rgba(10, 10, 12, 0.95) 0%, rgba(10, 10, 12, 0.6) 50%, transparent 100%);
}

.hero-content {
    max-width: 500px;
}

.hero-tag {
    color: var(--gold-dark);
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    display: block;
    text-transform: uppercase;
}

[data-theme="dark"] .hero-tag {
    color: var(--gold-primary);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

[data-theme="dark"] .hero-title {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    /* Fallback handled by fill-color */
}


.hero-btn {
    background: var(--gold-primary);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    transition: all 0.3s;
}

[data-theme="dark"] .hero-btn {
    color: #000;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.hero-btn:hover {
    transform: scale(1.05);
    background: var(--gold-dark);
}

[data-theme="dark"] .hero-btn:hover {
    background: var(--gold-primary);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.6);
}

/* Section Title */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    border-left: 4px solid var(--gold-primary);
    padding-left: 1rem;
}

/* Game Cards Grid - 4열 균등 배치 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    width: 100%;
}

/* 태블릿 반응형 - 2열 */
@media (max-width: 1200px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 모바일 반응형 - 2열 유지 */
@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
    box-shadow: var(--shadow-card);
}

.game-card:hover {
    border-color: var(--gold-primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
}

.card-header {
    background: #f8f9fa;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .card-header {
    background: rgba(255, 255, 255, 0.03);
}

.league-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.card-time {
    color: var(--gold-dark);
    font-weight: 600;
    font-size: 0.85rem;
}

[data-theme="dark"] .card-time {
    color: var(--gold-primary);
}

.card-body {
    padding: 1.5rem 1rem;
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.team img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

[data-theme="dark"] .team img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.team-name {
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.match-vs {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 1.2rem;
}

.odds-group {
    display: flex;
    gap: 0.5rem;
}

.odd-btn {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
}

[data-theme="dark"] .odd-btn {
    background: rgba(0, 0, 0, 0.3);
}

.odd-btn:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: var(--gold-primary);
}

[data-theme="dark"] .odd-btn:hover {
    background: rgba(212, 175, 55, 0.1);
}

.odd-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.odd-value {
    color: var(--text-primary);
    font-weight: 700;
}

[data-theme="dark"] .odd-value {
    color: #fff;
}

.odd-btn:hover .odd-value {
    color: var(--gold-dark);
}

[data-theme="dark"] .odd-btn:hover .odd-value {
    color: var(--gold-primary);
}


/* ================= Right Sidebar (Bet Slip) ================= */
.slip-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.slip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.slip-title {
    font-weight: 700;
    color: var(--text-gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slip-empty {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
}

.bet-btn-large {
    width: 100%;
    background: var(--gold-primary);
    color: #fff;
    font-weight: 800;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    transition: all 0.3s;
}

[data-theme="dark"] .bet-btn-large {
    color: #000;
}

.bet-btn-large:hover {
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    background: var(--gold-dark);
}

[data-theme="dark"] .bet-btn-large:hover {
    background: #eac548;
}

/* Utility */
.text-gold {
    color: var(--gold-dark) !important;
}

[data-theme="dark"] .text-gold {
    color: var(--gold-primary) !important;
}

.text-danger {
    color: #ff4757 !important;
}

.text-gray {
    color: #888 !important;
}

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

.text-secondary {
    color: var(--text-secondary) !important;
}

/* Responsive */
@media (max-width: 1200px) {

    /* Left Sidebar: 모바일에서 오프캔버스 */
    .sidebar-left {
        display: block !important;
        position: fixed;
        top: 0;
        bottom: 0;
        height: 100vh;
        z-index: 2000;
        background: var(--bg-card);
        border: none;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        left: 0;
        width: 280px;
        transform: translateX(-100%);
        border-right: 1px solid var(--border-color);
    }

    .sidebar-left.active {
        transform: translateX(0);
        overflow-y: auto !important;
    }

    /* 사이드바 열릴 때 body 스크롤 방지 */
    body.sidebar-open {
        overflow: hidden !important;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    /* 왼쪽 사이드바 닫기 버튼 - fixed 포지션 */
    .sidebar-close-btn {
        display: none;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 10px;
        left: 280px;
        width: 36px;
        height: 36px;
        border: none;
        background: #333;
        border-radius: 4px;
        cursor: pointer;
        z-index: 2001;
        color: #fff;
        font-size: 1.2rem;
    }

    .sidebar-left.active .sidebar-close-btn,
    .sidebar-left.active + .sidebar-close-btn {
        display: flex !important;
    }

    .sidebar-close-btn:hover {
        background: var(--gold-primary);
    }

    /* Right Sidebar: Slide from Right */
    .sidebar-right {
        display: block !important;
        position: fixed;
        top: 0;
        bottom: 0;
        height: 100vh;
        z-index: 2000;
        background: var(--bg-card);
        border: none;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        right: 0;
        width: 340px;
        transform: translateX(100%);
        border-left: 1px solid var(--border-color);
    }

    .sidebar-right.active {
        overflow-y: auto !important;
        transform: translateX(0);
        overflow-x: visible;
    }

    /* 오른쪽 사이드바 닫기 버튼 */
    .sidebar-close-btn-right {
        left: auto !important;
        right: 340px !important;
    }

    .sidebar-right.active .sidebar-close-btn-right {
        display: flex !important;
    }


    /* Adjust content margins */
    .main-content {
        margin: 0;
        width: 100%;
        box-sizing: border-box;
        padding: 0.5rem 0;
    }

    /* Nav Toggles */
    .nav-menu {
        display: none;
    }

    .mobile-nav {
        display: flex !important;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .header {
        padding: 0 1rem;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .header-actions {
        margin-left: auto;
        flex-shrink: 1;
        overflow: hidden;
    }

    .layout-container {
        max-width: 100vw;
        width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
}

/* Mobile Toggle Buttons (Hidden on Desktop) */
.mobile-menu-btn,
.mobile-slip-btn {
    display: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

@media (max-width: 1200px) {

    .mobile-menu-btn,
    .mobile-slip-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-btn:hover,
    .mobile-menu-btn:active,
    .mobile-slip-btn:hover,
    .mobile-slip-btn:active {
        color: var(--gold-primary);
        background: rgba(0, 0, 0, 0.05);
    }
}

.mobile-slip-btn {
    position: relative;
}

.slip-badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid var(--bg-header);
    display: none;
    /* Show via JS if slip has items */
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1500;
    /* Below sidebar, above header */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ================= Mobile Navigation ================= */
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--bg-header);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
    padding: 0.5rem 1rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: 1.5rem;
}

.mobile-nav::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar */
}

.mobile-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 0;
    min-width: 60px;
}

.mobile-link i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.mobile-link.active {
    color: var(--gold-dark);
}

.mobile-link.active::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: var(--gold-primary);
    margin-top: 2px;
    border-radius: 2px;
}

[data-theme="dark"] .mobile-link.active {
    color: var(--gold-primary);
}

/* 모바일 네비게이션 보유머니/포인트 버튼 - 전체 너비 */
.mobile-nav {
    justify-content: stretch !important;
    gap: 0 !important;
    padding: 0 !important;
}

.mobile-link.money-link,
.mobile-link.point-link {
    flex: 1 !important;
    background: linear-gradient(135deg, #d4af37 0%, #b8942d 100%);
    color: #fff !important;
    border-radius: 0;
    padding: 0.75rem 1rem;
    min-width: auto;
    justify-content: center;
    flex-direction: row !important;
    gap: 0.5rem;
}

.mobile-link.money-link i,
.mobile-link.point-link i {
    color: #fff;
    margin-bottom: 0 !important;
}

.mobile-link.money-link span,
.mobile-link.point-link span {
    font-weight: 700;
    font-size: 0.9rem;
}

.mobile-link.point-link {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

/* ================= Betting Slip Components ================= */
.slip-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.slip-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.slip-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
    min-height: 200px;
}

.slip-bottom {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

[data-theme="dark"] .slip-bottom {
    background: #18181b;
}

/* Slightly lighter than main bg */

.slip-input-group {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.slip-input {
    width: 100%;
    height: 36px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 0.75rem;
    color: var(--text-primary);
    text-align: right;
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 600;
}

.slip-input:focus {
    outline: none;
    border-color: var(--gold-primary);
}

.slip-quick-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.slip-quick-btn {
    padding: 0.5rem 0;
    font-size: 0.7rem;
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.slip-quick-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.slip-summary {
    padding: 0.75rem;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.slip-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.slip-summary-label {
    color: var(--text-secondary);
}

.slip-summary-value {
    color: var(--text-primary);
    font-weight: 500;
}

.slip-summary-value.highlight {
    color: var(--gold-dark);
    font-weight: 700;
}

[data-theme="dark"] .slip-summary-value.highlight {
    color: var(--gold-primary);
}

.slip-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.75rem;
}

/* ================= Casino Section ================= */
.casino-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.casino-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    /* Removed fixed aspect-ratio to fit image */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-card);
}

.casino-card img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: block;
    /* Removes bottom space for inline images */
}

.casino-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--gold-primary);
}

.casino-card:hover img {
    transform: scale(1.1);
}

.casino-name {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem;
    text-align: center;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s;
}

.casino-card:hover .casino-name {
    opacity: 1;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .casino-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .casino-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .casino-name {
        opacity: 1;
        /* Always show name on mobile */
        padding: 0.25rem;
        font-size: 0.7rem;
    }

    /* 4개 카드만 표시하므로 숨김 코드 제거됨 */
}

/* ================= Modal / Popup Styles ================= */
.popup__section {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    
    
}

.popup__section.is-open {
    align-items: center !important;
    justify-content: center !important;
    display: flex;
}

.popup__dim {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* 다크 테마 배경 */
[data-theme="dark"] .popup__dim {
    background: rgba(0, 0, 0, 0.8);
}

.popup__inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Login/Signup Modal Container - 라이트 테마 */
.login-modal-container,
.signup-modal-container {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid #e0e0e0;
}

/* Login/Signup Modal Container - 다크 테마 */
[data-theme="dark"] .login-modal-container,
[data-theme="dark"] .signup-modal-container {
    background: #1a1a1f;
    border: 1px solid #333;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-main);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gold-primary);
    color: #fff;
}

/* Modal Header */
.login-modal-header,
.signup-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-modal-title,
.signup-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-modal-subtitle,
.signup-modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Modal Form */
.modal-form-group {
    margin-bottom: 1rem;
}

.modal-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modal-field-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.modal-form-input,
.modal-form-select {
    width: 100%;
    height: 44px;
    padding: 0 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.modal-form-input:focus,
.modal-form-select:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.modal-form-input::placeholder {
    color: var(--text-secondary);
}

.modal-input-with-button {
    display: flex;
    gap: 0.5rem;
}

.modal-input-with-button .modal-form-input {
    flex: 1;
}

.modal-check-btn {
    padding: 0 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.modal-check-btn:hover {
    background: var(--gold-primary);
    color: #fff;
    border-color: var(--gold-primary);
}

.modal-form-row {
    display: flex;
    gap: 0.5rem;
}

.modal-form-row .modal-form-select {
    width: auto;
    min-width: 100px;
}

.modal-form-row .modal-form-input {
    flex: 1;
}

.modal-mt-10 {
    margin-top: 0.5rem;
}

.modal-error-message {
    font-size: 0.75rem;
    color: #e74c3c;
    margin-top: 0.25rem;
    min-height: 1rem;
}

.modal-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.modal-remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-forgot-password {
    color: var(--gold-dark);
    text-decoration: none;
}

.modal-forgot-password:hover {
    text-decoration: underline;
}

.modal-login-button,
.modal-signup-button {
    width: 100%;
    height: 48px;
    background: var(--gold-gradient);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.modal-login-button:hover,
.modal-signup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.modal-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.modal-divider::before,
.modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.modal-divider span {
    padding: 0 1rem;
}

.modal-signup-link,
.modal-login-link {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-signup-link a,
.modal-login-link a {
    color: var(--gold-dark);
    font-weight: 600;
    text-decoration: none;
}

.modal-signup-link a:hover,
.modal-login-link a:hover {
    text-decoration: underline;
}

/* 다크 테마 모달 입력 필드 */
[data-theme="dark"] .modal-form-input,
[data-theme="dark"] .modal-form-select {
    background: #0a0a0c;
    border-color: #444;
    color: #fff;
}

[data-theme="dark"] .modal-form-input::placeholder {
    color: #666;
}

[data-theme="dark"] .modal-form-input:focus,
[data-theme="dark"] .modal-form-select:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

[data-theme="dark"] .modal-form-group label {
    color: #e0e0e0;
}

[data-theme="dark"] .modal-close {
    background: #333;
    color: #fff;
}

[data-theme="dark"] .modal-check-btn {
    background: #333;
    border-color: #444;
    color: #fff;
}

[data-theme="dark"] .modal-forgot-password,
[data-theme="dark"] .modal-signup-link a,
[data-theme="dark"] .modal-login-link a {
    color: var(--gold-primary);
}

/* Modal Alert */
.modal-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.modal-alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.modal-alert-success {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.3);
    color: #27ae60;
}

/* Terms checkbox */
.modal-terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.modal-terms-checkbox input {
    margin-top: 2px;
}

.modal-terms-checkbox a {
    color: var(--gold-dark);
}