/* =========================================================
   1. 全域現代科技極簡風格設定 (全站通用)
   ========================================================= */
:root {
  --primary-cyan: #00f2fe;
  --accent-blue: #0072ff;
  --neon-pink: #ff007f;
  --bg-dark: #070a12;
  --panel-bg: rgba(10, 16, 30, 0.7);
  --panel-border: rgba(0, 242, 254, 0.25);
  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-dark);
  font-family: var(--font-family);
  color: #fff;
  overflow-x: hidden;
}

/* 專屬背景與網格遮罩（鎖定 100lvh 並移除 fixed，避免手機網址列收合時背景忽大忽小） */
#custom-bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100lvh;
  min-height: 100vh;
  background: radial-gradient(circle at center, #0f172a 0%, #05070f 100%);
  z-index: 0;
  transform: translateZ(0);
  pointer-events: none;
}

/* 電腦版首頁背景 (16:9) */
#custom-bg-layer.home-bg {
  background-color: #05070f;
  background-image:
    linear-gradient(rgba(7, 10, 18, 0.5), rgba(5, 7, 15, 0.6)),
    url('images/hero-bg-pc.jpg');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.5;
}

.tech-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100lvh;
  min-height: 100vh;
  background: 
    radial-gradient(circle at 50% 50%, transparent 30%, #05070f 90%),
    linear-gradient(rgba(0, 242, 254, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 242, 254, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  z-index: 1;
  pointer-events: none;
}

/* =========================================================
   梅花 & 櫻花粒子 Canvas 畫布
   ========================================================= */
#petal-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100lvh;
  min-height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* =========================================================
   2. 頂部 Header & 導覽列
   ========================================================= */
.top-bar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 60px);
  max-width: 1200px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-group img {
  height: 38px;
  border-radius: 8px;
  filter: drop-shadow(0 0 10px var(--primary-cyan));
}

.brand-group h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #fff, var(--primary-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.top-nav-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 16, 30, 0.6);
  padding: 6px 12px;
  border-radius: 30px;
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
}

.nav-btn {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover {
  color: #fff;
  background: rgba(0, 242, 254, 0.15);
}

.nav-btn.active {
  color: #fff;
  background: linear-gradient(90deg, var(--accent-blue), var(--primary-cyan));
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

/* =========================================================
   3. 主內容通用容器 & HUD 卡片
   ========================================================= */
main.main-container {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 20px 60px 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  word-break: keep-all;
}

.page-title i {
  color: var(--primary-cyan);
}

.hud-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 30px;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

.hud-title {
  font-size: 1.3rem;
  color: #fff;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.hud-title i {
  color: var(--primary-cyan);
}

/* =========================================================
   4. index.html 專屬元件 (Hero 雙欄 + 吉祥物 + Terminal)
   ========================================================= */
.hero-panel {
  padding: 50px 60px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.hero-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
}

.hero-text-side {
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 15px;
}

.hero-panel h2 {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #fff, var(--primary-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 20px;
  font-weight: 600;
}

/* 科技感 Terminal 打字框 */
.tech-terminal {
  width: 100%;
  max-width: 500px;
  background: rgba(5, 10, 20, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 25px;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
}

.terminal-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
  font-size: 0.75rem;
  color: #64748b;
  font-family: monospace;
  margin-left: 6px;
}

.terminal-body {
  padding: 12px 16px;
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 0.92rem;
  color: var(--primary-cyan);
  min-height: 48px;
  display: flex;
  align-items: center;
}

.terminal-body .prompt {
  color: #ff007f;
  margin-right: 8px;
  font-weight: bold;
}

.terminal-body .cursor {
  display: inline-block;
  color: var(--primary-cyan);
  animation: blink 0.8s infinite;
  margin-left: 2px;
  font-weight: bold;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(90deg, var(--accent-blue), var(--primary-cyan));
  border-radius: 30px;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
  transition: all 0.3s ease;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.7);
}

/* 右側吉祥物（改用獨立徑向背光層，避免 GIF 矩形播放邊框切斷光暈） */
.hero-mascot-side {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: visible;
}

.mascot-wrapper {
  position: relative;
  max-width: 280px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.mascot-wrapper::before {
  content: "";
  position: absolute;
  inset: -36px;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(0, 242, 254, 0.28) 0%,
    rgba(0, 114, 255, 0.12) 45%,
    rgba(0, 242, 254, 0) 72%
  );
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.mascot-img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.announcement-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.announcement-item {
  background: rgba(0, 242, 254, 0.05);
  border-left: 4px solid var(--primary-cyan);
  border-radius: 8px;
  padding: 14px 18px;
}

.announcement-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.announcement-date {
  font-size: 0.8rem;
  color: var(--primary-cyan);
  font-weight: 700;
  background: rgba(0, 242, 254, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.announcement-item h4 {
  font-size: 1rem;
  color: #fff;
}

.announcement-item p {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.game-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.game-tag {
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-tag i {
  color: var(--primary-cyan);
}

/* =========================================================
   5. server.html 專屬元件
   ========================================================= */
.connection-panel {
  background: rgba(0, 242, 254, 0.06);
  border: 1px solid var(--primary-cyan);
  border-left: 6px solid var(--primary-cyan);
  border-radius: 16px;
  padding: 22px;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
}

.connection-panel h3 {
  font-size: 1.1rem;
  color: var(--primary-cyan);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.connection-item strong {
  color: #fff;
}

.server-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 25px;
  display: flex;
  gap: 25px;
  align-items: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.server-card:hover {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.2);
}

.server-image {
  width: 320px;
  height: 180px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid var(--panel-border);
}

.server-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-info {
  flex: 1;
}

.server-info h3 {
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ip-badge {
  display: inline-block;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid var(--primary-cyan);
  color: var(--primary-cyan);
  padding: 4px 12px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.specs-box {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.6;
}

.specs-box strong {
  color: var(--primary-cyan);
}

/* =========================================================
   6. 頁尾與贊助廠商
   ========================================================= */
footer {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto 40px auto;
  padding: 0 20px;
}

.footer-panel {
  text-align: center;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 25px;
  backdrop-filter: blur(20px);
}

.sponsors {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.sponsor {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sponsor img {
  height: 36px;
  width: auto;
}

.sponsor a {
  color: var(--primary-cyan);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.sponsor a:hover {
  text-decoration: underline;
}

/* =========================================================
   7. 通用手機版完美適配 (RWD)
   ========================================================= */
@media (max-width: 992px) {
  /* 手機版專用直立背景 (9:21 自動等比例放大填滿並置中) */
  #custom-bg-layer.home-bg {
    background-image:
      linear-gradient(rgba(7, 10, 18, 0.45), rgba(5, 7, 15, 0.65)),
      url('images/hero-bg-mobile.jpg');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.55;
  }

  .top-bar {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    padding: 15px 15px 10px 15px;
    flex-direction: column;
    gap: 12px;
  }

  .brand-group h1 {
    font-size: 1.2rem;
  }

  .top-nav-menu {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 14px;
    -webkit-overflow-scrolling: touch;
  }

  .top-nav-menu::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
    flex-shrink: 0;
  }

  main.main-container {
    padding: 10px 15px 30px 15px;
    gap: 20px;
  }

  .page-title {
    font-size: 1.35rem;
    line-height: 1.4;
    word-break: keep-all;
  }

  .hero-panel {
    padding: 30px 15px;
    border-radius: 18px;
  }

  .hero-content-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 25px;
  }

  .hero-text-side {
    align-items: center;
    text-align: center;
    padding-left: 0;
  }

  .hero-panel h2 {
    font-size: 2.2rem;
  }

  .hero-sub {
    font-size: 1rem;
    margin-bottom: 15px;
  }

  .mascot-wrapper {
    max-width: 200px;
  }

  .hud-card {
    padding: 18px 15px;
    border-radius: 16px;
  }

  .hud-title {
    font-size: 1.15rem;
    margin-bottom: 14px;
  }

  .announcement-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .announcement-item h4 {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .connection-panel {
    padding: 16px;
    border-radius: 14px;
  }

  .connection-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .server-card {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border-radius: 16px;
    gap: 15px;
  }

  .server-image {
    width: 100%;
    height: 160px;
  }

  .server-info h3 {
    font-size: 1.2rem;
  }

  .ip-badge {
    font-size: 0.88rem;
    padding: 4px 10px;
    word-break: break-all;
  }

  .specs-box {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .game-grid {
    gap: 8px;
  }

  .game-tag {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  footer {
    padding: 0 15px;
    margin-bottom: 20px;
  }

  .footer-panel {
    padding: 20px 15px;
    border-radius: 16px;
  }

  .sponsors {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
  }

  .sponsor {
    width: 100%;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 242, 254, 0.1);
  }

  .sponsor img {
    height: 30px;
    max-width: 100px;
    object-fit: contain;
  }

  .sponsor a {
    font-size: 0.95rem;
  }
}