@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Rowdies:wght@300;400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');


@font-face {
  font-family: 'Unblocker';
  src: url(/tournament/asset/font/Unblocker.ttf) format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* --- Global Variables (Components สี bg กลาง) --- */
:root {
  --bg-official: linear-gradient(100deg, #FFB92E 0%, #FFDD92 25%, #FFF2C8 40%, #FFD576 65%, #F0A305 100%);
  --color-official: #824C00;

  --bg-community: linear-gradient(135deg, #A8DDFF 0%, #85C4F7 25%, #AEDDFF 40%, #72B5F0 65%, #60A5E6 100%);
  --color-community: #20418A;

  --bg-community: linear-gradient(120deg, #E6E6E6 0%, #D8D8D8 25%, #f2f2f2 40%, #D4D4D4 65%, #C2C2C2 100%);
  --color-community: #686868;

  --color-gray: #7F7F7F;
  --color-brown: #824C00;
}

@keyframes shinySurfaceLoop {
  0% {
    background-position: 250% 50%, 0 0;
  }

  100% {
    background-position: -150% 50%, 0 0;
  }
}


/* Base Body Styles */
body {
  font-family: 'Noto Sans Thai', sans-serif;
  background-color: #fff;
  color: #333;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

section {
  padding: 20px 0;
}


:not(.btn-check)+.btn:active {
  border-color: transparent;
}

/* color */
.text-gray {
  color: var(--color-gray);
}

.text-brown {
  color: var(--color-brown);
}

/* main btn */
.btn-main {
  background: linear-gradient(203deg, #7E94FF 2.08%, #2DABFF 32.84%, #2CC1FF 88.54%);
  border: solid 3px #1a8cff;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
  color: #fff;
  height: 50px;
  font-size: 22px;
}

.btn-main:hover:hover {
  border: solid 3px #44a2ff;
  filter: brightness(1.1);
  color: #fff;
}

.btn-main::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 100%;
  background: url(/tournament/asset/images/btn-main-pattern.webp) no-repeat center right;
  background-size: 250px;
  mix-blend-mode: overlay;
}

.btn-main::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  aspect-ratio: 1/1;
  background: url(/tournament/asset/images/btn-main-folds.webp) no-repeat center right;
  background-size: cover;
  mix-blend-mode: overlay;
}


/* badge-type */
.badge-type {
  position: relative;
  font-size: .6em;
  padding: 1px 10px;
  border-radius: 12px;
  font-weight: 400;
  min-width: 100px;
}

.badge-type.official {
  background: var(--bg-official);
  color: var(--color-official);
}

.badge-type.official::before {
  content: "Official";
}

.badge-type.community {
  background: var(--bg-community);
  color: var(--color-community);
}

.badge-type.community::before {
  content: "Community";
}

.badge-type.community {
  background: var(--bg-community);
  color: var(--color-community);
}

.badge-type.community::before {
  content: "Community";
}


/* Hero Section */
.tournament-hero {
  position: relative;
  min-height: 300px;
  width: 100%;
  background: url(/tournament/asset/images/main-tournament-cover.webp);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  padding-top: 30px;
}

.tournament-hero::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: linear-gradient(0deg, #FFF 0%, rgba(255, 255, 255, 0.58) 16.35%, rgba(255, 255, 255, 0.00) 37%);
}

.tournament-title {
  font-weight: 700;
  color: #ffffff;
  font-size: 40px;
  line-height: 1em;
  overflow: hidden;
  color: var(--Color-5, #FFF);
  text-overflow: ellipsis;
  text-shadow: 0 0px 10px #36A5FC;
  font-family: Unblocker;
  font-style: normal;
  font-weight: 400;
  text-align: center;
}

.tournament-subtitle {
  font-size: 17px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  text-shadow: 0 0px 10px #00589b;
}

@media (min-width: 768px) {
  .tournament-hero {
    background: url(/tournament/asset/images/main-tournament-cover-md.webp);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 330px;
  }

  .tournament-title {
    font-size: 50px;
  }

  .tournament-subtitle {
    font-size: 25px;
  }
}

@media (min-width: 992px) {
  .tournament-title {
    font-size: 70px;
  }
}

@media (min-width: 1200px) {
  .tournament-hero {
    background: url(/tournament/asset/images/main-tournament-cover-lg.webp);
    background-size: 1920px;
    background-position: center;
    background-repeat: no-repeat;
    height: 420px;
    padding-top: 70px;
    line-height: 2.5em;
    position: relative;
    width: 100%;
    margin: 0 auto;
    max-width: 1920px;
  }

  .tournament-title {
    text-align: left;
    font-size: 70px;

  }

  .tournament-subtitle {
    text-align: left;
    font-size: 32px;
  }
}

@media (min-width: 1921px) {
  .tournament-hero {
    background: url(/tournament/asset/images/main-tournament-cover-xl.webp);
    background-size: 1920px;
    background-position: center;
    background-repeat: no-repeat;
  }
}




/* Main Category Section */
.tournament-main {
  padding-bottom: 100px;
}


.community-tournaments {
  background-color: #f3f3f3;
}

.community-tournaments {
  background-color: #EFEFEF;
}

.category-title {
  font-weight: 500;
  font-size: 1.8rem;
  color: #000;
  margin-bottom: 0px;
}

.category-subtitle {
  font-size: 1.1rem;
  color: #777;
  font-weight: 400;
}

/* Cards & Hover Effects */
.tournament-card {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  position: relative;
}

.tournament-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 15px 30px rgba(21, 122, 255, 0.15);
  border-color: #55aaff;
  box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.15);
}

.card-footer-info {
  padding: 10px 20px;
  border-radius: var(--0, 0) var(--0, 0) var(--16, 16px) var(--16, 16px);
  position: relative;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
}

.card-footer-info .tournament-date {
  font-size: 1.3em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.card-footer-info .tournament-date::before {
  content: "เริ่มการแข่งขัน";
  color: #777777;
  font-size: .8em;
}


.tournament-card .badge-type {
  padding: 2px 14px;
  min-width: 35%;
  text-align: center;
  border-radius: 50px;
  font-size: 0.75rem;
  position: absolute;
  right: 50%;
  transform: translateX(50%);
  bottom: -15px;
  border-radius: 8px;
  padding: 3px .7em;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 10px;
  position: absolute;
  text-transform: uppercase;
}


/* tournament official */
.tournament-card.official {
  border-radius: var(--16, 16px);
  background: linear-gradient(180deg, #FFF 59.72%, #F8F0E4 100%);
}

.tournament-card.official .card-footer-info {
  border-radius: var(--0, 0) var(--0, 0) var(--16, 16px) var(--16, 16px);
  background: #F8F0E4;
  color: #824C00;
}

.tournament-card.official .badge-type {
  color: #6a4404;
  box-shadow: 0 2px 4px rgba(241, 179, 67, 0.4);
  border: var(--2, 2px) solid #FDD491;
  background: var(--bg-official);
}

.tournament-card.official .badge-type::before {
  content: "Official";
}



/* tournament community */
.tournament-card.community {
  border-radius: var(--16, 16px);
  background: linear-gradient(180deg, #FFF 59.72%, #E4F6F8 100%), #FFF;
}

.tournament-card.community .card-footer-info {
  border-radius: var(--0, 0) var(--0, 0) var(--16, 16px) var(--16, 16px);
  background: #E2F5F7;
  color: #4D9CC1;
}

.tournament-card.community .badge-type {
  border: var(--2, 2px) solid rgba(255, 255, 255, 0.70);
  background: var(--bg-community);
  color: #73726F;
}

.tournament-card.community .badge-type::before {
  content: "Community";
}




.card-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  /* 16:9 Aspect Ratio */
  background-color: #f0f0f0;
  /* fallback */
}

.card-img-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  border-radius: 16px 16px 0 0;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  border-radius: 0 0 16px 16px;
  padding: 22px 20px 15px 20px;

}

.tournament-card.official .card-body {
  border-top: 3px solid #FDDB8F;
}

.tournament-card.community .card-body {
  border-top: 3px solid #B7CBDA;
}

.card-title {
  font-size: 1.15rem;
  margin-bottom: 4px;
  color: #111;
  font-weight: 600;
  line-height: 1.2;
}

.card-text {
  font-size: 0.85rem;
  color: #777;
  line-height: 1.4;
  margin-bottom: 0;
  flex-grow: 1;
}

.card-title-link {
  text-decoration: none;
  color: inherit;
}

.card-title-link::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
}

.card-title-link:hover .card-title {
  color: #1a8cff;
  text-decoration: none;
}

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Badges (Top Left of image) */
.tournament-card .badge-status {
  position: absolute;
  top: 15px;
  left: -14px;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 400;
  color: #fff;
  z-index: 2;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
}

.tournament-card .badge-status.status-open {
  background-color: #46BE51;
}

.tournament-card .badge-status.status-open::before {
  content: "เปิดรับสมัคร";
}

.tournament-card .badge-status.status-live {
  border: 2px solid #FF80B4;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0) 70%), #FF006A;
  background-blend-mode: plus-lighter, normal;
  background-size: 300% 100%, 100% 100%;
  animation: shinySurfaceLoop 7s linear infinite;
}

.tournament-card .badge-status.status-live::before {
  content: "กำลังแข่งขัน";
}

.tournament-card .badge-status.status-upcoming {
  background-color: #FF994C;
}

.tournament-card .badge-status.status-upcoming::before {
  content: "เตรียมการแข่ง";
}

.tournament-card .badge-status.status-ended {
  background-color: #A8A8A8;
}

.tournament-card .badge-status.status-ended::before {
  content: "สิ้นสุดการแข่ง";
}








/* Load More on Scroll */
.card-fade-in {
  animation: cardFadeIn 0.5s ease forwards;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.load-more-spinner {
  display: flex;
  justify-content: center;
  padding: 30px 0;
}

/* Animation */
.tournament-tab-content {
  animation: fadeIn 0.4s ease-in-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-logo {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.read-more {
  color: #1a8cff;
  text-decoration: none;
  font-weight: 500;
}

.read-more:hover {
  text-decoration: underline;
}



@media (min-width: 1440px) {
  .container {
    max-width: 1440px !important;
  }
}