:root {
  --bg: #f2f4f6; --surface: #ffffff; --text: #191f28; --muted: #4e5968; --faint: #6b7684; --line: #e5e8eb;
  --accent: #1b64da; --accent-ink: #ffffff; --accent-soft: #e8f3ff; --chip: #f2f4f6;
  --open: #0a7d3c; --close: #d22030; --lottery: #6b36c4; --race: #191f28; --other: #4e5968;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317; --surface: #1b1f25; --text: #eceef1; --muted: #a9b1bb; --faint: #8b949e; --line: #2a3038;
    --accent: #5b9bff; --accent-ink: #0b1220; --accent-soft: #1b2a42; --chip: #262b33;
    --open: #4cc479; --close: #ff7a7a; --lottery: #b69cff; --race: #eceef1; --other: #a9b1bb;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  word-break: keep-all; overflow-wrap: anywhere; letter-spacing: -0.01em;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main, .top-in, .foot { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* 머리말 */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; }
.brand { font-weight: 800; color: var(--text); font-size: 17px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.top nav { display: flex; gap: 16px; font-size: 15px; font-weight: 500; }
.top nav a { color: var(--muted); }

/* 제목 */
h1 { font-size: 28px; line-height: 1.32; margin: 28px 0 8px; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: 20px; margin: 36px 0 12px; font-weight: 800; letter-spacing: -0.02em; }
h3 { font-size: 17px; margin: 18px 0 8px; font-weight: 700; }
.hero { padding: 4px 0 0; }
.hero p { color: var(--muted); margin: 0 0 18px; font-size: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; background: var(--accent); color: var(--accent-ink); padding: 0 20px; border-radius: 14px; font-weight: 700; font-size: 16px; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn-wide { width: 100%; max-width: 360px; min-height: 52px; }
.note { font-size: 14px; color: var(--muted); }

/* 지금 신청 가능 */
.open-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
@media (min-width: 640px) { .open-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); overflow: visible; } }
.open-card { flex: 0 0 168px; scroll-snap-align: start; background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.open-card:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--accent) inset; }
.open-name { font-size: 16px; font-weight: 800; }
.open-label { font-size: 13px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.open-until { font-size: 13px; color: var(--faint); margin-top: auto; padding-top: 6px; }

/* D-day */
.dday { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.dday.over { font-weight: 400; color: var(--faint); }
.dday.soon { color: var(--close); }
.dday-big { font-size: 24px; font-weight: 800; color: var(--close); letter-spacing: -0.02em; }

/* 일정 목록 */
.month { color: var(--muted); font-size: 15px; margin: 22px 0 8px; font-weight: 700; }
.timeline { list-style: none; margin: 0; padding: 0 16px; background: var(--surface); border-radius: var(--radius); }
.tl { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.tl:first-child { border-top: 0; }
.tl-day { width: 40px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.tl-day b { font-size: 22px; font-weight: 800; }
.tl-day span { font-size: 12px; color: var(--faint); }
.tl-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.tl-name { font-size: 16px; font-weight: 700; color: var(--text); }
.tl-label { font-size: 14px; color: var(--muted); line-height: 1.45; }
.kind { font-size: 12px; font-weight: 700; }
.k-entry_open { color: var(--open); } .k-entry_close, .k-payment_close { color: var(--close); }
.k-lottery_result { color: var(--lottery); } .k-race { color: var(--race); } .k-expo, .k-other { color: var(--other); }

.more { margin-top: 12px; }
.more summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 14px; background: var(--surface); font-weight: 700; color: var(--muted); }
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { display: none; }

/* 뱃지(대회 상세 표) */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--chip); white-space: nowrap; }
.b-entry_open { color: var(--open); } .b-entry_close, .b-payment_close { color: var(--close); }
.b-lottery_result { color: var(--lottery); } .b-race { color: var(--race); } .b-expo, .b-other { color: var(--other); }

/* 필터·대회 카드 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill { font: inherit; font-size: 14px; font-weight: 600; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; }
.pill.on { background: var(--text); color: var(--bg); }
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
.card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border-radius: var(--radius); padding: 16px; color: var(--text); }
.card:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--accent) inset; }
.card[hidden] { display: none; }
.card h3 { margin: 2px 0 0; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.card-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--faint); }
.card-head .dday { color: var(--text); }
.meta { margin: 0; font-size: 14px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 6px; background: var(--chip); color: var(--muted); }
.tag-open { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

/* 대회 상세 */
.crumb { margin: 24px 0 0; font-size: 14px; color: var(--faint); }
.race h1 { margin-top: 4px; margin-bottom: 0; }
.en { margin: 0 0 16px; color: var(--muted); }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.summary > div { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.k { font-size: 13px; color: var(--faint); }
.v { font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 0; }
.sub-links { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; font-size: 14px; font-weight: 600; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--text); }
.chip:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--accent) inset; }
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; font-size: 15px; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl th { border-top: 0; font-size: 13px; color: var(--faint); font-weight: 600; }
.tbl tr.past td { color: var(--faint); }
.tbl tr.past .badge { opacity: .6; }
.nowrap { white-space: nowrap; }
.tba { font-size: 12px; color: var(--faint); }
.hint { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); font-size: 15px; }
.agents { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--radius); }
.agents li { padding: 12px 16px; border-top: 1px solid var(--line); }
.agents li:first-child { border-top: 0; }
.agents .badge { color: var(--accent); background: var(--accent-soft); }
.sources ul { padding-left: 18px; }
.checked { font-size: 12px; color: var(--faint); }

/* 구독 */
.sub-list { list-style: none; padding: 0 16px; margin: 0; background: var(--surface); border-radius: var(--radius); }
.sub-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.sub-list li:first-child { border-top: 0; }
.sub-list .chip { background: var(--chip); }

.foot { margin-top: 56px; padding-top: 20px; padding-bottom: 36px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); }
