:root {
  --bg: #0b1220;
  --card: #131c2e;
  --card2: #18233a;
  --line: #24314d;
  --text: #e6edf7;
  --muted: #8b98b0;
  --green: #22c55e;
  --gold: #f5b301;
  --red: #ef4444;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
}

/* 헤더 */
.header { text-align: center; padding: 8px 0 18px; }
.header h1 { margin: 0; font-size: 28px; letter-spacing: -0.5px; }
.header .sub { margin: 4px 0 12px; color: var(--muted); font-size: 14px; }
.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(245, 179, 1, 0.12);
  border: 1px solid rgba(245, 179, 1, 0.5);
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
}

/* 성적판 */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 6px;
  text-align: center;
}
.stat b { display: block; font-size: 22px; color: var(--green); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }

/* 탭 */
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tab.active { background: var(--green); border-color: var(--green); color: #05210f; }

/* 경기 카드 */
.list { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.league { color: var(--gold); font-weight: 700; }
.teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}
.vs { color: var(--muted); font-size: 12px; font-weight: 800; }
.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.pick { font-size: 15px; font-weight: 800; }
.pick em {
  font-style: normal;
  font-size: 11px;
  padding: 2px 7px;
  margin-right: 6px;
  border-radius: 6px;
  background: var(--green);
  color: #05210f;
  vertical-align: 1px;
}
.result {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.result.hit { background: rgba(34, 197, 94, 0.15); color: var(--green); border: 1px solid var(--green); }
.result.miss { background: rgba(239, 68, 68, 0.15); color: var(--red); border: 1px solid var(--red); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  margin: 0;
}

/* 목록 중간 응원 박스 */
.support {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(135deg, rgba(245, 179, 1, 0.16), rgba(34, 197, 94, 0.12));
  border: 1px solid rgba(245, 179, 1, 0.5);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  font-size: 14px;
}
.support b { display: block; margin-top: 8px; color: var(--gold); }

/* 하단 고지문 */
.footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.footer p { margin: 4px 0; }

/* 하단 응원 카드 (바텀시트) */
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 50;
  width: 100%;
  max-width: 640px;
  padding: 22px 20px calc(18px + env(safe-area-inset-bottom));
  background: var(--card2);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
  transform: translate(-50%, 110%);
  visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.45s;
}
.sheet.show {
  transform: translate(-50%, 0);
  visibility: visible;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}
.sheet h2 { margin: 0 0 8px; font-size: 20px; }
.sheet p { margin: 0 0 16px; color: #c9d3e3; font-size: 15px; white-space: pre-line; }
.sheet-btn {
  display: block;
  padding: 15px;
  border-radius: 14px;
  background: var(--green);
  color: #05210f;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
}
.sheet small { display: block; margin-top: 10px; color: var(--muted); font-size: 11px; }
.sheet-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet.show { transition: none; }
}
