/* =========================================
   공통 스타일 (모든 페이지 적용)
   ========================================= */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  background-color: #0a0a0a;
  color: #f5f5f5;
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #2a2a2a;
}

.header-content {
  position: relative; /* 배너 absolute 포지셔닝 기준점 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 0.5rem;
}

.header-title {
  background: none;
  border: none;
  color: #f5f5f5;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: opacity 0.3s;
  flex-shrink: 0;
}

.header-title:hover {
  opacity: 0.8;
}

.header-title h1 {
  font-size: 1.5rem;
  font-weight: bold;
  white-space: nowrap; /* 로고 줄바꿈 방지 */
}

.header-subtitle {
  color: #888;
  font-size: 1rem;
}

/* 네비게이션 메뉴 */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.nav-link {
  background: none;
  border: none;
  color: #888;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.3s;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover {
  color: #dc2626;
}

/* 2026 시즌 드롭다운 트리거 스타일은 header.css에서 관리 */

/* 로드맵 링크 */
.nav-link-roadmap {
  color: #888;
}

.nav-link-roadmap:hover {
  color: #dc2626;
}

/* 최근 업데이트 배너 - 데스크탑 (헤더 중앙) */
.release-banner,
.release-banner-desktop {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(225, 6, 0, 0.12);
  border: 1px solid rgba(225, 6, 0, 0.35);
  border-radius: 9999px;
  padding: 0.25rem 0.85rem;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  max-width: 320px;
  /* 헤더 정중앙 고정 */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
}

/* 최근 업데이트 배너 - 모바일 (헤더 아래 띠 배너) */
.release-banner-mobile {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: rgba(225, 6, 0, 0.12);
  border-top: 1px solid rgba(225, 6, 0, 0.25);
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  width: 100%;
  overflow: hidden;
}

.release-banner-text {
  color: #f5f5f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-banner-link {
  color: #e10600;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.release-banner-link:hover {
  opacity: 0.75;
}

/* 모바일 헤더 반응형 (max-width: 768px) */
@media (max-width: 768px) {
  .header-title h1 {
    font-size: 1.1rem;
  }

  .header-subtitle {
    font-size: 0.85rem;
  }

  /* 데스크탑 배너 숨김 */
  .release-banner-desktop {
    display: none !important;
  }

  /* 모바일 배너: 활성화 시 flex로 표시 */
  .release-banner-mobile.active {
    display: flex;
  }

  /* 모바일에서 데스크탑 네비게이션 텍스트 버튼 모두 숨김 (로고 + 햄버거만 표시) */
  .nav-menu {
    display: none;
  }

  /* 모바일에서 A-Z 버튼 숨김 (서랍 메뉴에서 접근 가능) */
  #page-main .all-terms-btn {
    display: none;
  }
}

/* View Management */
.view {
  display: block;
}

.view.hidden {
  display: none;
}

/* Toast Notification (토스트 알림) */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 320px;
  padding: 1rem 1.25rem;
  background-color: rgba(20, 20, 20, 0.95);
  color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  border-left: 5px solid #333;
  backdrop-filter: blur(5px);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 500;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.info { border-left-color: #3b82f6; }

.toast-close {
  background: none;
  border: none;
  color: #666;
  font-size: 1.25rem;
  cursor: pointer;
  margin-left: 1rem;
  line-height: 1;
}

.toast-close:hover { 
  color: #fff; 
}

/* =========================================
   메인 페이지 전용 스타일 (#page-main)
   ========================================= */

#page-main .search-section {
  padding: 3rem 0;
}

#page-main .search-form {
  max-width: 48rem;
  margin: 0 auto;
}

#page-main .search-input-wrapper {
  position: relative;
}

#page-main .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
}

#page-main .search-input {
  width: 100%;
  padding: 1.25rem 1rem 1.25rem 3rem;
  font-size: 1.125rem;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  color: #f5f5f5;
  transition: all 0.3s;
}

#page-main .search-input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

#page-main .search-input::placeholder {
  color: #666;
}

#page-main .content-section {
  padding: 0 0 4rem 0;
}

#page-main .category-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 2rem;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
}

/* 카테고리 태그 묶음 */
#page-main .category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* A-Z 전체 목록 버튼 */
#page-main .all-terms-btn {
  flex-shrink: 0;
  margin-left: auto;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  color: #888;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.3s;
  white-space: nowrap;
}

#page-main .all-terms-btn:hover {
  border-color: #dc2626;
  color: #dc2626;
}

#page-main .category-btn {
  padding: 0.5rem 1rem;
  background-color: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  color: #888;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

#page-main .category-btn:hover {
  border-color: #dc2626;
  color: #dc2626;
}

#page-main .category-btn.active {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

#page-main .section-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 2rem;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
}

#page-main .section-subtitle {
  color: #888;
  font-size: 1.125rem;
}

/* 메인 페이지 용어 그리드 */
#page-main .terms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 80rem;
  margin: 0 auto;
}

@media (min-width: 640px) {
  #page-main .terms-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  #page-main .terms-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

#page-main .term-card {
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  /* a 태그 기본 스타일 리셋 */
  display: block;
  text-decoration: none;
  color: inherit;
}

#page-main .term-card:hover {
  border-color: #dc2626;
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.2);
}

#page-main .term-card h3 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}

#page-main .term-card:hover h3 {
  color: #dc2626;
}

#page-main .term-card p {
  font-size: 0.875rem;
  color: #888;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#page-main .term-card .card-link {
  display: flex;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #dc2626;
}

/* 뒤로가기 버튼 - <button>, <a> 태그 모두 동일한 외형 */
.back-button {
  background: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #a0a0b8;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
  text-decoration: none;
}

.back-button:link,
.back-button:visited {
  color: #a0a0b8;
}

.back-button:hover {
  color: #f5f5f5;
}

/* 레이스 상세 페이지 래퍼 - 용어 상세(.term-detail-page)와 동일한 상단 여백 */
.race-detail-page {
  min-height: 100vh;
  padding: 2rem 0 4rem;
}

#page-main .term-detail {
  max-width: 80rem;
  margin: 0 auto;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  padding: 2rem;
}

#page-main .term-detail h2 {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
}

#page-main .detail-content {
  display: grid;
  gap: 2rem;
}

@media (min-width: 1024px) {
  #page-main .detail-content {
    grid-template-columns: 1fr 1fr;
  }
}

#page-main .detail-description {
  font-size: 1.125rem;
  line-height: 1.8;
  color: rgba(245, 245, 245, 0.9);
}

#page-main .detail-image {
  background-color: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 0.5rem;
  overflow: hidden;
}

#page-main .detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#page-main .all-terms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
}

#page-main .page-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

#page-main .page-subtitle {
  color: #888;
}

#page-main .all-terms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 80rem;
  margin: 0 auto;
}

@media (min-width: 640px) {
  #page-main .all-terms-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  #page-main .all-terms-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

#page-main .all-term-card {
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.3s;
  /* a 태그 기본 스타일 리셋 */
  display: block;
  text-decoration: none;
  color: inherit;
}

#page-main .all-term-card:hover {
  border-color: #dc2626;
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.2);
}

#page-main .all-term-card h3 {
  font-size: 1.125rem;
  font-weight: bold;
  transition: color 0.3s;
}

#page-main .all-term-card:hover h3 {
  color: #dc2626;
}

#page-main .all-term-card p {
  font-size: 0.875rem;
  color: #888;
  margin-top: 0.25rem;
}

#page-main #loadMoreBtn {
  margin-top: 2rem;
  padding: 0.75rem 3rem;
  background-color: transparent;
  border: 1px solid #333;
  color: #888;
  font-size: 0.9rem;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  border-radius: 50px;
}

#page-main #loadMoreBtn:hover {
  border-color: #dc2626;
  color: #dc2626;
  background-color: rgba(220, 38, 38, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#page-main .card-animate {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* =========================================
   캘린더 페이지 전용 스타일 (#page-calendar)
   ========================================= */

#page-calendar .race-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

#page-calendar .race-card {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  border: 1px solid #333;
  text-decoration: none;
  display: block;
}

#page-calendar .race-card:hover {
  transform: translateY(-5px);
  border-color: #dc2626;
}

#page-calendar .round-badge {
  background: #dc2626;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  display: inline-block;
  margin-bottom: 10px;
}

#page-calendar .race-card h3 {
  margin: 5px 0;
  color: #fff;
  font-size: 1.2rem;
}

#page-calendar .circuit-name {
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

#page-calendar .race-date {
  color: #888;
  font-size: 0.9rem;
}

/* 상태별 Badge 스타일 */
#page-calendar .badge-scheduled {
  background: #16a34a;
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  display: inline-block;
  margin-left: 6px;
}

#page-calendar .badge-completed {
  background: #6b7280;
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  display: inline-block;
  margin-left: 6px;
}

#page-calendar .badge-cancelled {
  background: #dc2626;
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  display: inline-block;
  margin-left: 6px;
}

#page-calendar .badge-postponed {
  background: #f59e0b;
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  display: inline-block;
  margin-left: 6px;
}

/* 취소된 레이스 카드 딤 처리 */
#page-calendar .race-cancelled {
  opacity: 0.5;
  text-decoration: line-through;
}

/* Next Race 하이라이트 + Pulse 애니메이션 */
@keyframes pulse-next-race {
  0%, 100% {
    border-color: #16a34a;
    box-shadow: 0 0 8px rgba(22, 163, 74, 0.4);
  }
  50% {
    border-color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.75);
  }
}

#page-calendar .highlight-next-race {
  border-color: #16a34a !important;
  box-shadow: 0 0 12px rgba(22, 163, 74, 0.5);
  animation: pulse-next-race 1.8s ease-in-out infinite;
}

/* 종료/취소 레이스의 라운드 뱃지 무채색 동기화 */
#page-calendar .race-completed .round-badge,
#page-calendar .race-cancelled .round-badge {
  background: #555;
}

/* =========================================
   레이스 상세 페이지 전용 스타일 (#page-race-detail)
   ========================================= */

/* 2단 레이아웃 컨테이너 */
#page-race-detail .circuit-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 2rem 0;
}

/* 왼쪽: 지도 컬럼 (flex: 3, 약 60%) */
#page-race-detail .map-column {
  flex: 3;
  min-width: 0;
  position: sticky;
  top: 80px;
}

/* 오른쪽: 아코디언 컬럼 (flex: 2, 약 40%) */
#page-race-detail .info-column {
  flex: 2;
  min-width: 0;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  /* 다크 테마 커스텀 스크롤바 */
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

#page-race-detail .info-column::-webkit-scrollbar {
  width: 6px;
}

#page-race-detail .info-column::-webkit-scrollbar-track {
  background: transparent;
}

#page-race-detail .info-column::-webkit-scrollbar-thumb {
  background-color: #333;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

#page-race-detail .info-column::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}

/* 반응형: 768px 미만 단일 컬럼 */
@media (max-width: 768px) {
  #page-race-detail .circuit-layout {
    flex-direction: column;
  }

  #page-race-detail .map-column {
    position: static;
    width: 100%;
  }

  #page-race-detail .info-column {
    width: 100%;
    max-height: none;
  }
}

/* SVG 맵 컨테이너 */
#page-race-detail .svg-map-container {
  display: inline-block;
  max-width: 700px;
  max-height: 60vh;
  width: 100%;
  margin: 0 auto;
  background: #f0f0f0;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  overflow: hidden;
}

#page-race-detail .svg-map-container svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 60vh;
}

/* SVG 내부 핀 스타일 */
#page-race-detail .circuit-pin {
  cursor: pointer;
  transition: all 0.2s ease;
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.5));
}

#page-race-detail .circuit-pin circle {
  fill: #dc2626;
  stroke: #ffffff;
  stroke-width: 3;
  transition: fill 0.2s ease;
}

#page-race-detail .circuit-pin:hover {
  filter: drop-shadow(0px 3px 6px rgba(0, 0, 0, 0.7));
  transform: translateY(-2px);
}

#page-race-detail .circuit-pin:hover circle {
  fill: #ff1e1e;
}

#page-race-detail .circuit-pin text {
  fill: white;
  font-weight: bold;
  font-size: 16px;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  user-select: none;
}

/* =========================================
   아코디언 컴포넌트 스타일
   ========================================= */

/* 아코디언 아이템 */
#page-race-detail .accordion-item {
  border-bottom: 1px solid #2a2a2a;
}

/* 아코디언 헤더 (닫힌 상태) */
#page-race-detail .accordion-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1rem;
  background: transparent;
  border: none;
  color: #f5f5f5;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

#page-race-detail .accordion-header:hover {
  background: #1a1a1a;
}

/* 펼쳐진 상태 헤더 */
#page-race-detail .accordion-item.active .accordion-header {
  background: #1a1a1a;
}

/* 번호 배지 (빨간 원형) */
#page-race-detail .accordion-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: #dc2626;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: bold;
  flex-shrink: 0;
}

/* 아코디언 제목 */
#page-race-detail .accordion-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}

/* 화살표 아이콘 */
#page-race-detail .accordion-chevron {
  font-size: 0.75rem;
  color: #888;
  transition: transform 0.3s ease;
}

/* 펼쳐진 상태: 화살표 180도 회전 */
#page-race-detail .accordion-item.active .accordion-chevron {
  transform: rotate(180deg);
}

/* 아코디언 바디 (슬라이드 애니메이션) */
#page-race-detail .accordion-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease-out;
}

#page-race-detail .accordion-item.active .accordion-body {
  max-height: 500px;
  transition: max-height 0.25s ease-in;
}

/* 아코디언 콘텐츠 (다크 테마 + Fade-in) */
#page-race-detail .accordion-content {
  background: #111;
  padding: 1rem 1.25rem 1.25rem;
  border-left: 3px solid #dc2626;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

#page-race-detail .accordion-item.active .accordion-content {
  opacity: 1;
}

/* 펼쳐진 상태 제목 (빨간색) */
#page-race-detail .accordion-title-expanded {
  color: #dc2626;
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
}

/* 설명 텍스트 (밝은 색) */
#page-race-detail .accordion-desc {
  color: #ddd;
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* 태그 목록 */
#page-race-detail .accordion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Active Pin 스타일 - hover와 동일하게 빛남 + 그림자 + 위로 올라오는 효과 */
#page-race-detail .circuit-pin.active circle {
  fill: #ff1e1e;
  stroke: #fff;
  stroke-width: 3;
}

#page-race-detail .circuit-pin.active {
  filter: drop-shadow(0px 3px 6px rgba(0, 0, 0, 0.7));
  transform: translateY(-2px);
}

#page-race-detail .tag-btn {
  background: #333; 
  color: #fff; 
  border: 1px solid #555;
  padding: 5px 12px; 
  border-radius: 20px; 
  font-size: 0.85rem;
  cursor: pointer; 
  margin-right: 8px; 
  margin-bottom: 8px; 
  transition: 0.2s;
}

#page-race-detail .tag-btn:hover { 
  background: #dc2626; 
  border-color: #dc2626; 
}

/* 용어 상세 모달 */
#page-race-detail .term-modal-overlay {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

#page-race-detail .term-modal-content {
  background: #222;
  padding: 30px;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  border: 1px solid #444;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

#page-race-detail .term-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #888;
}

#page-race-detail .term-modal-close:hover {
  color: #fff;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  #page-race-detail .svg-map-container {
    max-width: 95vw;
  }
  
  #page-race-detail .circuit-pin circle {
    stroke-width: 1.5;
  }
  
  #page-race-detail .circuit-pin text {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  #page-race-detail .circuit-pin text {
    font-size: 12px;
  }
}

/* 탭 네비게이션 */
#page-race-detail .tab-navigation {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #2a2a2a;
  margin: 0 0 1.5rem;
  padding: 0 0.25rem;
}

#page-race-detail .tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #888;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

#page-race-detail .tab-btn:hover {
  color: #ccc;
}

#page-race-detail .tab-btn.active {
  color: #dc2626;
  border-bottom-color: #dc2626;
  font-weight: 600;
}

/* 탭 콘텐츠 전환 */
#page-race-detail .tab-content.hidden {
  display: none;
}

#page-race-detail .tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Race 탭 placeholder 카드 (레거시) */
#page-race-detail .tab-placeholder-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0.75rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: #888;
  font-size: 0.95rem;
  margin: 1rem 0;
}

/* Race 탭 - 서브섹션 제목 */
#page-race-detail .subsection-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: #f5f5f5;
  margin-bottom: 1rem;
}

/* Race 탭 - 구역 구분선 */
#page-race-detail .content-divider {
  border: none;
  border-top: 1px solid #2a2a2a;
  margin: 3rem 0;
}

/* Race 탭 - 플레이스홀더 박스 */
#page-race-detail .placeholder-box {
  background: #1a1a1a;
  border: 2px dashed #333;
  border-radius: 0.75rem;
  padding: 3rem;
  text-align: center;
  color: #888;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* =========================================
   가이드 배너 섹션 (메인 화면)
   ========================================= */

#page-main .guide-banner-section {
  padding: 1.5rem 0 0.5rem;
  margin-bottom: 1.5rem;
}

.guide-banner-title {
  font-size: 0.95rem;
  color: #888;
  margin-bottom: 0.75rem;
}

.guide-banner-cards {
  display: flex;
  gap: 1rem;
  flex-direction: row;
}

.guide-banner-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  padding: 1rem 1.25rem;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0.75rem;
  text-decoration: none;
  color: #f5f5f5;
  font-weight: 600;
  font-size: 1rem;
  transition: border-color 0.2s, background-color 0.2s;
}

.guide-banner-card:hover {
  border-color: #e10600;
  background-color: #1f1f1f;
}

.guide-banner-card-icon {
  font-size: 1.5rem;
}

/* 모바일: 세로 배치 */
@media (max-width: 768px) {
  .guide-banner-cards {
    flex-direction: column;
  }
}

/* =========================================
   Circuit Stats Bar (서킷 통계 바)
   ========================================= */

.circuit-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.stat-item {
    text-align: center;
    padding: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 반응형 레이아웃: 모바일 (768px 미만) */
@media (max-width: 768px) {
    .circuit-stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}

/* =========================================
   팬 투표 UI 스타일 (Fan Vote)
   ========================================= */

/* 투표 2열 그리드 컨테이너 */
.vote-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* 투표 섹션 카드 (VIP / VILLAIN) */
.vote-section {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

/* 섹션 제목 */
.vote-section-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #f5f5f5;
}

/* 드라이버 투표 카드 */
.driver-vote-card {
    background: #2a2a2a;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 0.75rem;
    transition: border-color 0.3s;
}

.driver-vote-card:last-child {
    margin-bottom: 0;
}

/* 카드 헤더: 뱃지 + 드라이버 정보 + 투표 버튼 */
.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* 드라이버 번호 원형 뱃지 */
.driver-number-badge {
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

/* 이름 + 팀명 세로 배치 */
.card-driver-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* 드라이버 이름 */
.card-driver-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #f5f5f5;
}

/* 팀명 */
.card-team-name {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.125rem;
}

/* 투표 버튼 */
.vote-btn {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.375rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
}

.vote-btn:hover {
    background: #b91c1c;
}

/* 투표 버튼 비활성화 */
.vote-btn:disabled {
    background: #444;
    opacity: 0.6;
    cursor: not-allowed;
}

/* 투표 상태 안내 메시지 (취소/연기 시 노출) */
.status-message {
    text-align: center;
    color: #888;
    font-size: 0.95rem;
    padding: 2.5rem 1rem;
}

/* 프로그레스 컨테이너 (투표 전 숨김) */
.progress-container {
    display: none;
    background: #1a1a1a;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 0.75rem;
}

/* 프로그레스 바 배경 */
.progress-bar {
    flex: 1;
    background: #333;
    border-radius: 0.375rem;
    height: 1.25rem;
    overflow: hidden;
}

/* 프로그레스 바 채움 */
.progress-fill {
    height: 100%;
    border-radius: 0.375rem;
    transition: width 1s ease-out;
}

/* VIP 프로그레스: F1 Red */
.vote-section-vip .progress-fill {
    background: #dc2626;
}

/* VILLAIN 프로그레스: 오렌지 → 퍼플 */
.vote-section-villain .progress-fill {
    background: linear-gradient(90deg, #f97316, #a855f7);
}

/* 퍼센테이지 텍스트 */
.percentage {
    font-size: 0.8rem;
    color: #ccc;
    text-align: right;
    margin-top: 0.375rem;
}

/* 투표 완료 상태 */
.driver-vote-card.voted .vote-btn {
    display: none;
}

.driver-vote-card.voted .progress-container {
    display: block;
}

/* 내가 투표한 카드 하이라이트 */
.driver-vote-card.my-vote {
    border: 1px solid #fbbf24;
}

/* 반응형: 768px 미만 1열 전환 */
@media (max-width: 768px) {
    .vote-container {
        grid-template-columns: 1fr;
    }
}
