/* === 全域基本設定 === */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0 3rem; /* 網頁整體左右邊距 */
  font-family: 'Segoe UI', '微軟正黑體', sans-serif;
  background-color: #0d0d0d;
  color: #f0f0f0;
  line-height: 1.6;
}

/* === 標題統一樣式 === */
h1, h2, h3 {
  color: #ff4d4d;
  text-shadow: 1px 1px 2px #000;
  text-align: center;
  margin: 0 0 3rem;
}

h3 {
  color: #ff4d4d;
  text-shadow: 1px 1px 2px #000;
  text-align: center;
  margin: 0 1rem 1rem;
  margin-bottom: 0;
}

h4 {
  color: #ff4d4d;
  text-shadow: 1px 1px 2px #000;
  text-align: center;
  margin: -2rem 1rem 2rem;
}

/* === 導覽列 === */
.navbar {
  background-color: #1a1a1a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}
.nav-logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: #f0f0f0;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}
.nav-links a:hover {
  color: #ff4d4d;
}

/* === Hero 區塊 === */
.hero {
  background: url('imgs/1081933.jpg') center/cover no-repeat;
  color: white;
  padding: 6rem 0;
}
.hero-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}
.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* === 通用段落容器（標題＋內容） === */
.section-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* === 區塊設定 === */
section {
  padding: 2rem 0;
  margin-bottom: 2rem;
  background-color: #1a1a1a;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(255, 77, 77, 0.1);
}

/* === 參賽隊伍卡片 === */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.team-card {
  background-color: #2b2b2b;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.team-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid #ff4d4d;
  background-color: #000;
  margin-bottom: 0.5rem;
}

.team-name {
  font-weight: bold;
  color: #f0f0f0;
  font-size: 0.95rem;
}

/* === 職員介紹卡片 === */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.staff-card {
  background-color: #2b2b2b;
  padding: 1.5rem 1rem;
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 250px; /* 拉長卡片 */
  justify-content: space-between;
}

.staff-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid #ff4d4d;
  background-color: #000;
  margin-bottom: 0.5rem;
}

.staff-name {
  font-weight: bold;
  color: #f0f0f0;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.staff-social {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  color: #fff;             /* 讓點過的 icon 顏色一樣 */
  background-color: #444;  /* 或用品牌色，如 #5865F2 */
}

.staff-social a {
  color: #ff4d4d;
  font-size: 1.2rem;
  transition: transform 0.2s;
  outline: none;
}

.staff-social a:hover {
  transform: scale(1.2);
}

.staff-social a.discord:visited {
  background-color: #5865F2;
  color: #fff;
}

.staff-social a.discord:visited {
  background-color: #5865F2;
  color: #fff;
}

/* === 贊助輪播 === */
.sponsor-carousel {
  position: relative;
  height: 500px;
}
.sponsor-carousel img {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 500px;
  object-fit: contain;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.sponsor-carousel img.active {
  opacity: 1;
  z-index: 1;
}

/* === YouTube 區塊 === */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(255, 77, 77, 0.2);
}
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* === 規章 === */
.tournament-rules ol {
    padding-left: 1.5em;
    margin: 0.5em 0;
}

.tournament-rules ul {
    padding-left: 1.5em;
    list-style-type: disc;
    margin: 0.3em 0;
}

.tournament-rules li {
    line-height: 1.6;
    margin-bottom: 4px 0;
}
.chinese-counter {
    list-style: none;
    padding-left: 1.5em;
    margin: 0.5em 0;
}

.chinese-counter .number {
    margin-right: 0.5em;
    font-weight: bold;
}



/* === 頁尾 === */
footer {
  text-align: center;
  padding: 1rem;
  background-color: #111;
  color: #888;
  font-size: 0.9rem;
}

/* === 響應式 === */
@media (max-width: 768px) {
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .team-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


.logo-img {
  height: 25px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffffff;
  line-height: 1; /* 加這行可避免文字被拉高 */
}

.hero-button {
  display: inline-block;
  margin-top: 0.01rem; /* 原本是 1.5rem，拉近一半 */
  padding: 0.75rem 2rem;
  color: #ff4d4d;
  font-weight: bold;
  text-decoration: none;
  border: 2px solid #ff4d4d;
  border-radius: 999px;
  background-color: transparent;
  transition: all 0.3s ease;
}

.hero-button:hover {
  background-color: rgba(255, 77, 77, 0.1);
  color: #fff;
  border-color: #fff;
}

.cookie-box {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  background-color: rgba(40, 40, 40, 0.95);
  color: #f0f0f0;
  padding: 1rem 1.25rem;
  border: 1px solid #ff4d4d;
  border-radius: 6px;
  font-size: 0.9rem;
  z-index: 9999;
  max-width: 280px;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cookie-box a {
  color: #ff4d4d;
  text-decoration: underline;
}

.cookie-close {
  background-color: transparent;
  border: 1px solid #ff4d4d;
  color: #ff4d4d;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  align-self: flex-end;
  transition: background-color 0.3s;
}

.cookie-close:hover {
  background-color: #ff4d4d;
  color: #fff;
}

.rules-button {
  display: inline-block;
  margin-top: 0.015rem; /* 原本是 1.5rem，拉近一半 */
  padding: 0.75rem 2rem;
  color: #ff4d4d;
  font-weight: bold;
  text-decoration: none;
  border: 2px solid #ff4d4d;
  border-radius: 999px;
  background-color: transparent;
  transition: all 0.3s ease;
}

.rules-button:hover {
  background-color: rgba(255, 77, 77, 0.1);
  color: #fff;
  border-color: #fff;
}

.announcement-bar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #ff4d4d;
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  z-index: 9999;
}

.announcement-bar::after {
  content: attr(data-text);
  position: absolute;
  width: 100%;
  height: 100%;
  left: 100%;
  top: 0;
  animation: scroll-left 15s linear infinite;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-200%);
  }
}

.scrolling-text {
  width: 100%;
  padding: 0.3rem 0;
  overflow: hidden;
  white-space: nowrap;
  z-index: 1; /* 不要蓋住 navbar */
  text-align: center;
}

.scrolling-text span {
  display: inline-block;
  padding-left: 100%;
  animation: scroll 20s linear infinite;
  color: #ff4d4d; /* 你想要的紅色文字 */
  font-weight: bold;
  text-shadow: 1px 1px 2px #000; /* 可選擇移除 */
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.announcement-section {
  padding: 2rem;
}
.announcement-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 一排最多三欄 */
  gap: 1.5rem;
}
.announcement-card {
  position: relative;
  background: #1e1e1e;
  color: #fff;
  padding: 1rem 1rem 3rem 1rem; /* 保留底部空間給按鈕 */
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  min-height: 200px;
  overflow: hidden;
}
.announcement-card h3 {
  margin-top: 0;
  font-size: 1.25rem;
}
.announcement-card .read-more-btn {
  background: #e63946;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  cursor: pointer;
}
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.6);
}
.modal-content {
  background-color: #f4f4f4;
  color: #000;
  margin: 10% auto;
  padding: 2rem;
  border-radius: 12px;
  max-width: 600px;
  position: relative;
}
.close-btn {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
}
#copy-link-btn {
  margin-top: 1rem;
  background-color: #333;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .announcement-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .announcement-grid {
    grid-template-columns: 1fr;
  }
}

.read-more-link {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: #e63946;
  color: #fff;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.3s ease;
}

.read-more-link:hover {
  background: #c92c3d;
}

.back-btn-wrapper {
  width: 100%;
  display: flex;
  justify-content: center; /* 水平置中 */
  margin-top: 2rem;
}

.back-to-news {
  background-color: #e63946;
  color: white;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.back-to-news:hover {
  background-color: #c92c3d;
}
