/* ===========================
   FPL Pulse — Intel Page
   Dark premium sports theme
   =========================== */

.fplp{
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #e2e8f0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 12px;
}

.fplp *, .fplp *::before, .fplp *::after{
  box-sizing: border-box;
}

.fplp-loading{
  text-align: center;
  padding: 60px 20px;
  font-weight: 700;
  font-size: 14px;
  color: #64748b;
}

/* ===========================
   HERO — GW Status
   =========================== */
.fplp-hero{
  position: relative;
  padding: 32px 28px 28px;
  border-radius: 20px;
  background: linear-gradient(135deg, #0b0f1a 0%, #1a1040 50%, #0f172a 100%);
  margin-bottom: 20px;
  overflow: hidden;
}

.fplp-hero::before{
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(183,255,60,.08) 0%, transparent 70%);
  pointer-events: none;
}

.fplp-hero-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
}

.fplp-hero-gw{
  font-weight: 900;
  font-size: 28px;
  color: #fff;
  letter-spacing: -.5px;
}

.fplp-hero-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 999px;
}

.fplp-hero-badge.live{
  background: rgba(183,255,60,.15);
  color: #b7ff3c;
}

.fplp-hero-badge.finished{
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.5);
}

.fplp-hero-badge.upcoming{
  background: rgba(99,102,241,.15);
  color: #a5b4fc;
}

.fplp-hero-dot{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #b7ff3c;
  animation: fplp-pulse 1.6s infinite;
}

@keyframes fplp-pulse{
  0%, 100%{ opacity: 1; }
  50%{ opacity: .25; }
}

.fplp-hero-countdown-wrap{
  text-align: right;
}

.fplp-hero-dl-label{
  font-weight: 700;
  font-size: 11px;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 4px;
}

.fplp-hero-countdown{
  font-weight: 900;
  font-size: 22px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
}

.fplp-hero-countdown.urgent{
  color: #f87171;
}

/* Hero stats row */
.fplp-hero-stats{
  display: flex;
  gap: 12px;
  position: relative;
}

.fplp-hero-stat{
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
}

.fplp-hero-stat-val{
  font-weight: 900;
  font-size: 22px;
  color: #fff;
}

.fplp-hero-stat-label{
  font-weight: 700;
  font-size: 10px;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-top: 2px;
}

/* ===========================
   MANAGER SUMMARY
   =========================== */
.fplp-mgr{
  background: #111827;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

/* Logged in — stats */
.fplp-mgr-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.fplp-mgr-team{
  font-weight: 900;
  font-size: 18px;
  color: #fff;
}

.fplp-mgr-player{
  font-weight: 600;
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.fplp-mgr-chip{
  font-weight: 800;
  font-size: 11px;
  color: #fbbf24;
  background: rgba(251,191,36,.12);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.fplp-mgr-stats{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fplp-mgr-s{
  flex: 1 1 0;
  min-width: 80px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}

.fplp-mgr-s-val{
  font-weight: 900;
  font-size: 20px;
  color: #fff;
}

.fplp-mgr-s-highlight{
  color: #b7ff3c;
}

.fplp-mgr-hit{
  font-weight: 700;
  font-size: 12px;
  color: #f87171;
}

.fplp-mgr-s-label{
  font-weight: 700;
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}

/* Guest — not logged in */
.fplp-mgr-guest{
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px dashed rgba(255,255,255,.12);
  background: rgba(255,255,255,.02);
}

.fplp-mgr-icon{
  font-size: 32px;
  flex: 0 0 auto;
}

.fplp-mgr-guest-title{
  font-weight: 800;
  font-size: 15px;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.fplp-mgr-guest-sub{
  font-weight: 600;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

/* Setup — link FPL ID */
.fplp-mgr-setup{
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border: 1px dashed rgba(183,255,60,.2);
  background: rgba(183,255,60,.03);
}

.fplp-mgr-setup-content{
  flex: 1;
  min-width: 0;
}

.fplp-mgr-form{
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.fplp-mgr-input{
  flex: 1;
  max-width: 200px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  outline: none;
}

.fplp-mgr-input:focus{
  border-color: #b7ff3c;
  box-shadow: 0 0 0 3px rgba(183,255,60,.15);
}

.fplp-mgr-input::placeholder{
  color: #475569;
}

.fplp-mgr-btn{
  padding: 8px 20px;
  border: none;
  border-radius: 10px;
  background: #b7ff3c;
  color: #0b0f1a;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: opacity .12s;
}

.fplp-mgr-btn:hover{
  opacity: .85;
}

.fplp-mgr-btn:disabled{
  opacity: .5;
  cursor: not-allowed;
}

.fplp-mgr-hint{
  font-weight: 600;
  font-size: 11px;
  color: #475569;
  margin-top: 6px;
}

.fplp-mgr-msg{
  font-weight: 700;
  font-size: 12px;
  margin-top: 6px;
  min-height: 18px;
}

/* Error state */
.fplp-mgr-error{
  display: flex;
  align-items: center;
  gap: 12px;
  border-color: rgba(248,113,113,.15);
}

/* ===========================
   FIXTURES — Match Cards
   =========================== */
.fplp-section-label{
  font-weight: 800;
  font-size: 14px;
  color: #e2e8f0;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fplp-section-label .icon{
  font-size: 16px;
}

.fplp-section-label .count{
  font-weight: 700;
  font-size: 11px;
  color: #64748b;
  margin-left: auto;
}

.fplp-fx-strip{
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 24px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.fplp-fx-strip::-webkit-scrollbar{ height: 4px; }
.fplp-fx-strip::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius: 999px;
}
.fplp-fx-strip::-webkit-scrollbar-track{ background: transparent; }

.fplp-fx-card{
  scroll-snap-align: start;
  flex: 0 0 auto;
  min-width: 220px;
  background: #111827;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 14px 16px;
  transition: transform .12s, border-color .12s;
}

.fplp-fx-card:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.15);
}

.fplp-fx-card.live{
  border-color: rgba(183,255,60,.25);
  background: linear-gradient(135deg, #111827 0%, #0f1a10 100%);
}

.fplp-fx-teams{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.fplp-fx-t{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.fplp-fx-badge{
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.fplp-fx-tname{
  font-weight: 800;
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.fplp-fx-score-center{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 0 4px;
}

.fplp-fx-score{
  font-weight: 900;
  font-size: 20px;
  color: #fff;
  letter-spacing: 2px;
}

.fplp-fx-status{
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
}

.fplp-fx-status.live{
  background: rgba(183,255,60,.12);
  color: #b7ff3c;
}

.fplp-fx-status.finished{
  background: rgba(255,255,255,.06);
  color: #64748b;
}

.fplp-fx-status.upcoming{
  background: rgba(99,102,241,.1);
  color: #a5b4fc;
}

.fplp-fx-live-dot{
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #b7ff3c;
  animation: fplp-pulse 1.6s infinite;
}

/* ===========================
   MAIN GRID
   =========================== */
.fplp-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

/* ===========================
   CARD
   =========================== */
.fplp-card{
  background: #111827;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  overflow: hidden;
}

.fplp-card.full{
  grid-column: 1 / -1;
}

.fplp-card-hd{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px 12px;
  font-weight: 800;
  font-size: 13px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.fplp-card-hd .icon{
  font-size: 16px;
}

.fplp-card-hd .badge{
  margin-left: auto;
  font-weight: 700;
  font-size: 10px;
  color: #64748b;
  background: rgba(255,255,255,.06);
  padding: 3px 8px;
  border-radius: 999px;
}

.fplp-card-body{
  padding: 4px 0;
}

/* ===========================
   PLAYER ROW
   =========================== */
.fplp-row{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  transition: background .12s;
}

.fplp-row:hover{
  background: rgba(255,255,255,.03);
}

.fplp-row + .fplp-row{
  border-top: 1px solid rgba(255,255,255,.04);
}

.fplp-rank{
  font-weight: 900;
  font-size: 12px;
  color: #475569;
  min-width: 20px;
  text-align: center;
}

.fplp-rank.gold{ color: #fbbf24; }
.fplp-rank.silver{ color: #94a3b8; }
.fplp-rank.bronze{ color: #d97706; }

.fplp-photo{
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.1);
  background: #1e293b;
  flex: 0 0 auto;
}

.fplp-photo.ph{
  background: #1e293b;
}

.fplp-info{
  flex: 1;
  min-width: 0;
}

.fplp-name{
  font-weight: 800;
  font-size: 13px;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fplp-meta{
  font-weight: 600;
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

.fplp-val{
  font-weight: 900;
  font-size: 14px;
  color: #f1f5f9;
  text-align: right;
  white-space: nowrap;
}

.fplp-val small{
  font-weight: 600;
  font-size: 10px;
  color: #64748b;
  margin-left: 2px;
}

/* Points bar */
.fplp-pts-bar-wrap{
  width: 48px;
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 3px;
}

.fplp-pts-bar{
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6d28d9, #a78bfa);
  transition: width .4s ease;
}

/* Transfer values */
.fplp-val.transfer-in{ color: #34d399; }
.fplp-val.transfer-out{ color: #f87171; }

/* Price changes */
.fplp-price-up{
  color: #34d399;
  font-weight: 900;
}

.fplp-price-down{
  color: #f87171;
  font-weight: 900;
}

/* ===========================
   INJURY STATUS BADGES
   =========================== */
.fplp-status{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.fplp-status.injured{
  background: rgba(239,68,68,.15);
  color: #f87171;
}

.fplp-status.doubtful{
  background: rgba(251,191,36,.12);
  color: #fbbf24;
}

.fplp-status.suspended{
  background: rgba(100,116,139,.15);
  color: #94a3b8;
}

.fplp-news-text{
  font-weight: 600;
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================
   DREAM TEAM — Pitch View
   =========================== */
.fplp-pitch{
  background: linear-gradient(180deg, #064e3b 0%, #065f46 40%, #047857 100%);
  border-radius: 14px;
  padding: 24px 12px 16px;
  margin: 8px 12px 12px;
  position: relative;
  overflow: hidden;
}

/* Pitch lines */
.fplp-pitch::before{
  content: '';
  position: absolute;
  top: 50%; left: 15%; right: 15%;
  height: 1px;
  background: rgba(255,255,255,.15);
}

.fplp-pitch::after{
  content: '';
  position: absolute;
  top: 35%; left: 30%; right: 30%;
  bottom: 65%;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%;
}

.fplp-pitch-row{
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  position: relative;
}

.fplp-pitch-row:last-child{
  margin-bottom: 0;
}

.fplp-pitch-player{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 80px;
}

.fplp-pitch-photo{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.3);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

.fplp-pitch-name{
  font-weight: 800;
  font-size: 10px;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

.fplp-pitch-pts{
  font-weight: 900;
  font-size: 11px;
  color: #fde68a;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

/* ===========================
   EMPTY & ERROR
   =========================== */
.fplp-empty{
  padding: 24px 16px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  color: #475569;
}

.fplp-error{
  text-align: center;
  padding: 40px 20px;
  font-weight: 800;
  font-size: 14px;
  color: #f87171;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px){
  .fplp{ padding: 0 8px; }

  .fplp-hero{
    padding: 20px 16px;
    border-radius: 16px;
  }

  .fplp-hero-top{
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .fplp-hero-countdown-wrap{ text-align: left; }

  .fplp-hero-gw{ font-size: 22px; }
  .fplp-hero-countdown{ font-size: 18px; }

  .fplp-hero-stats{ flex-direction: column; gap: 8px; }

  .fplp-grid{
    grid-template-columns: 1fr;
  }

  .fplp-fx-card{ min-width: 190px; }
  .fplp-fx-badge{ width: 26px; height: 26px; }

  .fplp-mgr{ padding: 16px; }
  .fplp-mgr-stats{ gap: 6px; }
  .fplp-mgr-s{ min-width: 70px; padding: 10px 6px; }
  .fplp-mgr-s-val{ font-size: 16px; }
  .fplp-mgr-team{ font-size: 15px; }
  .fplp-mgr-form{ flex-direction: column; }
  .fplp-mgr-input{ max-width: 100%; }

  .fplp-pitch-player{ width: 64px; }
  .fplp-pitch-photo{ width: 36px; height: 36px; }
  .fplp-pitch-name{ font-size: 9px; }
}

/* ===========================
   CLICKABLE PLAYER ROWS
   =========================== */
.fplp-clickable{
  cursor: pointer;
}

.fplp-clickable:hover .fplp-name{
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fplp-pitch-player.fplp-clickable:hover{
  transform: scale(1.08);
  transition: transform .15s ease;
}

.fplp-pitch-player.fplp-clickable:hover .fplp-pitch-name{
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===========================
   PLAYER DETAIL MODAL
   =========================== */
.fplp-modal-overlay{
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fplp-fade-in .2s ease;
}

@keyframes fplp-fade-in{
  from{ opacity: 0; }
  to{ opacity: 1; }
}

.fplp-modal{
  background: #111827;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 22px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 32px 80px rgba(0,0,0,.5);
  animation: fplp-slide-up .25s ease;
}

@keyframes fplp-slide-up{
  from{ transform: translateY(30px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}

.fplp-modal::-webkit-scrollbar{ width: 4px; }
.fplp-modal::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius: 999px;
}
.fplp-modal::-webkit-scrollbar-track{ background: transparent; }

.fplp-modal-close{
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background .12s;
}

.fplp-modal-close:hover{
  background: rgba(255,255,255,.15);
  color: #fff;
}

/* Header */
.fplp-modal-header{
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.fplp-modal-photo{
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.15);
  background: #1e293b;
  flex: 0 0 auto;
}

.fplp-modal-photo.ph{
  width: 72px; height: 72px;
  border-radius: 50%;
  background: #1e293b;
  border: 3px solid rgba(255,255,255,.1);
}

.fplp-modal-identity{
  flex: 1;
  min-width: 0;
}

.fplp-modal-name{
  font-weight: 600;
  font-size: 18px;
  color: #e2e8f0;
  line-height: 1.2;
}

.fplp-modal-name b{
  font-weight: 900;
  color: #fff;
}

.fplp-modal-team{
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

.fplp-modal-badge{
  width: 18px; height: 18px;
  object-fit: contain;
}

.fplp-modal-price{
  font-weight: 900;
  font-size: 14px;
  color: #e2e8f0;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* News bar */
.fplp-modal-news{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.fplp-modal-news-text{
  font-weight: 600;
  font-size: 12px;
  color: #94a3b8;
  flex: 1;
  min-width: 0;
}

/* Body — stat groups */
.fplp-modal-body{
  padding: 8px 20px 20px;
}

.fplp-modal-group{
  margin-top: 16px;
}

.fplp-modal-group:first-child{
  margin-top: 8px;
}

.fplp-modal-group-title{
  font-weight: 800;
  font-size: 10px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.fplp-modal-stats{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.fplp-modal-stat{
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.fplp-modal-stat-val{
  font-weight: 900;
  font-size: 16px;
  color: #fff;
}

.fplp-modal-stat-label{
  font-weight: 700;
  font-size: 9px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-top: 2px;
}

/* Responsive modal */
@media (max-width: 520px){
  .fplp-modal{
    max-width: 100%;
    max-height: 90vh;
    border-radius: 18px;
  }

  .fplp-modal-header{ padding: 18px 16px 14px; gap: 12px; }
  .fplp-modal-photo{ width: 56px; height: 56px; }
  .fplp-modal-photo.ph{ width: 56px; height: 56px; }
  .fplp-modal-name{ font-size: 15px; }
  .fplp-modal-body{ padding: 6px 14px 16px; }
  .fplp-modal-stats{ grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .fplp-modal-stat{ padding: 8px 4px; }
  .fplp-modal-stat-val{ font-size: 14px; }
}
