/*
 * 복권 결과 부품 — 공(LottoBall)·발행 세트·다음 추첨·회차 카드(RoundCard)·당첨금(PrizeList)·당첨 판매점 순위·게이지 (디자인 시스템 §4.2~§4.4·§4.13)
 * 받는 페이지: Config\Navigation::$pages의 parts에 'lotto' (회차 상세·홈·회차별 결과·번호받기 4종·분석·패턴·연금 홈/상세/분석·스피또 3종)
 * components.css(공통) 다음, 페이지 CSS 앞에 온다 — D10 1부에 components.css에서 옮김 (규칙·순서 그대로)
 */

/* ───────── 로또 공 ───────── */
.ft-balls { display: flex; align-items: center; flex-wrap: nowrap; gap: var(--ft-ball-gap, 6px); }
.ft-balls--lg { --ft-ball-gap: 5px; }
.ft-balls--sm { --ft-ball-gap: 3px; }
.ft-ball {
  --size: var(--ft-ball-md);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--size); height: var(--size); border-radius: var(--ft-radius-full);
  background: var(--ft-ball-empty); color: var(--ft-ball-text);
  box-shadow: inset 0 0 0 1px var(--ft-ball-edge);
  font-size: calc(var(--size) * 0.44); font-weight: var(--ft-weight-bold);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1;
}
.ft-ball--sm { --size: var(--ft-ball-sm); font-size: 12px; font-weight: var(--ft-weight-semibold); }
.ft-ball--md { --size: var(--ft-ball-md); font-size: 14px; }
.ft-ball--lg { --size: var(--ft-ball-lg); font-size: calc(var(--ft-ball-lg) * 0.42); }
.ft-ball[data-r="1"] { background: var(--ft-ball-1); }
.ft-ball[data-r="2"] { background: var(--ft-ball-2); }
.ft-ball[data-r="3"] { background: var(--ft-ball-3); }
.ft-ball[data-r="4"] { background: var(--ft-ball-4); }
.ft-ball[data-r="5"] { background: var(--ft-ball-5); }
/* 발행 번호에서 당첨번호와 다른 수: 흐리게(opacity) 대신 회색 바탕 + 보조 글자색 */
.ft-ball--miss { background: var(--ft-surface-2) !important; color: var(--ft-text-3); box-shadow: inset 0 0 0 1px var(--ft-border); font-weight: var(--ft-weight-semibold); }
.ft-balls__plus { flex: none; width: 14px; text-align: center; font-weight: var(--ft-weight-bold); color: var(--ft-text-3); font-size: var(--ft-text-md); }
.ft-balls--sm .ft-balls__plus { width: 10px; font-size: var(--ft-text-sm); }
.ft-ball-cap { position: relative; display: inline-flex; flex: none; }
.ft-ball-cap__label { position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%); white-space: nowrap; font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); color: var(--ft-text-3); font-weight: var(--ft-weight-semibold); }
.ft-balls:has(.ft-ball-cap) { padding-bottom: 18px; }

/* ───────── 회차 카드 ───────── */
.ft-round { padding: var(--ft-card-pad); display: grid; gap: var(--ft-space-4); }
.ft-round__head { display: flex; align-items: flex-start; gap: var(--ft-space-2); }
.ft-round__title { font-size: var(--ft-text-xl); line-height: var(--ft-lh-xl); font-weight: var(--ft-weight-bold); letter-spacing: -0.01em; }
.ft-round__title .ft-round__no { color: var(--ft-accent); }
.ft-round__date { font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); }
.ft-round__head .ft-fresh { margin-left: auto; margin-top: 3px; }
.ft-round__first {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--ft-space-1) var(--ft-space-3);
  padding: var(--ft-space-3) var(--ft-space-4); border-radius: var(--ft-radius-md); background: var(--ft-surface-2);
}
.ft-round__first dt { font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); font-weight: var(--ft-weight-semibold); }
.ft-round__first dd { font-variant-numeric: tabular-nums; }
.ft-round__amount { grid-column: 1; font-size: var(--ft-text-xl); line-height: var(--ft-lh-xl); font-weight: var(--ft-weight-bold); letter-spacing: -0.01em; }
.ft-round__full { grid-column: 1; font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); color: var(--ft-text-3); }
.ft-round__winners { grid-column: 2; grid-row: 1 / span 3; align-self: center; text-align: right; font-size: var(--ft-text-lg); font-weight: var(--ft-weight-bold); }
.ft-round__winners small { display: block; font-size: var(--ft-text-xs); line-height: var(--ft-lh-xs); color: var(--ft-text-2); font-weight: var(--ft-weight-semibold); }
.ft-round__sub { font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); }
.ft-round__nav { display: flex; align-items: center; gap: var(--ft-space-2); border-top: 1px solid var(--ft-border); padding-top: var(--ft-space-2); margin: 0 calc(var(--ft-card-pad) * -1) calc(var(--ft-card-pad) * -1 + 4px); padding-left: var(--ft-space-2); padding-right: var(--ft-space-2); }
.ft-round__nav a, .ft-round__nav span {
  display: inline-flex; align-items: center; gap: 2px; min-height: var(--ft-touch); padding: 0 var(--ft-space-2);
  font-size: var(--ft-text-sm); font-weight: var(--ft-weight-semibold); color: var(--ft-text-2); border-radius: var(--ft-radius-md);
}
.ft-round__nav a:hover { color: var(--ft-accent); background: var(--ft-surface-2); }
.ft-round__nav .is-center { margin: 0 auto; color: var(--ft-text); }
.ft-round__nav [aria-disabled="true"] { color: var(--ft-text-3); font-weight: var(--ft-weight-regular); }

/* ───────── 당첨금: 모바일 등수 카드 (데스크톱 표 .ft-table은 components.css) ───────── */
.ft-prize { display: grid; }
.ft-prize__item {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 2px var(--ft-space-3);
  padding: var(--ft-space-3) var(--ft-card-pad); border-top: 1px solid var(--ft-border);
}
.ft-prize__item:first-child { border-top: 0; }
.ft-prize__rank {
  grid-row: 1 / span 2; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 28px; border-radius: var(--ft-radius-sm);
  background: var(--ft-surface-2); font-size: var(--ft-text-sm); font-weight: var(--ft-weight-bold); color: var(--ft-text);
}
.ft-prize__item--top .ft-prize__rank { background: var(--ft-accent); color: var(--ft-on-accent); }
.ft-prize__amount { font-size: var(--ft-text-lg); line-height: var(--ft-lh-lg); font-weight: var(--ft-weight-bold); font-variant-numeric: tabular-nums; }
.ft-prize__item--top .ft-prize__amount { font-size: var(--ft-text-xl); line-height: var(--ft-lh-xl); }
.ft-prize__people { text-align: right; font-size: var(--ft-text-md); font-weight: var(--ft-weight-semibold); font-variant-numeric: tabular-nums; }
.ft-prize__meta { grid-column: 2 / span 2; font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); font-variant-numeric: tabular-nums; }

/* ───────── 발행 번호 세트 ───────── */
.ft-sets { display: grid; }
.ft-set { display: flex; align-items: center; gap: var(--ft-space-3); padding: var(--ft-space-2) 0; }
.ft-set + .ft-set { border-top: 1px dashed var(--ft-border); }
.ft-set__label { flex: none; width: 20px; font-size: var(--ft-text-sm); font-weight: var(--ft-weight-bold); color: var(--ft-text-2); }
.ft-set__result { margin-left: auto; font-size: var(--ft-text-xs); font-weight: var(--ft-weight-semibold); color: var(--ft-text-3); white-space: nowrap; }

/* ───────── 회차 카드 부품 보강 (D2 — components/round_card.php) ───────── */
.ft-round__heading { flex: 1; min-width: 0; }
.ft-round__date .ft-fresh { margin: 0 0 0 6px; vertical-align: 1px; }
.ft-round__head > .ft-copy { flex: none; margin: -8px -10px 0 auto; }
.ft-round__pending {
  display: flex; gap: var(--ft-space-2); align-items: flex-start; padding: var(--ft-space-3) var(--ft-space-4);
  border-radius: var(--ft-radius-md); background: var(--ft-accent-weak); color: var(--ft-accent);
  font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); font-weight: var(--ft-weight-semibold);
}
.ft-round__pending .ft-icon { margin-top: 2px; }
.ft-round__sub b { color: var(--ft-text); font-variant-numeric: tabular-nums; }
.ft-round__ranks { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ft-space-2) var(--ft-space-4); font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); }
@media (min-width: 480px) { .ft-round__ranks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ft-round__ranks div { display: flex; justify-content: space-between; gap: var(--ft-space-2); font-variant-numeric: tabular-nums; }
.ft-round__ranks dt { color: var(--ft-text-2); font-weight: var(--ft-weight-semibold); white-space: nowrap; }
.ft-round__ranks dd { font-weight: var(--ft-weight-semibold); text-align: right; }
.ft-card.ft-round__nav { margin: 0; padding: var(--ft-space-1) var(--ft-space-2); border-top: 1px solid var(--ft-border); }
.ft-set__result.is-win { color: var(--ft-success); font-weight: var(--ft-weight-bold); }

/* ───────── D6·D7: 게이지 · 당첨 판매점 목록 ───────── */
/* 게이지 (출고율·출현 횟수) — <meter>(값·범위를 스크린리더가 읽는다) + 보이는 글자. 색만으로 값을 말하지 않는다 */
.ft-meter { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--ft-space-1) var(--ft-space-2); font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); font-variant-numeric: tabular-nums; }
.ft-meter__label { color: var(--ft-text-2); font-weight: var(--ft-weight-semibold); }
.ft-meter__value { grid-column: 3; font-weight: var(--ft-weight-bold); color: var(--ft-text); text-align: right; }
.ft-meter__bar {
  grid-column: 1 / -1; display: block; width: 100%; height: 8px; margin: 0;
  -webkit-appearance: none; appearance: none; border: 0; border-radius: var(--ft-radius-full); background: var(--ft-surface-2); overflow: hidden;
}
.ft-meter__bar::-webkit-meter-bar { height: 8px; border: 0; border-radius: var(--ft-radius-full); background: var(--ft-surface-2); box-shadow: inset 0 0 0 1px var(--ft-border); }
.ft-meter__bar::-webkit-meter-optimum-value, .ft-meter__bar::-webkit-meter-suboptimum-value, .ft-meter__bar::-webkit-meter-even-less-good-value { border-radius: var(--ft-radius-full); background: var(--ft-accent); }
.ft-meter__bar::-moz-meter-bar { border-radius: var(--ft-radius-full); background: var(--ft-accent); }
/* 당첨 판매점 목록 (components/store_list — 연금·스피또, D2 회차 상세의 판매점 행과 같은 모양) */
.ft-store-row .ft-row__title { white-space: normal; }
.ft-store-rank {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--ft-radius-sm);
  background: var(--ft-surface-2); font-size: var(--ft-text-sm); font-weight: var(--ft-weight-bold); color: var(--ft-text); font-variant-numeric: tabular-nums;
}
.ft-store-more { border-top: 1px solid var(--ft-border); }
.ft-store-more > summary { font-size: var(--ft-text-sm); color: var(--ft-text-2); }

/* ───────── D5: 다음 추첨 카드 (디자인 시스템 §4.13) ───────── */
/* 다음 추첨 카드 (components/next_draw.php) */
.ft-next .ft-card__body { display: grid; gap: var(--ft-space-2); }
.ft-next__last { display: flex; align-items: center; gap: var(--ft-space-2); margin-top: var(--ft-space-1); font-size: var(--ft-text-sm); line-height: var(--ft-lh-sm); color: var(--ft-text-2); }
.ft-next__last a { display: inline-flex; align-items: center; min-height: var(--ft-touch); font-weight: var(--ft-weight-semibold); color: var(--ft-text); }
.ft-next__btn { margin-top: var(--ft-space-1); }
