/* Rate Limiting Phase 3 - Badge PENDING en rojo con animación */
:root { 
  --bg:#000000; 
  --bg-gradient: linear-gradient(135deg, #000000 0%, #0a0e1a 100%);
  --fg:#e2e8f0; 
  --line:#334155; 
  --btn:#1f2937; 
  --btnHover:#111827; 
  --blue:#1E40AF; 
  --red:#DC143C;
  --purple:#a855f7;
  --card-bg:#0a0e1a;
  --glow-blue: 0 0 20px rgba(30, 64, 175, 0.5);
  --glow-red: 0 0 20px rgba(220, 20, 60, 0.5);
  --glow-purple: 0 0 20px rgba(168, 85, 247, 0.5);
  --glow-green: 0 0 20px rgba(34, 197, 94, 0.5);
}
*{box-sizing:border-box}
body{
  margin:0;
  background:var(--bg-gradient);
  color:var(--fg);
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,Helvetica,sans-serif;
  min-height:100vh;
}

/* Header similar to index */
.page-header{max-width:1100px;margin:24px auto 8px;padding:0 16px}
.page-header h1{margin:0;font-size:2rem;font-weight:800;color:#fff}
.subtitle{margin:.25rem 0 0;color:#cbd5e1}

.tickets-main{max-width:1100px;margin:0 auto;padding:0 16px 48px}

.summary{display:flex;gap:12px;margin:12px 0 8px}
.summary-item{
  background: rgba(11, 18, 32, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border:1px solid rgba(51, 65, 85, 0.5);
  border-radius:14px;
  padding:12px 16px;
  display:flex;
  align-items:baseline;
  gap:10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: all 0.3s ease;
}
.summary-item:hover{
  border-color: rgba(30, 64, 175, 0.6);
  box-shadow: var(--glow-blue), 0 6px 20px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}
.summary-item span{font-size:1.25rem;font-weight:800;color:#fff}
.summary-item label{color:#94a3b8;font-size:.9rem}

.ticket-list{margin-top:8px}
.event-group{margin:18px 0 8px;color:#b0b8d1;font-weight:700;letter-spacing:.02em}
.ticket{
  background: rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border:2px solid rgba(51, 65, 85, 0.5);
  border-left:4px solid rgba(30, 64, 175, 0.8);
  border-radius:20px;
  padding:20px;
  margin:12px 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.ticket:hover{
  transform: translateY(-4px);
  box-shadow: var(--glow-blue), 0 12px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.15);
  border-color: rgba(30, 64, 175, 0.9);
  background: rgba(10, 14, 26, 0.8);
}
.ticket-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.badge{
  display:inline-block;
  padding:8px 14px;
  border-radius:999px;
  font-size:.8rem;
  font-weight:800;
  letter-spacing:.04em;
  background: linear-gradient(135deg, rgba(29, 34, 71, 0.8), rgba(42, 47, 58, 0.8));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border:2px solid rgba(30, 64, 175, 0.6);
  color:#cbd4ff;
  box-shadow: 0 0 10px rgba(30, 64, 175, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}
.badge:hover{
  box-shadow: var(--glow-blue);
  transform: scale(1.05);
}
.badge-pending{
  background: linear-gradient(135deg, #DC143C, #B91C1C);
  border-color: #DC143C;
  color: #fff;
  box-shadow: 0 0 10px rgba(220, 20, 60, 0.4);
  animation: pendingPulse 2s ease-in-out infinite;
}
.badge-pending:hover{
  box-shadow: 0 0 20px rgba(220, 20, 60, 0.6);
}
@keyframes pendingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.txline{color:#b0b8d1;font-size:.9rem}
.txline a{
  color:#dfe3ff;
  text-decoration:none;
  border-bottom:1px dashed #8392ff;
  transition: all 0.3s ease;
  position: relative;
}
.txline a:hover{
  color: var(--blue);
  border-bottom-color: var(--blue);
  text-shadow: 0 0 8px var(--blue);
}
.pending{color:#60a5fa}
.nums{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}
.nums label{color:var(--blue);margin-right:8px;font-weight:700}
.nums .main{font-weight:700;color:#fff}
.nums .power{font-weight:700;color:var(--red)}

.empty,.error{
  background: rgba(11, 18, 32, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border:1px solid rgba(51, 65, 85, 0.5);
  border-radius:16px;
  padding:16px;
  color:#cbd5e1;
  text-align:center;
  margin:10px 0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
}
.error{
  color:#ffd7d7;
  border-color:rgba(220, 20, 60, 0.5);
  background:rgba(42, 14, 23, 0.6);
  box-shadow: var(--glow-red), 0 4px 15px rgba(0,0,0,0.2);
}

@media (max-width:720px){
  .ticket{
    padding:12px;
    border-radius:12px;
  }
  
  .nums{
    grid-template-columns:1fr;
  }
  
  .page-header h1{
    font-size:1.6rem;
  }
  
  .subtitle{
    font-size:0.9rem;
  }
  
  .ticket-head{
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
  }
  
  .badge{
    padding:4px 10px;
    font-size:0.75rem;
  }
  
  .txline{
    font-size:0.85rem;
  }
  
  .event-group{
    font-size:1rem;
    margin:14px 0 6px;
  }
}

@media (max-width:480px){
  .tickets-main{
    padding:0 12px 48px;
  }
  
  .page-header{
    padding:0 12px;
  }
  
  .ticket{
    padding:10px;
    margin:8px 0;
  }
  
  .ticket:hover{
    transform:translateY(-2px);
  }
  
  .summary{
    flex-direction:column;
    gap:8px;
  }
  
  .summary-item{
    width:100%;
    justify-content:space-between;
  }
}

/* === Winners highlight (gaming neon effect) === */
.ticket.winner{
  border-color:#22c55e !important;
  border-left-color:#22c55e !important;
  background:rgba(34,197,94,.08) !important;
  box-shadow: var(--glow-green), 0 0 0 1px rgba(34,197,94,.25) inset;
  animation: neonPulse 2s ease-in-out infinite;
}
.ticket.winner:hover{
  box-shadow: var(--glow-green), 0 12px 40px rgba(34,197,94,0.3);
}
.badge.winner{
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color:#052e12;
  box-shadow: 0 0 10px rgba(34,197,94,0.5);
  animation: neonPulse 1.5s ease-in-out infinite;
}
.winner-meta{
  margin-top:6px;
  color:#cfead6;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:8px;
}
.winner-meta b{ color:#eafff0; }
.winner-meta a{ color:#d9ffe3; border-bottom:1px dashed #8de6a5; text-decoration:none; }
.winner-meta a:hover{ color:#fff; border-bottom-color:#fff; }

/* winner layout adjustments */
.ticket-head .line{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.ticket-head .line .badge{margin-right:6px}
.ticket-head .line .tx{opacity:.95}
.ticket-head .line .amount{margin-left:12px;font-weight:700;color:#d6f5e3}
.ticket-card.winner .ticket-head{border-bottom:1px dashed rgba(34,197,94,.35);padding-bottom:6px;margin-bottom:6px}

/* align 'Amount paid' to the right on the winner line */
.ticket-head .line-win { display:flex; align-items:center; flex-wrap:wrap; }
.ticket-head .line-win .amount { margin-left:auto; font-weight:700; }
.ticket-head .line-buy { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
/* keep link-like look for THX anchors */
.ticket-head .tx a { text-decoration:underline; }
/* optional subtle space under the header block */
.ticket-card .ticket-head { margin-bottom:6px; }

/* Keyframe Animations */
@keyframes neonPulse {
  0%, 100% { 
    box-shadow: 0 0 5px var(--glow-green), 0 0 10px var(--glow-green); 
  }
  50% { 
    box-shadow: 0 0 10px var(--glow-green), 0 0 20px var(--glow-green); 
  }
}

/* Accessibility - Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
