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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: #121212;
  min-height: 100vh;
  padding: 20px;
  color: #e0e0e0;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  body {
    padding: 10px;
    overflow-x: hidden;
    max-width: 100vw;
  }
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .container {
    max-width: 100%;
    overflow-x: hidden;
  }
}

header {
  background: #1e1e1e;
  padding: 20px 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #2c2c2c;
}

@media (max-width: 768px) {
  header {
    padding: 15px;
    margin-bottom: 10px;
  }
}

header h1 {
  font-size: 28px;
  color: #8ab4f8;
  font-weight: 700;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 20px;
  }
}

.header-info {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .header-info {
    gap: 8px;
    font-size: 12px;
  }
}

#currentTime {
  font-size: 14px;
  color: #9aa0a6;
  font-weight: 500;
}

@media (max-width: 768px) {
  #currentTime {
    font-size: 11px;
  }
}

.btn-refresh {
  background: #8ab4f8;
  color: #121212;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-refresh:hover {
  background: #aecbfa;
  box-shadow: 0 2px 8px rgba(138, 180, 248, 0.3);
}

@media (max-width: 768px) {
  .btn-refresh-text {
    display: none;
  }

  .btn-refresh {
    padding: 8px 12px;
    font-size: 16px;
  }
}

.section {
  background: #1e1e1e;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  border: 1px solid #2c2c2c;
}

.section h2 {
  color: #e0e0e0;
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

/* 경마장 탭 바 */
.tracks-bar {
  margin-bottom: 20px;
  padding: 15px;
  background: #1e1e1e;
  border-radius: 12px;
  border: 1px solid #2c2c2c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  .tracks-bar {
    padding: 10px;
    margin-bottom: 10px;
  }
}

.tracks-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 768px) {
  .tracks-tabs {
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tracks-tabs::-webkit-scrollbar {
    display: none;
  }
}

.track-tab {
  padding: 12px 20px;
  background: #2c2c2c;
  border: 2px solid #3c3c3c;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #9aa0a6;
  transition: all 0.2s;
  user-select: none;
}

@media (max-width: 768px) {
  .track-tab {
    padding: 10px 14px;
    font-size: 12px;
    border-width: 1.5px;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

.track-tab:hover:not(.disabled) {
  border-color: #8ab4f8;
  background: #2d3a4d;
  color: #8ab4f8;
}

.track-tab.active {
  background: #8ab4f8;
  color: #121212;
  border-color: #8ab4f8;
}

.track-tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: #5f6368;
  background: #2c2c2c;
}

.tab-btn {
  padding: 12px 20px;
  background: #2c2c2c;
  border: 2px solid #3c3c3c;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #9aa0a6;
  transition: all 0.2s;
  user-select: none;
}

@media (max-width: 768px) {
  .tab-btn {
    padding: 10px 14px;
    font-size: 12px;
    border-width: 1.5px;
  }
}

.tab-btn:hover:not(.disabled) {
  border-color: #8ab4f8;
  background: #2d3a4d;
  color: #8ab4f8;
}

.tab-btn.active {
  background: #8ab4f8;
  color: #121212;
  border-color: #8ab4f8;
}

.tab-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: #5f6368;
  background: #2c2c2c;
}

/* 메인 레이아웃 */
.main-layout {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 10px;
    overflow-x: hidden;
    max-width: 100%;
  }
}

/* 경주번호 패널 */
.race-numbers-panel {
  background: #1e1e1e;
  padding: 12px 6px;
  border-radius: 12px;
  border: 1px solid #2c2c2c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  height: fit-content;
  position: sticky;
  top: 20px;
}

@media (max-width: 768px) {
  .race-numbers-panel {
    position: static;
    padding: 10px 15px;
    background: #1e1e1e;
    border-radius: 12px;
    overflow-x: auto;
    max-width: 100%;
  }
}

.race-numbers-panel h3 {
  color: #8ab4f8;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 768px) {
  .race-numbers-panel h3 {
    font-size: 12px;
    margin-bottom: 8px;
    display: none;
  }
}

.race-numbers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#raceNumbersContent {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 768px) {
  .race-numbers-list {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0;
  }

  .race-numbers-list::-webkit-scrollbar {
    display: none;
  }

  #raceNumbersContent {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #raceNumbersContent::-webkit-scrollbar {
    display: none;
  }
}

.race-number-item {
  padding: 8px 4px;
  background: #2c2c2c;
  border: 2px solid #3c3c3c;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  color: #9aa0a6;
  transition: all 0.2s;
}

@media (max-width: 768px) {
  .race-number-item {
    flex: 0 0 auto;
    min-width: auto;
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
    border-width: 1.5px;
  }
}

.race-number-item:hover {
  border-color: #8ab4f8;
  background: #2d3a4d;
  color: #8ab4f8;
}

.race-number-item.active {
  background: #8ab4f8;
  color: #121212;
  border-color: #8ab4f8;
}

.odds-main-content {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  max-width: 100%;
}

@media (max-width: 768px) {
  .odds-main-content {
    overflow-x: visible;
    max-width: 100vw;
  }
}

.odds-header-info {
  margin-bottom: 20px;
}

.track-name {
  color: #8ab4f8;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.race-title {
  color: #9aa0a6;
  font-size: 18px;
  font-weight: 500;
}

/* 예상 요약 */
.prediction-summary {
  background: #1e1e1e;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #2c2c2c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
}

.prediction-summary h3 {
  color: #8ab4f8;
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: 700;
}

.prediction-content {
  overflow-x: auto;
}

.prediction-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

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

.prediction-table th,
.prediction-table td {
  border: 1px solid #3c3c3c;
  padding: 8px;
  text-align: center;
}

.prediction-table thead th {
  background: #2c2c2c;
  color: #8ab4f8;
  font-weight: 700;
  position: sticky;
  top: 0;
}

@media (max-width: 768px) {

  .prediction-table thead th:nth-child(2),
  .prediction-table thead th:nth-child(3) {
    display: none;
  }

  .prediction-table tbody td:nth-child(2),
  .prediction-table tbody td:nth-child(3) {
    display: none;
  }
}

.prediction-table tbody tr:hover {
  background: rgba(138, 180, 248, 0.1);
}

.prediction-table .horse-name {
  text-align: left;
  color: #e0e0e0;
}

@media (max-width: 768px) {
  .prediction-table .horse-name {
    display: none;
  }
}

.prediction-table .jockey-name {
  text-align: left;
  color: #9aa0a6;
  font-size: 12px;
}

@media (max-width: 768px) {
  .prediction-table .jockey-name {
    display: none;
  }
}

.prediction-table .pred-value {
  color: #ffa726;
  font-weight: 600;
}

.prediction-table .pred-total-cell {
  padding: 4px 8px !important;
}

.prediction-table .pred-total-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.prediction-table .pred-total {
  color: #8ab4f8;
  font-weight: 700;
  font-size: 14px;
  text-align: left;
  min-width: 40px;
}

.prediction-table .pred-percentage {
  color: #9aa0a6;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  min-width: 45px;
}

.prediction-table .pred-bar-container {
  width: 100%;
  height: 4px;
  background: #2c2c2c;
  border-radius: 2px;
  overflow: hidden;
}

.prediction-table .pred-bar {
  height: 100%;
  background: linear-gradient(90deg, #8ab4f8, #4fc3f7);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* 예상 배당 패널 */
.expected-odds-panel {
  background: #1e1e1e;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #2c2c2c;
}

.expected-odds-panel h4 {
  color: #8ab4f8;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
}

.odds-info-note {
  color: #9aa0a6;
  font-size: 12px;
  margin-bottom: 15px;
}

/* 예상 배당 매트릭스 - 실시간 배당과 동일한 스타일 */
.expected-odds-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}

.expected-odds-matrix th,
.expected-odds-matrix td {
  border: 1px solid #3c3c3c;
  padding: 8px;
  text-align: center;
  min-width: 40px;
}

.expected-odds-matrix thead th {
  background: #2c2c2c;
  color: #8ab4f8;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 10;
}

.expected-odds-matrix .corner-cell {
  background: #1e1e1e;
  border: none;
}

.expected-odds-matrix .row-header {
  background: #2c2c2c;
  color: #8ab4f8;
  font-weight: 700;
  position: sticky;
  left: 0;
  z-index: 5;
}

.expected-odds-matrix tbody tr:hover {
  background: rgba(138, 180, 248, 0.1);
}

.expected-odds-matrix .same-horse {
  background: #1e1e1e;
  color: #5f6368;
  font-style: italic;
}

.expected-odds-matrix .empty-cell {
  background: #1a1a1a;
  border-color: #2c2c2c;
}

.expected-odds-wrapper {
  max-height: 600px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.expected-odds-wrapper::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.expected-odds-wrapper::-webkit-scrollbar-track {
  background: #2c2c2c;
  border-radius: 3px;
}

.expected-odds-wrapper::-webkit-scrollbar-thumb {
  background: #5f6368;
  border-radius: 3px;
}

.expected-odds-wrapper::-webkit-scrollbar-thumb:hover {
  background: #8ab4f8;
}

/* 상단 2-column 그리드 */
.top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* 하단 2-column 그리드 */
.bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 1200px) {

  .top-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* 협회 액션 버튼 모바일 최적화 */
@media (max-width: 768px) {
  .association-actions {
    width: 100%;
    margin-top: 8px;
    display: flex;
    gap: 6px;
  }

  .association-actions .race-nav-btn {
    flex: 1;
  }

  #associationBar {
    flex-wrap: wrap;
  }
}

.grid-panel {
  background: #1e1e1e;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #2c2c2c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  max-width: 100%;
}

@media (max-width: 768px) {
  .grid-panel {
    padding: 12px;
    min-height: auto;
    overflow: visible;
    max-width: 100%;
    height: auto;
  }
}

.grid-panel h3 {
  color: #8ab4f8;
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 768px) {
  .grid-panel h3 {
    font-size: 15px;
    margin-bottom: 10px;
  }
}

.odds-info {
  color: #9aa0a6;
  font-size: 12px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-content {
  width: 100%;
  height: 100%;
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #5f6368 #2c2c2c;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  flex: 1;
  min-height: 0;
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  justify-content: space-around !important;
}

.panel-content>* {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

@media (max-width: 768px) {
  .panel-content {
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: visible !important;
    height: auto !important;
  }

  /* 하단 배당 패널 전체에 가로 스크롤 허용 (상위 grid-panel까지) */
  .bottom-grid .grid-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 예상 요약 컨테이너에 직접 가로 스크롤 부여 */
  #predictionSummary {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 예상 요약 가로 스크롤 지원 */
  #predictionContent,
  #predictionData {
    min-width: 520px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
  }

  #predictionContent {
    overflow-x: auto !important;
    overflow-y: visible;
    display: block !important;
  }

  #predictionData {
    flex: 0 0 auto !important;
    display: block !important;
  }
}

/* 모바일: 예상/실시간 배당만 가로 스크롤 활성화 (다른 panel-content 영향 방지) */
@media (max-width: 768px) {

  #expectedOdds.panel-content,
  #liveOdds.panel-content {
    overflow-x: auto !important;
    overflow-y: visible !important;
    display: block !important;
    max-height: none !important;
    height: auto !important;
  }

  /* 테이블 너비 확보 */
  #expectedOddsContent,
  #liveOddsContent {
    min-width: 720px !important;
    display: block !important;
    flex: 0 0 auto !important;
  }
}

/* 추천마권 패널 - 좌우 나란히 배치 */
/* .panel-content[style*="display:flex"] {
  display: flex !important;
  flex-direction: row !important;
  gap: 12px !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  overflow-y: visible !important;
  overflow-x: visible !important;
  max-height: none !important;
  height: auto !important;
  flex: 1;
  width: 100% !important;
} */

.panel-content[style*="display:flex"]>div {
  /* flex: 0 1 48% !important; */
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: visible !important;
  /* max-width: 48% !important; */
}

@media (max-width: 768px) {
  .panel-content[style*="display:flex"] {
    flex-direction: row !important;
    gap: 12px !important;
    align-items: flex-start !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
    overflow-x: visible !important;
    flex-wrap: nowrap !important;
  }

  .panel-content[style*="display:flex"]>div {
    /* flex: 0 1 48% !important; */
    min-width: 0 !important;
    overflow: visible !important;
    max-height: none !important;
    /* max-width: 48% !important; */
  }
}

.panel-content::-webkit-scrollbar {
  width: 8px;
}

.panel-content::-webkit-scrollbar-track {
  background: #2c2c2c;
  border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb {
  background: #5f6368;
  border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
  background: #8ab4f8;
}

.odds-content::-webkit-scrollbar {
  width: 8px;
}

.odds-content::-webkit-scrollbar-track {
  background: #2c2c2c;
  border-radius: 4px;
}

.odds-content::-webkit-scrollbar-thumb {
  background: #5f6368;
  border-radius: 4px;
}

.odds-content::-webkit-scrollbar-thumb:hover {
  background: #8ab4f8;
}

.odds-table {
  width: 100%;
  border-collapse: collapse;
}

.odds-table th {
  background: #2c2c2c;
  color: #8ab4f8;
  padding: 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  position: sticky;
  top: 0;
  border-bottom: 2px solid #3c3c3c;
}

.odds-table td {
  padding: 10px;
  border-bottom: 1px solid #2c2c2c;
  font-size: 14px;
  color: #e0e0e0;
}

.odds-table tr:hover {
  background: #2c2c2c;
}

/* 배당 매트릭스 테이블 */
.odds-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}

.odds-matrix th,
.odds-matrix td {
  border: 1px solid #3c3c3c;
  padding: 8px;
  text-align: center;
  min-width: 40px;
}

.odds-matrix thead th {
  background: #2c2c2c;
  color: #8ab4f8;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 10;
}

.odds-matrix .corner-cell {
  background: #1e1e1e;
  border: none;
}

.odds-matrix .row-header {
  background: #2c2c2c;
  color: #8ab4f8;
  font-weight: 700;
  position: sticky;
  left: 0;
  z-index: 5;
}

.odds-matrix tbody tr:hover {
  background: rgba(138, 180, 248, 0.1);
}

.odds-matrix .same-horse {
  background: #1e1e1e;
  color: #5f6368;
  font-style: italic;
}

.odds-matrix .empty-cell {
  background: #1a1a1a;
  border-color: #2c2c2c;
}

.odds-matrix .no-data {
  background: #1e1e1e;
  color: #5f6368;
}

.odds-value {
  font-weight: 700;
  color: #ffa726;
}

.odds-low {
  font-weight: 700;
  color: #f28b82;
}

.odds-medium {
  font-weight: 700;
  color: #ffa726;
}

.odds-high {
  font-weight: 700;
  color: #8ab4f8;
}

.odds-very-high {
  font-weight: 700;
  color: #9aa0a6;
}

.odds-cancelled {
  color: #5f6368;
  font-style: italic;
}

/* 추천 마권 안내 */
#recommendations,
.top-horse-section {
  color: #e0e0e0;
  font-size: 14px;
}

.recommendation-item {
  background: #2c2c2c;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  border-left: 4px solid #8ab4f8;
}

.recommendation-item .combo {
  color: #8ab4f8;
  font-weight: 700;
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.recommendation-item .combo .now-odds {
  font-weight: 700;
  color: #ffa726;
}

.recommendation-item .reason {
  color: #9aa0a6;
  font-size: 12px;
  margin-bottom: 0;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .recommendation-item .reason {
    font-size: 10px;
    -webkit-text-size-adjust: none;
  }
}

.recommendation-item .odds-value {
  color: #ffa726;
  font-weight: 700;
}

.comparison-content::-webkit-scrollbar {
  width: 8px;
}

.comparison-content::-webkit-scrollbar-track {
  background: #2c2c2c;
  border-radius: 4px;
}

.comparison-content::-webkit-scrollbar-thumb {
  background: #5f6368;
  border-radius: 4px;
}

.comparison-content::-webkit-scrollbar-thumb:hover {
  background: #8ab4f8;
}

.comparison-item {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  background: #2c2c2c;
  margin-bottom: 8px;
  border-radius: 6px;
  font-size: 14px;
  color: #e0e0e0;
  border: 1px solid #3c3c3c;
}

.comparison-increase {
  color: #f28b82;
  font-weight: 700;
}

.comparison-decrease {
  color: #81c995;
  font-weight: 700;
}

/* 로딩 및 정보 메시지 */
.loading {
  text-align: center;
  padding: 40px;
  color: #9aa0a6;
  font-size: 16px;
}

.info-text {
  text-align: center;
  padding: 40px;
  color: #9aa0a6;
  font-size: 14px;
}

/* 에러 메시지 */
.error-message {
  background: #5f2120;
  color: #f28b82;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  border: 1px solid #8c2d2b;
}


.tab-btn {
  padding: 12px 20px;
  background: #2c2c2c;
  border: 2px solid #3c3c3c;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #9aa0a6;
  transition: all 0.2s;
  user-select: none;
}

/* 날짜 이동 및 달력 머티리얼 스타일 */
.date-nav-btn {
  padding: 8px 10px;
  background: #2c2c2c;
  border: 2px solid #3c3c3c;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #9aa0a6;
  transition: all 0.2s;
  user-select: none;
}

.date-nav-btn:hover {
  border-color: #8ab4f8;
  background: #2d3a4d;
  color: #8ab4f8;
}

.date-nav-btn:active {
  background: #8ab4f8;
  color: #121212;
  border-color: #8ab4f8;
}

#dateInput[type="date"] {
  background: #1e1e1e;
  color: #e0e0e0;
  border: 2px solid #3c3c3c;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(33, 150, 243, 0.10);
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

#dateInput[type="date"]:focus {
  border-color: #1976d2;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.18);
}

#dateInput[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(0.7);
  opacity: 1;
}

#trackDate {
  font-size: 16px;
  color: #2196f3;
  font-weight: 700;
  letter-spacing: 1px;
}

/* 반응형 추가 스타일 */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 10px;
  }

  .odds-container {
    grid-template-columns: 1fr;
  }

  /* 날짜 입력 모바일 최적화 */
  #dateInput {
    font-size: 14px;
    padding: 8px 10px;
  }

  .date-nav-btn {
    padding: 8px 12px;
    font-size: 14px;
  }

  #trackDate {
    font-size: 14px;
  }

  /* 추천 마권 안내 모바일 세로 배치 */
  .grid-panel .panel-content {
    flex-direction: column !important;
  }

  /* 테이블 가로 스크롤 개선 */
  .prediction-table-wrapper,
  .expected-odds-wrapper,
  .panel-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 테이블 최소 너비 설정 */
  .prediction-table,
  .expected-odds-matrix,
  .live-odds-matrix {
    min-width: 450px;
    font-size: 11px;
  }

  .odds-matrix {
    font-size: 11px;
    min-width: 450px;
  }

  .odds-matrix th,
  .odds-matrix td {
    padding: 6px 4px !important;
    min-width: 35px !important;
  }

  .expected-odds-wrapper {
    max-height: 400px;
  }

  .panel-content {
    max-height: 500px;
  }

  .prediction-table th,
  .prediction-table td,
  .expected-odds-matrix th,
  .expected-odds-matrix td,
  .live-odds-matrix th,
  .live-odds-matrix td {
    padding: 4px 3px;
  }

  /* 버튼 터치 영역 확대 */
  .btn-refresh,
  .race-nav-btn {
    min-height: 44px;
    padding: 10px 16px;
  }

  /* 로딩 및 정보 메시지 크기 조정 */
  .loading,
  .info-text {
    padding: 20px;
    font-size: 13px;
  }

  /* 경주 결과 모바일 최적화 */
  .race-outcome {
    padding: 10px;
  }

  .finish-line {
    font-size: 14px;
    padding: 8px;
  }

  .payout-item {
    font-size: 12px;
  }
}

/* 결과 표시 스타일 */
.race-outcome-content {
  padding: 12px;
}

.finish-line {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding: 10px;
  background: #1e1e1e;
  border-radius: 6px;
  border-left: 4px solid #8ab4f8;
  color: #e0e0e0;
}

.payout-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.payout-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #252525;
  border-radius: 4px;
  font-size: 13px;
  text-align: left;
  flex-wrap: wrap;
}

.payout-item .combo {
  color: #e8eaed;
  font-weight: 600;
  font-family: 'Pretendard', monospace;
  font-size: 13px;
}

.payout-item .payout-value {
  color: #fdd663;
  font-weight: 600;
  font-family: 'Pretendard', monospace;
  font-size: 14px;
  margin-left: auto;
}

.payout-item.hit {
  border: 1px solid #34a853;
  box-shadow: 0 0 8px rgba(52, 168, 83, 0.3);
}

.payout-hit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  margin-left: 10px;
  background: #34a853;
  color: #0d1f0d;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.payout-item .type-label {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  background: #8ab4f8;
  color: #121212;
  border-radius: 3px;
  font-weight: 600;
  margin-bottom: 0;
  margin-right: 6px;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .payout-details {
    gap: 6px;
  }

  .payout-item {
    gap: 6px;
    padding: 8px;
  }
}

/* 모바일 터치 피드백 개선 */
@media (hover: none) and (pointer: coarse) {

  .track-tab:active,
  .tab-btn:active,
  .race-number-item:active,
  .btn-refresh:active {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

/* 가로 스크롤 영역 스크롤바 스타일 */
.panel-content::-webkit-scrollbar,
.prediction-table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.panel-content::-webkit-scrollbar-track,
.prediction-table-wrapper::-webkit-scrollbar-track {
  background: #2c2c2c;
  border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb,
.prediction-table-wrapper::-webkit-scrollbar-thumb {
  background: #5f6368;
  border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover,
.prediction-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #8ab4f8;
}

/* 모바일에서 스크롤 가능한 영역 표시 */
@media (max-width: 768px) {
  .panel-content {
    position: relative;
  }

  .panel-content::after {
    content: '↔';
    position: sticky;
    right: 0;
    float: right;
    background: rgba(30, 30, 30, 0.9);
    color: #8ab4f8;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
  }

  .panel-content:not(:has(table))::after {
    display: none;
  }
}

/* 인라인 스타일 통합 클래스 */
.track-date-label {
  margin-left: 16px;
  font-weight: bold;
}

.date-nav-margin {
  margin-left: 8px;
}

.association-actions {
  margin-left: auto;
}

.tracks-bar-error {
  display: none;
}

.recommendations-flex-container {
  display: flex !important;
  gap: 12px !important;
  align-items: flex-start !important;
  max-height: none !important;
  overflow: visible !important;
  height: auto !important;
}

@media (max-width: 768px) {
  .recommendations-flex-container {
    flex-direction: column !important;
    gap: 16px !important;
  }
}

.recommendations-left-column {
  /* flex: 0 1 48% !important; */
  min-width: 0 !important;
  /* max-width: 48% !important; */
}

.recommendations-right-column {
  /* flex: 0 1 48% !important; */
  min-width: 0 !important;
  /* max-width: 48% !important; */
}

@media (max-width: 768px) {
  .recommendations-left-column {
    width: 100% !important;
    flex: 1 1 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
  }

  .recommendations-right-column {
    width: 100% !important;
    flex: 1 1 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
  }
}

.recommendations-numbers-block-margin {
  margin-bottom: 8px;
}

.recommendations-numbers-header {
  margin: 4px 0 6px;
}

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

.site-footer {
  margin-top: 20px;
  padding: 12px;
  text-align: center;
  color: #9aa0a6;
  font-size: 13px;
}

.panel-content>.hidden-display,
.panel-content .hidden-display {
  display: none !important;
}

.auto-margin-left {
  margin-left: auto;
}

.outcome-loading-hidden {
  display: none;
}

.outcome-hidden {
  display: none;
}

.outcome-error-hidden {
  display: none;
}

.prediction-error-hidden {
  display: none;
}

.prediction-empty-hidden {
  display: none;
}

.top-horse-empty-hidden {
  display: none;
}

.top-horse-error-hidden {
  display: none;
}

.recommendations-list-empty-hidden {
  display: none;
}

.recommendations-list-content-hidden {
  display: none;
}

.expected-odds-hidden {
  display: none;
}

.live-odds-loading-hidden {
  display: none;
}

.live-odds-hidden {
  display: none;
}

.live-odds-error-hidden {
  display: none;
}