/* ===================================================
   PCSO Lottery Results - Premium UI 2026
   炫酷深色主题 + 动态效果 + 霓虹光效
=================================================== */

/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: linear-gradient(145deg, #1a1f2e 0%, #0d111a 100%);
  --bg-glass: rgba(17, 24, 39, 0.85);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-accent: #fbbf24;
  
  --accent-gold: #fbbf24;
  --accent-orange: #f97316;
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  
  --glow-gold: 0 0 20px rgba(251, 191, 36, 0.4);
  --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.4);
  --glow-purple: 0 0 20px rgba(168, 85, 247, 0.4);
  
  --gradient-gold: linear-gradient(135deg, #fbbf24, #f97316);
  --gradient-rainbow: linear-gradient(135deg, #f97316, #ec4899, #a855f7, #06b6d4);
  --gradient-neon: linear-gradient(135deg, #06b6d4, #a855f7);
  
  --border-glow: rgba(251, 191, 36, 0.3);
  --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ===== Global Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  background-image: 
    radial-gradient(ellipse at 20% 0%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
  padding-top: 70px;
  padding-bottom: 80px;
  line-height: 1.6;
}

/* ===== Animations ===== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: var(--glow-gold), 0 8px 32px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 0 40px rgba(251, 191, 36, 0.6), 0 8px 32px rgba(0,0,0,0.4); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bounce-in {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes gradient-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes neon-pulse {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.8; filter: brightness(1.3); }
}

/* ===== TOP FIXED BAR ===== */
.top-fixed-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 9999;
}

.top-btn {
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.top-btn.login {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.top-btn.login:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

.top-btn.register {
  background: var(--gradient-gold);
  background-size: 200% 200%;
  animation: gradient-flow 3s ease infinite;
  border: none;
  box-shadow: var(--glow-gold);
}

.top-btn.register:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
}

.top-icons {
  margin-left: auto;
  display: flex;
  gap: 16px;
}

.top-icons a {
  color: var(--text-secondary);
  font-size: 22px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.top-icons a:hover {
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  transform: scale(1.1);
}

/* ===== HEADER ===== */
.header {
  text-align: center;
  padding: 40px 20px 30px;
  position: relative;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.header h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px rgba(251, 191, 36, 0.3);
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.header p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 6px 0;
}

.last-updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  font-size: 12px !important;
  color: var(--accent-green) !important;
  margin-top: 10px !important;
}

.last-updated::before {
  content: '●';
  animation: neon-pulse 2s ease-in-out infinite;
  color: var(--accent-green);
}

.data-source {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.data-source a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: all 0.3s ease;
}

.data-source a:hover {
  text-shadow: var(--glow-cyan);
}

/* ===== UPDATE BAR ===== */
.update-bar {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.1), rgba(249, 115, 22, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: var(--accent-gold);
  font-size: 13px;
  font-weight: 500;
  padding: 12px 20px;
  margin: 0 16px;
  border-radius: 12px;
  text-align: center;
  backdrop-filter: blur(10px);
}

/* ===== MAIN GRID ===== */
#main-content {
  padding: 20px 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ===== LOTTERY CARDS ===== */
.card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-card);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-rainbow);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-8px);
  border-color: rgba(251, 191, 36, 0.3);
  box-shadow: var(--shadow-card), var(--glow-gold);
}

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

/* Main lottery highlight */
.card[data-tier="main"] {
  border: 2px solid rgba(251, 191, 36, 0.4);
  background: linear-gradient(145deg, #1f2937 0%, #111827 100%);
}

.card[data-tier="main"]::before {
  opacity: 1;
  height: 4px;
}

/* ===== Card Title ===== */
.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.title-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
  animation: float 3s ease-in-out infinite;
}

.card-title h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.draw-date {
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 20px;
}

/* ===== LOTTERY BALLS ===== */
.balls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
}

.ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gradient-gold);
  color: #000;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 
    0 4px 15px rgba(251, 191, 36, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
  animation: bounce-in 0.5s ease forwards;
  position: relative;
  overflow: hidden;
}

.ball::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 10px;
  width: 15px;
  height: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: rotate(-30deg);
}

/* Ball animation delays */
.ball:nth-child(1) { animation-delay: 0.1s; }
.ball:nth-child(2) { animation-delay: 0.2s; }
.ball:nth-child(3) { animation-delay: 0.3s; }
.ball:nth-child(4) { animation-delay: 0.4s; }
.ball:nth-child(5) { animation-delay: 0.5s; }
.ball:nth-child(6) { animation-delay: 0.6s; }

/* Ball hover effect */
.ball:hover {
  animation: pulse-glow 1s ease infinite;
  transform: scale(1.1);
}

/* Main lottery special balls */
.card[data-tier="main"] .ball {
  background: linear-gradient(135deg, #fcd34d, #f59e0b, #d97706);
  box-shadow: 
    0 4px 20px rgba(251, 191, 36, 0.6),
    inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

/* ===== OFFICIAL INFO BOX ===== */
.official-info {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  margin: 16px 0;
}

.official-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.official-row:last-child {
  border-bottom: none;
}

.official-row .label {
  color: var(--text-secondary);
  font-size: 13px;
}

.official-row .value {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* ===== JACKPOT BOX ===== */
.jackpot-box {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(249, 115, 22, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0;
  position: relative;
  overflow: hidden;
}

.jackpot-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(251, 191, 36, 0.1) 50%,
    transparent 70%
  );
  animation: shimmer 3s linear infinite;
}

.jackpot-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.jackpot-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  position: relative;
  z-index: 1;
}

.jackpot-row span {
  color: var(--text-secondary);
  font-size: 14px;
}

.jackpot-row b {
  font-weight: 700;
  color: var(--accent-gold);
  font-size: 16px;
}

.rollover {
  margin-top: 10px;
  padding: 8px 16px;
  background: rgba(249, 115, 22, 0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-orange);
  text-align: center;
  animation: neon-pulse 2s ease-in-out infinite;
}

/* ===== COUNTDOWN ===== */
.countdown {
  text-align: center;
  padding: 16px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(236, 72, 153, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #f87171;
  margin: 12px 0;
}

/* ===== VIDEO LINK ===== */
.video-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-cyan);
  transition: all 0.3s ease;
  margin: 12px 0;
}

.video-link:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(168, 85, 247, 0.2));
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

/* ===== ANALYSIS BOX ===== */
.analysis-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.hot-box {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hot-box span {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-purple);
  transition: all 0.3s ease;
}

.hot-box span:hover {
  transform: scale(1.05);
  box-shadow: var(--glow-purple);
}

/* ===== HISTORY ===== */
.history-toggle {
  margin-top: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-cyan);
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
}

.history-toggle:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
}

.history-panel {
  margin-top: 12px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.history-panel.hidden {
  display: none;
}

.history-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.history-row:last-child {
  border-bottom: none;
}

.history-row span:first-child {
  color: var(--text-secondary);
}

.history-row span:last-child {
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Custom scrollbar */
.history-panel::-webkit-scrollbar {
  width: 6px;
}

.history-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.history-panel::-webkit-scrollbar-thumb {
  background: var(--accent-cyan);
  border-radius: 3px;
}

/* ===== SEO TEXT SECTION ===== */
.seo-text {
  max-width: 900px;
  margin: 40px auto;
  padding: 30px;
  background: var(--bg-glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.seo-text h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  background: var(--gradient-neon);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.seo-text p {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 15px;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 9999;
  padding: 0 10px;
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 11px;
  padding: 8px;
  transition: all 0.3s ease;
  border-radius: 12px;
}

.bottom-nav a:hover, .bottom-nav a:focus {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
}

.bottom-nav span {
  font-size: 22px;
  margin-bottom: 4px;
}

.bottom-nav em {
  font-style: normal;
  font-weight: 500;
}

@media (min-width: 769px) {
  .bottom-nav {
    display: none;
  }
}

/* ===== SITE FOOTER ===== */
.site-footer {
  max-width: 900px;
  margin: 30px auto;
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  body {
    padding-top: 70px;
    padding-bottom: 80px;
  }

  .header h1 {
    font-size: 26px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 12px;
  }

  .card {
    padding: 20px;
  }

  .ball {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .balls {
    gap: 8px;
    padding: 16px;
  }

  .top-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  .ball {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }

  .header h1 {
    font-size: 22px;
  }
}

/* ===== LOADING STATE ===== */
.card.loading {
  animation: shimmer 1.5s linear infinite;
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    rgba(255, 255, 255, 0.05) 50%,
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
}

/* ===== PARTICLE BACKGROUND (Optional CSS-only) ===== */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.1), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(251,191,36,0.1), transparent),
    radial-gradient(2px 2px at 50px 160px, rgba(6,182,212,0.1), transparent),
    radial-gradient(2px 2px at 90px 40px, rgba(168,85,247,0.1), transparent),
    radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.05), transparent);
  background-size: 200px 200px;
  animation: float 20s linear infinite;
  z-index: -1;
}
