/* Checkrace App — light premium theme (โครงตาม checkrace-app-demo, ขัดเงาระดับแอปพรีเมียม)
   แดง gradient + การ์ดขาวมนใหญ่ + เงาหลายชั้น + soft-tint ต่อฟีเจอร์ (ม่วง=รูปภาพ, เขียว=สำเร็จ, เหลือง=แต้ม, ฟ้า=VR) */
:root {
  --primary: #E8402D; --primary-deep: #C22D1E; --primary-soft: #FDECE8; --primary-soft-2: #FBD9D1;
  --pgrad: linear-gradient(135deg, #FF6A3D, #E63324 60%, #D02A1E);
  --bg: #F5F6F8; --card: #FFFFFF;
  --text: #16171B; --text-2: #7E838C; --text-3: #AEB2B9; --line: #EEEFF2;
  --green: #22B364; --green-soft: #E4F6EC; --green-deep: #187F46; --ggrad: linear-gradient(135deg, #34C97B, #1E9E58);
  --amber: #F2A93B; --amber-soft: #FDF3DC; --amber-deep: #A96A0F; --agrad: linear-gradient(135deg, #FBBF24, #F59E0B);
  --purple: #7C4DEF; --purple-soft: #F1EBFE; --pugrad: linear-gradient(135deg, #8B5CF6, #6D28D9);
  --blue: #2F80ED; --blue-soft: #E8F1FD; --bgrad: linear-gradient(135deg, #38BDF8, #2563EB);
  --dark: #15161B; --dark-2: #222329; --dark-line: #33343C;
  --radius: 26px; --radius-sm: 18px;
  --shadow: 0 1px 2px rgba(22,23,27,.04), 0 8px 24px rgba(22,23,27,.07);
  --shadow-lg: 0 2px 6px rgba(22,23,27,.05), 0 18px 44px rgba(22,23,27,.13);
  --spring: cubic-bezier(.2,.8,.3,1);
  --font: 'Noto Sans Thai', 'LINE Seed Sans TH', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tabbar-h: calc(66px + env(safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: #E7E8EC;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
h1,h2,h3,h4 { margin: 0 0 .4em; line-height: 1.28; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.12rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .7em; }
.muted { color: var(--text-2); } .small { font-size: .86rem; } .tiny { font-size: .76rem; } .bold { font-weight: 700; }
.center { text-align: center; }
.svg { width: 1.3em; height: 1.3em; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
::selection { background: var(--primary-soft-2); }
:focus-visible { outline: 3px solid var(--primary-soft-2); outline-offset: 2px; border-radius: 8px; }

.app { max-width: 520px; margin: 0 auto; min-height: 100dvh; background: var(--bg); position: relative; }
.view { padding: 0 18px calc(var(--tabbar-h) + 28px); min-height: 72dvh; }
.view > * { animation: fadeUp .42s var(--spring) both; }
.view > *:nth-child(2) { animation-delay: .05s; } .view > *:nth-child(3) { animation-delay: .1s; }
.view > *:nth-child(4) { animation-delay: .15s; } .view > *:nth-child(5) { animation-delay: .2s; }
.view > *:nth-child(6) { animation-delay: .25s; }
.view > .ctabar { animation: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- page header ---------- */
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 0 14px; }
.page-h h1 { margin: 0; }
.hbtn { width: 48px; height: 48px; border: 0; border-radius: 17px; background: var(--card); box-shadow: var(--shadow);
  display: inline-grid; place-items: center; cursor: pointer; color: var(--text); position: relative; transition: transform .2s var(--spring); }
.hbtn:active { transform: scale(.9); }

/* ---------- home (premium red header) ---------- */
.home-hero { margin: 0 -18px; position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(160deg, #FF5B3A, #E63324 52%, #C4241B);
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px 92px; border-radius: 0 0 30px 30px; }
.home-hero::before { content: ''; position: absolute; right: -70px; top: -70px; width: 230px; height: 230px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.2), rgba(255,255,255,.05) 65%, transparent 70%); }
.home-hero::after { content: ''; position: absolute; left: -50px; bottom: -10px; width: 170px; height: 170px; border-radius: 50%;
  background: rgba(255,255,255,.07); }
.home-hero .row1 { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.home-hero .ava { width: 56px; height: 56px; border-radius: 50%; background: #fff; color: var(--primary);
  display: grid; place-items: center; font-weight: 900; font-size: 1.4rem; flex: none; box-shadow: 0 6px 18px rgba(120,20,10,.3); }
.home-hero .who { flex: 1; min-width: 0; }
.home-hero .who .hi { font-size: .84rem; opacity: .9; font-weight: 500; }
.home-hero .who b { font-size: 1.32rem; display: block; line-height: 1.25; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-hero .bell { width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.25); border-radius: 17px;
  background: rgba(255,255,255,.14); backdrop-filter: blur(8px); color: #fff; display: grid; place-items: center;
  cursor: pointer; transition: transform .2s var(--spring); }
.home-hero .bell:active { transform: scale(.9); }
.runner-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; max-width: 100%; position: relative; z-index: 1;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(8px);
  border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: .86rem; color: #fff; }
.runner-pill .svg { width: 1.05em; height: 1.05em; }
.runner-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* race countdown card */
.race-card { background: var(--card); border-radius: 28px; box-shadow: var(--shadow-lg);
  margin-top: -66px; position: relative; z-index: 2; overflow: hidden; border: 1px solid rgba(255,255,255,.6); }
.race-card .rc-body { padding: 20px 20px 16px; }
.race-card .rc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.race-card h2 { font-size: 1.22rem; margin: 0; }
.race-card .rc-sub { color: var(--text-2); font-size: .86rem; margin-top: 3px; }
.cd-row { display: flex; gap: 10px; margin-top: 16px; }
.cd-row div { flex: 1; background: var(--bg); border-radius: 17px; text-align: center; padding: 12px 2px 9px; }
.cd-row .n { font-size: 1.55rem; font-weight: 900; line-height: 1.15; font-variant-numeric: tabular-nums;
  background: var(--pgrad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cd-row .n.pulse { animation: pulseN .45s var(--spring); }
@keyframes pulseN { 40% { transform: scale(1.18); } }
.cd-row .l { font-size: .7rem; color: var(--text-2); font-weight: 700; }
.rc-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid var(--line); }
.rc-actions a { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 15px 4px;
  font-weight: 800; font-size: .9rem; color: var(--text); border-left: 1px solid var(--line); transition: background .15s; }
.rc-actions a:first-child { border-left: 0; }
.rc-actions a:active { background: var(--bg); }
.rc-actions .svg { color: var(--primary); width: 1.2em; height: 1.2em; }

/* quick actions — soft tint premium */
.qa-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0 4px; }
.qa-row a { text-align: center; color: var(--text); font-size: .8rem; font-weight: 700; }
.qa-row .qa-ic { width: 66px; height: 66px; max-width: 100%; margin: 0 auto 8px; border-radius: 23px;
  display: grid; place-items: center; transition: transform .2s var(--spring); box-shadow: 0 6px 16px rgba(22,23,27,.06); }
.qa-row a:active .qa-ic { transform: scale(.88); }
.qa-row .svg { width: 27px; height: 27px; }
.qa-red .qa-ic { background: var(--primary-soft); } .qa-red .svg { color: var(--primary); }
.qa-purple .qa-ic { background: var(--purple-soft); } .qa-purple .svg { color: var(--purple); }
.qa-blue .qa-ic { background: var(--blue-soft); } .qa-blue .svg { color: var(--blue); }
.qa-green .qa-ic { background: var(--green-soft); } .qa-green .svg { color: var(--green); }

/* feed "สำหรับคุณ" */
.feed-item { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 15px 16px; margin-bottom: 12px; color: var(--text); transition: transform .2s var(--spring); }
.feed-item:active { transform: scale(.975); }
.feed-ic { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; color: #fff; flex: none;
  box-shadow: 0 8px 18px rgba(22,23,27,.14); }
.feed-ic .svg { width: 24px; height: 24px; }
.feed-ic.green { background: var(--ggrad); } .feed-ic.purple { background: var(--pugrad); }
.feed-ic.amber { background: var(--agrad); } .feed-ic.red { background: var(--pgrad); } .feed-ic.blue { background: var(--bgrad); }
.feed-ic.dark { background: linear-gradient(135deg, #1C2530, #0B0F14); color: #B4FF3A; }
.feed-body { flex: 1; min-width: 0; }
.feed-body b { display: block; font-size: .97rem; line-height: 1.35; }
.feed-body span { color: var(--text-2); font-size: .8rem; }
.feed-item .arr { color: var(--text-3); }

.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 24px 2px 13px; }
.section-h h2 { margin: 0; font-size: 1.22rem; }
.section-h a, .section-h span { font-size: .84rem; font-weight: 800; color: var(--primary); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }

/* ---------- งานแนะนำ (แถบเลื่อนข้าง cover card) ---------- */
.hstrip { display: flex; gap: 14px; overflow-x: auto; margin: 0 -18px; padding: 4px 18px 12px;
  scrollbar-width: none; scroll-snap-type: x mandatory; }
.hstrip::-webkit-scrollbar { display: none; }
.hcard { flex: 0 0 246px; scroll-snap-align: start; background: var(--card); border-radius: 24px; overflow: hidden;
  box-shadow: var(--shadow); color: var(--text); transition: transform .2s var(--spring); }
.hcard:active { transform: scale(.97); }
.hc-cover { aspect-ratio: 16/9; position: relative; display: grid; place-items: center; color: #fff;
  font-weight: 800; font-size: .8rem; text-align: center; padding: 8px; text-transform: uppercase; }
.hc-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hc-cover .chip { position: absolute; top: 10px; left: 10px; z-index: 2; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.hc-body { padding: 12px 14px 13px; }
.hc-body h3 { font-size: .95rem; margin: 0 0 3px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hc-body .meta { color: var(--text-2); font-size: .78rem; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.hc-body .meta .price { color: var(--primary); font-weight: 800; font-size: .88rem; white-space: nowrap; }

/* ---------- event list (thumbnail ซ้าย) ---------- */
.evl { display: flex; gap: 14px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; margin-bottom: 13px; color: var(--text); transition: transform .2s var(--spring); }
.evl:active { transform: scale(.975); }
.evl .thumb { width: 98px; height: 98px; border-radius: 22px; overflow: hidden; flex: none; position: relative;
  display: grid; place-items: center; text-align: center; color: #fff; font-weight: 800; font-size: .7rem;
  line-height: 1.3; padding: 6px; text-transform: uppercase; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.evl .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.evl .evl-body { flex: 1; min-width: 0; }
.evl h3 { font-size: 1.02rem; margin: 1px 0 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.evl .meta { color: var(--text-2); font-size: .82rem; display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.evl .meta .svg { width: 1.05em; height: 1.05em; color: var(--text-3); }
.evl .foot { display: flex; align-items: center; gap: 9px; margin-top: 8px; flex-wrap: wrap; }
.evl .dists { color: var(--text-2); font-size: .84rem; font-weight: 800; }

.th-red { background: linear-gradient(135deg, #D3452F, #8E2418); }
.th-blue { background: linear-gradient(135deg, #4258E0, #2838A8); }
.th-green { background: linear-gradient(135deg, #1F9052, #135C33); }
.th-gold { background: linear-gradient(135deg, #C08422, #8A5D12); }
.th-purple { background: linear-gradient(135deg, #7442E8, #4A28A8); }
.th-teal { background: linear-gradient(135deg, #179682, #0E665E); }

/* ---------- chips / segmented ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4.5px 13px; border-radius: 999px;
  font-size: .76rem; font-weight: 800; background: var(--bg); color: var(--text-2); white-space: nowrap; }
.chip.ok { background: var(--green-soft); color: var(--green-deep); }
.chip.warn { background: var(--amber-soft); color: var(--amber-deep); }
.chip.err { background: var(--primary-soft); color: var(--primary-deep); }
.chip.info { background: var(--blue-soft); color: var(--blue); }
.chip.brand { background: var(--primary-soft); color: var(--primary-deep); }
.chip.purple { background: var(--purple-soft); color: var(--purple); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #EBECEF; border-radius: 20px; padding: 5px; margin-bottom: 14px; }
.seg button { border: 0; background: transparent; font-family: var(--font); font-weight: 800; font-size: .95rem;
  color: var(--text-2); padding: 12px 6px; border-radius: 16px; cursor: pointer; transition: color .2s; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 3px 10px rgba(22,23,27,.1); }
.chips-row { display: flex; gap: 9px; overflow-x: auto; padding: 2px 0 15px; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.chips-row button { border: 1px solid #E3E4E8; background: var(--card); color: var(--text); font-family: var(--font);
  font-weight: 700; font-size: .88rem; padding: 9.5px 19px; border-radius: 999px; white-space: nowrap; cursor: pointer;
  transition: transform .15s var(--spring); }
.chips-row button:active { transform: scale(.94); }
.chips-row button.on { background: var(--text); border-color: var(--text); color: #fff; box-shadow: 0 6px 14px rgba(22,23,27,.18); }

/* ---------- search ---------- */
.searchbar { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 19px;
  box-shadow: var(--shadow); padding: 13.5px 16px; margin-bottom: 14px; border: 1.5px solid transparent; transition: border-color .2s, box-shadow .2s; }
.searchbar:focus-within { border-color: var(--primary-soft-2); box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow); }
.searchbar input { border: 0; outline: 0; flex: 1; font-family: var(--font); font-size: .96rem; background: transparent; color: var(--text); }
.searchbar input::placeholder { color: var(--text-3); }
.searchbar .svg { color: var(--text-3); }

/* ---------- buttons / forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  font-family: var(--font); font-weight: 800; font-size: .96rem; padding: 14.5px 20px; cursor: pointer; text-align: center;
  transition: transform .2s var(--spring), box-shadow .2s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--pgrad); color: #fff; box-shadow: 0 10px 24px rgba(230,51,36,.32); }
.btn.soft { background: var(--primary-soft); color: var(--primary-deep); }
.btn.ghost { background: #EDEEF1; color: var(--text); }
.btn.block { display: flex; width: 100%; }
.btn.sm { padding: 9.5px 15px; font-size: .84rem; }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: .82rem; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select { width: 100%; border: 1.5px solid var(--line); border-radius: 17px; padding: 13.5px 15px;
  font-family: var(--font); font-size: 1rem; background: var(--card); color: var(--text); outline: none; transition: .15s; }
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 1.5rem !important; font-weight: 800; }

/* ---------- event detail ---------- */
.detail-cover { margin: 0 -18px 0; aspect-ratio: 16/10; background: linear-gradient(135deg, #D3452F, #7B1F14); overflow: hidden; position: relative; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.backbtn { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 16px; z-index: 6; width: 46px; height: 46px;
  border-radius: 17px; border: 0; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); color: var(--text);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-lg); transition: transform .2s var(--spring); }
.backbtn:active { transform: scale(.9); }
.backbtn.inline { position: static; margin: calc(16px + env(safe-area-inset-top, 0px)) 0 12px; }
.detail-head { background: var(--card); border-radius: 28px; box-shadow: var(--shadow-lg); padding: 20px; margin-top: -50px; position: relative; z-index: 4; }
.inforow { display: flex; gap: 11px; align-items: flex-start; padding: 7px 0; font-size: .92rem; color: var(--text-2); }
.inforow b { color: var(--text); font-weight: 800; }
.inforow .svg { color: var(--primary); margin-top: 3px; }
.countdown { display: flex; gap: 10px; margin-top: 13px; }
.countdown div { flex: 1; background: var(--bg); border-radius: 16px; text-align: center; padding: 11px 2px 8px; }
.countdown .n { font-size: 1.45rem; font-weight: 900; line-height: 1.2; background: var(--pgrad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.countdown .l { font-size: .68rem; color: var(--text-2); font-weight: 700; }
.ticket { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.ticket:last-child { border-bottom: 0; padding-bottom: 2px; }
.ticket .t-name { font-weight: 800; font-size: .96rem; }
.ticket .t-sub { color: var(--text-2); font-size: .78rem; }
.ticket .t-right { text-align: right; }
.ticket .price { color: var(--primary); font-weight: 800; }
.shirt-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.desc-html { font-size: .92rem; color: #3D4048; }
.desc-html img { border-radius: 14px; margin: 8px 0; }
.desc-html h3 { font-size: 1rem; margin-top: 14px; }
.desc-html table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.desc-html td, .desc-html th { border: 1px solid var(--line); padding: 5px 8px; }
.ctabar { position: fixed; bottom: calc(var(--tabbar-h) + 10px); left: 50%; transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 488px; padding: 12px 14px 12px 20px; background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.7); border-radius: 26px;
  display: flex; gap: 12px; align-items: center; z-index: 24; box-shadow: var(--shadow-lg); }
.ctabar .price-side { flex: 1; line-height: 1.25; }
.ctabar .price-side .price { color: var(--primary); font-weight: 900; font-size: 1.25rem; }
.ctabar .btn { flex: 1.3; }
.view.has-cta { padding-bottom: calc(var(--tabbar-h) + 104px); }

/* ---------- calendar ---------- */
.month-h { font-weight: 800; font-size: .95rem; color: var(--text-2); margin: 20px 2px 10px; display: flex; align-items: center; gap: 10px; }
.month-h::after { content: ''; flex: 1; height: 1px; background: #E0E1E5; }
.cal-item { display: flex; gap: 13px; background: var(--card); border-radius: 20px; box-shadow: var(--shadow);
  padding: 13px; margin-bottom: 10px; color: var(--text); align-items: center; transition: transform .2s var(--spring); }
.cal-item:active { transform: scale(.975); }
.cal-date { flex: 0 0 54px; text-align: center; background: var(--primary-soft); border-radius: 15px; padding: 8px 2px; }
.cal-date .d { font-size: 1.3rem; font-weight: 900; color: var(--primary); line-height: 1.15; }
.cal-date .m { font-size: .68rem; font-weight: 800; color: var(--primary-deep); }
.cal-body { flex: 1; min-width: 0; }
.cal-body h3 { font-size: .94rem; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-body .sub { color: var(--text-2); font-size: .78rem; }

/* ---------- ผลแข่ง ---------- */
.res-hero { background: var(--dark); border-radius: 28px; color: #fff; padding: 22px 20px; margin-bottom: 16px;
  position: relative; overflow: hidden; box-shadow: 0 20px 44px rgba(21,22,27,.35); }
.res-hero::after { content: ''; position: absolute; right: -50px; top: -30px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(232,64,45,.55), transparent 75%); pointer-events: none; }
.res-hero::before { content: ''; position: absolute; left: -40px; bottom: -60px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(124,77,239,.3), transparent 75%); pointer-events: none; }
.res-hero .rh-ev { color: rgba(255,255,255,.6); font-size: .82rem; }
.res-hero h2 { color: #fff; font-size: 1.25rem; margin: 2px 0 12px; }
.res-hero .rh-time { font-size: 3.2rem; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.res-hero .rh-sub { color: rgba(255,255,255,.65); font-size: .85rem; margin-top: 6px; }
.rh-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 18px; position: relative; z-index: 1; }
.rh-tiles div { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(4px);
  border-radius: 16px; text-align: center; padding: 11px 2px 9px; }
.rh-tiles .n { font-size: 1.08rem; font-weight: 900; color: #fff; }
.rh-tiles .l { font-size: .62rem; color: rgba(255,255,255,.55); font-weight: 700; }
.pill-actions { display: flex; gap: 10px; margin: 4px 0 8px; }
.pill-actions a, .pill-actions button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--primary-soft); color: var(--primary-deep); border: 0; border-radius: 999px; padding: 13.5px 8px;
  font-family: var(--font); font-weight: 800; font-size: .88rem; cursor: pointer; transition: transform .2s var(--spring); }
.pill-actions a:active, .pill-actions button:active { transform: scale(.95); }
.res-row { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.res-row:last-child { border-bottom: 0; }
.res-rank { flex: 0 0 42px; height: 38px; display: grid; place-items: center; font-weight: 900; color: var(--text-2);
  background: var(--bg); border-radius: 13px; font-size: .92rem; }
.res-rank.r1 { background: linear-gradient(135deg, #FFD84D, #FF9800); color: #3A2600; box-shadow: 0 4px 12px rgba(255,152,0,.35); }
.res-rank.r2 { background: linear-gradient(135deg, #ECEEF4, #A6AEBE); color: #232838; }
.res-rank.r3 { background: linear-gradient(135deg, #E8A06B, #B0603A); color: #2E1608; }
.res-name { flex: 1; min-width: 0; }
.res-name b { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-name span { font-size: .74rem; color: var(--text-2); }
.res-time { text-align: right; }
.res-time b { font-family: ui-monospace, Menlo, monospace; font-size: .96rem; }
.res-time span { display: block; font-size: .7rem; color: var(--text-2); }
.split-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .94rem; }
.split-row:last-child { border-bottom: 0; }
.split-row .sp-k { font-weight: 800; }
.split-row .sp-t { font-weight: 800; font-family: ui-monospace, Menlo, monospace; }

/* ---------- รูปภาพ (CheckFoto) ---------- */
.foto-banner { display: flex; align-items: center; gap: 15px; background: var(--pugrad); border-radius: 28px;
  color: #fff; padding: 21px 19px; margin-bottom: 14px; box-shadow: 0 14px 32px rgba(109,40,217,.32);
  position: relative; overflow: hidden; transition: transform .2s var(--spring); }
.foto-banner:active { transform: scale(.98); }
.foto-banner::after { content: ''; position: absolute; right: -46px; top: -46px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,.13); }
.foto-banner .fb-ic { width: 58px; height: 58px; border-radius: 19px; background: rgba(255,255,255,.18);
  backdrop-filter: blur(4px); display: grid; place-items: center; flex: none; }
.foto-banner .fb-ic .svg { width: 28px; height: 28px; }
.foto-banner b { font-size: 1.05rem; display: block; line-height: 1.35; }
.foto-banner span { opacity: .88; font-size: .82rem; }
.foto-banner .arr { color: rgba(255,255,255,.7); position: relative; z-index: 1; }

/* ---------- แต้ม RP + การแจ้งเตือน ---------- */
.pts-hero { background: linear-gradient(150deg, #FFC93C, #F2A93B 55%, #E08E12); border-radius: 28px; color: #fff;
  padding: 20px 19px; margin-bottom: 14px; position: relative; overflow: hidden; box-shadow: 0 16px 36px rgba(242,169,59,.4); }
.pts-hero::after { content: ''; position: absolute; right: -55px; top: -55px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.2); }
.pts-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.pts-top > .svg { width: 30px; height: 30px; }
.pts-top b { display: block; font-size: 1.05rem; line-height: 1.25; }
.pts-top span { font-size: .78rem; opacity: .92; }
.pts-top div { flex: 1; }
.pts-big { font-size: 3rem; font-weight: 900; line-height: 1.1; margin-top: 10px; position: relative; z-index: 1; text-shadow: 0 2px 10px rgba(140,90,0,.25); }
.pts-big span { font-size: 1.1rem; font-weight: 700; opacity: .9; }
.pts-exp { font-size: .82rem; opacity: .94; margin-top: 4px; position: relative; z-index: 1; }
.prog-track { height: 12px; border-radius: 8px; background: var(--bg); overflow: hidden; }
.prog-fill { height: 100%; border-radius: 8px; background: var(--agrad); transition: width .6s var(--spring); }
.how-row { display: flex; gap: 13px; align-items: flex-start; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.how-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.how-row > .svg { color: var(--amber); width: 22px; height: 22px; margin-top: 3px; }
.how-row b { display: block; font-size: .93rem; }
.how-row span { color: var(--text-2); font-size: .8rem; }
.rung { border: 1.5px solid transparent; }
.rung.on { border-color: var(--amber); box-shadow: 0 8px 24px rgba(242,169,59,.18); }
.rung-h { display: flex; align-items: center; gap: 9px; margin-bottom: 2px; }
.rung-h b { font-size: 1rem; }
.rung-gem .svg { width: 21px; height: 21px; }
.perks { margin: 8px 0 0; padding-left: 20px; color: var(--text-2); font-size: .86rem; }
.perks li { margin-bottom: 2px; }
/* สลับภาษา TH/EN */
.hlang { height: 48px; padding: 0 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 17px; background: rgba(255,255,255,.14);
  backdrop-filter: blur(8px); color: #fff; display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font-family: var(--font); font-weight: 800; font-size: .82rem; transition: transform .2s var(--spring); }
.hlang .svg { width: 1.15em; height: 1.15em; }
.hlang:active { transform: scale(.9); }
.lang-sw { display: inline-grid; grid-template-columns: 1fr 1fr; background: #EBECEF; border-radius: 14px; padding: 4px; flex: none; }
.lang-sw button { border: 0; background: transparent; font-family: var(--font); font-weight: 800; font-size: .84rem; color: var(--text-2);
  padding: 7px 14px; border-radius: 11px; cursor: pointer; }
.lang-sw button.on { background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(22,23,27,.1); }
.lang-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 18px; }
.lang-row > .svg { color: var(--primary); width: 20px; height: 20px; }
.lang-row b { flex: 1; font-size: .96rem; }

.nbadge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; border-radius: 10px; background: #fff;
  color: var(--primary); font-size: .68rem; font-weight: 900; display: grid; place-items: center; padding: 0 5px;
  box-shadow: 0 3px 8px rgba(120,20,10,.3); }
.home-hero .bell { position: relative; }
.notif.unread { border-left: 3px solid var(--primary); }
.notif .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex: none; }

/* ---------- ซ้อม (CheckGo + Strava) ---------- */
.go-card { background: linear-gradient(150deg, #12181F, #0B0F14 65%); border-radius: 28px; color: #E8EDF3;
  padding: 20px 19px; margin-bottom: 6px; position: relative; overflow: hidden; box-shadow: 0 16px 36px rgba(11,15,20,.35); }
.go-card::after { content: ''; position: absolute; right: -60px; top: -60px; width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(180,255,58,.22), transparent 75%); }
.go-card p { color: rgba(232,237,243,.72); font-size: .88rem; margin: 12px 0 14px; position: relative; z-index: 1; }
.go-top { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.go-ic { width: 52px; height: 52px; border-radius: 17px; background: rgba(180,255,58,.14); border: 1px solid rgba(180,255,58,.3);
  display: grid; place-items: center; color: #B4FF3A; flex: none; }
.go-ic .svg { width: 26px; height: 26px; }
.go-top b { font-size: 1.15rem; display: block; line-height: 1.2; }
.go-top span { color: #B4FF3A; font-size: .78rem; font-weight: 700; }
.go-ext { width: 42px; height: 42px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  display: grid; place-items: center; color: rgba(232,237,243,.8); }
.go-btn { background: #B4FF3A; color: #0B0F14; box-shadow: 0 10px 24px rgba(180,255,58,.25); position: relative; z-index: 1; }
.strava-row { display: flex; align-items: center; gap: 13px; }
.strava-badge { width: 50px; height: 50px; border-radius: 15px; background: #FC4C02; color: #fff; display: grid; place-items: center;
  font-weight: 900; font-size: 1.4rem; flex: none; box-shadow: 0 8px 18px rgba(252,76,2,.3); }
.strava-ava { width: 50px; height: 50px; border-radius: 15px; object-fit: cover; flex: none; }
.strava-btn { background: #FC4C02; color: #fff; box-shadow: 0 10px 24px rgba(252,76,2,.3); }

/* กราฟซ้อมรายสัปดาห์ */
.tw-tiles { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 9px; margin-bottom: 16px; }
.tw-tiles div { background: var(--bg); border-radius: 15px; text-align: center; padding: 11px 2px 8px; }
.tw-tiles .n { font-size: 1.4rem; font-weight: 900; line-height: 1.2; background: var(--pgrad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tw-tiles .l { font-size: .68rem; color: var(--text-2); font-weight: 700; }
.wk-chart { display: flex; align-items: flex-end; gap: 5px; height: 120px; padding-top: 16px; }
.wk-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.wk-km { font-size: .62rem; font-weight: 800; color: var(--text-2); margin-bottom: 3px; }
.wk-bar { width: 100%; max-width: 22px; border-radius: 7px 7px 3px 3px; background: var(--primary-soft-2); transition: height .5s var(--spring); }
.wk-bar.now { background: var(--pgrad); box-shadow: 0 6px 14px rgba(230,51,36,.3); }

/* embed CheckGo */
.embed-wrap { margin: 0 -18px; display: flex; flex-direction: column; height: calc(100dvh - var(--tabbar-h)); }
.embed-top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; }
.embed-top b { font-size: 1.02rem; }
.embed-wrap iframe { flex: 1; width: 100%; border: 0; border-radius: 24px 24px 0 0; background: #0B0F14; box-shadow: var(--shadow-lg); }

/* ---------- me / orders ---------- */
.me-head { background: var(--pgrad); border-radius: 28px; color: #fff; padding: 24px 20px; margin-bottom: 16px;
  display: flex; gap: 15px; align-items: center; position: relative; overflow: hidden; box-shadow: 0 14px 32px rgba(230,51,36,.3); }
.me-head::after { content: ''; position: absolute; right: -50px; top: -50px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.14); }
.me-head::before { content: ''; position: absolute; right: 40px; bottom: -70px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.09); }
.me-head .avatar-lg { width: 60px; height: 60px; border-radius: 50%; background: #fff; color: var(--primary);
  display: grid; place-items: center; font-size: 1.45rem; font-weight: 900; flex: none; box-shadow: 0 6px 18px rgba(120,20,10,.28); }
.me-head .who { min-width: 0; position: relative; z-index: 1; }
.me-head .who b { font-size: 1.12rem; display: block; }
.me-head .who span { opacity: .92; font-size: .8rem; word-break: break-all; display: block; }
.order-card { border: 1px solid var(--line); border-radius: 20px; padding: 14px 15px; margin-bottom: 10px; }
.order-card .o-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; margin-bottom: 4px; }
.order-card .o-top b { font-size: .94rem; }
.order-card .o-sub { color: var(--text-2); font-size: .78rem; }
.order-card .o-actions { display: flex; gap: 8px; margin-top: 10px; }
.menu-list a, .menu-list button { display: flex; width: 100%; align-items: center; gap: 13px; padding: 15px 4px; border: 0;
  background: none; border-bottom: 1px solid var(--line); font-family: var(--font); font-size: .96rem; font-weight: 700;
  color: var(--text); cursor: pointer; text-align: left; }
.menu-list a:last-child, .menu-list button:last-child { border-bottom: 0; }
.menu-list .svg { color: var(--primary); width: 20px; height: 20px; }
.menu-list .arr { margin-left: auto; color: var(--text-3); }

/* ---------- bottom tab bar (active pill) ---------- */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 25;
  background: rgba(255,255,255,.92); backdrop-filter: blur(18px); border-top: 1px solid rgba(22,23,27,.05);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; color: var(--text-3);
  font-size: .64rem; font-weight: 700; border-radius: 16px; transition: background .2s, color .2s, transform .2s var(--spring); }
.tabbar a:active { transform: scale(.92); }
.tabbar a .svg { width: 23px; height: 23px; }
.tabbar a.on { color: var(--primary); background: var(--primary-soft); font-weight: 800; }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--text-2); }
.empty .svg { width: 46px; height: 46px; color: #D8DADF; margin: 0 auto 12px; }
.skel { border-radius: var(--radius); background: linear-gradient(100deg, #EAEBEF 40%, #F7F8FA 50%, #EAEBEF 60%);
  background-size: 200% 100%; animation: sh 1.15s infinite; margin-bottom: 14px; }
@keyframes sh { to { background-position: -200% 0; } }
.toast { position: fixed; bottom: calc(var(--tabbar-h) + 12px); left: 50%; transform: translateX(-50%); background: rgba(30,31,36,.96);
  backdrop-filter: blur(8px); color: #fff; border-radius: 17px; padding: 13px 22px; font-size: .88rem; font-weight: 600; z-index: 60;
  box-shadow: var(--shadow-lg); max-width: 86vw; text-align: center; animation: pop .25s var(--spring); }
.toast.err { background: rgba(163,32,22,.96); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 14px) scale(.95); } }
.sheet-bg { position: fixed; inset: 0; background: rgba(15,16,20,.45); backdrop-filter: blur(3px); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; animation: dim .2s ease-out; }
@keyframes dim { from { opacity: 0; } }
.sheet { width: 100%; max-width: 520px; background: var(--bg); border-radius: 30px 30px 0 0;
  padding: 10px 18px calc(26px + env(safe-area-inset-bottom, 0px)); max-height: 88dvh; overflow-y: auto; animation: up .3s var(--spring); }
@keyframes up { from { transform: translateY(70px); opacity: .4; } }
.sheet .grab { width: 44px; height: 5px; border-radius: 5px; background: #D5D7DC; margin: 6px auto 16px; }
.notice { background: var(--blue-soft); color: #1D5EAF; border-radius: 18px; padding: 12px 15px; font-size: .86rem; margin-bottom: 12px; }
.notice.warn { background: var(--amber-soft); color: var(--amber-deep); }
.notice a { font-weight: 800; }

@media (min-width: 560px) { .app { box-shadow: 0 0 60px rgba(22,23,27,.2); } }
@media (prefers-reduced-motion: reduce) { *, .view > * { animation: none !important; transition: none !important; } }
