:root {
  --bg-dark: #090D16;
  --card-bg: rgba(22, 29, 47, 0.82);
  --card-border: rgba(255, 255, 255, 0.08);
  --primary: #3B82F6;
  --accent-include: #10B981;
  --accent-exclude: #EF4444;
  --accent-gold: #F59E0B;
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.5;
  padding: 24px 16px;
  min-height: 100vh;
}

.container {
  max-width: 1480px;
  margin: 0 auto;
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
}

/* Top Header Bar */
header.site-header {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 16px 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.header-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

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

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
  border: 1px solid rgba(245, 158, 11, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand:hover .brand-logo-img {
  transform: scale(1.06);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.6);
}

.brand-badge {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: white;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

/* Menu Navigation Tabs - PC/Mobile User-Friendly Segmented Control (대메뉴 3종 3등분 분할) */
.nav-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(10, 15, 30, 0.75);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
}

.nav-btn .nav-icon {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.nav-btn .nav-text {
  font-weight: 700;
  letter-spacing: -0.2px;
}

.nav-btn .nav-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #93C5FD;
  border: 1px solid rgba(59, 130, 246, 0.35);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 2px;
}

.nav-btn .nav-sub {
  font-size: 11px;
  color: #64748B;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.nav-btn:hover .nav-icon {
  transform: scale(1.15);
}

.nav-btn:hover .nav-sub {
  color: #94A3B8;
}

.nav-btn.active {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  border-color: rgba(147, 197, 253, 0.35);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
}

.nav-btn.active .nav-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  border-color: transparent;
}

.nav-btn.active .nav-sub {
  color: rgba(255, 255, 255, 0.8);
}

/* 헤더 우측 다음 회차 실시간 카운트다운 타이머 배너 */
.next-draw-timer-banner {
  background: linear-gradient(135deg, rgba(20, 30, 55, 0.92) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 12px;
  padding: 8px 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.next-draw-timer-banner::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.timer-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}

.timer-badge-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer-pulse-dot {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10B981;
  animation: pulse-dot 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.92);
    opacity: 0.75;
  }

  50% {
    transform: scale(1.18);
    opacity: 1;
  }

  100% {
    transform: scale(0.92);
    opacity: 0.75;
  }
}

.timer-text-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.timer-target-round {
  font-size: 13.5px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.timer-target-date {
  font-size: 10.5px;
  color: #94A3B8;
  font-weight: 600;
  white-space: nowrap;
}

/* 타이머 디스플레이 */
.timer-countdown-display {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(10, 15, 29, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 10px;
}

.timer-unit-box {
  display: flex;
  align-items: baseline;
  gap: 1.5px;
}

.timer-num {
  font-size: 16px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: #F8FAFC;
  min-width: 20px;
  text-align: center;
}

.timer-num.highlight-sec {
  color: #F59E0B;
}

.timer-unit-label {
  font-size: 10px;
  color: #94A3B8;
  font-weight: 600;
}

.timer-colon {
  font-size: 13px;
  font-weight: 700;
  color: #64748B;
  padding: 0 1px;
}

.mini-ball {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.bonus-ball {
  border: 2px solid #F59E0B;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}

.bonus-plus {
  color: var(--text-muted);
  font-weight: 900;
  font-size: 12px;
  margin: 0 2px;
}

/* 1~6구 번호 범위 지정기 스타일 */
.ball-pos-range-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.ball-pos-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s, background 0.2s;
}

.ball-pos-box:focus-within {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(15, 23, 42, 0.9);
}

.ball-pos-title {
  font-size: 12px;
  font-weight: 800;
  color: #60A5FA;
  letter-spacing: -0.2px;
}

.ball-pos-inputs {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  justify-content: center;
}

.pos-input {
  width: 38px;
  height: 28px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  color: #F8FAFC;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pos-input:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.pos-input::-webkit-inner-spin-button,
.pos-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mini-ball {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 800;
  color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  user-select: none;
}

.bonus-ball {
  border: 2px solid #D97706;
  box-shadow: none;
}

.bonus-plus {
  color: var(--text-muted);
  font-weight: 900;
  font-size: 14px;
  margin: 0 3px;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

.bg-zone-1 {
  background: #D97706;
}

.bg-zone-2 {
  background: #2563EB;
}

.bg-zone-3 {
  background: #DC2626;
}

.bg-zone-4 {
  background: #475569;
}

.bg-zone-5 {
  background: #16A34A;
}

/* Tab Content Switcher */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========================================================
       TAB 1: 814만 건 조합 대상 15대 다조건 필터 덱
       ======================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.35fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.legend-bar {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 14px;
  border-radius: 10px;
}

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

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-inc {
  background: var(--accent-include);
  box-shadow: none;
}

.dot-exc {
  background: var(--accent-exclude);
  box-shadow: none;
}

.dot-def {
  background: #475569;
}

.ball-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .ball-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
  }
}

.lotto-ball {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  background: #1E293B;
  color: #94A3B8;
}

.lotto-ball:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.ball-zone-1 {
  color: #FCD34D;
}

.ball-zone-2 {
  color: #60A5FA;
}

.ball-zone-3 {
  color: #F87171;
}

.ball-zone-4 {
  color: #CBD5E1;
}

.ball-zone-5 {
  color: #4ADE80;
}

.lotto-ball.state-include {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--accent-include);
  color: #34D399;
  box-shadow: none;
  transform: scale(1.05);
}

.lotto-ball.state-include::after {
  content: '+';
  position: absolute;
  top: -4px;
  right: -2px;
  font-size: 11px;
  background: var(--accent-include);
  color: #042F2E;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.lotto-ball.state-exclude {
  background: rgba(239, 68, 68, 0.18);
  border-color: var(--accent-exclude);
  color: #F87171;
  opacity: 0.65;
  text-decoration: line-through;
}

.lotto-ball.state-exclude::after {
  content: '✕';
  position: absolute;
  top: -4px;
  right: -2px;
  font-size: 9px;
  background: var(--accent-exclude);
  color: white;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.preset-toolbar-single {
  display: flex;
  justify-content: flex-end;
}

.btn-reset-only {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: #CBD5E1;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-reset-only:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--accent-exclude);
  color: #FCA5A5;
  transform: translateY(-1px);
}

/* TAB 1 좌/우 분할 레이아웃 (좌: 통합 콘솔 / 우: 추천 슬립) */
.generator-split-container {
  display: flex !important;
  flex-direction: row !important;
  gap: 20px !important;
  align-items: flex-start !important;
  width: 100% !important;
  margin-top: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 900px) {
  .generator-split-container {
    flex-direction: column !important;
  }
}

/* 통합 퀀텀 스튜디오 마스터 카드 (좌측) */
.unified-matrix-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 54% !important;
  width: 54% !important;
  min-width: 0 !important;
  margin-top: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 900px) {
  .unified-matrix-card {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

/* 우측 슬립 및 HUD 컨테이너 */
.smart-slip-side-panel {
  flex: 1 1 46% !important;
  width: 46% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  margin-top: 0 !important;
  position: sticky;
  top: 0;
}

@media (max-width: 900px) {
  .smart-slip-side-panel {
    flex: 1 1 100% !important;
    width: 100% !important;
    position: static !important;
  }
}

.unified-matrix-header {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.98));
  border-bottom: 1px solid var(--card-border);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.unified-matrix-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.unified-badge-combo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-quantum {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  flex-wrap: wrap;
}

.badge-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: all 0.2s;
}

.badge-pill-default {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
}

.badge-pill-inc {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #6EE7B7;
}

.badge-pill-inc .num-tag {
  font-family: 'JetBrains Mono', monospace;
  color: #A7F3D0;
  font-weight: 800;
}

.badge-pill-exc {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #FCA5A5;
}

.badge-pill-exc .num-tag {
  font-family: 'JetBrains Mono', monospace;
  color: #FECACA;
  font-weight: 800;
}

/* 1. 번호 선택기와 2. 스트림 필터 덱을 세로로 순서대로 배치 */
.unified-matrix-vertical-body {
  display: flex;
  flex-direction: column;
}

/* 상단 블록: 번호 선택기 */
.unified-block-top {
  padding: 22px 24px;
  background: rgba(15, 23, 42, 0.45);
  border-bottom: 1px solid var(--card-border);
}

.panel-sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.panel-sub-title {
  font-size: 15px;
  font-weight: 800;
  color: #F1F5F9;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 하단 블록: 15대 스트림 필터 덱 */
.unified-block-bottom {
  padding: 22px 24px;
  background: rgba(11, 17, 32, 0.65);
}

/* 15대 조건 전용 서브 내비게이션 탭 (세그먼트 탭 바 UI) */
.filter-subnav {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  background: rgba(10, 15, 29, 0.85);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.filter-subnav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94A3B8;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
}

.filter-subnav-btn:hover {
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.filter-subnav-btn.active {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.85), rgba(37, 99, 235, 0.7));
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #E2E8F0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-weight: 800;
}

.filter-subnav-btn.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: #3B82F6;
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}

/* 전체 펼쳐보기 탭 전용 구분 스타일 */
.filter-subnav-btn[data-sub="sub-all"] {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-subnav-btn[data-sub="sub-all"]:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.filter-subnav-btn[data-sub="sub-all"].active {
  background: linear-gradient(135deg, #475569, #334155);
  border-color: rgba(203, 213, 225, 0.3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.filter-subnav-btn[data-sub="sub-all"].active::after {
  background: #94A3B8;
  box-shadow: 0 0 8px #64748B;
}

.subnav-badge {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 999px;
  color: inherit;
}

.filter-subnav-btn.active .subnav-badge {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.filter-subgroup {
  display: none;
  animation: fadeInSub 0.25s ease-out forwards;
}

.filter-subgroup.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@keyframes fadeInSub {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 세련된 필터 카드 그리드 */
.filter-grid-sleek {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.filter-item-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.45), rgba(15, 23, 42, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.filter-item-card:hover {
  border-color: rgba(96, 165, 250, 0.35);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.65), rgba(15, 23, 42, 0.7));
  transform: translateY(-1px);
}

.filter-item-card.full-span {
  grid-column: 1 / -1;
}

.filter-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15.5px;
  font-weight: 700;
  color: #F8FAFC;
  letter-spacing: -0.2px;
  line-height: 1.5;
}

.filter-item-header span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 1~15 조건 번호 배지 강조 스타일: 시원하고 큼직하게 극대화 */
.filter-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(11, 148, 240, 0.9), rgba(37, 99, 235, 0.65));
  border: 1.5px solid rgba(147, 197, 253, 0.55);
  color: #F8FAFC;
  font-weight: 900;
  font-size: 18px;
  min-width: 38px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.filter-item-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #93C5FD;
  background: rgba(30, 58, 138, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  white-space: nowrap;
}

/* 쉬운 구간 선택기 (Chips + 직접 입력 박스) */
.easy-range-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.multi-range-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.direct-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  padding: 6px 12px;
  border-radius: 10px;
  width: fit-content;
}

.direct-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.num-input {
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #60A5FA;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 6px;
  border-radius: 6px;
  width: 54px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.num-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

/* 분법 설정 전용 그리드 및 셀 */
.partition-deck-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.partition-deck-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.partition-section-block {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.partition-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.partition-section-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #93C5FD;
  display: flex;
  align-items: center;
  gap: 6px;
}

.partition-section-badge {
  font-size: 11px;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
}

.partition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.partition-cell {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  box-sizing: border-box;
  transition: all 0.2s;
}

.partition-cell-label {
  font-size: 11px;
  font-weight: 700;
  color: #CBD5E1;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.25;
  min-width: 0;
  flex: 1 1 auto;
}

.partition-cell-inputs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.partition-num-input {
  width: 32px;
  height: 24px;
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #60A5FA;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
  border-radius: 4px;
  outline: none;
  box-sizing: border-box;
  padding: 0 2px;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: border-color 0.2s;
}

.partition-num-input::-webkit-outer-spin-button,
.partition-num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.partition-cell.is-extinct,
.section-count-box.is-extinct {
  opacity: 0.38;
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(239, 68, 68, 0.25);
  pointer-events: none;
}

.section-count-wrap {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.section-count-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #94A3B8;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.section-count-title .tip {
  font-size: 10.5px;
  color: #64748B;
  font-weight: 500;
}

.section-count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.section-count-box {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  box-sizing: border-box;
  transition: all 0.2s;
}

.section-count-box-label {
  font-size: 11px;
  font-weight: 700;
  color: #CBD5E1;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.25;
  min-width: 0;
  flex: 1 1 auto;
}

.partition-cell.is-extinct .partition-cell-label,
.section-count-box.is-extinct .section-count-box-label {
  color: #F87171;
  text-decoration: line-through;
}

.section-count-box-inputs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.section-num-input {
  width: 32px;
  height: 24px;
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #60A5FA;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
  border-radius: 4px;
  outline: none;
  box-sizing: border-box;
  padding: 0 2px;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: border-color 0.2s;
}

.section-num-input::-webkit-outer-spin-button,
.section-num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.section-num-input:focus {
  border-color: var(--primary);
}

.partition-num-input:disabled,
.section-num-input:disabled {
  background: #0F172A;
  color: #64748B;
  border-color: rgba(255, 255, 255, 0.05);
  cursor: not-allowed;
}

.partition-num-input:focus {
  border-color: var(--primary);
}

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

/* +/- 범위 추가/삭제 버튼 */
.btn-range-action {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  user-select: none;
}

.btn-range-action.btn-add {
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
}

.btn-range-action.btn-add:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #6EE7B7;
  transform: scale(1.08);
}

.btn-range-action.btn-del {
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
}

.btn-range-action.btn-del:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #FCA5A5;
  transform: scale(1.08);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chip:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.chip.active {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.75), rgba(37, 99, 235, 0.65));
  color: #F8FAFC;
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* 체크박스형 칩(복수 선택) */
.chip-check {
  cursor: pointer;
}

.chip-check .check-icon {
  font-size: 11px;
  opacity: 0.5;
}

.chip-check.active .check-icon {
  opacity: 1;
  color: #93C5FD;
}

.toggle-row-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.toggle-row-compact .toggle-info h4 {
  font-size: 12.5px;
  font-weight: 600;
}

.toggle-row-compact .toggle-info p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--accent-include);
}

input:checked+.slider:before {
  transform: translateX(18px);
}

.hud-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 20px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.hud-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.hud-metric {
  display: flex;
  flex-direction: column;
}

.hud-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.hud-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 30px;
  font-weight: 800;
  color: #60A5FA;
}

.hud-percent {
  font-size: 14px;
  color: var(--accent-include);
  font-weight: 700;
  margin-left: 6px;
}

/* 정렬 모드 및 셔플 컨트롤 스타일 */
.hud-action-row {
  display: flex !important;
  align-items: stretch !important;
  gap: 10px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.hud-action-row .comb-sort-panel {
  flex: 0 0 165px !important;
  width: 165px !important;
  min-width: 145px !important;
  display: flex !important;
  align-items: stretch !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 14px !important;
  border: none !important;
  box-sizing: border-box !important;
}

.hud-action-row .comb-sort-panel .comb-sort-select {
  height: 52px !important;
  line-height: 50px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  width: 100% !important;
  padding: 0 14px !important;
  margin: 0 !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 14px !important;
  color: #F1F5F9 !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px !important;
}

.hud-action-row .comb-sort-panel .comb-sort-select:hover {
  border-color: rgba(96, 165, 250, 0.5) !important;
  background-color: rgba(30, 41, 59, 0.95) !important;
}

.hud-action-row .btn-generate-wrap {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.hud-action-row .btn-generate-wrap .btn-generate {
  width: 100% !important;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  margin: 0 !important;
  padding: 0 18px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  border-radius: 14px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: nowrap !important;
}

@media (max-width: 600px) {
  .hud-action-row {
    flex-direction: column !important;
  }

  .hud-action-row .comb-sort-panel,
  .hud-action-row .btn-generate-wrap,
  .hud-action-row .btn-generate-wrap .btn-generate {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
}

.comb-sort-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.comb-sort-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comb-sort-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: -0.2px;
}

.btn-reshuffle {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60A5FA;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-reshuffle:hover {
  background: rgba(59, 130, 246, 0.3);
  color: #93C5FD;
  border-color: rgba(96, 165, 250, 0.6);
  transform: scale(1.03);
}

.comb-sort-select {
  width: 100%;
  background: rgba(30, 41, 59, 0.9);
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.comb-sort-select:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

/* 슬립 페이징 바 */
.slip-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 12px;
}

.btn-page-nav {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #E2E8F0;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-page-nav:hover:not(:disabled) {
  background: #2563EB;
  color: white;
  border-color: #3B82F6;
}

.btn-page-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 12.5px;
  color: #94A3B8;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-num-highlight {
  color: #60A5FA;
  font-weight: 800;
  font-size: 14px;
  font-family: 'JetBrains Mono', monospace;
}

.page-seed-tag {
  font-size: 11px;
  color: #64748B;
  font-family: 'JetBrains Mono', monospace;
}

.btn-generate {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: white;
  border: none;
  padding: 15px 24px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  width: 100%;
  box-sizing: border-box;
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.6);
}

.btn-generate:active {
  transform: translateY(0);
}

.results-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 22px 24px;
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.ticket-card {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
}

.ticket-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(30, 41, 59, 0.75);
  transform: translateX(2px);
}

/* 간결하고 보기 좋은 6자리 전용 슬립 카드 */
.compact-ticket-card {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px 16px !important;
  gap: 16px !important;
  background: rgba(15, 23, 42, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 12px !important;
}

.compact-ticket-card:hover {
  border-color: rgba(96, 165, 250, 0.5) !important;
  background: rgba(30, 41, 59, 0.8) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  transform: translateY(-1px) !important;
}

.ticket-game-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  font-weight: 800;
  color: #60A5FA;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.3);
  padding: 5px 10px;
  border-radius: 8px;
  min-width: 44px;
  text-align: center;
  flex-shrink: 0;
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.ticket-balls {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.result-ball {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: white;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}

.compact-ticket-card:hover .result-ball {
  transform: scale(1.04);
}

/* ========================================================
       TAB 2, 3, 4 공통 스타일
       ======================================================== */
.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
}

.history-table th {
  text-align: left;
  padding: 14px 16px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--card-border);
  font-weight: 600;
}

.history-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.history-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.draw-balls-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pattern-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

@media (max-width: 860px) {
  .pattern-container {
    grid-template-columns: 1fr;
  }
}

.omr-sheet {
  background: #111827;
  border: 2px solid #374151;
  border-radius: 16px;
  padding: 20px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.omr-grid-7x7 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.omr-cell {
  aspect-ratio: 1;
  background: #1F2937;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #6B7280;
  transition: all 0.2s;
}

.omr-cell.hit {
  background: #2563EB;
  color: white;
  font-weight: 900;
  transform: scale(1.04);
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.6);
  border-color: #60A5FA;
}

.omr-cell.bonus-hit {
  background: #DC2626;
  color: white;
  border: 2px solid #F59E0B;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.6);
}

.omr-cell.empty-slot {
  background: transparent;
  border: none;
}

.pattern-summary-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pattern-stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
}

.extinct-badge {
  display: inline-block;
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  margin-right: 6px;
}

.cycle-btn-group {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.cycle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.cycle-btn.active {
  background: var(--accent-gold);
  color: #1E293B;
  border-color: var(--accent-gold);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.regression-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.regression-item {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.repeat-tag {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-preset:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* ==========================================================
       [모바일 전용 최적화 UI (Mobile-Friendly Responsive & Floating Action Bar)]
       ========================================================== */
.mobile-float-bar {
  display: none;
}

@media (max-width: 900px) {
  body {
    padding-bottom: 96px;
    /* 하단 고정 액션바 공간 확보 */
  }

  .container {
    padding: 12px 10px;
  }

  /* 모바일 헤더 & 네비게이션 최적화 */
  header.site-header {
    padding: 12px 12px;
    border-radius: 16px;
    gap: 12px;
    margin-bottom: 16px;
  }

  .header-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
  }

  .brand-title {
    font-size: 18px;
  }

  .next-draw-timer-banner {
    width: 100%;
    justify-content: space-between;
    padding: 8px 12px;
  }

  /* 모바일 탭: 가로 2x2 그리드 또는 터치 스크롤 바 */
  .nav-tabs {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 4px;
    border-radius: 12px;
  }

  .nav-btn {
    padding: 9px 8px;
    font-size: 12.5px;
    gap: 6px;
  }

  .nav-btn .nav-icon {
    font-size: 15px;
  }

  .nav-btn .nav-sub {
    display: none;
    /* 모바일에서는 서브텍스트 숨겨서 깔끔한 터치 영역 확보 */
  }

  .nav-btn .nav-badge {
    font-size: 9.5px;
    padding: 1px 4px;
  }

  /* 모바일 1~6구 번호 범위 지정기: 3열 2행으로 터치하기 편하게 분할 */
  .ball-pos-range-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
  }

  .pos-input {
    width: 32px;
    height: 26px;
    font-size: 12px;
  }

  /* 1단 세로 스택 전환 */
  .generator-split-container {
    flex-direction: column !important;
    gap: 16px !important;
  }

  .unified-matrix-card {
    flex: 1 1 100% !important;
    width: 100% !important;
    border-radius: 16px;
  }

  .smart-slip-side-panel {
    flex: 1 1 100% !important;
    width: 100% !important;
    position: static !important;
    gap: 16px !important;
  }

  /* 모바일 헤더 패딩 및 폰트 조절 */
  .unified-matrix-header {
    padding: 14px 16px;
  }

  .unified-matrix-title-wrap h2 {
    font-size: 15px !important;
  }

  .unified-block-bottom {
    padding: 14px 12px;
  }

  /* 탭 버튼 가로 스크롤 터치 친화적 지원 */
  .filter-subnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
  }

  .filter-subnav::-webkit-scrollbar {
    height: 4px;
  }

  .filter-subnav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
  }

  .filter-subnav-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* 그리드 1열 최적화 */
  .filter-grid-sleek {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .filter-item-card {
    padding: 12px 14px;
    border-radius: 12px;
  }

  .filter-item-header {
    font-size: 13.5px;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* 칩 터치 영역 최적화 */
  .chip {
    padding: 6px 10px;
    font-size: 11.5px;
    min-height: 34px;
  }

  /* 모바일 구간별 개수 그리드 최적화 (오버플로우 방지 및 라벨 줄바꿈) */
  .section-count-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 5px;
  }

  .section-count-box {
    padding: 5px 6px;
    gap: 4px;
  }

  .section-count-box-label {
    font-size: 10.5px;
    line-height: 1.2;
  }

  .section-num-input {
    width: 28px;
    height: 22px;
    font-size: 11px;
  }

  /* 모바일 분법 그리드 및 인풋 최적화 */
  .partition-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 5px;
  }

  .partition-cell {
    padding: 5px 6px;
    gap: 4px;
  }

  .partition-cell-label {
    font-size: 10.5px;
    line-height: 1.2;
  }

  .partition-num-input {
    width: 28px;
    height: 22px;
    font-size: 11px;
  }

  /* 모바일 하단 플로팅 액션 바 (Floating Action Bar) */
  .mobile-float-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(59, 130, 246, 0.35);
    padding: 10px 16px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-float-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .mobile-float-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
  }

  .mobile-float-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 800;
    color: #60A5FA;
    white-space: nowrap;
  }

  .mobile-float-btn {
    flex: 1;
    max-width: 220px;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    border: 1px solid rgba(147, 197, 253, 0.4);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 13.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5);
    transition: transform 0.15s, background 0.2s;
  }

  .mobile-float-btn:active {
    transform: scale(0.97);
    background: #1E40AF;
  }
}

/* ========================================================== */
/* [공통 푸터 & 면책 조항 컴포넌트 통합 스타일] */
/* ========================================================== */
.site-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-inner {
  display: flex;
  flex-direction: column;
}

.footer-unified-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid #3B82F6;
  border-radius: 16px;
  padding: 24px 28px;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.footer-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.disclaimer-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #93C5FD;
  letter-spacing: -0.2px;
}

.disclaimer-title {
  font-size: 14px;
  font-weight: 700;
  color: #F1F5F9;
  letter-spacing: -0.3px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.footer-grid-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-grid-item .item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #E2E8F0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-grid-item .item-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #3B82F6;
  border-radius: 50%;
}

.footer-grid-item .item-desc {
  font-size: 12px;
  color: #94A3B8;
  line-height: 1.6;
  margin: 0;
  word-break: keep-all;
}

.footer-grid-item .item-desc strong {
  color: #F8FAFC;
  font-weight: 600;
}

.footer-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 18px 0 14px 0;
}

.footer-bottom-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  color: #64748B;
}

.footer-brand-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94A3B8;
}

.footer-brand-info strong {
  color: #E2E8F0;
}

.footer-tag {
  background: rgba(59, 130, 246, 0.2);
  color: #93C5FD;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.footer-copyright {
  color: #64748B;
  font-size: 11px;
}

@media (max-width: 900px) {
  .footer-unified-card {
    padding: 18px 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .footer-bottom-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ========================================================== */
/* [글로벌 토스트 알림 컴포넌트 - 상단 플로팅 배너 스타일] */
/* ========================================================== */
.lotto-toast {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid #EF4444;
  color: #FFFFFF;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 24px rgba(239, 68, 68, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}

.lotto-toast span.toast-icon {
  font-size: 17px;
  display: flex;
  align-items: center;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.8));
}

.lotto-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 900px) {
  .lotto-toast {
    top: 18px;
    width: 92%;
    max-width: 380px;
    justify-content: center;
    font-size: 13px;
    padding: 12px 18px;
    border-radius: 14px;
  }
}

/* ========================================================== */
/* [조합 정렬 및 추출 설정 패널 (Glassmorphism Dark)] */
/* ========================================================== */
.comb-sort-panel {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 12px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.comb-sort-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comb-sort-label {
  font-size: 12px;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: -0.2px;
}

.btn-reshuffle {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #A5B4FC;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-reshuffle:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: #818CF8;
  color: #FFFFFF;
  transform: translateY(-1px);
}

.comb-sort-select {
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F1F5F9;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.comb-sort-select:focus {
  border-color: #60A5FA;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

/* ========================================================== */
/* [슬립 페이징 바 & 페이지 직접 점프 입력기] */
/* ========================================================== */
.slip-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  gap: 8px;
}

.btn-page-nav {
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94A3B8;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-page-nav:hover:not(:disabled) {
  background: #334155;
  color: #F8FAFC;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-page-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.slip-page-jump-input {
  width: 60px;
  height: 28px;
  background: #0F172A;
  border: 1px solid #3B82F6;
  border-radius: 6px;
  color: #60A5FA;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  outline: none;
  box-sizing: border-box;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: all 0.2s;
}

.slip-page-jump-input::-webkit-outer-spin-button,
.slip-page-jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.slip-page-jump-input:focus {
  border-color: #93C5FD;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.slip-page-total {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 600;
}

.btn-page-jump {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3B82F6;
  color: #93C5FD;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-page-jump:hover {
  background: #3B82F6;
  color: #FFFFFF;
}

/* ==========================================================
   [역대 회차 서브 네비게이션 & 분석 대시보드 스타일]
========================================================== */
.history-subnav-container {
  display: flex;
  margin-top: 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 6px;
  overflow-x: auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.subnav-hidden {
  display: none !important;
}

.history-subnav-scroll {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.subnav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: #94A3B8;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.subnav-pill:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.subnav-pill.active {
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: #FFFFFF;
  border-color: rgba(147, 197, 253, 0.4);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.subnav-pill .subnav-icon {
  font-size: 14px;
}

/* 1. 회차 상세 모달 (완전조합기 15대 조건 상세) */
.history-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.history-modal-box {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  color: #F8FAFC;
}

.history-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(17, 24, 39, 0.95);
  position: sticky;
  top: 0;
  z-index: 10;
}

.history-modal-body {
  padding: 20px 24px;
}

.modal-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: #93C5FD;
  margin: 18px 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-section-title:first-of-type {
  margin-top: 4px;
}

.modal-section-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
}

.history-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.detail-attr-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
}

.detail-attr-card .attr-label {
  font-size: 12px;
  color: #94A3B8;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.detail-attr-card .attr-val {
  font-size: 14.5px;
  font-weight: 700;
  color: #F1F5F9;
}

/* 역대 회차 페이지 사이즈 선택 드롭다운 */
.history-pagesize-select {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--card-border);
  color: #F1F5F9;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.history-pagesize-select:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

/* 최근 N주 통계 헤더 컨트롤 & 범례 */
.period-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.period-legend-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.65);
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.period-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #94A3B8;
  white-space: nowrap;
}

.period-legend-item b {
  font-weight: 700;
}

.period-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.period-legend-sep {
  color: rgba(255, 255, 255, 0.15);
  user-select: none;
}

.period-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 모바일 반응형 대응 (768px 이하) */
@media (max-width: 768px) {
  .period-header-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 8px;
  }

  .period-legend-box {
    width: 100%;
    justify-content: space-around;
    padding: 8px 10px;
    gap: 6px;
  }

  .period-legend-item {
    font-size: 11.5px;
  }

  .period-legend-sep {
    display: none;
  }

  .period-select-wrap {
    width: 100%;
    justify-content: space-between;
  }

  .period-select-wrap select {
    flex: 1;
  }
}

/* 통계 분포 카테고리 필터 탭 바 */
.dist-category-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 14px 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.dist-category-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dist-category-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #F1F5F9;
  border-color: rgba(255, 255, 255, 0.2);
}

.dist-category-btn.active {
  background: #3B82F6;
  border-color: #60A5FA;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

/* 통계 카드 공통 스타일 */
.dist-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.dist-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.dist-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

.dist-card-title {
  font-size: 14.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dist-card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
}

/* 행(Row) 하이라이트 효과 */
.dist-stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}

.dist-stat-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.dist-stat-row.row-peak {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* 하위 소구간 2열 반응형 그리드 */
.dist-subgroup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

@media (max-width: 768px) {
  .dist-card {
    padding: 14px;
  }

  .dist-subgroup-grid {
    grid-template-columns: 1fr;
  }
}

.history-pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.history-page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.history-page-btn.active {
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: #FFFFFF;
  border-color: #60A5FA;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.history-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.history-page-info {
  font-size: 13px;
  color: #94A3B8;
  margin: 0 8px;
  font-weight: 600;
}

.history-page-jump-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.history-page-jump-input {
  width: 54px;
  height: 32px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #60A5FA;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  outline: none;
  box-sizing: border-box;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: all 0.2s;
}

.history-page-jump-input::-webkit-outer-spin-button,
.history-page-jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.history-page-jump-input:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.btn-history-page-jump {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3B82F6;
  color: #93C5FD;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-history-page-jump:hover {
  background: #3B82F6;
  color: #FFFFFF;
}

/* 2. 이월수 뷰 스타일 */
.carryover-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.carryover-table th,
.carryover-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.carryover-ball-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  color: white;
  margin: 0 2px;
  position: relative;
}

/* 이월수 / 이웃수 모드 전환 탭 버튼 */
.carryover-mode-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px;
  border-radius: 12px;
  gap: 6px;
}

.carryover-tab-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
}

.carryover-tab-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}

.carryover-tab-btn.active {
  background: #3B82F6;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.mode-pill-cnt {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.carryover-tab-btn.active .mode-pill-cnt {
  background: rgba(0, 0, 0, 0.25);
  color: #FFFFFF;
}

.mode-pill-cnt.gold-pill {
  color: #FCD34D;
}

.mode-pill-cnt.green-pill {
  color: #6EE7B7;
}

/* 안내 및 범례 박스 */
.carryover-guide-box {
  margin-bottom: 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  color: #94A3B8;
  line-height: 1.6;
}

.carryover-legend-items {
  display: flex;
  gap: 10px;
  align-items: center;
}

.legend-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-carry {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #FCD34D;
}

.legend-neighbor {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6EE7B7;
}

/* 회차 간 연계 트랙 (Connecting Stream) */
.carry-stream-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}

.carry-flow-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.carry-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  animation: fadeIn 0.25s ease;
}

.carry-link-badge.badge-carry {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #FCD34D;
}

.carry-link-badge.badge-carry .link-arrow {
  color: #F59E0B;
  font-weight: 900;
}

.carry-link-badge.badge-neighbor {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6EE7B7;
}

.carry-link-badge.badge-neighbor .link-arrow {
  color: #10B981;
  font-weight: 900;
}

/* ========================================================== */
/* [장기 미출현 역추적표 격자 그리드 (Cold Grid View)] */
/* ========================================================== */
.cold-grid-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  background: #0B1120;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.cold-grid-table th,
.cold-grid-table td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 6px;
  text-align: center;
  box-sizing: border-box;
}

.cold-grid-table thead th {
  background: #0F172A;
  color: #94A3B8;
  font-weight: 700;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

/* 5개 행마다 굵은 구분 테두리 (외부 테두리 강조) */
.cold-grid-table tbody tr.row-group-end td {
  border-bottom: 2px solid #3B82F6 !important;
}

/* ========================================================== */
/* [2. 모눈종이 1~45 격자 목록 (Graph Paper Grid View)] */
/* ========================================================== */
.carryover-grid-table {
  border-collapse: collapse;
  width: auto;
  min-width: 100%;
  font-size: 12.5px;
  background: #0B1120;
}

.carryover-grid-table th,
.carryover-grid-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 4px;
  text-align: center;
  box-sizing: border-box;
}

.carryover-grid-table thead tr.grid-header-row th {
  background: #0F172A;
  color: #94A3B8;
  font-weight: 700;
  padding: 10px 8px;
}

.carryover-grid-table thead tr.grid-subhead-row th {
  background: #162032;
  color: #CBD5E1;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 2px;
  width: 28px;
  min-width: 28px;
  max-width: 28px;
}

/* 고정 열 스타일 */
.col-fixed.col-round {
  width: 80px;
  min-width: 80px;
  position: sticky;
  left: 0;
  background: #0F172A !important;
  z-index: 10;
}

.col-fixed.col-date {
  width: 95px;
  min-width: 95px;
  position: sticky;
  left: 80px;
  background: #0F172A !important;
  z-index: 10;
}

.col-fixed.col-stats {
  width: 65px;
  min-width: 65px;
  background: #0F172A;
}

tbody td.col-fixed.col-round {
  background: #090E1A !important;
}

tbody td.col-fixed.col-date {
  background: #090E1A !important;
}

/* 1~45 모눈종이 격자 셀 */
.grid-num-cell {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  height: 32px;
  padding: 2px !important;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.015);
  transition: background 0.15s;
}

.carryover-grid-table tr:hover td.grid-num-cell {
  background: rgba(255, 255, 255, 0.04);
}

/* 격자 내 미출현 번호 빈칸 표시 */
.grid-empty-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

/* 격자 내 번호 볼 칩 */
.grid-ball-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  color: #FFFFFF;
  margin: auto;
  box-sizing: border-box;
  transition: transform 0.15s;
}

/* 1) 일반 당첨번호 (연계 아님) - 깔끔한 슬레이트 블루 */
.chip-normal {
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.6);
  color: #93C5FD;
}

/* 2) 이월수 (직전 회차 동일 번호 재출현) - 선명한 주황/골드 */
.chip-carryover {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #000000;
  font-weight: 900;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transform: scale(1.05);
}

/* 3) 이웃수 (직전 회차 번호의 ±1 인접 번호) - 화사한 에메랄드/그린 */
.chip-neighbor {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #000000;
  font-weight: 900;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transform: scale(1.05);
}

/* 4) 보너스 번호 표출 시 테두리 링 */
.chip-bonus {
  position: relative;
}

.chip-bonus::after {
  content: '+';
  position: absolute;
  top: -6px;
  right: -5px;
  font-size: 9px;
  font-weight: 900;
  color: #F59E0B;
}

/* 5구간 번호대 헤더 색상 */
.subhead-zone-1 {
  color: #F87171 !important;
}

.subhead-zone-2 {
  color: #60A5FA !important;
}

.subhead-zone-3 {
  color: #FBBF24 !important;
}

.subhead-zone-4 {
  color: #94A3B8 !important;
}

.subhead-zone-5 {
  color: #34D399 !important;
}

.carry-limit-btns {
  display: inline-flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.8);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.carry-limit-btns .cycle-btn {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.carry-arrow-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #FCD34D;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

/* 3. 전체 번호 빈도 차트 */
.freq-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s;
}

.freq-bar-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.freq-bar-track {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  height: 18px;
  border-radius: 9px;
  overflow: hidden;
  position: relative;
}

.freq-bar-fill {
  height: 100%;
  border-radius: 9px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, #3B82F6, #60A5FA);
}

/* 5. 장기 미출현 표 */
.cold-table {
  width: 100%;
  border-collapse: collapse;
}

.cold-table th,
.cold-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cold-ball-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
}

/* 6. 용지/패턴표 (7x7 그리드 가로/세로 멸 강조) */
.pattern-sheet-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.pattern-grid-7x7-pro {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 12px 0;
  background: #090E1A;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 480px;
  width: 100%;
}

.pattern-cell {
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.05);
  color: #94A3B8;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}

/* 가로 또는 세로 전멸 라인: 구분 없이 빨간색으로 일괄 강조 */
.pattern-cell.cell-extinct-all {
  background: rgba(239, 68, 68, 0.16);
  border: 1.5px solid rgba(239, 68, 68, 0.55);
  color: #FCA5A5;
  box-shadow: inset 0 0 8px rgba(239, 68, 68, 0.25);
}

.pattern-cell.cell-hit {
  background: #3B82F6;
  color: #FFFFFF;
  font-weight: 800;
  border-color: #60A5FA;
  box-shadow: none;
}

.pattern-cell.cell-bonus {
  background: #F59E0B;
  color: #FFFFFF;
  font-weight: 800;
  border-color: #FBBF24;
  box-shadow: none;
}

/* ========================================================== */
/* [7. 열린 건의함 & 소통 광장 UI (Community Page)] */
/* ========================================================== */
.community-page-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.community-hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 30px;
  position: relative;
  overflow: hidden;
}

.community-hero-badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #93C5FD;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.community-hero-title {
  font-size: 24px;
  font-weight: 800;
  color: #F8FAFC;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.community-hero-desc {
  font-size: 14.5px;
  color: #94A3B8;
  line-height: 1.7;
  max-width: 900px;
}

.community-hero-stats {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.hero-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-stat-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-gold);
}

.hero-stat-label {
  font-size: 12px;
  color: #64748B;
}

.community-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 960px) {
  .community-grid {
    grid-template-columns: 1fr;
  }
}

.community-form-card {
  display: flex;
  flex-direction: column;
}

.comm-input {
  width: 100%;
  background: #0B1120;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F8FAFC;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.comm-input:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.comm-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #CBD5E1;
  margin-bottom: 6px;
}

/* 피드 리스트 */
.feedback-feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  max-height: 540px;
  overflow-y: auto;
  padding-right: 4px;
}

.feed-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s, border-color 0.2s;
}

.feed-item:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.feed-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.feed-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.feed-tag.tag-done {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.feed-tag.tag-review {
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.feed-category {
  color: #94A3B8;
}

.feed-date {
  color: #64748B;
  margin-left: auto;
}

.feed-item-title {
  font-size: 14px;
  font-weight: 700;
  color: #F1F5F9;
}

.feed-item-content {
  font-size: 13px;
  color: #94A3B8;
  line-height: 1.5;
}

.feed-item-reply {
  background: rgba(30, 41, 59, 0.6);
  border-left: 3px solid #3B82F6;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  color: #CBD5E1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.reply-badge {
  font-size: 10.5px;
  font-weight: 800;
  color: #60A5FA;
  align-self: flex-start;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.faq-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
}

.faq-question {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #E2E8F0;
  cursor: pointer;
  outline: none;
  user-select: none;
}

.faq-answer {
  padding: 12px 16px;
  font-size: 13px;
  color: #94A3B8;
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   모눈종이 격자 (1~45 Graph Paper Grid) - 이월수 / 이웃수 분석
   ========================================================================== */
.carryover-grid-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', 'Pretendard', sans-serif;
  font-size: 11.5px;
  background: #090E1A;
  border: 1px solid rgba(255, 255, 255, 0.12);
  user-select: none;
  contain: paint;
}

.carryover-grid-table thead {
  position: sticky;
  top: 0;
  z-index: 40;
}

.carryover-grid-table thead tr.grid-header-row th {
  position: sticky;
  top: 0;
  background: #0F172A !important;
  color: #E2E8F0;
  font-weight: 700;
  text-align: center;
  padding: 8px 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  z-index: 40;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.carryover-grid-table thead tr.grid-subhead-row th {
  position: sticky;
  top: 36px;
  /* 첫 번째 헤더 행 바로 아래 밀착 고정 */
  background: #0B1120 !important;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 5px 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 39;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* 회차 및 개수 컬럼 헤더는 행 2개를 차지하므로 z-index 최상위 부여 */
.carryover-grid-table thead th.col-fixed.col-round {
  z-index: 50 !important;
  left: 0;
  background: #0F172A !important;
}

.carryover-grid-table thead th.col-fixed.col-stats {
  z-index: 50 !important;
  background: #0D1527 !important;
}

/* 상단 스크롤바 커스텀 스타일 */
#carryoverTopScrollWrap::-webkit-scrollbar,
#carryoverScrollContainer::-webkit-scrollbar {
  height: 8px;
}

#carryoverTopScrollWrap::-webkit-scrollbar-track,
#carryoverScrollContainer::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}

#carryoverTopScrollWrap::-webkit-scrollbar-thumb,
#carryoverScrollContainer::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.5);
  border-radius: 4px;
}

#carryoverTopScrollWrap::-webkit-scrollbar-thumb:hover,
#carryoverScrollContainer::-webkit-scrollbar-thumb:hover {
  background: #60A5FA;
}

.carryover-grid-table tbody tr {
  height: 27px;
  content-visibility: auto;
  contain-intrinsic-size: 27px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.carryover-grid-table td {
  padding: 3px 2px;
  text-align: center;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* 고정 열 (회차, 개수 통계) */
.carryover-grid-table .col-fixed.col-round {
  width: 62px;
  min-width: 62px;
  max-width: 62px;
  position: sticky;
  left: 0;
  background: #0F172A;
  z-index: 5;
  border-right: 1.5px solid rgba(255, 255, 255, 0.15);
  padding: 3px 2px;
}

.carryover-grid-table thead .col-fixed {
  z-index: 15 !important;
}

.carryover-grid-table .col-fixed.col-stats {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  text-align: center;
  font-weight: 800;
  border-left: 1.5px solid rgba(255, 255, 255, 0.15);
  background: #0D1527;
  padding: 3px 2px;
}

/* 1~45 번호 헤더: 진한 번호대별 배경색 제거, 단정하고 깔끔한 모눈종이 헤더로 변경 */
.grid-head-num {
  width: 20px;
  min-width: 18px;
  max-width: 21px;
  padding: 5px 0 !important;
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8 !important;
  background: #0B1120 !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  text-shadow: none !important;
}

/* 모눈종이 1~45 내부 셀: 한 화면에 들어오도록 콤팩트화 */
.grid-num-cell {
  width: 20px;
  min-width: 18px;
  max-width: 21px;
  height: 25px;
  padding: 1px 0 !important;
  box-sizing: border-box;
}

.grid-empty-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

/* 모눈종이 위 번호 칩 (Ball Chip): 불필요한 트랜지션 및 마우스 오버 렌더링 부하 제거 */
.grid-ball-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 800;
  box-sizing: border-box;
  pointer-events: none;
}

/* 1) 일반 당첨번호 (연계 없는 번호) */
.grid-ball-chip.chip-normal {
  background: rgba(59, 130, 246, 0.22);
  color: #93C5FD;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

/* 2) 이월수 (전회차와 동일 출현 번호) - 화사한 주황/골드 엠버 */
.grid-ball-chip.chip-carryover {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
  border: 1px solid #FDE68A;
  font-weight: 900;
  box-shadow: none;
  transform: scale(1.05);
  z-index: 2;
}

/* 3) 이웃수 (전회차 당첨번호 ±1 인접 번호) - 산뜻한 에메랄드/그린 */
.grid-ball-chip.chip-neighbor {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  border: 1px solid #A7F3D0;
  font-weight: 900;
  box-shadow: none;
  transform: scale(1.05);
  z-index: 2;
}

/* 4) 보너스번호 ➔ 보너스번호 연속 출현 (보너스 전용 색상: 생생한 바이올렛/퍼플) */
.grid-ball-chip.chip-bonus-repeat {
  background: linear-gradient(135deg, #A855F7 0%, #7C3AED 100%) !important;
  color: #FFFFFF !important;
  border: 1.5px solid #E9D5FF !important;
  font-weight: 900 !important;
  box-shadow: none !important;
  transform: scale(1.05) !important;
  z-index: 3 !important;
}

/* 5) 순수 일반 보너스 번호 (연계 없음) */
.grid-ball-chip.chip-bonus-normal {
  background: rgba(147, 51, 234, 0.22);
  color: #D8B4FE;
  border: 1px dashed rgba(192, 132, 252, 0.6);
}

/* 모바일 전용 반응형: 좌우 스크롤 추가 & 회차 컬럼 고정 */
@media (max-width: 992px) {
  #carryoverScrollContainer {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .carryover-grid-table {
    min-width: 860px;
    /* 모바일에서 표가 찌그러지지 않고 좌우로 자연스럽게 스크롤되도록 보장 */
  }

  .carryover-grid-table .col-fixed.col-round {
    position: sticky !important;
    left: 0 !important;
    background: #0F172A !important;
    z-index: 10 !important;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.4);
  }

  .carryover-grid-table thead .col-fixed.col-round {
    z-index: 20 !important;
  }
}