:root{
  --bg:#0f172a;
  --card:#ffffff;
  --text:#0b1220;
  --muted:#64748b;
  --primary:#0b6b3a;
  --secondary:#ffd54a;
  --accent:#e11d48;
  --pill:#eef2ff;
  --now:#fff7cc;
  --border:rgba(2,6,23,.08);
  --shadow:0 10px 30px rgba(2,6,23,.10);
  --radius:16px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans Thai", "Noto Sans Devanagari", sans-serif;
  color:var(--text);
  background: linear-gradient(180deg, rgba(11,107,58,.12), rgba(255,213,74,.12)) , #f6f7fb;
}
a{color:inherit}
.header{
  position:sticky; top:0; z-index:50;
  background:rgba(11,107,58,.94);
  backdrop-filter:saturate(160%) blur(10px);
  color:#fff;
  padding:14px 14px 10px;
  box-shadow:0 6px 20px rgba(2,6,23,.18);
}
.header-top{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  max-width:760px; margin:0 auto;
}
.brand{
  display:flex; flex-direction:column; gap:2px;
}
.brand .title{font-weight:800; letter-spacing:.2px; font-size:16px; line-height:1.2}
.brand .sub{opacity:.9; font-size:12px}
.lang{
  display:flex; gap:6px; align-items:center;
}
.lang button{
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.10);
  color:#fff;
  padding:8px 10px;
  border-radius:999px;
  font-weight:700;
  font-size:12px;
  cursor:pointer;
}
.lang button.active{background:#fff; color:var(--primary); border-color:#fff}
.clock{
  max-width:760px; margin:6px auto 0;
  font-size:12px; opacity:.9;
  display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap;
}
.container{max-width:760px; margin:0 auto; padding:14px}
.card{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  border:1px solid var(--border);
  overflow:hidden;
}
.card-pad{padding:14px}
.badge-live{
  display:inline-flex; align-items:center; gap:8px;
  font-weight:800;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(225,29,72,.10);
  color:var(--accent);
}
.dot{
  width:8px; height:8px; border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 0 rgba(225,29,72,.35);
  animation:pulse 1.6s infinite;
}
@keyframes pulse{
  0%{box-shadow:0 0 0 0 rgba(225,29,72,.35)}
  70%{box-shadow:0 0 0 10px rgba(225,29,72,0)}
  100%{box-shadow:0 0 0 0 rgba(225,29,72,0)}
}
.h2{
  margin:10px 0 4px;
  font-size:18px; font-weight:900; color:var(--primary);
}
.meta{color:var(--muted); font-size:13px}
.hr{height:1px; background:var(--border); margin:12px 0}
.tabs{
  display:flex; gap:8px; overflow-x:auto; padding:10px 2px;
  scrollbar-width:thin;
}
.tabs button{
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  padding:10px 12px;
  border-radius:999px;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
}
.tabs button.active{background:var(--primary); color:#fff; border-color:var(--primary)}
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:13px;
}
.table th{
  text-align:left;
  padding:12px 12px;
  background:#f1f5f9;
  font-size:12px;
  color:#334155;
  letter-spacing:.2px;
}
.table td{
  padding:12px;
  border-top:1px solid var(--border);
  vertical-align:top;
}
.time{
  width:92px;
  font-weight:900;
  color:var(--primary);
  white-space:nowrap;
}
.row-now{background:var(--now)}
.pill{
  display:inline-flex; align-items:center;
  font-size:11px;
  font-weight:900;
  border-radius:999px;
  padding:4px 8px;
  margin-right:6px;
  background:var(--pill);
  border:1px solid var(--border);
}
.pill.main{background:#fff7ed; color:#9a3412}
.pill.adult{background:#e0f2fe; color:#075985}
.pill.youth{background:#f3e8ff; color:#6b21a8}
.small{font-size:12px; color:var(--muted)}
.next-box{
  display:grid; gap:8px;
}
.next-item{
  padding:10px;
  border-radius:12px;
  background:#f8fafc;
  border:1px dashed rgba(2,6,23,.15);
}
.countdown{
  display:grid; grid-template-columns:repeat(3,1fr);
  gap:10px;
}
.count{
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px;
  text-align:center;
}
.count .n{font-size:20px; font-weight:1000; color:var(--primary)}
.count .l{font-size:12px; color:var(--muted); font-weight:800}
.footer-note{
  margin-top:10px;
  text-align:center;
  font-size:12px;
  color:rgba(2,6,23,.55);
}
.testbar{
  margin-top:10px;
  display:flex; gap:10px; flex-wrap:wrap;
  align-items:center;
}
.testbar input[type="time"]{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  font-weight:800;
}
.testbar label{font-weight:900; font-size:12px; color:rgba(255,255,255,.9)}
.testbar .hint{font-size:12px; opacity:.9}
.end{
  text-align:center;
  padding:28px 14px;
}
.end h1{margin:0 0 6px; font-size:22px; color:var(--primary)}
.end p{margin:0; color:var(--muted)}
.match-grid{display:grid; gap:10px; margin-top:12px}
.match-card{
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px;
}
.match-head{display:flex; justify-content:space-between; gap:8px; align-items:center}
.match-title{font-weight:1000; font-size:13px}
.match-sub{font-size:12px; color:var(--muted)}
.vs-line{display:flex; gap:10px; align-items:center; margin-top:8px; flex-wrap:wrap}
.team-pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  font-weight:900;
  font-size:12px;
}
.team-dot{width:12px; height:12px; border-radius:999px; border:1px solid rgba(2,6,23,.12)}
.vs{font-weight:1000; color:rgba(2,6,23,.55)}


/* schedule tools */
.schedule-tools{
  padding:10px 2px 0;
  display:flex;
  justify-content:flex-end;
}
.togglePast{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  font-weight:900;
  color:rgba(255,255,255,.92);
}
.togglePast input{
  width:18px;
  height:18px;
  accent-color: var(--secondary);
}
@media (max-width:520px){
  .schedule-tools{justify-content:flex-start}
}
