/* ==========================================
   單純ღ美好ᴴᴰ (DanChuen) - Free Fire 官方實況主專屬影音基地
   ========================================== */

:root {
  --ff-red: #ff0033;
  --ff-red-glow: rgba(255, 0, 51, 0.4);
  --ff-orange: #ff5500;
  --cyber-cyan: #00d2ff;
  --cyber-cyan-glow: rgba(0, 210, 255, 0.35);
  --gold-accent: #ffb703;
  --bg-dark: #060911;
  --card-bg: rgba(14, 19, 33, 0.8);
  --card-border: rgba(255, 255, 255, 0.09);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* 🌌 宇宙深空燃燒動態光暈 */
body::before {
  content: "";
  position: fixed;
  top: -15%;
  left: 10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(255, 0, 51, 0.12) 0%, rgba(255, 85, 0, 0.06) 40%, transparent 70%);
  filter: blur(100px);
  pointer-events: none;
  z-index: -2;
  animation: flameGlow 18s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  bottom: -20%;
  right: 10%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.1) 0%, rgba(255, 0, 51, 0.05) 50%, transparent 70%);
  filter: blur(100px);
  pointer-events: none;
  z-index: -2;
  animation: flameGlow 22s ease-in-out infinite alternate-reverse;
}

@keyframes flameGlow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -40px) scale(1.12); }
  100% { transform: translate(-40px, 50px) scale(0.95); }
}

/* 🌠 全域粒子拖尾畫布 */
#yt-particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
}

/* 🌌 主版面容器 */
.youtube-main {
  flex: 1;
  padding: 85px 20px 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ==========================================
   1. 實況主 Hero Profile 卡片
   ========================================== */
.streamer-hero-section {
  margin-bottom: 40px;
}

.streamer-card {
  --mouse-x: 50%;
  --mouse-y: 50%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 36px 32px;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 28px;
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out, border-color 0.3s ease, box-shadow 0.3s ease;
}

.streamer-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle 320px at var(--mouse-x) var(--mouse-y),
    rgba(255, 0, 51, 0.16),
    transparent 80%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}

.streamer-card:hover::before {
  opacity: 1;
}

.streamer-card:hover {
  border-color: rgba(255, 0, 51, 0.45);
  box-shadow: 0 25px 50px -15px var(--ff-red-glow);
}

.streamer-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.streamer-avatar-info {
  display: flex;
  align-items: center;
  gap: 22px;
}

/* 旋轉烈焰光環頭像 */
.streamer-avatar-box {
  position: relative;
  width: 95px;
  height: 95px;
  flex-shrink: 0;
}

.flame-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--ff-red), var(--ff-orange), var(--cyber-cyan), var(--ff-red));
  animation: spinFlame 5s linear infinite;
  filter: blur(4px);
  opacity: 0.9;
}

@keyframes spinFlame {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.streamer-avatar-img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #0d1322;
  border: 2px solid rgba(255, 255, 255, 0.9);
  z-index: 1;
}

.status-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: linear-gradient(135deg, #ff0033, #ff5500);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 12px;
  border: 2px solid #060911;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 0 12px rgba(255, 0, 51, 0.8);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulseDot 1.4s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.4; }
}

/* 實況主文字資訊 */
.streamer-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.streamer-title {
  margin: 0;
  font-size: 1.95rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, #ffffff 0%, #ff4d6d 40%, #ff9e00 80%, #00d2ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.verified-badge {
  width: 20px;
  height: 20px;
  background: var(--cyber-cyan);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #060911;
  font-size: 11px;
  font-weight: 900;
  -webkit-text-fill-color: initial;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.6);
}

.streamer-subtitle {
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.handle-highlight {
  color: var(--ff-red);
  font-weight: 700;
}

.streamer-bio {
  margin: 6px 0 0 0;
  color: #cbd5e1;
  font-size: 0.9rem;
  max-width: 620px;
  line-height: 1.6;
}

/* 官方社群與操作按鈕 */
.streamer-buttons-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-yt-sub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ff0033 0%, #d60029 100%);
  color: #fff;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 0 25px rgba(255, 0, 51, 0.45);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-yt-sub:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 35px rgba(255, 0, 51, 0.7);
  background: linear-gradient(135deg, #ff1a47 0%, #e6002e 100%);
}

.btn-yt-sub svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.btn-yt-join {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 183, 3, 0.12);
  border: 1px solid var(--gold-accent);
  color: var(--gold-accent);
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.btn-yt-join:hover {
  background: var(--gold-accent);
  color: #060911;
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(255, 183, 3, 0.5);
}

.btn-yt-dc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(88, 101, 242, 0.15);
  border: 1px solid #5865f2;
  color: #8fa0ff;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-yt-dc:hover {
  background: #5865f2;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(88, 101, 242, 0.5);
}

.btn-yt-ig {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(225, 48, 108, 0.15);
  border: 1px solid #e1306c;
  color: #ff70a6;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-yt-ig:hover {
  background: #e1306c;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(225, 48, 108, 0.5);
}

/* 遊戲 UID 與標籤列 */
.game-id-badge-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  flex-wrap: wrap;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.uid-box {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
}

.uid-number {
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid var(--cyber-cyan);
  color: var(--cyber-cyan);
  padding: 4px 12px;
  border-radius: 10px;
  font-family: monospace;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.btn-copy-uid {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-uid:hover {
  background: var(--cyber-cyan);
  border-color: var(--cyber-cyan);
  color: #060911;
}

.channel-tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.channel-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
}

/* ==========================================
   2. Google / YouTube API 即時動態影音區
   ========================================== */
.api-videos-section {
  margin-bottom: 50px;
}

.section-top-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-heading-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.api-live-tag {
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid var(--cyber-cyan);
  color: var(--cyber-cyan);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.api-pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--cyber-cyan);
  border-radius: 50%;
  animation: pulseDot 1.4s infinite ease-in-out;
}

/* 搜尋即時篩選框 */
.search-filter-box {
  position: relative;
  max-width: 320px;
  width: 100%;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 10px 16px 10px 38px;
  border-radius: 20px;
  font-size: 0.88rem;
  outline: none;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}

.search-input:focus {
  border-color: var(--ff-red);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(255, 0, 51, 0.35);
}

.search-icon-svg {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  fill: #94a3b8;
  pointer-events: none;
}

/* 動態影音網格 */
.dynamic-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* API 動態生成卡片樣式 */
.api-video-card {
  --mouse-x: 50%;
  --mouse-y: 50%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(14px);
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out, border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.4);
}

.api-video-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle 220px at var(--mouse-x) var(--mouse-y),
    rgba(255, 0, 51, 0.2),
    transparent 80%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.api-video-card:hover::before {
  opacity: 1;
}

.api-video-card:hover {
  border-color: var(--ff-red);
  box-shadow: 0 15px 35px -5px var(--ff-red-glow), 0 0 20px rgba(255, 0, 51, 0.25);
}

.api-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0d1222;
}

.api-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.api-video-card:hover .api-thumb-img {
  transform: scale(1.06);
}

.api-yt-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 0, 51, 0.85);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  z-index: 2;
  box-shadow: 0 0 10px rgba(255, 0, 51, 0.6);
}

.api-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.api-video-card:hover .api-play-overlay {
  opacity: 1;
}

.api-play-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ff-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 25px rgba(255, 0, 51, 0.85);
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.api-video-card:hover .api-play-icon {
  transform: scale(1);
}

.api-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  position: relative;
  z-index: 2;
}

.api-card-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.api-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: #64748b;
}

.api-card-date {
  color: #94a3b8;
}

.api-card-btn-text {
  color: var(--ff-red);
  font-weight: 700;
}

/* 骨架屏載入動畫 (Skeleton Loader) */
.skeleton-card {
  background: rgba(14, 19, 33, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  overflow: hidden;
  height: 280px;
  position: relative;
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.skeleton-text {
  height: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  margin: 16px 18px 8px 18px;
}

.skeleton-text.short {
  width: 60%;
  margin-top: 0;
}

.skeleton-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
  100% { left: 100%; }
}

/* ==========================================
   3. 官方頻道直達與生態圈
   ========================================== */
.official-hub-section {
  margin-bottom: 50px;
}

.hub-banner-box {
  background: linear-gradient(135deg, rgba(255, 0, 51, 0.15) 0%, rgba(0, 210, 255, 0.08) 100%);
  border: 1px solid rgba(255, 0, 51, 0.3);
  border-radius: 24px;
  padding: 32px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  backdrop-filter: blur(14px);
}

.hub-text-wrap h3 {
  margin: 0 0 6px 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.hub-text-wrap p {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.5;
}

.hub-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ff-red);
  color: #fff;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 0 25px rgba(255, 0, 51, 0.5);
  transition: all 0.25s ease;
}

.hub-cta-btn:hover {
  background: #ff1a47;
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(255, 0, 51, 0.8);
}

/* 🍞 Toast 提示框 */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--cyber-cyan);
  box-shadow: 0 10px 30px rgba(0, 210, 255, 0.35);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.92rem;
  font-weight: 600;
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 999999;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 頁尾版權 */
footer {
  background: transparent;
  color: #64748b;
  text-align: center;
  padding: 30px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 1;
}

/* 📱 RWD 響應式優化 */
@media (max-width: 768px) {
  .youtube-main {
    padding: 75px 14px 40px 14px;
  }

  .streamer-card {
    padding: 24px 18px;
  }

  .streamer-avatar-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .streamer-title {
    font-size: 1.55rem;
  }

  .game-id-badge-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .dynamic-videos-grid {
    grid-template-columns: 1fr;
  }

  .hub-banner-box {
    flex-direction: column;
    align-items: flex-start;
  }
}
