/* =========================================================
   เนื้อหาในแต่ละหน้า (โหลดต่อจาก ui.css)
   ส่วนกลางใช้ prefix x-  ส่วนเฉพาะหน้าใช้ prefix ของหน้านั้น
   ========================================================= */

/* ---------- โครงหน้า ---------- */
.x-page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 20px 8px; }
.x-narrow { max-width: 760px; }
.x-panel { background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: 16px; }
.x-h2 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.4; color: var(--bo-ink); }
.x-muted { color: var(--bo-muted); }

/* ---------- สวิตช์แบบแบ่งช่อง ---------- */
.x-seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--bo-soft); border: 1px solid var(--bo-line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.x-seg::-webkit-scrollbar { display: none; }
.x-seg > a, .x-seg > button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--bo-muted); font: 600 14px/1.2 var(--bo-font); white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s; }
.x-seg > a:hover, .x-seg > button:hover { color: var(--bo-ink); }
html .x-seg > .is-on, html .x-seg > .btn-active, html .x-seg > .btn-active.bg-orange-500 { background: var(--bo-surface) !important; color: var(--bo-ink) !important; box-shadow: 0 1px 2px #0b12201f, 0 0 0 1px var(--bo-line); filter: none; }

/* ---------- ชิปเลือกรุ่น ---------- */
.x-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.x-chips::-webkit-scrollbar { display: none; }
.x-chip { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--bo-line); border-radius: 999px; background: var(--bo-surface); color: var(--bo-ink); font: 600 14px/1.2 var(--bo-font); white-space: nowrap; text-decoration: none; cursor: pointer; transition: border-color .15s, background-color .15s; }
.x-chip:hover { border-color: color-mix(in srgb, var(--bo-ink) 35%, transparent); }
html .x-chip.btn-outline { background: var(--bo-surface); color: var(--bo-ink); border-color: var(--bo-line); }
html .x-chip.is-on, html .x-chip.btn-active, html .x-chip.btn-active.bg-orange-500 { background: var(--bo-ink) !important; border-color: var(--bo-ink) !important; color: var(--bo-surface) !important; filter: none; }
.x-label { flex: none; align-self: center; color: var(--bo-muted); font-size: 13px; font-weight: 600; }

/* ---------- ช่องค้นหา ---------- */
.x-search { position: relative; display: flex; align-items: center; min-width: 0; }
.x-search svg { position: absolute; left: 14px; color: var(--bo-muted); pointer-events: none; }
html .x-search input { width: 100%; height: 44px; padding: 0 14px 0 42px; border: 1px solid var(--bo-line); border-radius: 12px; background: var(--bo-surface); color: var(--bo-ink); font: 400 15px var(--bo-font); outline: none; }
html .x-search input:focus { border-color: var(--brand-color); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- ตัวเลขสรุป ---------- */
.x-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--bo-line); border-radius: 16px; background: var(--bo-surface); overflow: hidden; }
.x-stats > div { padding: 18px 20px; border-right: 1px solid var(--bo-line); min-width: 0; }
.x-stats > div:last-child { border-right: 0; }
.x-stats b { display: block; padding-top: 2px; font-size: 30px; line-height: 1.4; font-weight: 700; letter-spacing: -.02em; color: var(--bo-ink); overflow-wrap: anywhere; }
.x-stats span { display: block; margin-top: 4px; color: var(--bo-muted); font-size: 13.5px; }
.x-stats .is-ok b { color: var(--brand-text); }

/* ---------- สถานะว่าง ---------- */
.x-empty { padding: 56px 24px; text-align: center; border: 1px dashed color-mix(in srgb, var(--bo-ink) 22%, transparent); border-radius: 16px; background: var(--bo-surface); }
.x-empty svg { margin: 0 auto 14px; color: var(--bo-muted); }
.x-empty h2, .x-empty h3 { margin: 0; font-size: 19px; font-weight: 700; color: var(--bo-ink); }
.x-empty p { margin: 6px auto 0; max-width: 32em; color: var(--bo-muted); font-size: 15px; line-height: 1.7; }

/* ---------- ป้ายเล็ก ---------- */
.x-tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--bo-soft); color: var(--bo-ink); font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; }
.x-tag-dark { background: var(--bo-ink); color: var(--bo-surface); }
.x-tag-brand { background: var(--brand-soft); color: var(--brand-text); }
.x-tag-blue { background: color-mix(in srgb, #2563eb 14%, transparent); color: #1d4ed8; }
[data-theme="dark"] .x-tag-blue { color: #93b4ff; }
.x-tag-warn { background: color-mix(in srgb, #d97706 16%, transparent); color: #b45309; }
[data-theme="dark"] .x-tag-warn { color: #fbbf24; }
.x-tag-ok { background: color-mix(in srgb, #16a34a 14%, transparent); color: #15803d; }
[data-theme="dark"] .x-tag-ok { color: #4ade80; }
.x-tag-bad { background: color-mix(in srgb, #dc2626 14%, transparent); color: #b91c1c; }
[data-theme="dark"] .x-tag-bad { color: #f87171; }

/* ---------- โมดอล (DaisyUI) ---------- */
html .modal::backdrop, html .modal-backdrop { background: rgba(6, 10, 16, .62); }
html .modal-box { background: var(--bo-surface); color: var(--bo-ink); border: 1px solid var(--bo-line); border-radius: 20px; box-shadow: 0 30px 80px -20px #000a; }
html .modal-box .btn-circle { width: 36px; height: 36px; min-height: 36px; border-radius: 10px; color: var(--bo-muted); }
html .modal-box .btn-circle:hover { background: var(--bo-soft); color: var(--bo-ink); }

@keyframes x-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-color) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } }
.x-live-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--brand-color); animation: x-pulse 1.8s infinite; }

@media (max-width: 639px) {
  .x-page { padding: 20px 16px 4px; }
  .x-stats > div { padding: 14px 16px; }
  .x-stats b { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .x-live-dot { animation: none; } }

/* =========================================================
   ลำดับการแข่งขัน (schedule.php)
   ========================================================= */
.sc-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 16px; }
.sc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--bo-muted); font-size: 13px; }
.sc-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sc-legend i { width: 9px; height: 9px; border-radius: 50%; }
.st-wait { background: color-mix(in srgb, var(--bo-ink) 25%, transparent); }
.st-live { background: var(--brand-color); }
.st-late { background: #f59e0b; }
.st-done { background: var(--bo-ink); }

.sc-tools { display: grid; grid-template-columns: auto minmax(0, 1fr) 300px; align-items: center; gap: 14px; padding: 12px; margin-bottom: 16px; background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: 16px; }
.sc-tools .x-search input { height: 40px; background: var(--bo-soft); border-color: transparent; }

.sc-stats { margin-bottom: 28px; grid-template-columns: 1fr 1fr 1.3fr 1.5fr; }
.sc-stats .sc-now b { color: var(--brand-text); }
.sc-prog { position: relative; }
.sc-prog i { position: absolute; left: 20px; right: 20px; bottom: 16px; height: 6px; border-radius: 6px; background: var(--bo-soft); overflow: hidden; }
.sc-prog i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--brand-color); border-radius: inherit; }
.sc-prog span { margin-bottom: 14px; }

/* ส่วนกำลังแข่ง */
.sc-live { margin-bottom: 32px; padding: 18px; border-radius: 20px; background: var(--bo-night); color: #fff; }
.sc-live > header { display: flex; align-items: center; gap: 10px; margin: 2px 4px 14px; }
.sc-live h2 { margin: 0; font-size: 19px; font-weight: 700; color: #fff; }
.sc-live-n { margin-left: auto; color: var(--bo-on-night-2); font-size: 14px; }

/* ตามเวลา */
.sc-slot { display: flex; gap: 24px; align-items: flex-start; padding: 22px 0; border-top: 1px solid var(--bo-line); scroll-margin-top: 80px; }
.sc-slot:first-child { border-top: 0; padding-top: 4px; }
.sc-time { position: sticky; top: 82px; flex: 0 0 96px; }
.sc-time b { display: block; font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; color: var(--bo-ink); }
.sc-time span { display: block; margin-top: 4px; color: var(--bo-muted); font-size: 13px; }
.sc-grid { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

/* การ์ดแมตช์ */
html .mc { display: block; position: relative; height: 100%; padding: 12px 14px 8px; border: 1px solid var(--bo-line); border-radius: 14px; background: var(--bo-surface); color: var(--bo-ink); cursor: pointer; box-shadow: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
html .mc:hover { border-color: color-mix(in srgb, var(--bo-ink) 30%, transparent); box-shadow: 0 10px 24px -14px #0b122066; }
html .mc:focus-visible { outline: 3px solid var(--brand-color); outline-offset: 2px; }
html .mc.ring-4 { box-shadow: 0 0 0 3px var(--brand-color); }
.mc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; min-height: 26px; }
.mc-no { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 7px; background: var(--bo-ink); color: var(--bo-surface); font-size: 13px; font-weight: 700; letter-spacing: .01em; }
.mc-lv { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 7px; background: var(--bo-soft); color: var(--bo-ink); font-size: 12.5px; font-weight: 600; }
.mc-lv::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: hsl(var(--h) 65% 48%); }
.mc-where { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: var(--bo-muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.mc-where em { font-style: normal; }
.mc-team { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--bo-line); min-height: 56px; }
.mc-head + .mc-team { border-top: 0; }
.mc-av { flex: none; display: flex; }
.mc-av img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--bo-soft); border: 2px solid var(--bo-surface); }
.mc-av img + img { margin-left: -12px; }
.mc-who { flex: 1; min-width: 0; line-height: 1.35; }
.mc-who b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.mc-who small { display: block; overflow: hidden; max-height: 2.7em; color: var(--bo-muted); font-size: 12.5px; line-height: 1.35; }
.mc-code { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 22px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--bo-line); color: var(--bo-muted); font-size: 11.5px; font-weight: 700; }
.mc-sets { flex: none; display: flex; gap: 4px; }
.mc-sets i { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 8px; background: var(--bo-soft); color: var(--bo-muted); font-style: normal; font-size: 15px; font-weight: 600; }
.mc-sets i.w { background: var(--bo-ink); color: var(--bo-surface); font-weight: 700; }
.mc-team.is-win .mc-who b { font-weight: 700; }
.mc-team.is-win .mc-who b::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--brand-color); vertical-align: 2px; }
.mc-team.is-lose .mc-who, .mc-team.is-lose .mc-av { opacity: .62; }
.mc-done .mc-no { background: var(--bo-soft); color: var(--bo-muted); }
.mc-late { border-color: #f59e0b; }
.mc-late .mc-where em { color: #b45309; }
[data-theme="dark"] .mc-late .mc-where em { color: #fbbf24; }
.mc-live { border-color: color-mix(in srgb, var(--brand-color) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-color) 40%, transparent); }
.mc-live .mc-where { color: var(--brand-text); }
.sc-live .mc { border-color: transparent; }

/* คะแนนสด (live_api อัปเดต) */
.live-score { flex: none; display: flex; align-items: center; gap: 4px; }
.live-set { min-width: 28px; height: 30px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 8px; background: var(--bo-soft); color: var(--bo-muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.live-set.is-current { min-width: 40px; height: 34px; background: var(--brand-color); color: var(--brand-ink); font-size: 19px; font-weight: 700; }

/* มุมมองตารางคอร์ต */
.sc-tablewrap { overflow-x: auto; border: 1px solid var(--bo-line); border-radius: 16px; background: var(--bo-surface); }
html .table-schedule { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 0; text-align: center; font-variant-numeric: tabular-nums; }
html .table-schedule th { position: sticky; top: 0; z-index: 2; padding: 12px 8px; background: var(--bo-soft) !important; color: var(--bo-muted) !important; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--bo-line); }
html .table-schedule th:first-child, html .table-schedule td:first-child { position: sticky; left: 0; z-index: 3; width: 84px; background: var(--bo-surface) !important; border-right: 1px solid var(--bo-line); }
html .table-schedule td:first-child { color: var(--bo-ink) !important; font-size: 17px !important; font-weight: 700; box-shadow: none !important; }
html .table-schedule td { padding: 6px; border-bottom: 1px solid var(--bo-line); border-right: 1px solid var(--bo-line); }
html .table-schedule td.grid-cell-match { border-radius: 0; transition: opacity .2s, background-color .15s; }
html .table-schedule td.grid-cell-match:hover { background: var(--bo-soft) !important; }

/* หน้าต่างรายละเอียดแมตช์ */
html .md-box { width: min(920px, 94vw); max-width: 920px; max-height: 92vh; padding: 0; overflow-y: auto; }
.md-head { position: sticky; top: 0; z-index: 2; padding: 18px 64px 14px 22px; background: var(--bo-surface); border-bottom: 1px solid var(--bo-line); }
.md-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.md-no { height: 30px; font-size: 16px; padding: 0 10px; }
html #modalLevel { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 0 !important; border-radius: 8px; background: var(--bo-soft) !important; color: var(--bo-ink) !important; font-size: 13.5px; font-weight: 600; }
html #modalBracketType span { display: inline-flex; align-items: center; height: 28px; margin-left: 0 !important; margin-right: 6px; padding: 0 10px; border: 0 !important; border-radius: 8px; background: var(--bo-soft) !important; color: var(--bo-ink) !important; font-size: 13px; }
.md-when { margin: 10px 0 0; color: var(--bo-muted); font-size: 14px; }
.md-when b { color: var(--bo-ink); }
html #modalCourtBadge { margin-left: 10px; color: var(--bo-ink); font-weight: 600; }
.md-close { position: absolute; top: 14px; right: 14px; }
.md-status { padding: 18px 22px 0; text-align: center; }
html #modalStatusBadge { height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--bo-soft) !important; color: var(--bo-ink) !important; font-size: 14px; font-weight: 600; animation: none; }
html #modalStatusBadge.bg-info { background: var(--brand-color) !important; color: var(--brand-ink) !important; }
html #modalStatusBadge.bg-success { background: var(--bo-ink) !important; color: var(--bo-surface) !important; }
html #modalStatusBadge.bg-warning { background: #f59e0b !important; color: #111 !important; }
.md-body { display: grid; grid-template-columns: minmax(0, 1fr) 190px minmax(0, 1fr); gap: 16px; align-items: start; padding: 18px 22px 24px; }
.md-team { position: relative; padding: 22px 16px 16px; border: 1px solid var(--bo-line); border-radius: 16px; background: var(--bo-surface); text-align: center; }
html .md-team.border-success { border-color: var(--brand-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-color) 40%, transparent); }
html .md-team.border-success h4::after { content: 'ชนะ'; display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 6px; background: var(--brand-color); color: var(--brand-ink); font-size: 12px; vertical-align: 3px; }
.md-code { position: absolute; top: -11px; left: 14px; background: var(--bo-surface); }
.md-team-2 .md-code { left: auto; right: 14px; }
.md-team h4 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.md-team > p { margin: 2px 0 14px; color: var(--bo-muted); font-size: 13.5px; }
.md-player { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; background: var(--bo-soft); text-align: left; }
.md-player + .md-player { margin-top: 8px; }
.md-player img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--bo-line); flex: none; }
.md-player b { display: block; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.md-player span { display: block; color: var(--bo-muted); font-size: 13px; }
.md-score { align-self: center; border: 1px solid var(--bo-line); border-radius: 16px; overflow: hidden; }
.md-score > div { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 12px; border-top: 1px solid var(--bo-line); }
.md-score > div:first-child { border-top: 0; }
.md-score span { font-size: 24px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.md-score em { font-style: normal; color: var(--bo-muted); font-size: 12px; }

@media (max-width: 1023px) {
  .sc-tools { grid-template-columns: minmax(0, 1fr); }
  .sc-tools .x-seg { justify-self: start; }
  .sc-stats { grid-template-columns: 1fr 1fr; }
  .sc-stats > div:nth-child(2) { border-right: 0; }
  .sc-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--bo-line); }
}
@media (max-width: 767px) {
  .sc-slot { flex-direction: column; gap: 10px; padding: 16px 0; }
  .sc-time { position: sticky; top: 60px; z-index: 4; display: flex; align-items: baseline; gap: 10px; width: 100%; flex-basis: auto; padding: 8px 0; background: var(--bo-bg); }
  .sc-time b { font-size: 22px; }
  .sc-time span { margin: 0; }
  .sc-grid { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .sc-live { margin-left: -16px; margin-right: -16px; border-radius: 0; padding: 16px; }
  .md-body { grid-template-columns: minmax(0, 1fr); }
  .md-score { order: -1; display: grid; grid-template-columns: repeat(3, 1fr); }
  .md-score > div { grid-template-columns: minmax(0, 1fr); gap: 2px; text-align: center; border-top: 0; border-left: 1px solid var(--bo-line); }
  .md-score > div:first-child { border-left: 0; }
  .md-score em { order: -1; }
  .md-score span { font-size: 20px; }
  html .md-box { width: 100%; max-height: 90vh; }
}
.gc { display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 76px; justify-content: center; }
.gc-top { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.gc-court { display: inline-flex; align-items: center; height: 24px; padding: 0 7px; border-radius: 7px; background: var(--bo-soft); color: var(--bo-muted); font-size: 11.5px; font-weight: 600; }
.gc-no { font-size: 18px; font-weight: 700; line-height: 1.1; }
.gc-codes { display: flex; gap: 4px; }
html .table-schedule td.gc-done { background: var(--bo-soft); }
html .table-schedule td.gc-done .gc-no { color: var(--bo-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
html .table-schedule td.gc-live { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand-color); }
html .table-schedule td.gc-live .gc-court { background: var(--brand-color); color: var(--brand-ink); }
html .table-schedule td.gc-late { background: color-mix(in srgb, #f59e0b 14%, transparent); }
html .table-schedule td.gc-empty { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--bo-soft) 6px 7px); }
html .table-schedule td.bg-warning { background: #fde68a !important; }

/* =========================================================
   ตารางคะแนน (standings.php)
   ========================================================= */
.st-levels { margin-bottom: 20px; }
.st-note { margin: 0 0 18px; color: var(--bo-muted); font-size: 14px; line-height: 1.7; }
.st-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.st-group { background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: 18px; overflow: hidden; }
.st-group > header { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 18px 12px; }
.st-group h2 { margin: 0; font-size: 20px; font-weight: 700; }
.st-group > header span { color: var(--bo-muted); font-size: 13px; }
.st-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.st-table th { padding: 8px 6px; color: var(--bo-muted); font-size: 12.5px; font-weight: 600; text-align: center; border-top: 1px solid var(--bo-line); border-bottom: 1px solid var(--bo-line); background: var(--bo-soft); }
.st-table th.st-t { text-align: left; }
.st-table td { padding: 12px 6px; text-align: center; border-bottom: 1px solid var(--bo-line); font-size: 15px; }
.st-table tbody tr:last-child td { border-bottom: 0; }
.st-table tbody tr { cursor: pointer; transition: background-color .12s; }
.st-table tbody tr:hover, .st-table tbody tr:focus-visible { background: var(--bo-soft); outline: none; }
.st-table .st-r { width: 50px; }
.st-table th:not(.st-t):not(.st-r) { width: 52px; }
.st-table .st-pts { width: 60px !important; font-weight: 700; font-size: 18px; }
.st-table th.st-pts { font-size: 12.5px; color: var(--bo-ink); }
.st-rank { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--bo-soft); font-weight: 700; font-size: 14px; }
.st-rank.r1, .st-rank.r2 { background: var(--bo-ink); color: var(--bo-surface); }
.st-team { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
.st-who { min-width: 0; line-height: 1.35; }
.st-who b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.st-who small { display: block; margin-top: 2px; color: var(--bo-muted); font-size: 12.5px; }
.st-who em { font-style: normal; margin-left: 6px; padding: 1px 6px; border-radius: 5px; background: var(--bo-soft); color: var(--bo-muted); font-size: 11.5px; white-space: nowrap; }

html .st-modal { width: min(560px, 94vw); padding: 24px; }
.st-m-head { padding-right: 40px; }
.st-m-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.st-m-head h3 { margin: 10px 0 0; font-size: 24px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.st-m-players { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.st-m-players > div { padding: 14px 10px; border-radius: 14px; background: var(--bo-soft); text-align: center; min-width: 0; }
.st-m-players img { width: 76px; height: 76px; margin: 0 auto 8px; border-radius: 50%; object-fit: cover; background: var(--bo-line); }
.st-m-players b { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.st-m-players span { display: block; color: var(--bo-muted); font-size: 13px; }
.st-m-stats { grid-template-columns: repeat(4, 1fr); }
.st-m-stats > div { padding: 12px 10px; text-align: center; }
.st-m-stats b { font-size: 22px; }
.st-m-h { margin: 22px 0 8px; font-size: 16px; font-weight: 700; }
.st-m-empty { padding: 18px; border-radius: 12px; background: var(--bo-soft); color: var(--bo-muted); text-align: center; font-size: 14px; }
.st-m-list { margin: 0; padding: 0; list-style: none; }
.st-m-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--bo-line); }
.st-m-opp { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.st-m-opp small { margin-right: 6px; color: var(--bo-muted); font-weight: 400; }
.st-m-list .mc-sets i { min-width: 48px; font-size: 13.5px; }

@media (max-width: 1023px) { .st-groups { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .st-table .st-hide { display: none; }
  .st-table .mc-av img { width: 32px; height: 32px; }
  .st-table .mc-av img + img { margin-left: -10px; }
  .st-table td { padding: 11px 4px; }
  .st-table .st-r { width: 40px; }
  .st-m-list li { flex-wrap: wrap; }
  .st-m-list .mc-sets { width: 100%; padding-left: 46px; }
}

/* =========================================================
   สายการแข่งขัน (knockout.php)
   ========================================================= */
.ko-page { --ko-line: color-mix(in srgb, var(--bo-ink) 22%, transparent); }
.ko-main .st-levels { margin-bottom: 20px; }
.ko-card { background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: 18px; overflow: hidden; }
.ko-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 18px 20px; border-bottom: 1px solid var(--bo-line); }
.ko-card-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.ko-card-head p { margin: 2px 0 0; color: var(--bo-muted); font-size: 14px; }
html .x-seg > #tab-upper.bg-orange-500, html .x-seg > #tab-lower.bg-blue-500 { background: var(--bo-surface) !important; color: var(--bo-ink) !important; box-shadow: 0 1px 2px #0b12201f, 0 0 0 1px var(--bo-line); }
#bkToolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 20px; border-bottom: 1px solid var(--bo-line); background: var(--bo-soft); }
#bkToolbar .bk-label { color: var(--bo-muted); font-size: 13px; font-weight: 600; margin-right: auto; }
#bkToolbar .x-seg { background: var(--bo-surface); }
#bkToolbar .x-seg > .is-active { background: var(--bo-ink); color: var(--bo-surface); }
.bk-zoom { display: inline-flex; align-items: center; border: 1px solid var(--bo-line); border-radius: 10px; background: var(--bo-surface); overflow: hidden; }
.bk-zoom button { width: 38px; height: 38px; border: 0; background: transparent; color: var(--bo-ink); font-size: 18px; cursor: pointer; }
.bk-zoom button:hover { background: var(--bo-soft); }
.bk-zoom span { min-width: 56px; text-align: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.ko-tree { background-color: var(--bo-bg); background-image: radial-gradient(circle, color-mix(in srgb, var(--bo-ink) 12%, transparent) 1px, transparent 1.3px); background-size: 22px 22px; scrollbar-width: thin; }
.ko-round-name { text-align: center; }
.ko-round-name span { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 999px; background: var(--bo-night); color: #fff; font-size: 13px; font-weight: 600; }
.ko-lower .ko-round-name span { background: #1d4ed8; }
.ko-box { border: 1px solid var(--bo-line); border-radius: 14px; background: var(--bo-surface); color: var(--bo-ink); box-shadow: 0 8px 22px -16px #0b122077; transition: border-color .15s, box-shadow .15s; }
.ko-box:hover, .ko-box:focus-visible { border-color: color-mix(in srgb, var(--bo-ink) 40%, transparent); outline: none; }
.ko-box.ko-live { border-color: var(--brand-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-color) 30%, transparent); }
.ko-box.third-place-match { border-style: dashed; }
.ko-head { border-radius: 13px 13px 0 0; font-style: normal; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; background: var(--bo-soft); font-size: 12.5px; font-weight: 600; }
.ko-no { color: var(--bo-ink); }
.ko-st { display: inline-flex; align-items: center; gap: 6px; color: var(--bo-muted); }
.ko-live .ko-st { color: var(--brand-text); }
.ko-slot { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; padding: 4px 12px; border-top: 1px solid var(--bo-line); overflow: hidden; }
.ko-slot small { overflow: hidden; color: var(--bo-muted); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.ko-slot > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ko-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14.5px; font-weight: 600; }
.ko-slot .mc-sets i { min-width: 26px; height: 24px; font-size: 13px; border-radius: 6px; }
.ko-slot.is-win .ko-name::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--brand-color); vertical-align: 2px; }
.ko-slot.is-lose { opacity: .6; }
.ko-wait, .ko-bye { color: var(--bo-muted); font-weight: 400; font-style: italic; font-size: 13px; }
@media (max-width: 639px) { #bkToolbar .bk-label { width: 100%; } .ko-card-head { padding: 16px; } }

/* =========================================================
   สรุปผล (results.php)
   ========================================================= */
.results-tabs { margin-bottom: 26px; }
.rs-head { margin-bottom: 20px; }
.rs-head h2 { margin: 0; font-size: 26px; font-weight: 700; }
.rs-head p { margin: 4px 0 0; color: var(--bo-muted); font-size: 15px; }
.rs-medal { display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; font-size: 20px; font-weight: 700; color: #3b2a06; background: radial-gradient(circle at 35% 30%, #fff6d6 0 12%, #e8bd52 45%, #b98a1f 100%); box-shadow: inset 0 -3px 0 #0000002a; }
.rs-r2 .rs-medal, .rs-pod2 .rs-medal { color: #2c3340; background: radial-gradient(circle at 35% 30%, #ffffff 0 12%, #c9d0da 45%, #8c96a5 100%); }
.rs-r3 .rs-medal, .rs-pod3 .rs-medal { color: #3a1d08; background: radial-gradient(circle at 35% 30%, #ffe3c7 0 12%, #d39158 45%, #9c5a26 100%); }
.rs-r4 .rs-medal { color: var(--bo-ink); background: var(--bo-soft); box-shadow: inset 0 0 0 2px var(--bo-line); }

.rs-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 14px; max-width: 900px; margin: 0 auto; }
.rs-pod { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.rs-pod h3 { margin: 12px 0 2px; font-size: 18px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.rs-pod p { margin: 0 0 12px; color: var(--bo-muted); font-size: 14px; }
.rs-pod p b { color: var(--bo-ink); font-size: 18px; }
.rs-step { display: grid; place-items: center; width: 100%; border-radius: 14px 14px 0 0; background: var(--bo-surface); border: 1px solid var(--bo-line); border-bottom: 0; color: var(--bo-muted); font-weight: 600; font-size: 14px; }
.rs-pod1 .rs-step { height: 150px; background: var(--bo-night); color: #fff; border-color: var(--bo-night); font-size: 17px; }
.rs-pod2 .rs-step { height: 104px; }
.rs-pod3 .rs-step { height: 76px; }
.rs-pod1 .rs-medal { width: 64px; height: 64px; font-size: 26px; }
.rs-pod1 h3 { font-size: 22px; }

.rs-bracket + .rs-bracket { margin-top: 30px; }
.rs-bname { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.rs-lower .rs-bname { color: #1d4ed8; }
[data-theme="dark"] .rs-lower .rs-bname { color: #93b4ff; }
.rs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rs-card { display: flex; align-items: center; gap: 16px; padding: 18px; border: 1px solid var(--bo-line); border-radius: 16px; background: var(--bo-surface); min-width: 0; }
.rs-card.rs-r1 { grid-column: 1 / -1; padding: 24px; background: var(--bo-night); color: #fff; border-color: var(--bo-night); }
.rs-avs { flex: none; display: flex; }
.rs-avs img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--bo-soft); border: 3px solid var(--bo-surface); }
.rs-avs img + img { margin-left: -14px; }
.rs-r1 .rs-avs img { width: 84px; height: 84px; border-color: var(--bo-night); }
.rs-txt { min-width: 0; }
.rs-txt em { display: block; font-style: normal; color: var(--bo-muted); font-size: 13px; font-weight: 600; }
.rs-r1 .rs-txt em { color: var(--brand-color); font-size: 14px; }
.rs-txt b { display: block; margin-top: 2px; font-size: 16px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.rs-txt b span { color: var(--bo-muted); font-weight: 400; }
.rs-r1 .rs-txt b { font-size: 21px; }
.rs-r1 .rs-txt b span { color: var(--bo-on-night-2); }
.rs-txt small { display: block; margin-top: 4px; color: var(--bo-muted); font-size: 13.5px; }
.rs-r1 .rs-txt small { color: var(--bo-on-night-2); }
.rs-r1 .rs-medal { width: 58px; height: 58px; font-size: 24px; }
[data-theme="dark"] .rs-card.rs-r1, [data-theme="dark"] .rs-pod1 .rs-step { background: var(--bo-surface); border-color: color-mix(in srgb, var(--brand-color) 55%, transparent); }
[data-theme="dark"] .rs-r1 .rs-avs img { border-color: var(--bo-surface); }

@media (max-width: 639px) {
  .rs-podium { gap: 8px; }
  .rs-pod h3 { font-size: 14.5px; }
  .rs-pod1 h3 { font-size: 16px; }
  .rs-pod1 .rs-step { height: 120px; font-size: 14px; }
  .rs-grid { grid-template-columns: minmax(0, 1fr); }
  .rs-card { padding: 14px; gap: 12px; }
  .rs-r1 .rs-avs img { width: 64px; height: 64px; }
  .rs-card.rs-r1 { flex-wrap: wrap; }
  .rs-r1 .rs-txt { flex-basis: 100%; }
  .rs-r1 .rs-txt b { font-size: 18px; }
  .rs-avs img { width: 46px; height: 46px; }
  .rs-medal { width: 38px; height: 38px; font-size: 17px; }
}

/* =========================================================
   ตรวจสอบนักกีฬา (players-check.php)
   ========================================================= */
.pc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; margin-bottom: 18px; background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: 16px; }
.pc-tools .x-search { flex: 1 1 320px; }
.pc-tools .x-search input { background: var(--bo-soft); border-color: transparent; }
.players-search-spinner { position: absolute; right: 14px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--bo-line); border-top-color: var(--brand-color); animation: pc-spin .6s linear infinite; display: none; }
.pc-excel { color: #15803d; }
[data-theme="dark"] .pc-excel { color: #4ade80; }
.pc-stats { grid-template-columns: repeat(4, 1fr); margin: 18px 0 26px; }
.pc-cap { position: relative; }
.pc-cap span { margin-bottom: 14px; }
.pc-cap i { position: absolute; left: 20px; right: 20px; bottom: 16px; height: 6px; border-radius: 6px; background: var(--bo-soft); overflow: hidden; }
.pc-cap i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--brand-color); border-radius: inherit; }
.pc-cap.is-full b { color: #b91c1c; }
[data-theme="dark"] .pc-cap.is-full b { color: #f87171; }
.pc-h { margin: 0 0 14px; font-size: 20px; font-weight: 700; }
.pc-h.hidden, .bo-btn.hidden { display: none; }

.pc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.pc-grid > .team-card { content-visibility: auto; contain-intrinsic-size: 0 360px; }
.pc-card { position: relative; padding: 18px; background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: 18px; color: var(--bo-ink); }
.pc-card::before { content: ''; position: absolute; left: 18px; right: 18px; top: -1px; height: 3px; border-radius: 0 0 3px 3px; background: #f59e0b; }
.pc-card.pc-pass::before { background: #16a34a; }
.pc-card.pc-fail::before { background: #dc2626; }
.team-header-info { display: flex; align-items: center; gap: 14px; }
.seq-badge { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--bo-soft); color: var(--bo-ink); font-size: 16px; font-weight: 700; }
.pc-title { flex: 1; min-width: 0; }
.team-name-text { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.team-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.payment-status { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.team-admin-comment { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, #f59e0b 12%, transparent); font-size: 14px; line-height: 1.7; }
.team-admin-comment b { display: block; font-weight: 600; }
.team-admin-comment p { margin: 2px 0 0; overflow-wrap: anywhere; }
.grid-players { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.grid-players.is-single { grid-template-columns: minmax(0, 560px); }
.player-container { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 12px; border-radius: 14px; background: var(--bo-soft); }
.player-img { flex: none; width: 92px; height: 92px; border-radius: 14px; object-fit: cover; background: var(--bo-line); cursor: zoom-in; }
.player-details { min-width: 0; }
.player-details small { display: block; color: var(--bo-muted); font-size: 12.5px; font-weight: 600; }
.player-details h3 { margin: 2px 0 2px; font-size: 16px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.player-details p { margin: 0; color: var(--bo-muted); font-size: 13.5px; line-height: 1.6; }
.pc-clip { display: inline-flex; align-items: center; height: 30px; margin-top: 8px; padding: 0 12px; border-radius: 8px; background: var(--bo-surface); border: 1px solid var(--bo-line); color: var(--bo-ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.pc-clip:hover { border-color: var(--bo-ink); }

/* มุมมองย่อ */
.pc-grid.view-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pc-grid.view-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pc-grid.view-16 { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.pc-grid:is(.view-4, .view-8, .view-16) .team-card { cursor: pointer; }
.pc-grid:is(.view-4, .view-8, .view-16) .team-card:hover { border-color: color-mix(in srgb, var(--bo-ink) 35%, transparent); }
.pc-grid.view-4 .player-img { width: 64px; height: 64px; }
.pc-grid.view-4 .grid-players { grid-template-columns: minmax(0, 1fr); }
.pc-grid.view-8 .team-card, .pc-grid.view-16 .team-card { padding: 12px; }
.pc-grid.view-8 .team-header-info { flex-wrap: wrap; }
.pc-grid.view-8 .pc-title { flex-basis: calc(100% - 64px); }
.pc-grid.view-8 .payment-status { width: 100%; }
.pc-grid.view-8 .team-name-text { font-size: 15px; }
.pc-grid.view-8 .payment-status { justify-content: flex-start; }
.pc-grid:is(.view-8, .view-16) :is(.team-admin-comment, .team-clip, .player-details p) { display: none; }
.pc-grid.view-8 .grid-players { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.pc-grid.view-8 .player-container { padding: 6px; gap: 8px; }
.pc-grid.view-8 .player-img { width: 40px; height: 40px; border-radius: 10px; }
.pc-grid.view-8 .player-details h3 { font-size: 13.5px; }
.pc-grid.view-16 :is(.team-badges, .payment-status, .player-details) { display: none; }
.pc-grid.view-16 .team-header-info { flex-direction: column; gap: 6px; text-align: center; }
.pc-grid.view-16 .seq-badge { width: 32px; height: 32px; font-size: 12.5px; }
.pc-grid.view-16 .team-name-text { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-grid.view-16 .grid-players { grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 8px; }
.pc-grid.view-16 .player-container { padding: 0; background: none; justify-content: center; }
.pc-grid.view-16 .player-img { width: 36px; height: 36px; border-radius: 50%; }

html .pc-lightbox { width: auto; max-width: min(92vw, 720px); padding: 0; background: transparent; border: 0; box-shadow: none; overflow: visible; }
#pc-preview-frame { display: flex; flex-direction: column; align-items: center; }
#modal_expanded_image { max-height: 80vh; max-width: 100%; border-radius: 16px; object-fit: contain; background: #000; transition: opacity .2s; }
#pc-preview-caption { margin-top: 12px; padding: 8px 16px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 15px; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
.pc-lightbox .btn-circle { position: absolute; top: -8px; right: -8px; z-index: 2; background: #000a; color: #fff; }

@media (max-width: 1023px) {
  .pc-stats { grid-template-columns: 1fr 1fr; }
  .pc-stats > div:nth-child(2) { border-right: 0; }
  .pc-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--bo-line); }
  .pc-grid.view-8 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pc-grid.view-16 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .team-header-info { flex-wrap: wrap; }
  .payment-status { width: 100%; justify-content: flex-start; }
  .grid-players { grid-template-columns: minmax(0, 1fr); }
  .player-img { width: 76px; height: 76px; }
  .pc-grid.view-4 { grid-template-columns: minmax(0, 1fr); }
  .pc-views { width: 100%; }
  .pc-views > button { flex: 1; padding: 0 8px; }
  .pc-grid.view-16 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* =========================================================
   ทีมของฉัน (myteams.php)
   ========================================================= */
.mt-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.mt-bar p { margin: 0; color: var(--bo-muted); font-size: 15px; }
.mt-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.mt-team { padding: 20px; background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: 18px; }
.mt-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; }
.mt-head h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.mt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-locked { display: inline-flex; align-items: center; height: 42px; padding: 0 14px; border-radius: 10px; background: var(--bo-soft); color: var(--bo-muted); font-size: 14px; }
.mt-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: s; }
.mt-steps li { position: relative; padding: 0 10px 0 0; min-width: 0; }
.mt-steps li::before { content: ''; position: absolute; top: 14px; left: 34px; right: 6px; height: 2px; background: var(--bo-line); }
.mt-steps li:last-child::before { display: none; }
.mt-steps li.is-done::before { background: var(--bo-ink); }
.mt-steps li > span { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--bo-line); background: var(--bo-surface); color: var(--bo-muted); font-size: 13px; font-weight: 700; }
.mt-steps li b { display: block; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--bo-muted); }
.mt-steps li small { display: block; color: var(--bo-muted); font-size: 12.5px; line-height: 1.45; }
.mt-steps li.is-done > span { background: var(--bo-ink); border-color: var(--bo-ink); color: var(--bo-surface); }
.mt-steps li.is-done b { color: var(--bo-ink); }
.mt-steps li.is-now > span { border-color: var(--brand-color); background: var(--brand-color); color: var(--brand-ink); box-shadow: 0 0 0 4px var(--brand-soft); }
.mt-steps li.is-now b { color: var(--bo-ink); }
.mt-steps li.is-now small { color: var(--brand-text); font-weight: 600; }
.mt-steps li.is-fail > span { border-color: #dc2626; background: #dc2626; color: #fff; }
.mt-steps li.is-fail b { color: var(--bo-ink); }
.mt-steps li.is-fail small { color: #b91c1c; font-weight: 600; }
[data-theme="dark"] .mt-steps li.is-fail small { color: #f87171; }
.mt-players { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.mt-players.is-single { grid-template-columns: minmax(0, 560px); }
.mt-player { padding: 14px; border-radius: 14px; background: var(--bo-soft); min-width: 0; }
.mt-p-top { display: flex; align-items: center; gap: 14px; }
.mt-p-img { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; background: var(--bo-line); }
.mt-p-top small { display: block; color: var(--bo-muted); font-size: 12.5px; font-weight: 600; }
.mt-p-top h3 { margin: 2px 0; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.mt-p-top p { margin: 0; color: var(--bo-muted); font-size: 13.5px; }
.mt-p-more { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bo-line); font-size: 14px; }
.mt-p-label { margin: 8px 0 2px; color: var(--bo-muted); font-size: 12.5px; font-weight: 600; }
.mt-p-hist { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }

html .mt-pay { width: min(480px, 94vw); padding: 24px; }
.mt-pay h3 { margin: 0; padding-right: 40px; font-size: 22px; font-weight: 700; }
.mt-pay-team { margin: 4px 0 16px; color: var(--bo-muted); }
.mt-pay-team b { color: var(--bo-ink); }
.mt-pay-acc { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; padding: 14px; border-radius: 14px; background: var(--bo-soft); }
.mt-pay-acc img { width: 100%; border-radius: 10px; background: #fff; }
.mt-pay-acc small { display: block; color: var(--bo-muted); font-size: 12.5px; }
.mt-pay-acc b { display: block; font-size: 15px; }
.mt-pay-acc strong { display: block; margin: 4px 0; font-size: 22px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.mt-pay-acc span { display: block; color: var(--bo-muted); font-size: 13.5px; }
.mt-file { display: block; margin: 18px 0 16px; }
.mt-file > span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.mt-file em { font-style: normal; color: #dc2626; }
.mt-file input { width: 100%; padding: 10px; border: 1px dashed color-mix(in srgb, var(--bo-ink) 30%, transparent); border-radius: 12px; background: var(--bo-soft); color: var(--bo-ink); font: inherit; font-size: 14px; }
.mt-file input::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 8px; background: var(--bo-ink); color: var(--bo-surface); font: 600 13.5px var(--bo-font); cursor: pointer; }
.pf-notice { max-width: 1200px; margin: 16px auto 0; padding: 12px 16px; border-radius: 12px; background: var(--brand-soft); color: var(--bo-ink); font-size: 14.5px; }

@media (max-width: 767px) {
  .mt-team { padding: 16px; }
  .mt-head h2 { font-size: 19px; }
  .mt-actions { width: 100%; }
  .mt-actions .bo-btn { flex: 1; }
  .mt-steps { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mt-steps li { display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; }
  .mt-steps li::before { top: 32px; bottom: -12px; left: 14px; right: auto; width: 2px; height: auto; }
  .mt-steps li > span { grid-row: span 2; }
  .mt-steps li b { margin-top: 0; }
  .mt-players { grid-template-columns: minmax(0, 1fr); }
  .mt-pay-acc { grid-template-columns: 110px 1fr; }
}

/* =========================================================
   ตารางแข่งขันของฉัน (my-schedule.php)
   ========================================================= */
.ms-tabs { width: 100%; margin-bottom: 18px; }
.ms-tabs > button { flex: 1; }
.ms-tabs em { font-style: normal; margin-left: 2px; padding: 1px 7px; border-radius: 999px; background: var(--bo-line); font-size: 12px; }
.ms-tabs > .is-on em { background: var(--bo-ink); color: var(--bo-surface); }
#group_section.hidden, #knockout_section.hidden, #followed_section.hidden { display: none; }
.ms-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ms-card { display: flex; gap: 16px; padding: 14px 16px; border: 1px solid var(--bo-line); border-radius: 16px; background: var(--bo-surface); color: var(--bo-ink); cursor: pointer; transition: border-color .15s; }
.ms-card:hover, .ms-card:focus-visible { border-color: color-mix(in srgb, var(--bo-ink) 35%, transparent); outline: none; }
.ms-card.ms-live { border-color: var(--brand-color); box-shadow: 0 0 0 1px var(--brand-color); }
.ms-when { flex: none; width: 72px; padding-right: 14px; border-right: 1px solid var(--bo-line); }
.ms-when b { display: block; font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.ms-when span { display: block; margin-top: 2px; color: var(--bo-muted); font-size: 13px; font-weight: 600; }
.ms-body { flex: 1; min-width: 0; }
.ms-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.ms-court { color: var(--bo-muted); font-size: 13px; font-weight: 600; }
.ms-st { margin-left: auto; }
.ms-team { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.ms-team b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.ms-team.is-lose b { color: var(--bo-muted); font-weight: 400; }
.ms-team.is-win b::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--brand-color); vertical-align: 2px; }
.ms-team .mc-sets i { min-width: 28px; height: 26px; font-size: 13.5px; }
.ms-fol { flex: none; padding: 1px 7px; border-radius: 6px; background: color-mix(in srgb, #eab308 20%, transparent); color: #854d0e; font-size: 11.5px; font-weight: 600; }
[data-theme="dark"] .ms-fol { color: #fde047; }
.countdown-box { margin-top: 8px; }
.countdown-box.hidden { display: none; }
.countdown-text { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-text); font-size: 13px; font-weight: 700; }
.ms-follow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px; margin-bottom: 22px; border-radius: 16px; background: var(--bo-night); color: #fff; }
.ms-follow h3 { margin: 0; font-size: 18px; font-weight: 700; color: #fff; }
.ms-follow p { margin: 4px 0 0; color: var(--bo-on-night-2); font-size: 14px; }
.ms-h { margin: 0 0 10px; font-size: 17px; font-weight: 700; }
.ms-followed { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ms-followed li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; border: 1px solid var(--bo-line); border-radius: 14px; background: var(--bo-surface); }
.ms-followed b { display: block; font-size: 15px; }
.ms-followed small { color: var(--bo-muted); font-size: 13px; }
.ms-unf { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
html .ms-pick { width: min(980px, 96vw); max-width: 980px; height: min(86vh, 900px); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.ms-pick-head { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--bo-line); }
.ms-pick-head h3 { margin: 0; font-size: 20px; font-weight: 700; }
.ms-pick-head p { margin: 2px 0 0; color: var(--bo-muted); font-size: 13.5px; }
.ms-pick-head .x-search { grid-column: 1 / -1; }
.ms-pick-head .x-search input { background: var(--bo-soft); border-color: transparent; }
.ms-pick-body { flex: 1; overflow-y: auto; padding: 16px 18px 24px; }
.team-group + .team-group { margin-top: 20px; }
.team-group h4 { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--bo-muted); }
.ms-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ms-pick-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--bo-line); border-radius: 14px; background: var(--bo-surface); cursor: pointer; }
.ms-pick-card:hover, .ms-pick-card:focus-visible { border-color: var(--brand-color); outline: none; }
.ms-pick-who { flex: 1; min-width: 0; }
.ms-pick-who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.ms-pick-who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bo-muted); font-size: 12.5px; }
.ms-pick-add { flex: none; padding: 4px 10px; border-radius: 8px; background: var(--bo-soft); font-size: 13px; font-weight: 600; }
.ms-pick-card:hover .ms-pick-add { background: var(--brand-color); color: var(--brand-ink); }
@media (max-width: 639px) {
  .ms-tabs > button { padding: 0 8px; font-size: 13px; }
  .ms-card { gap: 12px; padding: 12px; }
  .ms-when { width: 58px; padding-right: 10px; }
  .ms-when b { font-size: 18px; }
  .ms-st { margin-left: 0; }
  .ms-follow .bo-btn { width: 100%; }
}

/* =========================================================
   ฟอร์มสมัคร / แก้ไขใบสมัคร (apply.php, edit_apply.php)
   ========================================================= */
.f-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.f-form { display: grid; gap: 16px; }
.f-sec { padding: 22px; background: var(--bo-surface); border: 1px solid var(--bo-line); border-radius: 18px; }
.f-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.f-num { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--bo-ink); color: var(--bo-surface); font-weight: 700; }
.f-head h2 { margin: 3px 0 0; font-size: 19px; font-weight: 700; }
.f-head p { margin: 2px 0 0; color: var(--bo-muted); font-size: 14px; line-height: 1.6; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.f-span { grid-column: 1 / -1; }
.f-field { display: block; min-width: 0; }
.f-field > span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--bo-ink); }
.f-field em, .f-photo em { font-style: normal; color: #dc2626; }
.f-field i { font-style: normal; margin-left: 4px; color: var(--bo-muted); font-weight: 400; font-size: 13px; }
html .f-input, html .f-field select, html .f-field textarea { display: block; width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--bo-line); border-radius: 10px; background: var(--bo-surface); color: var(--bo-ink); font: 400 15.5px/1.5 var(--bo-font); outline: none; transition: border-color .15s, box-shadow .15s; }
html .f-field textarea { min-height: 92px; resize: vertical; }
html .f-input:focus { border-color: var(--brand-color); box-shadow: 0 0 0 3px var(--brand-soft); }
html .f-input.border-error { border-color: #dc2626; background: color-mix(in srgb, #dc2626 7%, var(--bo-surface)); }
.f-date { display: grid; grid-template-columns: 0.8fr 1fr 1fr; gap: 8px; }
.f-photo { display: block; position: relative; cursor: pointer; }
.f-photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.f-photo-box { display: flex; align-items: center; gap: 16px; min-height: 120px; padding: 14px; border: 1.5px dashed color-mix(in srgb, var(--bo-ink) 28%, transparent); border-radius: 14px; background: var(--bo-soft); transition: border-color .15s; }
.f-photo:hover .f-photo-box, .f-photo:focus-within .f-photo-box { border-color: var(--brand-color); }
.f-photo input.border-error + .f-photo-box { border-color: #dc2626; }
.f-photo img { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; }
.f-photo-hint { display: flex; align-items: center; gap: 12px; color: var(--bo-muted); }
.f-photo-hint b { display: block; color: var(--bo-ink); font-size: 15px; }
.f-photo-hint small { display: block; font-size: 13px; }
.f-photo-hint svg { flex: none; }
.f-photo.has-img .f-photo-hint svg { display: none; }
.f-photo-cur { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; color: var(--bo-muted); font-size: 13.5px; }
.f-photo-cur img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.f-submit { padding: 6px 0 0; }
.f-submit .bo-btn { width: 100%; }
.f-submit p { margin: 10px 0 0; color: var(--bo-muted); font-size: 13.5px; text-align: center; }
.f-aside { position: sticky; top: 90px; padding: 20px; border-radius: 18px; background: var(--bo-night); color: var(--bo-on-night-2); font-size: 14.5px; line-height: 1.7; }
.f-aside h3 { margin: 0 0 8px; color: #fff; font-size: 16px; font-weight: 700; }
.f-aside h3 + ul, .f-aside h3 + ol { margin: 0 0 18px; padding-left: 20px; }
.f-aside ul { list-style: disc; }
.f-aside ol { list-style: decimal; }
.f-aside li + li { margin-top: 4px; }
.f-note { padding: 12px 14px; margin-bottom: 16px; border-radius: 12px; background: color-mix(in srgb, #f59e0b 14%, transparent); color: var(--bo-ink); font-size: 14.5px; line-height: 1.7; }
.ap-closed svg { color: var(--bo-muted); }
@media (max-width: 1023px) { .f-layout { grid-template-columns: minmax(0, 1fr); } .f-aside { position: static; order: -1; } }
@media (max-width: 639px) { .f-sec { padding: 16px; } .f-grid { grid-template-columns: minmax(0, 1fr); } .f-photo-box { min-height: 100px; } }

/* แผงสีเข้มในโหมดมืด: ใช้พื้นผิวยกขึ้นแทน เพื่อไม่ให้กลืนกับพื้นหลัง */
[data-theme="dark"] :is(.f-aside, .sc-live, .ms-follow) { background: var(--bo-surface); border: 1px solid var(--bo-line); }
[data-theme="dark"] .bo-mine { background: var(--bo-surface); border: 1px solid var(--bo-line); }

/* =========================================================
   ประท้วงนักกีฬา (protest.php)
   ========================================================= */
.pt-intro { padding: 16px 18px; margin-bottom: 18px; border-radius: 16px; background: var(--bo-surface); border: 1px solid var(--bo-line); }
.pt-intro h2 { margin: 0; font-size: 17px; font-weight: 700; }
.pt-intro p { margin: 4px 0 0; color: var(--bo-muted); font-size: 14.5px; line-height: 1.7; max-width: 60em; }
.pt-levels { margin-bottom: 20px; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.pt-card { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border: 1px solid var(--bo-line); border-radius: 14px; background: var(--bo-surface); min-width: 0; }
.pt-who { flex: 1; min-width: 0; }
.pt-who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.pt-who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bo-muted); font-size: 13px; }
.pt-btn { flex: none; min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.pt-btn:hover { border-color: #dc2626; color: #b91c1c; background: color-mix(in srgb, #dc2626 8%, transparent); }
.pt-loading { display: flex; align-items: center; gap: 10px; padding: 30px; color: var(--bo-muted); }
.pt-form { display: grid; gap: 14px; }
.pt-form .mt-file { margin: 0; }
@media (max-width: 639px) { .pt-grid { grid-template-columns: minmax(0, 1fr); } }

/* =========================================================
   จองทดสอบสนาม (book-court.php)
   ========================================================= */
.bc-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; margin-bottom: 26px; }
.bc-info, .bc-status { padding: 18px 20px; border: 1px solid var(--bo-line); border-radius: 16px; background: var(--bo-surface); }
.bc-date { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 12px; border-radius: 10px; background: var(--bo-soft); font-size: 14px; }
.bc-date b { color: var(--brand-text); }
.bc-info h2, .bc-status h2 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.bc-info ul { margin: 0; padding-left: 20px; list-style: disc; color: var(--bo-muted); font-size: 14.5px; line-height: 1.75; }
.bc-state { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bo-soft); font-size: 14px; font-weight: 600; }
.bc-state.is-off { background: color-mix(in srgb, #dc2626 10%, transparent); color: #b91c1c; }
[data-theme="dark"] .bc-state.is-off { color: #f87171; }
.bc-state.is-ok { background: var(--brand-soft); color: var(--brand-text); }
.bc-mine { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 8px; border-radius: 12px; background: var(--bo-night); color: #fff; }
.bc-mine small { display: block; color: var(--bo-on-night-2); font-size: 12.5px; }
.bc-mine b { font-size: 16px; }
.bc-cancel { min-height: 34px; padding: 0 10px; font-size: 13px; background: transparent; color: #fff; border-color: var(--bo-line-night); }
.bc-cancel:hover { background: rgba(255, 255, 255, .1); }
.bc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.bc-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.bc-legend { display: flex; gap: 14px; color: var(--bo-muted); font-size: 13px; }
.bc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bc-legend i { width: 12px; height: 12px; border-radius: 4px; }
.bc-legend .free { border: 1.5px dashed var(--brand-color); }
.bc-legend .taken { background: var(--bo-soft); border: 1px solid var(--bo-line); }
.bc-legend .mine { background: var(--bo-ink); }
.bc-wrap { overflow-x: auto; border: 1px solid var(--bo-line); border-radius: 16px; background: var(--bo-surface); }
.bc-table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; text-align: center; }
.bc-table th { position: sticky; top: 0; padding: 10px 6px; background: var(--bo-soft); color: var(--bo-muted); font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--bo-line); }
.bc-table th:first-child, .bc-table td:first-child { position: sticky; left: 0; z-index: 2; width: 86px; background: var(--bo-surface); border-right: 1px solid var(--bo-line); }
.bc-table th:first-child { background: var(--bo-soft); }
.bc-table td { padding: 6px; border-bottom: 1px solid var(--bo-line); }
.bc-table tbody tr:last-child td { border-bottom: 0; }
.bc-table td:first-child b { display: block; font-size: 16px; }
.bc-table td:first-child small { color: var(--bo-muted); font-size: 12px; }
.bc-slot { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; min-width: 96px; min-height: 58px; padding: 6px; border-radius: 10px; font: inherit; }
.bc-slot b { font-size: 13.5px; font-weight: 600; }
.bc-slot small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; opacity: .8; }
.bc-slot.is-free { border: 1.5px dashed color-mix(in srgb, var(--brand-color) 70%, transparent); background: transparent; color: var(--brand-text); cursor: pointer; transition: background-color .15s; }
.bc-slot.is-free:hover { background: var(--brand-soft); }
.bc-slot.is-free.is-static { cursor: default; border-color: var(--bo-line); color: var(--bo-muted); }
.bc-slot.is-taken { background: var(--bo-soft); color: var(--bo-muted); }
.bc-slot.is-mine { background: var(--bo-ink); color: var(--bo-surface); }
.bc-confirm { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 16px; }
.bc-confirm > div { padding: 12px 14px; border-radius: 12px; background: var(--bo-soft); }
.bc-confirm small { display: block; color: var(--bo-muted); font-size: 12.5px; }
.bc-confirm b { font-size: 18px; }
.bc-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
@media (max-width: 1023px) { .bc-top { grid-template-columns: minmax(0, 1fr); } }

/* =========================================================
   คูปองของฉัน (my-coupons.php)
   ========================================================= */
.cp-id { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 20px; margin-bottom: 18px; border-radius: 20px; background: var(--bo-night); color: #fff; }
[data-theme="dark"] .cp-id { background: var(--bo-surface); border: 1px solid var(--bo-line); }
.cp-qr { padding: 8px; border-radius: 14px; background: #fff; line-height: 0; }
.cp-qr svg, .cp-qr img { width: 100%; height: auto; }
.cp-id-txt small { color: var(--bo-on-night-2); font-size: 13px; }
.cp-id-txt h2 { margin: 2px 0; font-size: 21px; font-weight: 700; color: #fff; overflow-wrap: anywhere; }
.cp-id-txt p { margin: 0; color: var(--bo-on-night-2); font-size: 14px; }
.cp-id-txt .cp-hint { margin-top: 10px; display: inline-block; padding: 4px 10px; border-radius: 8px; background: color-mix(in srgb, var(--brand-color) 22%, transparent); color: #fff; font-size: 13px; }
.cp-bal { text-align: right; }
.cp-bal b { display: block; font-size: 46px; line-height: 1.1; font-weight: 700; color: var(--brand-color); }
.cp-bal span { display: block; color: #fff; font-weight: 600; }
.cp-bal em { display: block; margin-top: 2px; font-style: normal; color: var(--bo-on-night-2); font-size: 12.5px; }
.cp-tabs { width: 100%; margin-bottom: 18px; }
.cp-tabs > a { flex: 1; }
.cp-list { display: grid; gap: 14px; }
.cp-card { border-radius: 18px; overflow: hidden; color: #fff; }
.coupon-content { padding: 18px; }
.cp-card-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid rgba(255, 255, 255, .2); }
.cp-card-head small { display: block; color: rgba(255, 255, 255, .7); font-size: 12.5px; }
.cp-card-head b { display: block; font-size: 19px; letter-spacing: .02em; }
.cp-card-head span { display: block; color: rgba(255, 255, 255, .8); font-size: 13.5px; }
.cp-left { flex: none; align-self: flex-start; white-space: nowrap; padding: 4px 10px; border-radius: 9px; background: var(--brand-color); color: var(--brand-ink); font-weight: 600; }
.cp-left b { font-size: 18px; }
.cp-left.is-empty { background: rgba(0, 0, 0, .5); color: rgba(255, 255, 255, .75); }
.cp-stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px 8px; justify-items: center; }
.cp-stamp-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cp-stamp-wrap > span { padding: 1px 6px; border-radius: 5px; background: rgba(0, 0, 0, .45); font-size: 10.5px; font-weight: 600; }
.stamp-used { color: #f87171; }
.cp-ref { font-size: 12px; font-weight: 700; }
.cp-history { padding: 16px; border: 1px solid var(--bo-line); border-radius: 16px; background: var(--bo-surface); }
.cp-h-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cp-h-top small { margin-left: auto; color: var(--bo-muted); font-size: 13px; }
.cp-h-vs { margin: 10px 0; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.cp-h-vs span { margin: 0 4px; color: var(--bo-muted); font-weight: 400; }
.cp-h-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--bo-line); }
.cp-h-foot small { display: block; color: var(--bo-muted); font-size: 12.5px; }
.cp-h-foot code { font-family: inherit; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.cp-h-n { flex: none; color: var(--bo-muted); }
.cp-h-n b { color: var(--bo-ink); font-size: 22px; }
@media (max-width: 639px) {
  .cp-id { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 16px; }
  .cp-bal { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; text-align: left; padding-top: 12px; border-top: 1px solid var(--bo-line-night); }
  .cp-bal b { font-size: 32px; }
  .cp-bal em { margin-left: auto; }
  .cp-stamps { gap: 12px 4px; }
}
.ck-note { margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--bo-surface); border: 1px solid var(--bo-line); color: var(--bo-muted); font-size: 14px; line-height: 1.7; }

.st-table .mc-av img { width: 44px; height: 44px; border-width: 2px; }
.st-table .mc-av img + img { margin-left: -14px; }
@media (max-width: 520px) { .st-table .mc-av img { width: 34px; height: 34px; } .st-table .mc-av img + img { margin-left: -12px; } }
.st-who b { overflow-wrap: break-word; word-break: normal; }
@media (max-width: 520px) { .st-table .mc-av img { width: 28px; height: 28px; } .st-table .mc-av img + img { margin-left: -10px; } .st-team { gap: 8px; } }

/* ปุ่มลอย: ไปแมตช์ปัจจุบัน */
.sc-jump { position: fixed; right: 16px; bottom: 24px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; background: var(--brand-color); color: var(--brand-ink); font: 600 15px/1 var(--bo-font); cursor: pointer; box-shadow: 0 10px 28px -6px #0008, 0 0 0 1px #0002; transition: transform .15s, filter .15s; }
.sc-jump:hover { filter: brightness(.94); }
.sc-jump:active { transform: scale(.96); }
.sc-jump-toast { position: fixed; left: 50%; bottom: 84px; z-index: 41; max-width: min(92vw, 420px); padding: 11px 16px; border-radius: 12px; background: var(--bo-night); color: #fff; font-size: 14px; line-height: 1.5; text-align: center; box-shadow: 0 10px 30px -8px #000a; opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.sc-jump-toast.on { opacity: 1; transform: translate(-50%, 0); }
.mc.sc-flash { animation: sc-flash 1.1s ease-out 2; }
@keyframes sc-flash { 0% { box-shadow: 0 0 0 0 var(--brand-color); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (max-width: 1023px) { .sc-jump { bottom: calc(76px + env(safe-area-inset-bottom)); } .sc-jump-toast { bottom: calc(136px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .mc.sc-flash { animation: none; outline: 3px solid var(--brand-color); } }
.sc-live { scroll-margin-top: 76px; }
