@font-face {
  font-family: "Noto Sans Thai";
  src: url("/fonts/noto-sans-thai-thai-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}

:root {
  --paper: #f9faf8;
  --ink: #132820;
  --muted: #506156;
  --rule: #b7bfb4;
  --gold: #ffd565;
  font-family: "Noto Sans Thai", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body, h1, h2, p, ul { margin: 0; }
[hidden] { display: none !important; }
.shell, .layout { width: min(calc(100% - clamp(1.75rem, 5vw, 6rem)), 92rem); margin-inline: auto; }
a, button { -webkit-tap-highlight-color: rgb(210 179 78 / .2); }
a:focus-visible, button:focus-visible {
  outline: 3px solid #14634c;
  outline-offset: 4px;
}
.masthead {
  color: #f7f8ed;
  background: #101e1b;
  border-top: 3px solid var(--gold);
}
.masthead-inner {
  min-height: 4.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand, .wordmark {
  display: inline-flex;
  align-items: center;
  font: italic 900 1.55rem/1 system-ui, sans-serif;
  letter-spacing: -.075em;
  white-space: nowrap;
}
.brand-icon {
  position: relative;
  display: inline-block;
  margin-right: .55rem;
  width: 2rem;
  height: 1.65rem;
  transform: skewX(-12deg);
  background: var(--gold);
  clip-path: polygon(0 0, 48% 0, 35% 100%, 0 100%, 15% 46%, 0 46%, 0 0, 61% 0, 100% 50%, 48% 100%, 61% 0);
}
.brand-tv {
  margin: -.04rem 0 0 .34rem;
  padding: .12rem .26rem .13rem .2rem;
  color: #17231c;
  background: var(--gold);
  font-size: .53em;
  font-weight: 900;
  letter-spacing: -.025em;
  transform: skew(-8deg);
}
#today { display: flex; align-items: center; gap: .7rem; font-weight: 520; font-size: .88rem; color: #e2e7dc; }
#today::before {
  content: "";
  width: .84rem;
  height: .78rem;
  box-sizing: border-box;
  border: 1.4px solid #d7dbc9;
  border-radius: .14rem;
  background: linear-gradient(to bottom, transparent 23%, #d7dbc9 23% 39%, transparent 39%);
}
.directory { padding-block: clamp(1.25rem, 2.2vw, 2rem) clamp(3rem, 6vw, 6rem); }
.program-heading { display: flex; align-items: center; gap: clamp(.75rem, 2.1vw, 2rem); margin-bottom: 1.25rem; }
h1 { font-size: clamp(1.65rem, 2.8vw, 2.65rem); line-height: 1.3; letter-spacing: -.034em; font-weight: 770; }
.program-rule { height: 1px; background: var(--rule); flex: 1; min-width: .3rem; }
#match-count { display: inline-flex; align-items: center; gap: .52rem; font-size: .97rem; font-weight: 700; white-space: nowrap; }
#match-count::before { content: ""; width: .48rem; height: .48rem; border-radius: 50%; background: #28724d; }
#match-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem .65rem;
  align-items: start;
}
#match-list > li { min-width: 0; }
.match-card {
  display: block;
  overflow: hidden;
  color: var(--ink);
  background: white;
  border: 1px solid #d7dcd7;
  border-radius: .45rem;
  text-decoration: none;
  transition: border-color .16s, box-shadow .16s;
}
.card-preview {
  display: block;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #244737;
}
.card-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 65% 55%;
}
.card-preview::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 35% 0 0;
  background: linear-gradient(transparent, rgb(7 16 13 / .54));
  pointer-events: none;
}
.card-badge, .card-teams, .card-play { position: absolute; z-index: 1; }
.card-badge {
  inset-block-start: .45rem;
  inset-inline-start: .45rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .18rem .42rem;
  border-radius: .22rem;
  background: #b92430;
  color: #fff;
  font-size: .7rem;
  font-weight: 670;
  line-height: 1.35;
}
.card-badge::before {
  content: "";
  width: .57rem;
  height: .58rem;
  background: linear-gradient(currentColor, currentColor) left bottom / 22% 46% no-repeat,
              linear-gradient(currentColor, currentColor) center bottom / 22% 74% no-repeat,
              linear-gradient(currentColor, currentColor) right bottom / 22% 100% no-repeat;
}
.card-teams {
  inset-inline-start: .48rem;
  inset-block-end: .45rem;
  display: flex;
  align-items: center;
  gap: .23rem;
}
.crest {
  display: grid;
  place-items: center;
  width: clamp(1.35rem, 1.9vw, 1.75rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fffff8;
  border: 1px solid #e0e4db;
}
.crest img { display: block; width: 76%; height: 76%; object-fit: contain; }
.crest-initial { color: #233b2e; background: #fae8a4; border-color: #ead691; font-size: .78rem; font-weight: 720; }
.card-play {
  inset-inline-end: .46rem;
  inset-block-end: .42rem;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / .72);
  color: #fff;
  background: rgb(15 24 23 / .6);
}
.card-play::after { content: ""; margin-left: .12rem; border-block: .24rem solid transparent; border-left: .36rem solid currentColor; }
.card-caption { display: grid; align-content: start; gap: .22rem; padding: .55rem .65rem; }
.card-title, .card-lineup {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-title { font-size: .96rem; font-weight: 640; line-height: 1.5; }
.card-lineup { color: var(--muted); font-size: .8rem; line-height: 1.45; }
@media (hover: hover) {
  .match-card:hover { box-shadow: 0 3px 12px rgb(14 34 25 / .13); border-color: #8c9e93; }
  .match-card:hover .card-play { background: var(--gold); color: #17251e; border-color: var(--gold); }
}
.match-card:active .card-play { background: var(--gold); color: var(--ink); }

#match-status:not(:empty), noscript p {
  padding: clamp(1.3rem, 4vw, 3rem);
  border-block: 1px solid var(--rule);
  background: #e9ecdf;
  font-size: 1.05rem;
  line-height: 1.5;
}
#retry {
  min-height: 2.85rem;
  margin-top: 1rem;
  padding: .6rem 1.25rem;
  border: 0;
  border-radius: .25rem;
  background: #193a2d;
  color: white;
  font: inherit;
  font-weight: 680;
  cursor: pointer;
}
#updated {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: .77rem;
}
#updated::before {
  content: "";
  width: .68rem;
  height: .68rem;
  margin-right: .1rem;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: linear-gradient(to right, currentColor, currentColor) 48% 28% / 1px 32% no-repeat,
              linear-gradient(to right, currentColor, currentColor) 67% 56% / 26% 1px no-repeat;
}

/* Missing-page template. */
.layout header { border-bottom: 1px solid var(--rule); padding-block: 1.45rem; }
.layout main { display: grid; align-items: center; min-height: 65vh; }
.message { max-width: 42rem; }
.message p { color: var(--muted); margin-block: 1rem; }
.message a { color: #1c513a; font-weight: 650; text-underline-offset: .2em; }

@media (min-width: 43rem) {
  #match-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .card-badge { inset-inline: auto .5rem; }
}
@media (min-width: 60rem) {
  #match-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 80rem) {
  #match-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 37.5rem) {
  .masthead-inner { min-height: 3.35rem; }
  .brand { font-size: 1.22rem; }
  .brand-icon { width: 1.55rem; height: 1.25rem; margin-right: .4rem; }
  #today { font-size: .77rem; gap: .4rem; }
  .directory { padding-top: 1.08rem; }
  .program-heading { gap: .7rem; margin-bottom: .85rem; }
  #match-count { font-size: .82rem; gap: .35rem; }
  .card-caption { padding: .35rem .45rem; }
  .card-title { font-size: .86rem; line-height: 1.48; }
  .card-badge { font-size: .64rem; padding: .12rem .34rem; }
  .card-play { width: 1.25rem; height: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .match-card { transition: none; }
}
