.contest-intro {
  text-align: center;
  margin-bottom: 18px;
}
.contest-intro h2 {
  margin: 0 0 6px;
  font-size: 22px;
  background: linear-gradient(90deg, #f97316, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.contest-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  justify-content: center;
}
.contest-filters button {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.contest-filters button:hover { background: var(--header-bg); }
.contest-filters button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.contest-grid {
  display: grid;
  gap: 12px;
}
.contest-card {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.contest-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15,23,42,0.08);
}

.contest-dday {
  flex-shrink: 0;
  min-width: 90px;
  text-align: center;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.contest-card.dd-urgent { border-left-color: #dc2626; }
.contest-card.dd-urgent .contest-dday { color: #b91c1c; }
.contest-card.dd-soon { border-left-color: #f59e0b; }
.contest-card.dd-soon .contest-dday { color: #b45309; }
.contest-card.dd-ok { border-left-color: #10b981; }
.contest-card.dd-ok .contest-dday { color: #047857; }
.contest-card.dd-unknown { border-left-color: #6366f1; }
.contest-card.dd-unknown .contest-dday {
  color: #4338ca;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.contest-card.dd-ended { border-left-color: #9ca3af; opacity: 0.55; }
.contest-card.dd-ended .contest-dday { color: var(--muted); font-size: 13px; }

.contest-body { flex: 1; min-width: 0; }
.contest-body h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.contest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  align-items: center;
}
.contest-meta > span {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--header-bg);
}
.contest-meta .contest-end { color: var(--text); font-weight: 600; }
.contest-meta .contest-region.national { background: rgba(16,185,129,0.12); color: #047857; font-weight: 600; }
.contest-meta .contest-region.regional { background: rgba(249,115,22,0.12); color: #c2410c; font-weight: 600; }
.contest-meta .contest-type { background: rgba(99,102,241,0.1); color: #4338ca; font-weight: 600; }

.contest-cta {
  flex-shrink: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.contest-sources {
  margin-top: 32px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
}
.contest-sources h3 { margin: 0 0 10px; font-size: 15px; }
.contest-sources ul { margin: 0; padding-left: 18px; }
.contest-sources li { margin: 4px 0; font-size: 13px; color: var(--text); }
.contest-sources a { color: var(--primary); text-decoration: none; }
.contest-sources a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .contest-card { flex-wrap: wrap; }
  .contest-dday { min-width: auto; text-align: left; }
  .contest-cta { width: 100%; text-align: right; }
}

/* ----- 뷰 토글 ----- */
.view-toggle-bar {
  display: flex; justify-content: center; margin-bottom: 14px;
}

/* ----- 달력 뷰 ----- */
.contest-cal-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 12px;
}
.contest-cal-nav h2 { margin: 0; font-size: 20px; min-width: 160px; text-align: center; }
.contest-cal-nav button {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 14px; cursor: pointer; font-size: 14px;
}
.contest-cal-nav button:hover { background: var(--header-bg); }

.contest-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.contest-cal-head {
  background: var(--header-bg);
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 4px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.contest-cal-head.sat { color: #2563eb; }
.contest-cal-head.sun { color: #dc2626; }

.contest-cal-cell {
  min-height: 110px;
  padding: 6px;
  border-right: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.contest-cal-cell.empty { background: #fafafa; }
.contest-cal-cell.today { background: rgba(254, 243, 199, 0.4); }
.cal-date {
  font-size: 12px; font-weight: 600; color: var(--text);
  text-align: right; padding: 0 2px;
}
.contest-cal-cell.sat .cal-date { color: #2563eb; }
.contest-cal-cell.sun .cal-date { color: #dc2626; }
.contest-cal-cell.today .cal-date { color: #b45309; }

.cal-chip {
  display: block;
  font-size: 11px; line-height: 1.3;
  padding: 4px 6px;
  border-radius: 5px;
  text-decoration: none;
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cal-chip:hover { filter: brightness(1.08); }
.chip-name { font-weight: 600; }
.chip-dday { float: right; margin-left: 4px; opacity: 0.85; }

.cal-chip.dd-urgent { background: #dc2626; }
.cal-chip.dd-soon { background: #f59e0b; }
.cal-chip.dd-ok { background: #10b981; }
.cal-chip.region-regional { background: #ea580c; }
.cal-chip.region-regional.dd-urgent { background: #b91c1c; }

.cal-legend {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 8px; margin-top: 10px; font-size: 12px;
}
.lg-item {
  padding: 3px 10px; border-radius: 999px;
  font-weight: 600;
}
.lg-item.lg-urgent { background: #dc2626; color: #fff; }
.lg-item.lg-soon { background: #f59e0b; color: #fff; }
.lg-item.lg-ok { background: #10b981; color: #fff; }
.lg-item.lg-national { background: rgba(16,185,129,0.15); color: #047857; }
.lg-item.lg-regional { background: rgba(234,88,12,0.15); color: #c2410c; }

.unknown-section {
  margin-top: 24px;
}
.unknown-section h3 {
  font-size: 15px; margin: 0 0 10px;
}

@media (max-width: 600px) {
  .contest-cal-cell { min-height: 80px; padding: 3px; }
  .cal-chip { font-size: 10px; padding: 2px 4px; }
  .chip-dday { display: none; }
  .contest-cal-head { font-size: 11px; padding: 5px 2px; }
}
