:root {
  --fantasy-max-width: 1100px;
}

/* Custom tooltip for fantasy points breakdown */
.ft-tooltip-wrapper {
  position: relative;
  cursor: pointer;
}

.ft-tooltip {
  display: none;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1f2937;
  color: #ffffff;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ft-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #1f2937 transparent transparent transparent;
}

.ft-tooltip-wrapper:hover .ft-tooltip,
.ft-tooltip-wrapper.active .ft-tooltip {
  display: block;
}

.ft-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0;
}

.ft-tooltip-label {
  color: #9ca3af;
}

.ft-tooltip-value {
  font-weight: 600;
  color: #10b981;
}

/* Mobile adjustments for tooltips */
@media (max-width: 640px) {
  .ft-tooltip {
    font-size: 0.75rem;
    padding: 8px 10px;
    max-width: 200px;
    white-space: normal;
  }
  
  .ft-tooltip-row {
    gap: 12px;
  }
}

.fantasy-container {
  width: var(--fantasy-max-width);
  margin: 40px auto 80px auto;
  padding-left: 20px;
  padding-right: 20px;
}

@media (max-width: 1200px) {
  .fantasy-container {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .fantasy-container {
    margin: 24px auto 60px auto;
    padding-left: 16px;
    padding-right: 16px;
  }
}

.fantasy-columns {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

@media (max-width: 960px) {
  .fantasy-columns {
    flex-direction: column;
  }
}

.fantasy-summary-card,
.fantasy-card,
.fantasy-board-card,
.fantasy-table-wrapper {
  width: 100%;
}

.fantasy-round-card {
  flex: 1 1 320px;
  min-width: 280px;
}

@media (max-width: 640px) {
  .fantasy-round-card {
    min-width: 0;
  }
}

.fantasy-flex-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

@media (max-width: 640px) {
  .fantasy-flex-wrap {
    gap: 12px;
  }
}

.fantasy-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.fantasy-nav {
  margin-bottom: 18px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 6px;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fantasy-nav a,
.fantasy-nav strong {
  margin-right: 14px;
  text-decoration: none;
  color: #374151;
  transition: color 0.2s;
}

.fantasy-nav a:hover {
  color: #111827;
}

.fantasy-nav a.active,
.fantasy-nav strong {
  font-weight: 600;
  color: #111827;
}

@media (max-width: 640px) {
  .fantasy-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 10px;
  }

  .fantasy-nav a,
  .fantasy-nav strong {
    margin-right: 0 !important;
    white-space: nowrap;
  }

  .fantasy-nav::-webkit-scrollbar {
    display: none;
  }
}

.fantasy-sidebar {
  flex: 0 0 260px;
  max-width: 260px;
}

@media (max-width: 960px) {
  .fantasy-sidebar {
    width: 100%;
    max-width: 100%;
  }
}

.fantasy-summary-card {
  margin-bottom: 18px;
  border-radius: 14px;
  border: 1px solid #0f766e;
  background: var(--sl-bg, #047857);
  color: #f9fafb;
  padding: 18px 20px;
  box-shadow: 0 10px 25px rgba(4, 120, 87, 0.45);
}

.fantasy-summary-card .top-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.fantasy-total-metrics {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.fantasy-total-metric {
  flex: 1;
  min-width: 160px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.fantasy-total-metric .label {
  font-size: 0.75rem;
  color: #9ca3af;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fantasy-total-metric .value {
  font-size: 1.3rem;
  font-weight: 600;
}

.fantasy-total-metric.is-total {
  background: linear-gradient(135deg, #ea580c, #f97316);
  border-color: transparent;
  color: #fff7ed;
  text-align: center;
  box-shadow: 0 8px 18px rgba(234, 88, 12, 0.45);
}

.fantasy-total-metric.is-total .label {
  color: rgba(248, 250, 252, 0.8);
}

.fantasy-total-metric.is-total .value {
  color: #fff;
}

.fantasy-summary-note {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #9ca3af;
}

.fantasy-gw-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.fantasy-gw-tabs {
  flex: 1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.fantasy-gw-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 0.85rem;
  color: #374151;
  text-decoration: none;
  white-space: nowrap;
}

.fantasy-gw-tab.is-active {
  background: #111827;
  border-color: #111827;
  color: #fff;
  font-weight: 600;
}

.fantasy-gw-tabs::-webkit-scrollbar {
  height: 4px;
}

.fantasy-gw-tabs::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.4);
  border-radius: 999px;
}

.fantasy-gw-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  color: #111827;
  text-decoration: none;
  font-size: 1rem;
}

.fantasy-gw-arrow.disabled {
  opacity: 0.4;
  pointer-events: none;
}

@media (max-width: 640px) {
  .fantasy-total-metric {
    min-width: 120px;
  }
}

.round-total-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.3);
}

/* FPL-style Player Cards */
.ft-player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  /* background: #ffffff; */
  border-radius: 8px;
  /* border: 1px solid #e5e7eb; */
  transition: all 0.2s ease;
}

.ft-player-card:hover {
  border-color: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.ft-sub-card {
  background: #fafafa;
}

.ft-sub-card:hover {
  border-color: #f97316;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.15);
}

.ft-player-avatar-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ft-player-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 3px solid #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.ft-player-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.ft-starter-card {
  padding: 12px;
  /* background: rgba(255, 255, 255, 0.98); */
}

.ft-starter-avatar {
  width: 80px;
  height: 80px;
  border-width: 3px;
}

.ft-starter-points {
  min-width: 36px;
  height: 28px;
  font-size: 0.95rem;
}

.ft-starter-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.ft-sub-avatar {
  width: 56px;
  height: 56px;
  border-color: #f97316;
  border-width: 2px;
}

.ft-player-points-badge {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 32px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid #ffffff;
}

.ft-sub-card .ft-player-points-badge {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.ft-sub-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f97316;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.ft-player-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ft-sub-name {
  font-size: 0.75rem;
  color: #6b7280;
}

.ft-lineup-slot {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ft-lineup-card {
  width: 100%;
  cursor: move;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.ft-lineup-card.is-dragging {
  opacity: 0.7;
  transform: scale(0.98);
}

.ft-lineup-placeholder {
  width: 100%;
  padding: 22px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

.ft-lineup-placeholder.sub-slot {
  border-color: #d1d5db;
  color: #9ca3af;
}

.ft-lineup-opp {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
}

.ft-sub-card .ft-lineup-opp {
  color: #6b7280;
}

/* FPL-style Metrics Strip */
.ft-metrics-strip {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}

.ft-metric-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ft-metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.ft-metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}
