/* --- ✨ 마이페이지 전용 스타일 (최종 완성본) ✨ --- */

.mypage-container {
    background-color: var(--bg-color); /* 이렇게 하면 됩니다! */
}

.mypage-container .container {
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
    padding: 3rem 24px;
}

/* 사이드바 */
.mypage-sidebar {
    flex: 0 0 260px;
    position: sticky;
    top: 120px;
    /* align-self: flex-start; ✨ 이 줄을 삭제하여 모바일 정렬 문제 해결 */
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}
.mypage-sidebar h2 {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-family-display);
    margin: 0 0 1.5rem;
    color: var(--text-color);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-nav h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted-color);
    margin: 1.5rem 0 0.8rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted-color);
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.sidebar-nav a i {
    width: 20px;
    text-align: center;
}
.sidebar-nav a:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}
.sidebar-nav a.active {
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
}
.sidebar-nav a.active i {
    animation: bounce-icon 0.6s ease;
}
@keyframes bounce-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* 메인 콘텐츠 */
.mypage-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}
.content-box {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: 0 4px 20px var(--shadow-color);
}
.content-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 2rem;
    color: var(--text-color);
}

.current-cash-info {
    background-color: var(--bg-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}
.current-cash-info p {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.current-cash-info p > i {
    font-size: 1.5rem;
    margin-right: 10px;
    color: var(--primary-color);
}
.current-cash-info strong {
    color: var(--primary-color);
    font-size: 1.1rem;
}
.user-info {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.tier-icon-wrapper {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 2px;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}
.tier-icon-wrapper svg {
    width: 100%;
    height: 100%;
}
.user-info[data-tier="diamond"] .tier-icon-wrapper {
    animation: sparkle-diamond-small 3s infinite ease-in-out;
}
@keyframes sparkle-diamond-small {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 2px 2px rgba(79, 70, 229, 0.3)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 3px 5px rgba(79, 70, 229, 0.5)); }
}

.info-list-dot {
    list-style: '· ';
    padding-left: 1.2rem;
    color: var(--text-muted-color);
    font-size: 0.95rem;
}
.info-list-dot li {
    padding-left: 0.5rem;
    margin-bottom: 0rem;
    line-height: 1.8;
}
.text-highlight {
    color: var(--highlight-color);
    font-weight: 600;
}

.membership-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.membership-tier {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
}
.membership-tier h4 {
    margin: 0 0 1rem;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
    color: var(--text-color);
}
.membership-tier h4 small {
    font-weight: 400;
    font-size: 1rem;
    color: var(--text-muted-color);
}
.membership-tier ul {
    list-style: '✓ ';
    padding-left: 1.2rem;
    margin: 0;
    font-size: 0.95rem;
}

.charge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.charge-header .content-title {
    margin-bottom: 0;
}

.charge-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.charge-option {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
}
.charge-option .amount {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-family-display);
    color: var(--primary-color);
}
.charge-option .details {
    margin: 1rem 0;
    flex-grow: 1;
    color: var(--text-muted-color);
    line-height: 1.7;
}
.charge-option .details p {
    margin: 0.2rem 0;
}
.bonus-tag {
    background-color: var(--highlight-color);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
}
.charge-option.placeholder {
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-style: dashed;
}
.charge-option.placeholder i {
    font-size: 2rem;
    color: var(--text-muted-color);
    margin-bottom: 1rem;
}
.charge-buttons {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
}
.charge-buttons .btn {
    flex: 1;
}

/* 회원 등급 안내 섹션 (content-box 내부) */
.content-box .section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin: -1rem 0 2.5rem;
}
.content-box .tier-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.content-box .tier-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.content-box .tier-card:hover {
    transform: translateY(-5px);
}
.content-box .tier-card.diamond:hover { border-color: #7dd3fc; }
.content-box .tier-card.gold:hover { border-color: #fcd34d; }
.content-box .tier-card.silver:hover { border-color: #e5e7eb; }
.content-box .tier-card.bronze:hover { border-color: #f97316; }

.content-box .gem-icon {
    width: 60px; /* ✨ 보석 크기 축소 */
    height: 60px; /* ✨ 보석 크기 축소 */
    margin: 0 auto 1rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
    transform: perspective(800px) rotateX(10deg) rotateY(-15deg);
    transition: all 0.3s ease;
}
.content-box .tier-card:hover .gem-icon {
    transform: perspective(800px) rotateX(0deg) rotateY(0deg) scale(1.05);
}
@keyframes sparkle-diamond-mypage {
    0%, 100% { filter: drop-shadow(0 4px 6px rgba(79, 70, 229, 0.2)) saturate(1.2) brightness(1.1); }
    50% { filter: drop-shadow(0 6px 12px rgba(79, 70, 229, 0.3)) saturate(1.5) brightness(1.3); }
}
.content-box .tier-card.diamond .gem-icon {
    animation: sparkle-diamond-mypage 3s infinite ease-in-out;
}
.content-box .tier-card h4 {
    font-family: var(--font-family-display);
    font-size: 1.1rem;
    margin: 0 0 0.25rem;
    color: var(--text-color);
}
.content-box .tier-card p {
    font-size: 0.9rem;
    color: var(--text-muted-color);
    margin: 0 0 1rem;
}
.content-box .tier-desc {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 0.8rem;
    font-size: 0.85rem;
    min-height: 40px;
    color: var(--text-muted-color);
}
.light-mode .content-box .tier-desc {
    background-color: #eef2ff;
}
.dark-mode .content-box .tier-desc {
    background-color: #334155;
}


/* --- 반응형 --- */
@media(max-width: 992px){
    .mypage-container .container {
        flex-direction: column;
    }
	
    .mypage-sidebar {
        width: 100%;
        position: static;
        border-right: none;
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    .mypage-sidebar h2 {
        margin: 0 0 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--border-color);
        font-size: 1.5rem;
    }
    .membership-info-grid, .charge-options-grid {
        grid-template-columns: 1fr;
    }
    .content-box .tier-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media(max-width: 500px){
    .mypage-container .container {
        flex-direction: column;
    }
	
    .mypage-sidebar {
        width: 90%;
        position: static;
        border-right: none;
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    .mypage-sidebar h2 {
        margin: 0 0 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--border-color);
        font-size: 1.5rem;
    }
    .membership-info-grid, .charge-options-grid {
        grid-template-columns: 1fr;
    }
    .content-box .tier-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}



/* MY페이지 */
/* --- ✨ MY 정보 페이지 전용 스타일 ✨ --- */
.mypage-container.new-layout .container {
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
    padding: 3rem 24px;
}

.mypage-content.new-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1 1 auto;
    min-width: 0;
}

.user-profile-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
}
.user-greeting .user-info { font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--text-color); }
.user-greeting .tier-icon-wrapper { width: 24px; height: 24px; }
.user-contact { display: flex; gap: 1rem; margin-top: 0.5rem; color: var(--text-muted-color); }
.user-contact span { font-size: 0.9rem; }

.account-summary-box {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
}
.summary-item {
    padding: 1rem;
    border-right: 1px solid var(--border-color);
}
.summary-item:last-of-type, .summary-details-link { border-right: none; }
.summary-item h4 { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--text-muted-color); }
.summary-item p { margin: 0; font-size: 1.5rem; font-weight: 700; font-family: var(--font-family-display); color: var(--text-color); }
.summary-item p small { font-size: 1rem; font-family: var(--font-family-base); }
.btn-charge {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 0.5rem;
}
.summary-details-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted-color);
    transition: color 0.2s ease;
}
.summary-details-link:hover { color: var(--primary-color); }
.summary-details-link i { font-size: 1.5rem; margin-top: 0.5rem; }

.auto-order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.auto-order-header .content-title { margin: 0; font-size: 1.5rem; }
.auto-order-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.lotto-status-box h4 {
    margin: 0 0 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
	color: var(--text-color);
    align-items: center;
    justify-content: space-between;
}
.lotto-status-box h4 small { font-size: 0.9rem; color: var(--text-muted-color); font-weight: 400; }
.toggle-switch { font-size: 0.8rem; background-color: var(--bg-color); padding: 2px 8px; border-radius: 4px; font-weight: 700; }
.toggle-switch.off { color: var(--text-muted-color); }

.status-table-wrapper { max-height: 250px; overflow-y: auto;}
.status-table { width: 100%; border-collapse: collapse; text-align: center; }
.status-table th { font-weight: 600; padding: 0.8rem 0.5rem; color: var(--text-muted-color); }
.status-table td { padding: 0.8rem 0.5rem; vertical-align: middle; color: var(--text-color);}
.status-table .numbers { display: flex; gap: 4px; justify-content: center; }
.status-table .num { width: 28px; height: 28px; font-size: 0.9rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; background-color: var(--bg-color); border: 1px solid var(--border-color); }
.status-table .num.mega { background-color: #f59e0b; color: #fff; border: none; }
.btn-delete { background: none; border: none; color: var(--text-muted-color); cursor: pointer; }
.btn-delete:hover { color: var(--highlight-color); }

.status-empty { text-align: center; padding: 4rem 0; color: var(--text-muted-color); background-color: var(--bg-color); border-radius: 8px; }
.status-empty i { font-size: 3rem; margin-bottom: 1rem; }

/* 반응형 */
@media(max-width: 1200px) {
    .account-summary-box { grid-template-columns: repeat(3, 1fr); }
    .summary-item:nth-child(3) { border-right: none; }
}
@media(max-width: 992px){
    .account-summary-box { grid-template-columns: repeat(2, 1fr); }
    .summary-item:nth-child(2n) { border-right: none; }
    .auto-order-grid { grid-template-columns: 1fr; }
}
@media(max-width: 768px) {
    .user-profile-box { flex-direction: column; text-align: center; gap: 1.5rem; }
    .user-greeting .user-contact { justify-content: center; }
	.mypage-container .container {
        flex-direction: column-reverse; /* ✨ 수정: main과 aside의 순서를 뒤집음 */
    }
}
@media(max-width: 500px) {
    .account-summary-box { grid-template-columns: 1fr; }
    .summary-item { border-right: none !important; border-bottom: 1px solid var(--border-color); }
	
}



/* --- ✨ 구매/당첨내역 페이지 추가 스타일 ✨ --- */
.user-summary {
    background-color: var(--bg-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    font-size: 1.05rem;
}
.user-summary p {
	color: var(--text-color);
}
.filter-box {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
}
.filter-group {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 1rem;
    gap: 1rem;
}
.filter-group + .filter-group {
    border-top: 1px solid var(--border-color);
}
.filter-group dt {
    flex-shrink: 0;
    font-weight: 600;
    width: 250px;
    color: var(--text-color);
}
.filter-group dd {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-group div {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}



.filter-btn {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-muted-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}
.filter-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}
.date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}
.date-inputs input {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px;
    border-radius: 6px;
	
	
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.list-header .content-title {
    margin: 0;
}
.list-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.list-actions a {
    color: var(--text-muted-color);
    font-size: 0.9rem;
}

.table-wrapper {
    overflow-x: auto; /* 좁은 화면에서 좌우 스크롤 */
}
.history-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    font-size: 0.95rem;
}
.history-table th, .history-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.history-table thead th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-muted-color);
}
.history-table td {
    color: var(--text-color);
}
.table-empty {
    padding: 5rem 0;
    text-align: center;
    color: var(--text-muted-color);
}
.table-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* 구매/당첨내역 반응형 */
@media(max-width: 992px){
	.content-box {
	padding: 1px; 1px; 1px; 1px;
	}
	.filter-box {
	padding: 1px; 1px; 1px; 1px;
	}
	.mypage-container .container{
	    padding-right: 0px;
		padding-left: 0px;

	}
    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
	.mypage-content {
		width: 100%;
	}
    .filter-group dd {
        width: 100%;
		justify-content: center;
    }
	.filter-btn {
		width:100%;
	}

    .date-filter {
        flex-direction: column;
        align-items: stretch;
    }
    .date-filter .btn {
        width: 100%;
    }
	.date-inputs {
		width: 100%;
	}
	.date-inputs input {
	    width: 25%;
	}
}



/* --- ✨ 게임규칙안내 모달 스타일 (디자인 개선) ✨ --- */
.rules-modal {
    padding: 0;
    max-width: 650px;
    background-color: var(--bg-color); /* 모달 배경색을 bg-color로 변경 */
}
.rules-tabs {
    display: flex; /* grid 대신 flex 사용 */
    background-color: var(--surface-color);
    border-radius: 16px 16px 16px 16px;
    padding: 8px;
	margin: 8px;
    gap: 8px;
	width: 50%;
}
.rules-tabs .tab-btn {
    flex: 1; /* 동일한 너비 차지 */
    padding: 12px;
    font-size: 1.0rem;
    font-weight: 700;
    border: none;
    background-color: transparent;
    color: var(--text-muted-color);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px; /* 부드러운 모서리 */
}

.rules-tabs .tab-btn.active {
    background-color: var(--primary-color);
    color: #fff;
}
.rules-content-wrapper {
    padding: 2.5rem;
}
.rules-content {
    display: none;
    text-align: center;
}
.rules-content.active {
    display: block;
}
.lotto-logo-modal {
    height: 45px; /* 로고 크기 조정 */
    margin-bottom: 1.5rem;
}
.rules-content h4 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: 0 0 0.5rem;
}
.rules-content > p {
    font-size: 1.05rem;
    color: var(--text-color);
    margin: 0 0 1.5rem;
}
.rules-content ol {
    text-align: left;
    padding-left: 1.5rem;
    color: var(--text-muted-color);
    line-height: 1.8;
}

/* 닫기 버튼 위치 개선 */
.modal-content.rules-modal .close-button {
    top: -35px;
    right: -15px;
    color: #fff;
    background: rgba(0,0,0,0.3);
}
@media(max-width: 768px){
    .modal-content.rules-modal .close-button {
        top: 10px;
        right: 10px;
        color: var(--text-muted-color);
        background: var(--surface-color);
    }
}


/* --- ✨ 스캔본 확인 페이지 전용 스타일 (다크 모드 수정본) ✨ --- */

/* 시간 안내 박스 */
.scan-time-notice {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.scan-time-notice i {
    font-size: 1.5rem;
    color: var(--primary-color);
}
.scan-time-notice .notice-text strong {
    display: block;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color); /* 변수 사용 */
    margin-bottom: 0.5rem;
}
.scan-time-notice .notice-text p {
    margin: 0;
    font-size: 1.0rem;
    color: var(--text-muted-color); /* 변수 사용 */
    line-height: 1.6;
}

/* 필터 탭 (기존 filter-btn 재사용) */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* 티켓 그리드 */
.ticket-grid {
    display: grid;
    /* 기본(데스크탑) 화면에서 3개의 열을 만듭니다 */
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* 티켓 카드 */
.ticket-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ticket-card:hover {
    transform: translateY(-4px);
}

.ticket-card .card-header {
    margin-bottom: 1rem;
}
.ticket-card .view-back-btn {
    background-color: var(--surface-color);
    color: var(--text-muted-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.ticket-card .view-back-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.ticket-card .ticket-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}
.ticket-card .ticket-info {
    margin-top: 1.5rem;
}
.ticket-card .ticket-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color); /* 변수 사용 */
    margin: 0 0 1rem;
}

/* 숫자 볼 스타일 */
.number-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.number-balls:not(:last-child) {
    margin-bottom: 10px;
}
.number-balls .ball {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
    /* 라이트 모드 기본 스타일 */
    background-color: #f0f2f5; 
    border: 1px solid #e0e0e0;
    color: #333;
}

/* 파워볼, 메가볼 특별 스타일 (공통) */
.number-balls .ball.powerball {
    background: #d92a2a;
    color: white;
    border: none;
}
.number-balls .ball.megaball {
    background: #f0b82f;
    color: white;
    border: none;
}

/* ▼▼▼ [수정된 부분] 다크 모드 전용 스타일 추가 ▼▼▼ */
.dark-mode .number-balls .ball {
    background-color: var(--surface-color); /* 다크모드에 맞는 배경색 변수 */
    border: 1px solid var(--border-color);
    color: var(--text-color); /* 다크모드에 맞는 글자색 변수 */
}
/* ▲▲▲ [수정된 부분] 다크 모드 전용 스타일 추가 ▲▲▲ */


/* 반응형 스타일 */
@media (max-width: 992px) {
    .ticket-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .ticket-grid {
        grid-template-columns: 1fr;
    }
}

/* --- ✨ 페이지네이션(Paging) 스타일 ✨ --- */

.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem; /* 목록과의 간격 */
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px; /* 버튼 사이 간격 */
}

.page-link {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    
    /* 기본 버튼 스타일 (CSS 변수 사용) */
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-muted-color);
}

/* 마우스를 올렸을 때 */
.page-link:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
    border-color: var(--text-muted-color);
}

/* 현재 페이지 or 활성화된 버튼 */
.page-link.active {
    background: linear-gradient(90deg, var(--primary-color), #ff5200);
    color: #fff;
    font-weight: 700;
    border-color: var(--primary-color);
    cursor: default;
}
.page-link.active:hover {
    background: linear-gradient(90deg, var(--primary-color), #ff5200);
    color: #fff;
}

.coupon-registration-header {
    text-align: center;
    margin-bottom: 2rem;
}
.coupon-registration-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 0.5rem;
}
.coupon-registration-header p {
    font-size: 1rem;
    color: var(--text-muted-color);
    margin: 0;
}

/* 쿠폰 종류 선택 버튼 (16자리/6자리) */
.coupon-type-selector {
    display: flex;
    max-width: 500px;
    margin: 0 auto 1.5rem;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
}
.coupon-type-selector .btn {
    flex: 1; /* 1:1 비율로 너비 차지 */
    border: none;
    border-radius: 0;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    background-color: var(--surface-color);
    color: var(--primary-color);
    transition: all 0.2s ease;
}
.coupon-type-selector .btn.active {
    background-color: var(--primary-color);
    color: #fff;
}

/* 쿠폰 입력 영역 */
.coupon-input-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap; /* 모바일에서 줄바꿈 */
}
.coupon-input-segment {
    width: 100px;
    height: 48px;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    color: var(--text-color);
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase; /* 영어를 대문자로 */
}
.coupon-input-segment::placeholder {
    color: var(--text-muted-color);
    opacity: 0.5;
}
.btn-coupon-register {
    height: 48px;
    padding: 0 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}
.filter-title {
    flex-shrink: 0;
    font-weight: 600;
    width: 100px;
    color: var(--text-color);
}

/* --- ✨ 출금신청 페이지 전용 스타일 ✨ --- */

/* 주의사항 목록 */
.info-list-caution {
    list-style: none;
    padding: 1rem 1rem 1rem 1.5rem;
    margin: 0;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
}
.info-list-caution li {
    position: relative;
    padding-left: 1.2rem;
    color: var(--text-muted-color);
    line-height: 1.8;
}
.info-list-caution li:not(:last-child) {
    margin-bottom: 0.1rem;
}
.info-list-caution li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.8rem;
    color: var(--highlight-color);
}
.text-danger {
    color: #e53e3e;
    font-weight: 600;
}
.info-list-sub {
    list-style-type: '- ';
    padding-left: 1.5rem;
    margin-top: 0.8rem;
}

/* 출금신청 폼 */
.withdrawal-form {
    margin-top: 2rem;
}
.form-grid {
    display: grid;
    gap: 1.5rem;
}
.form-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 1rem;
}
.form-row dt {
    font-weight: 600;
    color: var(--text-color);
}
.form-row dd {
    margin: 0;
}

/* 폼 컨트롤 (input, select) 공통 스타일 */
.form-control {
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    font-size: 1rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    transition: border-color 0.2s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}
.form-control[disabled] {
    background-color: var(--bg-color);
    color: var(--text-muted-color);
}

/* 폼 인풋 그룹 (인풋 + 헬퍼 텍스트) */
.form-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.input-helper-text {
    font-size: 0.9rem;
    color: var(--text-muted-color);
}

/* 폼 고정 텍스트 (수수료, 실제 출금액) */
.form-static-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}
.form-static-text.highlight {
    color: var(--primary-color);
}

/* 신청하기 버튼 */
.btn-submit-lg {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 3rem auto 0;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
}

/* 반응형 */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        align-items: flex-start;
    }
    .form-row dt {
        margin-bottom: 0.25rem;
    }
    .form-input-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

:root{
  --ball-bg:#f3f4f6;            /* 일반 흰 공 */
  --ball-fg:#111827;
  --ball-hit-bg:#3b82f6;        /* 맞춘 흰 공(파란색) */
  --ball-hit-fg:#ffffff;

  --megaball-bg:#ffd34d;        /* 메가볼 기본(노랑) */
  --megaball-hit-bg:#3b82f6;    /* 메가볼 당첨 강조 */
  --powerball-bg:#ef4444;       /* 파워볼 기본(빨강) */
  --powerball-hit-bg:#b91c1c;   /* 파워볼 당첨 강조 */
}
html.dark,[data-theme="dark"]{
  --ball-bg:#1f2937;
  --ball-fg:#e5e7eb;
  --ball-hit-bg:#60a5fa;
  --ball-hit-fg:#0b1220;

  --megaball-bg:#d6b100;
  --megaball-hit-bg:#3b82f6;
  --powerball-bg:#b91c1c;
  --powerball-hit-bg:#991b1b;
}

.number-balls .ball.hit{
  background:var(--ball-hit-bg) !important;
  color:var(--ball-hit-fg) !important;
}

/* 특수공(메가볼/파워볼) 기본 */
.number-balls .ball.megaball{  background:var(--megaball-bg);  color:#111; }
.number-balls .ball.powerball{ background:var(--powerball-bg); color:#fff;  }

/* 특수공 ‘당첨’일 때 색상 더 강하게 */
.number-balls .ball.megaball.hit{  background:var(--megaball-hit-bg) !important;  color:#111 !important; }
.number-balls .ball.powerball.hit{ background:var(--powerball-hit-bg) !important; color:#fff  !important; }

  .installment-modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.55);z-index:9999}
  .installment-modal.open{display:flex}
  .im-card{width:min(820px,94vw);max-height:60vh;overflow:auto;border-radius:16px;border:1px solid #22314a;background:linear-gradient(180deg,#0f1b2c,#0c1624);box-shadow:0 22px 60px rgba(2,8,23,.5);color:#e8eef7}
  .im-hd{position:sticky;top:0;background:rgba(15,27,44,.95);backdrop-filter:blur(4px);padding:16px 18px;border-bottom:1px solid #22314a;display:flex;align-items:center;justify-content:space-between}
  .im-tt{font-size:18px;font-weight:800}
  .im-close{border:1px solid #22314a;background:linear-gradient(180deg,#0f1b2c,#0c1624);color:#d6e6ff;border-radius:10px;height:36px;padding:0 12px;font-weight:700;cursor:pointer}
  .im-bd{padding:16px 18px}
  .im-meta{font-size:13px;color:#93a4bf;margin:6px 0 12px}
  .im-table{width:100%;border-collapse:separate;border-spacing:0 6px;font-size:14px}
  .im-table th,.im-table td{padding:10px 12px;vertical-align:top}
  .im-table thead th{font-weight:800;color:#b9c9e6;border-bottom:1px solid #22314a}
  .im-row{background:rgba(16,36,58,.55);border:1px solid #1e3a5f;border-radius:12px}
  .im-row td:first-child{font-weight:800;white-space:nowrap;width:120px}
  .im-badge{display:inline-block;border:1px solid #1e3a5f;border-radius:999px;padding:2px 8px;font-size:12px;color:#b7d6ff;margin-right:6px;background:#10243a}
  .im-note{margin-top:12px;color:#93a4bf;font-size:12.5px;line-height:1.6}
  .im-note li{margin:4px 0}
