/* Left role filter bar and team feed */
#roleFilterBar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  height: 100%;
}

.team-feed {
  position: absolute;
  top: 86px; /* Height of the header */
  left: 20px; /* Padding from .main-col-left */
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: fit-content;
  padding-bottom: 50px; /* Space for .team-feed-controls */
  overflow: auto;
  width: 250px; /* Fixed width for desktop */
  box-sizing: border-box;
  z-index: 999;
}

.team-feed-item {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: clamp(4px, 0.6vw, 8px) clamp(12px, 1.4vw, 22px);
  transform: translateX(-20px);
  opacity: 0;
  transition: transform 240ms ease, opacity 240ms ease;
}

.team-feed-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(255, 255, 255, 0.9);
  opacity: 0.9;
}

.team-feed-item.entered {
  transform: translateX(0);
  opacity: 1;
}

.team-feed-item img {
  width: clamp(28px, 2.4vw, 40px);
  height: clamp(28px, 2.4vw, 40px);
  object-fit: cover;
}

.team-feed-item > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.team-feed-item .tf-player {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(0.65rem, 0.48rem + 0.35vw, 0.9rem);
  text-align: center;
  font-family: var(--font-display);
}

.team-feed-item .tf-role {
  opacity: 0.85;
  font-size: clamp(0.75rem, 0.55rem + 0.3vw, 0.95rem);
  text-align: center;
}

/* Wheel container and canvas */
canvas {
  margin-top: 0;
  border-radius: 10px;
  max-width: 100vw;
  height: auto;
  cursor: pointer;
}

#wheelContainer {
  position: relative;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90vw;
  height: 100%;
  max-width: 100%;
  max-height: 90vh;
  aspect-ratio: 1 / 1;
}

#wheelMarker {
  display: none;
}

.wheel-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

.wheel-empty p {
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wheel-empty span {
  font-size: 0.8rem;
  opacity: 0.75;
}

.wheel-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.loading-spinner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--bg-accent);
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.loading-text {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

#wheelContainer.loading canvas,
#wheelContainer.loading #wheelMarker {
  opacity: 0;
  pointer-events: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hide role filter bar in specific app states */
body.modal-open #roleFilterBar,
body.team-feed-visible #roleFilterBar,
body.wheel-spinning #roleFilterBar {
  display: none;
}

/* Winner banner near the wheel (legacy) */
/* Team feed controls in left column */
.team-feed-controls {
  gap: 8px;
  bottom: 0; /* Position at the bottom */
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px;
  border-radius: 10px;
  justify-content: center;
  box-sizing: border-box; /* Ensure padding is included in width/height */
}

.team-feed-copy,
.team-feed-close {
  padding: 8px 12px;
  border-radius: 10px;
}

.team-feed-controls.hidden {
  display: none;
}

/* Role filter buttons */
.role-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  padding: 0;
}

.role-btn:hover {
  transform: translateY(-1px) scale(1.02);
}

.role-btn[aria-pressed="true"],
.role-btn.selected {
  border-color: var(--border);
  box-shadow: 0 0px 12px var(--border);
}

.role-btn img {
  width: 60%;
  height: 60%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

/* Agent filter button icon inside role bar */
.role-btn span {
  font-size: 4rem;
  color: white;
  line-height: 1;
}

#agentFilterBtn {
  position: relative;
}

#agentFilterBtn span {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
}

@media (max-width: 650px) {
  #agentFilterBtn span {
    font-size: 3rem;
  }

  #roleFilterBar {
    flex-direction: row;
    height: unset;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
  }
}

@media (max-width: 900px) {
  .team-feed {
    position: absolute;
    left: 8px;
    right: auto;
    bottom: 80px; /* Footer height */
    width: min(260px, 70vw);   /* not full width, just a panel */
    padding-bottom: 50px; /* Space for .team-feed-controls */
    overflow: auto;
    z-index: 1001;
    top: unset;
  }
}
