/* === GLOBAL RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", sans-serif;
  color: #333;
}

/* =========================================================
   DESKTOP VERSION
   ========================================================= */

/* === HEADER === */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #004cc7;
  color: white;
  transition: all 0.4s ease;
  z-index: 10;
}

header.blur {
  background: rgba(255, 255, 255, 0.6);
  color: #000;
  backdrop-filter: blur(15px) saturate(180%);
  -webkit-backdrop-filter: blur(15px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* === LOGO === */
.logo {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.logo-img {
  height: 34px;
  width: auto;
}

header.blur .logo-img {
  filter: brightness(0);
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: inherit;
}

/* === NAVIGATION === */
.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-buttons {
  display: flex;
  gap: 20px;
}

.nav-buttons button {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.3s ease, color 0.3s ease;
}

header:not(.blur) .nav-buttons button:hover {
  background: rgba(255, 255, 255, 0.2);
}

header.blur .nav-buttons button:hover {
  background: rgba(0, 0, 0, 0.1);
}

.mobile-icons {
  display: none;
  align-items: center;
  gap: 18px;
}

.bottom-nav {
  display: none;
}

/* === SPACER === */
.spacer {
  height: 70px;
  background-color: #004cc7;
}

/* === HERO GALLERY === */
.hero-gallery {
  touch-action: pan-y;
  overscroll-behavior-x: contain;
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  height: 75vh;
}

.hero-gallery .slides {
  position: absolute;
  inset: 0;
}

.hero-gallery .slides img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-gallery .slides img.loaded {
  opacity: 1;
}

.hero-gallery .slides img.active {
  opacity: 1;
  z-index: 2;
}

.hero-gallery .dots {
  position: absolute;
  bottom: 30px;
  display: flex;
  gap: 10px;
  z-index: 3;
}

.hero-gallery .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s ease;
}

.hero-gallery .dot.active {
  background: #007AFF;
}

/* =========================================================
   NEWS HEADER
   ========================================================= */
.news-header {
  background: #f9f9f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 5%;
  margin-top: 0;
  margin-bottom: -20px;
}

.news-header .news-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 40px;
  letter-spacing: 0.02em;
  color: #111;
  text-transform: uppercase;
  position: relative;
  padding-left: 16px;
}

.news-header .news-title::before {
  content: "|";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 900;
  color: #004cc7;
  font-size: 42px;
  line-height: 1;
}

/* =========================================================
   NEWS SECTION
   ========================================================= */
.news-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 60px;
  padding: 20px 5%;
  background: #f9f9f9;
  color: #111;
  flex-wrap: wrap;
}

.news-left {
  flex: 1;
  min-width: 300px;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  cursor: pointer;
}

.news-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #ddd;
}

.news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.news-image img:hover {
  transform: scale(1.05);
}

.news-img-anim {
  opacity: 0;
  transform: scale(1.1);
}

.news-img-anim.loaded {
  opacity: 1;
  transform: scale(1);
}

.news-article-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: #222;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-date {
  font-size: 13px;
  color: #777;
  margin-top: 4px;
}

.news-right {
  flex: 0.9;
  display: flex;
  flex-direction: column;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-item {
  display: flex;
  align-items: stretch;
  width: 100%;
  flex: 0 0 auto;
  gap: 0;
  background: transparent;
  transition: transform 0.2s ease, opacity 0.3s ease;
}

.news-item:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.news-item .thumb {
  flex: 1 1 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #ccc;
  border-radius: 8px;
}

.news-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-item .info {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 14px;
}

.news-item .item-title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-item .item-date {
  font-size: 12px;
  color: #777;
}

/* =========================================================
   EVENTS SECTION
   ========================================================= */
.events-section {
  position: relative;
  padding: 50px 5%;
  color: #fff;
  overflow: hidden;
  background-color: #111;
  background-image:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 39px,
      rgba(255,255,255,0.06) 39px,
      rgba(255,255,255,0.06) 40px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 39px,
      rgba(255,255,255,0.06) 39px,
      rgba(255,255,255,0.06) 40px
    ),
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 199px,
      rgba(255,255,255,0.12) 199px,
      rgba(255,255,255,0.12) 200px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 199px,
      rgba(255,255,255,0.12) 199px,
      rgba(255,255,255,0.12) 200px
    );
}

.events-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 40px;
  text-transform: uppercase;
  color: white;
  margin-bottom: 40px;
  text-align: left;
  position: relative;
  padding-left: 16px;
}

.events-title::before {
  content: "|";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 900;
  color: #004cc7;
  font-size: 1.05em;
}

.events-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 34px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  align-items: stretch;
}

.event-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-radius: 16px;
  background: transparent;
  min-width: 0;
}

.event-inner {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.1);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.event-inner:hover {
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.event-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #222;
}

.event-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.event-inner:hover .event-image img {
  transform: scale(1.08);
}

.event-info {
  flex: 1;
  background: #fff;
  color: #000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px 16px;
}

.event-tag {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #666;
}

.event-title {
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   RANKING SECTION
   ========================================================= */
.ranking-section {
  background: #ffffff;
  color: #111111;
  padding: 70px 5%;
}

.ranking-header {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 28px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.ranking-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 40px;
  text-transform: uppercase;
  color: #111111;
  position: relative;
  padding-left: 16px;
}

.ranking-title::before {
  content: "|";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 900;
  color: #004cc7;
  font-size: 42px;
}

.ranking-select {
  min-width: 170px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #dcdcdc;
  background: #ffffff;
  color: #111111;
  font-family: "Noto Sans TC", sans-serif;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.ranking-table-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.ranking-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #ffffff;
}

.ranking-table thead {
  background: #f6f6f6;
  color: #111111;
}

.ranking-table th,
.ranking-table td {
  padding: 16px 18px;
  text-align: center;
  border-bottom: 1px solid #eeeeee;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-table th {
  color: #555555;
  font-weight: 700;
}

.ranking-table td {
  color: #111111;
}

.ranking-table tr:last-child td {
  border-bottom: none;
}

.ranking-table tbody tr:nth-child(1) td {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.16), transparent);
  font-weight: 700;
}

.ranking-table tbody tr:nth-child(2) td {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.16), transparent);
}

.ranking-table tbody tr:nth-child(3) td {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.16), transparent);
}

.ranking-table tbody tr:hover {
  background: rgba(0, 76, 199, 0.04);
}

.ranking-table th:nth-child(1),
.ranking-table td:nth-child(1) {
  width: 8%;
}

.ranking-table th:nth-child(2),
.ranking-table td:nth-child(2) {
  width: 22%;
}

.ranking-table th:nth-child(3),
.ranking-table td:nth-child(3) {
  width: 25%;
}

.ranking-table th:nth-child(4),
.ranking-table td:nth-child(4) {
  width: 27%;
}

.ranking-table th:nth-child(5),
.ranking-table td:nth-child(5) {
  width: 18%;
}

.ranking-no {
  font-family: 'Archivo Black', sans-serif;
}

.ranking-time {
  font-weight: 800;
}

/* =========================================================
   FOOTER
   ========================================================= */
.play-footer {
  background: #004cc7;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 80px 0;
  gap: 40px;
  text-align: left;
}

.play-footer > *:not(:last-child) {
  border-bottom: 0.8px solid rgba(255, 255, 255, 0.25);
  padding-bottom: 20px;
}

.play-footer > * {
  width: 100%;
  padding: 0 60px;
  box-sizing: border-box;
}

.play-footer .footer-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.play-footer .footer-logo img {
  width: 180px;
  height: auto;
  opacity: 0.95;
}

.play-footer .footer-links {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
  text-align: left;
  margin: 0 auto;
}

.play-footer .footer-group h4 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.play-footer .footer-group a {
  display: block;
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 300;
  margin: 4px 0;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.play-footer .footer-group a:hover {
  opacity: 0.6;
}

.play-footer .social-icons {
  display: flex;
  gap: 14px;
  margin-top: 6px;
}

.play-footer .social-icons img {
  width: 22px;
  height: 22px;
  opacity: 0.85;
  filter: brightness(0) invert(1);
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.play-footer .social-icons img:hover {
  opacity: 1;
  transform: scale(1.1);
}

.play-footer .footer-copy {
  font-size: 13px;
  opacity: 0.8;
  text-align: left;
}

.play-footer .fia-logo {
  width: 120px;
  opacity: 0.9;
  filter: brightness(0) invert(1);
  margin-bottom: 20px;
}

/* =========================================================
   MOBILE VERSION
   ========================================================= */
@media (max-width: 768px) {

  body {
    padding-bottom: 60px;
  }

  header {
    padding: 0 14px;
  }

  .nav-right {
    display: none;
  }

  .mobile-icons {
    display: flex;
  }

  .hero-gallery {
    height: 80vw;
    background: #004cc7;
    overflow: hidden;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
  }

  .hero-gallery .slides img {
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
  }

  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 10;
  }

  .news-header {
    padding: 40px 5%;
    margin-top: 0;
  }

  .news-header .news-title {
    font-size: 30px;
  }

  .news-section {
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 0 20px 40px 20px;
  }

  .news-left {
    max-width: 100%;
  }

  .news-article-title {
    font-size: 16px;
  }

  .events-section {
    padding: 50px 20px;
  }

  .events-title {
    font-size: 30px;
  }

  .events-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 100%;
  }

  .event-inner {
    aspect-ratio: 1 / 1;
    border-radius: 18px;
  }

  .event-info {
    padding: 12px;
  }

  .event-tag {
    font-size: 12px;
  }

  .event-title {
    font-size: 18px;
  }

  .ranking-section {
    padding: 50px 20px;
  }

  .ranking-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
  }

  .ranking-title {
    font-size: 30px;
  }

  .ranking-title::before {
    font-size: 32px;
  }

  .ranking-select {
    width: 100%;
  }

  .ranking-table {
    min-width: 100%;
  }

  .ranking-table th,
  .ranking-table td {
    font-size: 13px;
    padding: 12px 10px;
  }
  
  .ranking-table th:nth-child(1),
  .ranking-table td:nth-child(1){
      width:12%;
  }
  
  .ranking-table th:nth-child(2),
  .ranking-table td:nth-child(2){
      width:28%;
  }
  
  .ranking-table th:nth-child(4),
  .ranking-table td:nth-child(4){
      width:28%;
  }
  
  .ranking-table th:nth-child(5),
  .ranking-table td:nth-child(5){
      width:32%;
  }
  
  .play-footer {
    padding: 60px 20px;
    gap: 30px;
  }

  .play-footer > * {
    width: 90%;
  }

  .play-footer .footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 40px;
    justify-items: start;
    text-align: left;
  }

  .play-footer .footer-group {
    width: 100%;
  }

  .play-footer .footer-logo,
  .play-footer .footer-copy {
    text-align: center;
    align-items: center;
  }
}