:root {
  --color-primary: #facc15;
  --color-ink: #0c0c0c;
  --color-white: #ffffff;
  --color-marquee-bg: #0f0f0f;
  --color-neutral-300: #b8b3a7;
  --color-hairline: #3a352d;
  --color-dark: #0f0f0f;
  --color-card-bg: #14151a;
  --gold-deep: #d4af37;
  --gold-light: #f5e6a8;
  --gradient-gold: linear-gradient(151.122deg, var(--gold-deep) 0%, var(--gold-light) 50%, var(--gold-deep) 100%);
  --gradient-gold-flat: linear-gradient(112.348deg, var(--gold-deep) 0%, var(--gold-light) 50%, var(--gold-deep) 100%);
  --gradient-button: linear-gradient(to right, #e7c975 0%, #cd9d37 100%);

  --font-sans: "Poppins", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-thai: "Noto Sans Thai", "Poppins", system-ui, sans-serif;

  --fs-body: 1rem;
  --space-4: 2.5rem;
  --maxw-page: 1920px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--color-ink);
  background-color: #fff7df;
}

img,
picture,
source {
  display: block;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero {
  width: 100%;
}

.hero__img {
  width: 100%;
  height: auto;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .hero__img {
    max-width: var(--maxw-page);
  }
}

.marquee {
  background-color: var(--color-marquee-bg);
  padding-block: var(--space-4);
  border-top: 1px solid var(--color-hairline);
  border-bottom: 1px solid var(--color-hairline);
}

.marquee__viewport {
  overflow: hidden;
}

.marquee__track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: marquee-scroll 50s linear infinite;
}

.marquee__group {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 0 0 auto;
}

.marquee__item {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  font-family: var(--font-thai);
  font-weight: 500;
  font-size: var(--fs-body);
  line-height: 24px;
  color: var(--color-neutral-300);
  white-space: nowrap;
}

.marquee__item::after {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-inline: 26px;
  background: url("assets/marquee-star.svg") center / contain no-repeat;
  transform: skewX(-0.67deg);
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track {
    animation: none;
  }
}

.prize {
  position: relative;
  isolation: isolate;
  background-color: var(--color-dark);
  overflow: hidden;
}

.prize::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("assets/PrizeSection-bg.png") center / cover no-repeat;
  opacity: 0.8;
}

.prize::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, var(--color-dark) 0%, rgba(15, 15, 15, 0) 54%);
}

.prize__inner {
  max-width: var(--maxw-page);
  margin-inline: auto;
  padding: clamp(3rem, 8vw, 9.4rem) clamp(1.25rem, 5vw, 4rem) clamp(2rem, 4vw, 2.7rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2rem, 3vw, 3rem);
}

.prize__title {
  margin: 0;
  text-align: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(1.75rem, 4.5vw, 3.5rem);
  line-height: 1.14;
  color: var(--color-white);
  text-wrap: balance;
}

.prize__title-accent {
  background-image: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.prize__podiums {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.prize__podium-img {
  width: 100%;
  height: auto;
  max-width: 300px;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .prize__podiums {
    display: block;
    position: relative;
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 1299 / 770;
    margin-inline: auto;
  }

  .prize__podium {
    position: absolute;
    margin: 0;
  }

  .prize__podium-img {
    width: 100%;
    height: auto;
    max-width: none;
    margin-inline: 0;
  }

  .prize__podium--1 {
    left: 25.558%;
    top: 0;
    width: 47.498%;
    z-index: 2;
  }

  .prize__podium--2 {
    left: 0;
    top: 10.895%;
    width: 41.108%;
    z-index: 1;
  }

  .prize__podium--3 {
    left: 58.968%;
    top: 11.155%;
    width: 41.032%;
    z-index: 1;
  }
}

@media (min-width: 1280px) {
  .prize__podiums {
    max-width: 1299px;
  }
}

.consolation {
  background-color: var(--color-dark);
  display: flex;
  justify-content: center;
  padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 5vw, 10rem);
}

.consolation__card {
  position: relative;
  width: 100%;
  max-width: 1600px;
  border: 1px solid var(--color-hairline);
  border-radius: 24px;
  background-color: var(--color-card-bg);
  background-image: url("assets/CertificateSection-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.consolation__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1.25rem, 5vw, 3rem);
}

.consolation__medal {
  height: 54px;
  width: auto;
}

.consolation__title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.1;
  background-image: var(--gradient-gold-flat);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.consolation__subtitle {
  margin: 0;
  font-family: var(--font-thai);
  font-weight: 600;
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  line-height: 1.33;
  color: var(--color-white);
}

.consolation__sub-line {
  display: block;
}

.consolation .gold {
  color: var(--color-primary);
}

.leaderboard {
  background-color: var(--color-dark);
  display: flex;
  justify-content: center;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 5vw, 8.75rem);
}

.leaderboard__inner {
  width: 100%;
  max-width: 1640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2rem, 3vw, 3rem);
}

.leaderboard__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 1058px;
  text-align: center;
  color: var(--color-white);
}

.leaderboard__title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(1.875rem, 4.5vw, 3.5rem);
  line-height: 1.14;
  text-wrap: balance;
}

.leaderboard__title-accent {
  background-image: linear-gradient(110.437deg, var(--gold-deep) 0%, var(--gold-light) 50%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.leaderboard__subtitle {
  margin: 0;
  font-family: var(--font-thai);
  font-weight: 400;
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.67;
  color: var(--color-white);
}

.leaderboard__tabs {
  display: inline-flex;
  gap: 11px;
  padding: 12px;
  background-color: #141414;
  border: 1px solid #343434;
  border-radius: 20px;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
}

.leaderboard__tab {
  margin: 0;
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px clamp(1.25rem, 5vw, 3rem);
  font-family: var(--font-thai);
  font-weight: 500;
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.5;
  background: transparent;
  color: var(--color-neutral-300);
  transition: color 0.2s ease;
}

.leaderboard__tab.is-active {
  background-image: linear-gradient(109.543deg, var(--gold-deep) 0%, var(--gold-light) 50%, var(--gold-deep) 100%);
  color: #141210;
}

.leaderboard__tab:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.leaderboard__panel {
  width: 100%;
}

.leaderboard__placeholder {
  text-align: center;
  color: var(--color-neutral-300);
  font-family: var(--font-thai);
  padding: 3rem 1rem;
}

.ldb-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ldb-table-wrap {
  min-width: 720px;
  max-width: 1360px;
  margin-inline: auto;
  border: 0.5px solid #343434;
  border-radius: 24px;
  overflow: hidden;
}

.ldb-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--font-sans);
}

.ldb-table th,
.ldb-table td {
  font-size: 1rem;
  line-height: 1.5;
  padding: clamp(0.875rem, 1.8vw, 1.5rem) clamp(0.5rem, 1vw, 1rem);
  word-break: break-word;
}

.ldb-table th:first-child,
.ldb-table td:first-child {
  padding-left: clamp(1.5rem, 4vw, 3rem);
}

.ldb-table th:last-child,
.ldb-table td:last-child {
  padding-right: clamp(1.5rem, 4vw, 3rem);
}

.ldb-table .is-center { text-align: center; }
.ldb-table .is-left { text-align: left; }
.ldb-table .is-right { text-align: right; }

.ldb-table thead tr {
  background-image: linear-gradient(149.63deg, var(--gold-deep) 0%, var(--gold-light) 50%, var(--gold-deep) 100%);
}

.ldb-table thead th {
  font-weight: 500;
  color: #141210;
  background: transparent;
  height: 68px;
  border: 0;
}

.ldb-table tbody td {
  font-weight: 500;
  color: var(--color-white);
  height: 68px;
  border: 0;
}

.ldb-table tbody tr:nth-child(even) td {
  background-color: rgba(51, 51, 51, 0.15);
}

.cta {
  background-color: var(--color-dark);
  display: flex;
  justify-content: center;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 5vw, 8.75rem);
}

.cta__card {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 1640px;
  border-radius: 24px;
  overflow: hidden;
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 4rem);
}

.cta__card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("assets/Cup-bg.png") center bottom / cover no-repeat;
}

.cta__card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.1) 45%);
}

.cta__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  max-width: 716px;
}

.cta__heading {
  margin: 0;
  font-family: var(--font-thai);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 2rem;
  color: var(--color-primary);
}

.cta__body {
  margin: 0;
  font-family: var(--font-thai);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--color-white);
}

.cta__body p {
  margin: 0;
}

.cta__body p + p {
  margin-top: 1.5rem;
}

.cta__button {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 100px;
  background-image: var(--gradient-button);
  color: #141210;
  font-family: var(--font-thai);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.625rem;
  text-decoration: none;
  filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.05));
  transition: filter 0.2s ease, transform 0.2s ease;
}

.cta__button:hover {
  transform: translateY(-2px);
  filter: brightness(1.06) drop-shadow(0 8px 16px rgba(205, 157, 55, 0.35));
}

.cta__button:active {
  transform: translateY(0);
  filter: brightness(0.98) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
}

.cta__button:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .cta__button {
    transition: filter 0.2s ease;
  }
  .cta__button:hover,
  .cta__button:active {
    transform: none;
  }
}

@media (max-width: 767px) {
  .cta__card::after {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.5) 100%);
  }
}
