/* 배팅내역(/betting-history) 티켓 카드 — 2026-11-04 형님 "디자인 깔끔하게, 다폴더도".
   my.css 위에 얹는다. 카드 이름은 bt- 로 시작하고, 삭제 줄(my-hide*)·회원 직접 취소(my-can*)는 예전 이름 그대로 여기로 옮겼다(my-bet.js 가 넣던 style).
   카드 짜임: 머리(선택·그림·제목/구분·상태/시각) → 경기별 줄(다폴더) 또는 내용 한 줄 → 금액 요약(배팅금·배당·당첨금) → 취소 칸.
   휴대폰은 위에서 아래로, PC(761px~)는 금액 요약을 머리 줄 오른쪽에 붙이고 경기별 줄을 표처럼 한 줄씩 그린다. */

/* 넓은 모양(금액 요약을 머리 줄에, 경기별 줄을 표처럼)은 화면 폭이 아니라 목록이 실제로 차지한 폭으로 고른다 — 옆 메뉴가 있는 PC·태블릿 폭에서도 칸이 모자라지 않게 */
.bt-list { display: grid; gap: 12px; container: bt-list / inline-size; }
.bt-box { border-radius: var(--radius); background: linear-gradient(180deg, var(--ink-2), var(--ink)); box-shadow: inset 0 0 0 1px var(--line); }

.bt {
  position: relative;
  display: grid;
  grid-template-columns: auto 40px minmax(0, 1fr) auto;
  grid-template-areas:
    "sel img id st"
    "body body body body"
    "sum sum sum sum"
    "can can can can";
  align-items: center;
  column-gap: 12px;
  padding: 16px 16px 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  box-shadow: inset 0 0 0 1px var(--line);
}
.bt:not([data-sel]) { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "img id st" "body body body" "sum sum sum" "can can can"; }
/* 왼쪽 띠: 진행 중은 주황, 당첨은 금색 — 목록을 훑을 때 결과가 먼저 보이게 */
.bt::before { content: ""; position: absolute; top: 14px; bottom: 14px; left: 0; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.bt[data-tone="live"]::before { background: #f0b04a; }
.bt[data-tone="won"]::before { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
.bt[data-tone="won"] { box-shadow: inset 0 0 0 1px var(--line-2), 0 14px 34px -22px rgba(216, 176, 100, .55); }

.bt-sel { grid-area: sel; display: grid; place-items: center; width: 40px; height: 44px; margin: 0 -8px 0 -12px; cursor: pointer; } /* 누르는 자리 40×44, 보이는 자리는 그대로(음수 여백) */
.bt-sel input { width: 20px; height: 20px; margin: 0; accent-color: var(--gold); cursor: pointer; }
.bt-sel input:disabled { opacity: .3; cursor: not-allowed; }
.bt-sel:has(input:disabled) { cursor: not-allowed; }
.bt-img { grid-area: img; width: 40px; height: 40px; border-radius: 9px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.bt-id { grid-area: id; min-width: 0; }
.bt-t { margin: 0; font: 600 15px/1.35 var(--sans); color: var(--ivory); letter-spacing: -.01em; word-break: keep-all; overflow-wrap: anywhere; outline: 0; }
.bt-m { display: flex; flex-wrap: wrap; margin: 3px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--ivory-3); }
.bt-m span + span::before { content: "·"; margin: 0 5px; color: rgba(196, 181, 151, .45); }
.bt-st { grid-area: st; display: grid; justify-items: end; gap: 5px; text-align: right; }
.bt-st time { font-size: 12.5px; color: var(--ivory-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bdg.bt-win { background: linear-gradient(180deg, #f6dd9b, #d2a256); color: #1d1408; }

/* 금액 요약: 배팅금 · 배당(또는 당첨금) · 당첨금(또는 손익) */
.bt-sum { grid-area: sum; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); margin: 12px 0 0; border-radius: 10px; background: rgba(11, 8, 6, .55); box-shadow: inset 0 0 0 1px rgba(217, 177, 101, .12); }
.bt-sum > div { min-width: 0; padding: 10px 12px; }
.bt-sum > div + div { box-shadow: inset 1px 0 0 rgba(217, 177, 101, .1); }
.bt-sum dt { font-size: 12px; line-height: 1.3; color: var(--ivory-3); white-space: nowrap; }
.bt-sum dd { margin: 4px 0 0; font: 700 clamp(13.5px, 3.9vw, 15.5px)/1.25 var(--sans); color: var(--ivory); font-variant-numeric: tabular-nums; word-break: keep-all; overflow-wrap: anywhere; }
.bt-sum dd.muted { color: var(--ivory-3); font-weight: 600; }
.bt-sum dd.gold-t { color: var(--gold-hi); }
.bt-sum .bt-pay dd { font-size: clamp(14px, 4.1vw, 16.5px); }

/* 내용 한 줄(카지노·슬롯·미니게임·해시게임·홀덤·선물) */
.bt-note { grid-area: body; min-width: 0; margin-top: 10px; }
.bt-nm { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ivory-2); word-break: keep-all; overflow-wrap: anywhere; }
.bt-ns { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ivory-3); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* 경기별 줄(다폴더) */
.bt-legs-box { grid-area: body; min-width: 0; margin-top: 12px; padding: 2px 12px; border-radius: 10px; background: rgba(11, 8, 6, .55); box-shadow: inset 0 0 0 1px rgba(217, 177, 101, .12); container: bt-legs / inline-size; --cols: 84px minmax(100px, .8fr) minmax(150px, 1.6fr) minmax(130px, 1fr) 56px 76px; }
.bt-lh { display: none; }
.bt-legs { margin: 0; padding: 0; list-style: none; }
.bt-leg {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "mt rs" "pk od" "lg kick";
  align-items: center;
  gap: 3px 12px;
  padding: 10px 0 10px 12px;
}
.bt-leg + .bt-leg { border-top: 1px solid rgba(217, 177, 101, .08); }
.bt-legs[data-fold="true"] > .bt-leg[data-more] { display: none; }
.bt-leg::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--leg, var(--gold-lo)); }
.bt-leg[data-r="won"], .bt-leg[data-r="half_won"] { --leg: #3fae72; }
.bt-leg[data-r="lost"], .bt-leg[data-r="half_lost"] { --leg: #c8402a; }
.bt-leg[data-r="live"] { --leg: #f0b04a; }
.bt-leg[data-r="pre"] { --leg: var(--gold-lo); }
.bt-leg[data-r="void"], .bt-leg[data-r="etc"] { --leg: rgba(196, 181, 151, .35); }

.bt-mt { grid-area: mt; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; margin: 0; font: 600 14.5px/1.4 var(--sans); color: var(--ivory); word-break: keep-all; }
.bt-tm { min-width: 0; overflow-wrap: anywhere; }
.bt-tm[data-pick] { color: var(--gold-hi); }
.bt-tm[data-pick]::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 2px 0; border-radius: 50%; background: var(--gold); vertical-align: middle; }
.bt-vs { font-size: 12px; font-weight: 500; color: var(--ivory-3); }
.bt-sc { padding: 1px 7px; border-radius: 5px; background: rgba(243, 233, 214, .08); font: 700 13px/1.45 var(--sans); color: var(--ivory); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bt-pk { grid-area: pk; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; min-width: 0; margin: 0; font-size: 14px; line-height: 1.4; }
.bt-pk b { font-weight: 700; color: var(--gold-hi); overflow-wrap: anywhere; }
.bt-mk { font-size: 12.5px; color: var(--ivory-3); white-space: nowrap; }
.bt-live { align-self: center; padding: 2px 6px; border-radius: 4px; background: rgba(200, 64, 42, .9); font: 700 10.5px/1.2 var(--sans); color: #fff; }
.bt-od { grid-area: od; font: 700 15px/1.3 var(--sans); color: var(--ivory); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bt-rs { grid-area: rs; justify-self: end; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; font: 700 12px/1 var(--sans); white-space: nowrap; background: rgba(196, 181, 151, .12); color: var(--ivory-2); }
.bt-leg[data-r="won"] .bt-rs, .bt-leg[data-r="half_won"] .bt-rs { background: rgba(63, 174, 114, .16); color: #8fdcb0; }
.bt-leg[data-r="lost"] .bt-rs, .bt-leg[data-r="half_lost"] .bt-rs { background: rgba(200, 64, 42, .16); color: #f19a8a; }
.bt-leg[data-r="live"] .bt-rs { background: rgba(240, 176, 74, .16); color: #ffd28a; }
.bt-leg[data-r="pre"] .bt-rs, .bt-leg[data-r="void"] .bt-rs { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ivory-2); }
.bt-lg { grid-area: lg; min-width: 0; margin: 0; overflow: hidden; font-size: 12px; line-height: 1.4; color: var(--ivory-3); text-overflow: ellipsis; white-space: nowrap; }
.bt-kick { grid-area: kick; font-size: 12px; color: var(--ivory-3); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.bt-more { display: flex; align-items: center; justify-content: center; gap: 6px; width: calc(100% + 24px); height: 44px; margin: 0 -12px; padding: 0 12px; border: 0; border-top: 1px solid rgba(217, 177, 101, .1); border-radius: 0 0 10px 10px; background: rgba(217, 177, 101, .04); color: var(--gold-hi); font: 600 13.5px/1 var(--sans); cursor: pointer; }
.bt-more:hover { background: rgba(217, 177, 101, .08); }
.bt-more .my-i { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .3s var(--ease); }
.bt-more[aria-expanded="true"] .my-i { transform: rotate(180deg); }
.bt-more:focus-visible, .bt-sel input:focus-visible, .bt-t:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* 상태(불러오는 중·없음·오류) */
.bt-box > .empty { padding: 56px 20px; }

/* 삭제 줄(예전 my-bet.js 안 style 그대로) */
.my-hidebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 18px 0 12px; padding: 12px 16px; border-radius: 10px; background: linear-gradient(180deg, var(--ink-2), var(--ink)); box-shadow: inset 0 0 0 1px var(--line); }
.my-hidebar[hidden] { display: none; }
.my-hide-n { font-size: 13.5px; color: var(--ivory-2); font-variant-numeric: tabular-nums; }
.my-hide-note { flex: 1 1 auto; font-size: 13px; color: var(--ivory-3); }
.my-hide-act { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.my-hidebar .btn[disabled] { opacity: .45; cursor: default; }
.btn.my-danger { box-shadow: inset 0 0 0 1px rgba(239, 90, 70, .55); color: #ff9d8e; }
.btn.my-danger:hover:not([disabled]) { background: rgba(239, 90, 70, .14); }
.my-hide-dlg .dlg-in { padding: 30px 26px 24px; }
.my-hide-dlg h2 { margin: 0 0 16px; }
.my-hide-body { margin: 0 0 20px; text-align: left; }
.my-hide-body p { margin: 0 0 10px; font-size: 15px; line-height: 1.7; color: var(--ivory-2); }
.my-hide-body p.my-hide-warn { margin-bottom: 0; color: #ff9d8e; }
.my-hide-act2 { display: flex; gap: 10px; justify-content: center; }
.my-hide-act2 .btn { flex: 1 1 0; min-width: 0; height: 52px; padding: 0 14px; font-size: 16px; }
.my-hide-act2 .btn[disabled] { opacity: .62; cursor: default; }

/* 회원 직접 취소(진행 중 스포츠 배팅 카드 맨 아래): 왼쪽 안내·마감, 오른쪽 취소 단추 */
.my-can { grid-area: can; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 14px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(217, 177, 101, .06); box-shadow: inset 0 0 0 1px var(--line-2); text-align: left; }
.my-can:empty { display: none; }
.my-can-m { grid-column: 1; display: grid; gap: 2px; min-width: 0; }
.my-can-m strong { font-size: 13px; color: var(--ivory); }
.my-can-t { font-size: 12.5px; line-height: 1.5; color: var(--ivory-3); }
.my-can-b { grid-column: 2; grid-row: 1 / span 2; min-height: 40px; box-shadow: inset 0 0 0 1px rgba(239, 90, 70, .55); color: #ff9d8e; }
.my-can-b:hover:not([disabled]) { background: rgba(239, 90, 70, .14); }
.my-can-b[disabled] { opacity: .6; cursor: wait; }
.my-can-d { grid-column: 1; font-size: 12.5px; color: var(--gold-hi); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 목록 폭 760px 이상: 금액 요약을 머리 줄 오른쪽에 */
@container bt-list (min-width: 760px) {
  .bt {
    grid-template-columns: auto 44px minmax(140px, 1fr) auto auto;
    grid-template-areas:
      "sel img id sum st"
      "body body body body body"
      "can can can can can";
    column-gap: 16px;
    padding: 16px 20px 16px 22px;
  }
  .bt:not([data-sel]) { grid-template-columns: 44px minmax(140px, 1fr) auto auto; grid-template-areas: "img id sum st" "body body body body" "can can can can"; }
  .bt-img { width: 44px; height: 44px; }
  .bt-st { min-width: 84px; }
  .bt-sum { grid-template-columns: minmax(96px, auto) minmax(76px, auto) minmax(120px, auto); margin: 0; background: none; box-shadow: none; }
  .bt-sum > div { padding: 2px 0 2px 18px; text-align: right; }
  .bt-sum > div + div { box-shadow: none; }
  .bt-sum dd, .bt-sum .bt-pay dd { font-size: 15px; white-space: nowrap; }
  .bt-sum .bt-pay dd { font-size: 16px; }
  .bt-note { margin-top: 12px; padding-left: 60px; }
  .bt[data-sel] .bt-note { padding-left: 104px; }
  .bt-legs-box { margin-top: 14px; padding: 0 14px; }
  .bt-more { width: calc(100% + 28px); margin: 0 -14px; }
}
/* 경기별 줄 칸이 720px 이상: 경기시간 · 리그 · 경기 · 선택 · 배당 · 결과 한 줄 */
@container bt-legs (min-width: 720px) {
  .bt-lh { display: grid; grid-template-columns: var(--cols); gap: 0 14px; padding: 10px 0 8px 12px; border-bottom: 1px solid rgba(217, 177, 101, .1); font-size: 12px; color: var(--ivory-3); }
  .bt-lh span:nth-child(5), .bt-lh span:nth-child(6) { text-align: right; }
  .bt-leg { grid-template-columns: var(--cols); grid-template-areas: "kick lg mt pk od rs"; gap: 0 14px; padding: 11px 0 11px 12px; }
  .bt-leg::before { top: 12px; bottom: 12px; }
  .bt-kick { text-align: left; }
  .bt-lg { white-space: normal; overflow: visible; font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
}

@media (max-width: 760px) {
  .my-hidebar { margin: 14px 0 12px; padding: 12px 14px; }
  .my-hide-act { width: 100%; margin-left: 0; }
  .my-hide-act .btn { flex: 1 1 0; }
  .my-hidebar .check input { width: 22px; height: 22px; margin: 5px 4px 5px 2px; }
  .my-can { column-gap: 10px; padding: 10px; }
  .my-can-b { min-height: 44px; padding: 0 12px; }
}
@media (max-width: 380px) {
  .bt { column-gap: 10px; padding: 14px 12px 14px 14px; }
  .bt-sum > div { padding: 9px 9px; }
  .bt-legs-box { padding: 2px 10px; }
  .bt-more { width: calc(100% + 20px); margin: 0 -10px; }
}
@media (max-width: 480px) {
  .my-hide-act2 { flex-direction: column-reverse; }
  .my-hide-act2 .btn { flex: none; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .bt-more .my-i { transition: none; }
}
