/* OBS Robot Competition Overlay Stylesheet */
body.overlay-robot-body {
  background: transparent !important;
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  font-family: 'IBM Plex Sans Thai', 'Kanit', sans-serif;
}

.overlay-robot-container {
  width: 100%;
  height: 100%;
  display: flex;
  pointer-events: none;
  box-sizing: border-box;
}

/* HUD View (Bottom-Left or Lower-Third) */
.overlay-robot-container.view-hud {
  align-items: flex-end;
  justify-content: flex-start;
  padding: 32px;
}

.robot-hud-card {
  background: rgba(0, 18, 86, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 20px rgba(6, 182, 212, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: 580px;
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hud-top-meta {
  background: rgba(0, 10, 48, 0.8);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-logo {
  font-size: 16px;
}

.hud-brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #38bdf8;
}

.hud-category {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
}

.hud-round-badge {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
}

/* Main Content */
.hud-main-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  gap: 16px;
}

.hud-team-details {
  flex: 1;
  min-width: 0;
}

.hud-team-code {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  display: block;
}

.hud-team-name {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin: 1px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-team-school {
  font-size: 13px;
  color: #38bdf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Timer Box */
.hud-timer-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 12px;
  text-align: right;
  min-width: 160px;
}

.hud-timer-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #94a3b8;
}

.hud-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #64748b;
}

.hud-live-dot.active {
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: timerBlink 1s infinite alternate;
}

@keyframes timerBlink {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

.hud-timer-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: #facc15;
  line-height: 1.1;
  letter-spacing: 1px;
}

.hud-sub-stats {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  font-size: 11px;
  margin-top: 2px;
}

.hud-pen-tag {
  color: #f87171;
  font-weight: 700;
}

.hud-best-tag {
  color: #94a3b8;
}

/* ========================================================
   VIEW 2: LEADERBOARD OVERLAY
   ======================================================== */
.overlay-robot-container.view-leaderboard {
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.robot-leaderboard-card {
  background: rgba(0, 18, 86, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(24px);
  width: 860px;
  overflow: hidden;
}

.lb-header {
  background: rgba(0, 10, 48, 0.9);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lb-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #38bdf8;
  display: block;
}

.lb-category-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}

.lb-status {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.4);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.lb-table-wrapper {
  padding: 12px 20px 20px;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  color: #fff;
  font-size: 14px;
}

.lb-table th {
  text-align: left;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-transform: uppercase;
}

.lb-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.text-right {
  text-align: right;
}

/* Medals */
.rank-pill {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.rank-pill.gold { background: #facc15; color: #713f12; }
.rank-pill.silver { background: #e2e8f0; color: #1e293b; }
.rank-pill.bronze { background: #fdba74; color: #7c2d12; }

.lb-team-name {
  font-weight: 800;
  color: #ffffff;
}

.lb-team-school {
  font-size: 11px;
  color: #94a3b8;
}

.lb-best-time {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #38bdf8;
}
