/* Indus Fiesta 2026 Main Stage Projector Display
 * AWS Student Builder Group | DY Patil International University (DYPIU)
 * Sleek, high-contrast esports telemetry & aerospace timing console
 */

.projector-shell {
  background: var(--bg-deep);
  min-height: 100vh;
  padding: 1rem 1.75rem 0 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  position: relative;
  overflow-x: hidden;
}

/* Stage Header */
.projector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
}

.stage-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.stage-logo-box {
  width: 46px;
  height: 46px;
  background: #111722;
  border: 1.5px solid rgba(255, 153, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 20px rgba(255, 153, 0, 0.35);
  flex-shrink: 0;
  overflow: hidden;
}

.stage-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stage-logo-box svg {
  width: 22px;
  height: 22px;
  color: #000;
}

.stage-title {
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  line-height: 1.1;
}

.stage-subtitle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

/* Minimalist Telemetry Ticker */
.stage-ticker-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(6, 11, 21, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  backdrop-filter: blur(8px);
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
}

.ticker-item strong {
  color: #fff;
  font-weight: 700;
}

/* ---------------- SLEEK TELEMETRY PODIUM ---------------- */
.stage-podium-grid {
  display: grid;
  grid-template-columns: 1fr 1.08fr 1fr;
  gap: 0.85rem;
  align-items: stretch;
}

.podium-card {
  background: linear-gradient(180deg, rgba(14, 23, 42, 0.35) 0%, rgba(6, 11, 21, 0.75) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: all 0.25s ease;
}

/* Top hairline indicators */
.podium-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
}

.podium-card.rank-1-card {
  background: linear-gradient(180deg, rgba(255, 153, 0, 0.06) 0%, rgba(6, 11, 21, 0.85) 100%);
  border-color: rgba(255, 153, 0, 0.35);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55), 0 0 20px rgba(255, 153, 0, 0.1);
}
.podium-card.rank-1-card::before {
  background: var(--orange-primary);
  box-shadow: 0 0 10px rgba(255, 153, 0, 0.6);
}

.podium-card.rank-2-card {
  border-color: rgba(148, 163, 184, 0.25);
}
.podium-card.rank-2-card::before {
  background: #94A3B8;
}

.podium-card.rank-3-card {
  border-color: rgba(180, 83, 9, 0.25);
}
.podium-card.rank-3-card::before {
  background: #B45309;
}

/* Podium Header Strip inside card */
.podium-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.podium-pos-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.podium-pos-badge.pos-1 {
  background: rgba(255, 153, 0, 0.15);
  color: var(--orange-primary);
  border: 1px solid rgba(255, 153, 0, 0.4);
}

.podium-pos-badge.pos-2 {
  background: rgba(148, 163, 184, 0.12);
  color: #E2E8F0;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.podium-pos-badge.pos-3 {
  background: rgba(180, 83, 9, 0.15);
  color: #FCD34D;
  border: 1px solid rgba(180, 83, 9, 0.3);
}

.podium-tag-chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-subtle);
}

.podium-tag-chip.chip-gap {
  color: var(--orange-primary);
  font-weight: 700;
}

/* Team Title & Meta */
.podium-team-title {
  font-size: 1.45rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-1-card .podium-team-title {
  font-size: 1.65rem;
}

.podium-meta-line {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Precision Stopwatch Display */
.podium-stopwatch-box {
  margin-top: 0.65rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  padding-top: 0.5rem;
}

.podium-stopwatch {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}

.rank-1-card .podium-stopwatch {
  font-size: 2.45rem;
}

.podium-stopwatch .ms-digits {
  color: var(--orange-primary);
  font-size: 0.78em;
  font-weight: 700;
}

.podium-stat-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-subtle);
  text-align: right;
}

.podium-empty-notice {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-subtle);
  padding: 1.5rem 0;
  text-align: center;
}

/* ---------------- TELEMETRY STANDINGS TABLE ---------------- */
.stage-table-card {
  background: rgba(6, 11, 21, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.stage-table-wrapper {
  max-height: calc(100vh - 390px);
  min-height: 240px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
}

.stage-table-wrapper::-webkit-scrollbar {
  width: 5px;
}
.stage-table-wrapper::-webkit-scrollbar-track {
  background: #030509;
}
.stage-table-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
.stage-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--orange-primary);
}

.stage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.stage-table th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  background: #060B14;
  z-index: 5;
}

.stage-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.stage-table tr:hover {
  background: rgba(255, 153, 0, 0.03);
}

.pos-pill {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 2px 7px;
  border-radius: 3px;
  display: inline-block;
  text-align: center;
  min-width: 28px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pos-pill.pos-1 {
  background: rgba(255, 153, 0, 0.15);
  color: var(--orange-primary);
  border-color: rgba(255, 153, 0, 0.4);
}

.pos-pill.pos-2 {
  background: rgba(148, 163, 184, 0.12);
  color: #E2E8F0;
  border-color: rgba(148, 163, 184, 0.3);
}

.pos-pill.pos-3 {
  background: rgba(180, 83, 9, 0.15);
  color: #FCD34D;
  border-color: rgba(180, 83, 9, 0.3);
}

.table-team-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.table-captain-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-subtle);
  margin-left: 0.4rem;
}

.table-time-digits {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.table-time-digits .ms-sub {
  color: var(--orange-primary);
  font-size: 0.82em;
}

.gap-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-subtle);
}

.gap-pill.lead {
  color: var(--status-green);
  background: rgba(0, 230, 118, 0.08);
  border: 1px solid rgba(0, 230, 118, 0.25);
  padding: 1px 6px;
  border-radius: 3px;
}

.split-sum-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--purple-bright);
}

.table-row-dq {
  background: rgba(239, 68, 68, 0.04);
  border-left: 3px solid #EF4444;
}

.table-row-dq:hover {
  background: rgba(239, 68, 68, 0.08) !important;
}

/* Confetti Canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99999;
}

/* ==========================================================================
   CIRCUIT TELEMETRY CARDS (Track A Amber, Track B Cyan, Track C Purple)
   ========================================================================== */
.stage-circuit-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: rgba(6, 11, 21, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
}

.circuit-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.circuit-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.circuit-title {
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
}

.circuit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.circuit-card {
  background: linear-gradient(180deg, rgba(14, 23, 42, 0.45) 0%, rgba(6, 11, 21, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Track Color Variants */
.circuit-card.track-amber {
  border-color: rgba(255, 153, 0, 0.35);
}
.circuit-card.track-amber::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: #FF9900;
  box-shadow: 0 0 12px rgba(255, 153, 0, 0.75);
}

.circuit-card.track-cyan {
  border-color: rgba(0, 210, 255, 0.35);
}
.circuit-card.track-cyan::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: #00D2FF;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.75);
}

.circuit-card.track-purple {
  border-color: rgba(217, 70, 239, 0.35);
}
.circuit-card.track-purple::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: #D946EF;
  box-shadow: 0 0 12px rgba(217, 70, 239, 0.75);
}

/* Track Badges */
.track-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}
.track-badge.track-amber {
  background: rgba(255, 153, 0, 0.15);
  color: #FF9900;
  border: 1px solid rgba(255, 153, 0, 0.4);
}
.track-badge.track-cyan {
  background: rgba(0, 210, 255, 0.15);
  color: #00D2FF;
  border: 1px solid rgba(0, 210, 255, 0.4);
}
.track-badge.track-purple {
  background: rgba(217, 70, 239, 0.15);
  color: #D946EF;
  border: 1px solid rgba(217, 70, 239, 0.4);
}

/* Squad Header */
.circuit-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.circuit-team-name {
  font-size: 1.12rem;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}
.circuit-captain-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.circuit-stopwatch {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

/* Status Banner Highlight Box */
.status-highlight-banner {
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.status-highlight-banner.in-room {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34D399;
}
.status-highlight-banner.in-transit {
  background: rgba(255, 153, 0, 0.12);
  border: 1px solid rgba(255, 153, 0, 0.35);
  color: #FBBF24;
}
.status-highlight-banner.sprinting {
  background: rgba(217, 70, 239, 0.15);
  border: 1px solid rgba(217, 70, 239, 0.45);
  color: #F472B6;
}
.status-highlight-banner.finished {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60A5FA;
}
.status-highlight-banner.dq {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
}

/* Station Route Timeline Stepper */
.circuit-stepper {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
}
.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  transition: background 0.2s ease;
}
.stepper-row.cleared {
  background: rgba(16, 185, 129, 0.08);
}
.stepper-row.active {
  background: rgba(0, 210, 255, 0.12);
  border-left: 2px solid #00D2FF;
}
.stepper-row.in_transit {
  background: rgba(255, 153, 0, 0.12);
  border-left: 2px solid #FF9900;
}
.stepper-row.timeout {
  background: rgba(245, 158, 11, 0.12);
  border-left: 2px solid #F59E0B;
}
.stepper-row.pending {
  opacity: 0.5;
}

.stepper-station-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: #fff;
}
.stepper-metrics {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.68rem;
}
.stepper-metric-pill {
  color: var(--text-muted);
}
.stepper-metric-pill strong {
  color: #fff;
}

/* Pending Rooms Strip */
.circuit-pending-strip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
  padding-top: 0.4rem;
}
.pending-room-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  padding: 1px 5px;
  color: #cbd5e1;
}

/* ---------------- STAGE NAVIGATION BUTTONS ---------------- */
.stage-nav-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.stage-nav-btn {
  padding: 0.55rem 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

/* ---------------- RESPONSIVE BREAKPOINTS (ALL SCREENS) ---------------- */
@media (max-width: 1080px) {
  .circuit-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .circuit-page-shell {
    padding: 1rem 1.25rem 1.5rem 1.25rem;
  }
}

@media (max-width: 960px) {
  .projector-shell {
    padding: 1rem 1.25rem 0 1.25rem;
  }

  .stage-podium-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .podium-card.rank-1-card {
    grid-column: span 2;
    order: -1;
  }

  .stage-ticker-bar {
    flex-wrap: wrap;
    gap: 0.85rem;
  }
}

@media (max-width: 640px) {
  .projector-shell,
  .circuit-page-shell {
    padding: 0.75rem 0.75rem 1.25rem 0.75rem;
    gap: 0.85rem;
  }

  .projector-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .stage-title-group {
    width: 100%;
    align-items: center;
    gap: 0.65rem;
  }

  .stage-logo-box {
    width: 38px;
    height: 38px;
  }

  .stage-title {
    font-size: 1.12rem;
    letter-spacing: 0.03em;
  }

  .stage-subtitle {
    font-size: 0.65rem;
  }

  .pixel-block-cluster {
    display: none !important;
  }

  .stage-nav-group {
    width: 100%;
    display: flex;
    gap: 0.4rem;
  }

  .stage-nav-btn {
    flex: 1;
    justify-content: center;
    padding: 0.45rem 0.6rem;
    font-size: 0.72rem;
  }

  /* Circuit Telemetry Mobile Layout */
  .circuit-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .circuit-title {
    font-size: 0.95rem;
  }

  .circuit-card {
    padding: 0.75rem 0.8rem;
    gap: 0.55rem;
  }

  .circuit-team-name {
    font-size: 1.05rem;
    white-space: normal;
    line-height: 1.25;
  }

  .circuit-stopwatch {
    font-size: 0.95rem;
    padding: 2px 6px;
  }

  .status-highlight-banner {
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.7rem;
    padding: 0.45rem 0.55rem;
  }

  /* Stepper mobile wrap */
  .stepper-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    padding: 0.35rem 0.45rem;
  }

  .stepper-station-label {
    font-size: 0.72rem;
  }

  .stepper-metrics {
    width: 100%;
    justify-content: flex-end;
    gap: 0.45rem;
    font-size: 0.65rem;
  }

  /* Stage Leaderboard Mobile Layout */
  .stage-podium-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .podium-card.rank-1-card {
    grid-column: span 1;
    order: 1;
  }
  .podium-card.rank-2-card {
    order: 2;
  }
  .podium-card.rank-3-card {
    order: 3;
  }

  .podium-header-strip {
    padding-bottom: 0.4rem;
  }

  .podium-team-name {
    font-size: 1.15rem;
  }

  .podium-main-time {
    font-size: 1.35rem;
  }

  .stage-table-wrapper {
    max-height: 380px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .stage-table {
    min-width: 660px;
    font-size: 0.8rem;
  }

  .stage-table td, .stage-table th {
    padding: 0.45rem 0.55rem;
  }
}
